This commit is contained in:
Zahary Karadjov 2017-06-19 22:45:15 +03:00 • committed by Andreas Rumpf
commit 21ce7b2af4
6 changed files with 43 additions and 2 deletions

26
tests/concepts/t5888.nim Normal file
View file

@ -0,0 +1,26 @@
discard """
output: '''
true
true
true
f
0
'''
"""
import t5888lib/ca, t5888lib/opt
type LocalCA = ca.CA
proc f(c: CA) =
echo "f"
echo c.x
var o = new(Opt)
echo o is CA
echo o is LocalCA
echo o is ca.CA
o.f()

View file

@ -0,0 +1,4 @@
type
CA* = concept c
c.x is int

View file

@ -0,0 +1,6 @@
import ca
type
Opt* = object
x*: int