-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'stmt' adds symbols too early #3482
Comments
minimized: template foo*(body: typed) =
if true:
body
proc test =
foo:
var output = ""
echo output.len
test() Error: execution of an external compiler program 'clang -c -w -I/Users/timothee/git_clone/nim/Nim/lib -o /tmp/nim/nimcache/timn_issue_3482.c.o /tmp/nim/nimcache/timn_issue_3482.c' failed with exit code: 1 /tmp/nim/nimcache/timn_issue_3482.c:103:24: error: use of undeclared identifier 'output' |
The following doesn't produce a Nim error, but a C error as due to the 'body: stmt' body is sem'checked twice. 'body: untyped' produces a proper Nim error.
The text was updated successfully, but these errors were encountered: