Skip to content

Commit

Permalink
tests: add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
zerbina committed Jul 27, 2024
1 parent c0db716 commit 63ea168
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion tests/lang_callable/macros/tmacros_issues.nim
Original file line number Diff line number Diff line change
Expand Up @@ -538,4 +538,20 @@ block orginal_parameter_types:
doAssert x.intVal == 1
doAssert y.intVal == 2

m(1, 2)
m(1, 2)

block field_names_with_backticks:
# field names containing backticks (only possible with macro-generated
# code) couldn't be accessed with dot expressions
macro test() =
let name = ident"a`b"

result = quote do:
type Object = object
`name`: int

# test accessing the field with both constructors and a dot expression
let o = Object(`name`: 1)
doAssert o.`name` == 1

test()

0 comments on commit 63ea168

Please sign in to comment.