Fix #21532: Check if template return is untyped (#22517)

* Don't ignore return in semTemplateDef

* Add test

---------

Co-authored-by: SirOlaf <>
This commit is contained in:
SirOlaf
2023-08-23 06:18:35 +02:00
committed by GitHub
parent 6b04d0395a
commit 3de75ffc02
2 changed files with 11 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
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