Skip to content
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

block label matching (template with untyped param) or (iterator) treats param as typed, causing CT errors #14778

Open
timotheecour opened this issue Jun 23, 2020 · 1 comment

Comments

@timotheecour
Copy link
Member

timotheecour commented Jun 23, 2020

block label matching template with untyped param treats param as typed, causing error

Example 1

template fun*(a: untyped) = discard
block fun: # BUG
# block: # fun # works
  fun(bar)

Current Output

Error: undeclared identifier: 'bar'

Expected Output

works

Example 2: until this is fixed, block label: should be avoided in tests

typical example: Error: attempting to call routine: 'decodeQuery`gensym0'

import std/[uri]
template main =
  block decodeQuery:
    for ai in decodeQuery("a=1&b=0"): discard
main()

Additional Information

@timotheecour timotheecour changed the title block label matching template with untyped param treats param as typed block label matching (template with untyped param) or (iterator) treats param as typed Dec 29, 2020
@timotheecour timotheecour changed the title block label matching (template with untyped param) or (iterator) treats param as typed block label matching (template with untyped param) or (iterator) treats param as typed, causing CT errors Dec 29, 2020
@timotheecour timotheecour mentioned this issue Feb 27, 2021
8 tasks
@metagn
Copy link
Collaborator

metagn commented Aug 27, 2024

Maybe just treat skLabel the same as we treat skModule and skPackage?

Edit: No, but we should easily be able to skip skLabel in general

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants