mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 22:10:33 +00:00
@@ -226,7 +226,7 @@ proc semGenericStmt(c: PContext, n: PNode,
|
||||
var mixinContext = false
|
||||
if s != nil:
|
||||
incl(s.flags, sfUsed)
|
||||
mixinContext = s.magic in {mDefined, mDefinedInScope, mCompiles}
|
||||
mixinContext = s.magic in {mDefined, mDefinedInScope, mCompiles, mAstToStr}
|
||||
let sc = symChoice(c, fn, s, if s.isMixedIn: scForceOpen else: scOpen)
|
||||
case s.kind
|
||||
of skMacro:
|
||||
|
||||
6
tests/generics/t13525.nim
Normal file
6
tests/generics/t13525.nim
Normal file
@@ -0,0 +1,6 @@
|
||||
# https://github.com/nim-lang/Nim/issues/13524
|
||||
template fun(field): untyped = astToStr(field)
|
||||
proc test1(): string = fun(nonexistant1)
|
||||
proc test2[T](): string = fun(nonexistant2) # used to cause: Error: undeclared identifier: 'nonexistant2'
|
||||
doAssert test1() == "nonexistant1"
|
||||
doAssert test2[int]() == "nonexistant2"
|
||||
Reference in New Issue
Block a user