Files
Nim/tests/template/t21532.nim
SirOlaf 3de75ffc02 Fix #21532: Check if template return is untyped (#22517)
* Don't ignore return in semTemplateDef

* Add test

---------

Co-authored-by: SirOlaf <>
2023-08-23 06:18:35 +02:00

8 lines
146 B
Nim

template elementType(a: untyped): typedesc =
typeof(block: (for ai in a: ai))
func fn[T](a: T) =
doAssert elementType(a) is int
@[1,2,3].fn