summary refs log tree commit diff stats
path: root/tests/concepts/t4982.nim
blob: 9d82c83c9f257133db0cf675d762498edb2041c0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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)