This commit is contained in:
Bung 2022-12-19 19:35:15 +08:00 • committed by GitHub
commit e278a781fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View file

@ -1947,6 +1947,8 @@ proc semYieldVarResult(c: PContext, n: PNode, restype: PType) =
tupleConstr[i] = takeImplicitAddr(c, tupleConstr[i], e.kind == tyLent) tupleConstr[i] = takeImplicitAddr(c, tupleConstr[i], e.kind == tyLent)
else: else:
localError(c.config, n[0].info, errXExpected, "tuple constructor") localError(c.config, n[0].info, errXExpected, "tuple constructor")
elif e.kind == tyEmpty:
localError(c.config, n[0].info, errTypeExpected)
else: else:
when false: when false:
# XXX investigate what we really need here. # XXX investigate what we really need here.

13
tests/misc/t21109.nim Normal file
View file

@ -0,0 +1,13 @@
discard """
action: reject
errormsg: "type expected"
file: "iterators.nim"
"""
template b(j: untyped) = j
template m() = discard
b:
for t, f in @[]:
m()