Files
Nim/tests/template/t1027.nim
ringabout 60350eca1a fixes #1027; disallow templates to use ambiguous identifiers (#21405)
* Add `nkFastAsgn` into `semExpr` (#20939)

* Add nkFastAsgn into case statement

* Add test case

* fixes #1027; disallow templates to use ambiguous identifiers (#20631)

* test qualifiedLookUp in templates

* check later

* add testcase

* add 4errormsg

* Update tests/template/m1027a.nim

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>

* Update tests/template/m1027b.nim

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>

---------

Co-authored-by: Jake Leahy <jake@leahy.dev>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
2023-02-20 23:50:53 +08:00

23 lines
356 B
Nim

discard """
cmd: "nim check --hints:off $file"
errormsg: ""
nimout: '''
t1027.nim(20, 19) Error: ambiguous identifier: 'version_str' -- use one of the following:
m1027a.version_str: string
m1027b.version_str: string
'''
"""
import m1027a, m1027b
# bug #1027
template wrap_me(stuff): untyped =
echo "Using " & version_str
wrap_me("hey")