t4982.nim 393 B

12345678910111213141516171819
  1. discard """
  2. errormsg: "undeclared identifier: 'x'"
  3. line: 10
  4. """
  5. import typetraits # without this import the program compiles (and echos false)
  6. type
  7. SomeTestConcept = concept t
  8. x.name is string # typo: t.name was intended (which would result in echo true)
  9. type
  10. TestClass = ref object of RootObj
  11. name: string
  12. var test = TestClass(name: "mytest")
  13. echo $(test is SomeTestConcept)