parent
1074cc1fb9
commit
ac0f986008
2 changed files with 28 additions and 1 deletions
27
tests/concepts/t6770.nim
Normal file
27
tests/concepts/t6770.nim
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
discard """
|
||||
output: '''
|
||||
10
|
||||
10
|
||||
'''
|
||||
"""
|
||||
|
||||
type GA = concept c
|
||||
c.a is int
|
||||
|
||||
type A = object
|
||||
a: int
|
||||
|
||||
type AA = object
|
||||
case exists: bool
|
||||
of true:
|
||||
a: int
|
||||
else:
|
||||
discard
|
||||
|
||||
proc print(inp: GA) =
|
||||
echo inp.a
|
||||
|
||||
let failing = AA(exists: true, a: 10)
|
||||
let working = A(a:10)
|
||||
print(working)
|
||||
print(failing)
|
||||
Loading…
Add table
Add a link
Reference in a new issue