Files
Nim/tests/generics/tnestedtemplate.nim
metagn bf865fa75a fix undeclared identifier in templates in generics (#24069)
fixes #13979

Fixes templates in generics that use identifiers that aren't defined
yet, giving an early `undeclared identifier` error, by just marking
template bodies as in a mixin context in `semgnrc`.
2024-09-06 11:16:43 +02:00

10 lines
248 B
Nim

block: # issue #13979
var s: seq[int]
proc filterScanline[T](input: openArray[T]) =
template currPix: untyped = input[i]
for i in 0..<input.len:
s.add currPix
let pix = [1, 2, 3]
filterScanline(pix)
doAssert s == @[1, 2, 3]