You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see notcompiles.nim does not compile (tested with #head #devel 1.7.1 and 1.6.0 compilers) ❌
But compiles.nim which uses include instead of import compiles without error. ✅
Also compiles2.nim which uses import without generics compiles without error. ✅
Is this a bug or am I missing something?
$ nim c -r --hints:off notcompiles.nim
./notcompiles.nim(3, 7) template/generic instantiation of `f` from here
./module.nim(4, 14) template/generic instantiation of `toDeque` from here
./bug.nim(8, 11) Error: attempting to call undeclared routine: 'addLast'
$ nim c -r --hints:off compiles.nim
1
$ nim c -r --hints:off compiles2.nim
1
$ nim -v
Nim Compiler Version 1.7.1 [MacOSX: amd64]
Compiled at 2021-12-16
Copyright (c) 2006-2021 by Andreas Rumpf
git hash: 5d2bab7558b54813b212a26fbcdb51556ff37b05
The text was updated successfully, but these errors were encountered:
addLast is mixed in in toDeque since it isn't defined yet, and notcompiles does not import addLast so it's not resolved. Should work with --experimental:typeBoundOps (#24315) but expected regardless.
@Araq to reproduce the bug discussed here: #19233
I've created a sample project as a gist: https://gist.github.com/4945609c860f52cb97fbbc4081510772
As you can see
notcompiles.nim
does not compile (tested with #head #devel 1.7.1 and 1.6.0 compilers) ❌But
compiles.nim
which usesinclude
instead ofimport
compiles without error. ✅Also
compiles2.nim
which usesimport
withoutgenerics
compiles without error. ✅Is this a bug or am I missing something?
The text was updated successfully, but these errors were encountered: