nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.55k stars 1.47k forks source link

Problem with simple derived value in "concept" #6509

Open cdunn2001 opened 7 years ago

cdunn2001 commented 7 years ago
$ nim --version
Nim Compiler Version 0.17.3 (2017-09-30) [MacOSX: amd64]

$ nim c bug.nim
...
bug.nim(23, 8) template/generic instantiation from here
bug.nim(20, 66) Error: expression 'initTable(64)' has no type (or is ambiguous)

When I run in glot.io, which might be an older Nim, I get

main.nim(23, 8) template/generic instantiation from here
main.nim(20, 41) Error: undeclared field: 'Node'
ghost commented 7 years ago

@cdunn2001 yeah, compiler should have a proper error message here, but AFAIK this code is not valid.

narimiran commented 5 years ago

Error: expression 'initTable(64)' has no type (or is ambiguous)

Still the same in July 2019 with the latest Nim (v0.20.99).