diff options
Diffstat (limited to 'tests/concepts/t4982.nim')
-rw-r--r-- | tests/concepts/t4982.nim | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/concepts/t4982.nim b/tests/concepts/t4982.nim new file mode 100644 index 000000000..9d82c83c9 --- /dev/null +++ b/tests/concepts/t4982.nim @@ -0,0 +1,18 @@ +discard """ +errormsg: "undeclared identifier: 'x'" +line: 10 +""" + +import typetraits # without this import the program compiles (and echos false) + +type + SomeTestConcept = concept t + x.name is string # typo: t.name was intended (which would result in echo true) + +type + TestClass = ref object of RootObj + name: string + +var test = TestClass(name: "mytest") +echo $(test is SomeTestConcept) + |