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

* Add test

---------

Co-authored-by: SirOlaf <>
(cherry picked from commit 3de75ffc02)
2023-09-18 12:12:58 +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