Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
bung87 committed Oct 3, 2023
1 parent 93249a9 commit f5e482b
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions tests/lang_callable/macros/tfor_ill_formed.nim
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
discard """
cmd: "nim check --msgFormat=sexp --filenames=canonical --hints:off $options $file"
description: '''
Ensure that ill-formed for-statement AST is detected
'''
cmd: "nim check --hints:off $options $file"
action: reject
nimoutFormat: sexp
nimout: '''
tfor_ill_formed.nim(18, 16) Error: expression has no type:
if true:
discard
else:
discard
tfor_ill_formed.nim(18, 16) Error: iterator within for loop context expected
tfor_ill_formed.nim(18, 1) Error: wrong number of variables
'''
"""
for i in (if true: discard else: discard): #[tt.Error
^ (SemExpressionHasNoType) ]#

for i, x, y in (if true: discard else: discard):
discard

0 comments on commit f5e482b

Please sign in to comment.