Skip to content

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

Open
@timotheecour

Description

@timotheecour

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions