fixes #2346
This commit is contained in:
parent
bc264618f5
commit
bf90b9c833
9 changed files with 107 additions and 97 deletions
24
tests/concepts/tusertypeclasses2.nim
Normal file
24
tests/concepts/tusertypeclasses2.nim
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
type
|
||||
hasFieldX = generic z
|
||||
z.x is int
|
||||
|
||||
obj_x = object
|
||||
x: int
|
||||
|
||||
ref_obj_x = ref object
|
||||
x: int
|
||||
|
||||
ref_to_obj_x = ref obj_x
|
||||
|
||||
p_o_x = ptr obj_x
|
||||
v_o_x = var obj_x
|
||||
|
||||
template check(x) =
|
||||
static: assert(x)
|
||||
|
||||
check obj_x is hasFieldX
|
||||
check ref_obj_x is hasFieldX
|
||||
check ref_to_obj_x is hasFieldX
|
||||
check p_o_x is hasFieldX
|
||||
check v_o_x is hasFieldX
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue