diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/concepts/t5888.nim | 26 | ||||
-rw-r--r-- | tests/concepts/t5888lib/ca.nim | 4 | ||||
-rw-r--r-- | tests/concepts/t5888lib/opt.nim | 6 |
3 files changed, 36 insertions, 0 deletions
diff --git a/tests/concepts/t5888.nim b/tests/concepts/t5888.nim new file mode 100644 index 000000000..dbbab8c4c --- /dev/null +++ b/tests/concepts/t5888.nim @@ -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() + diff --git a/tests/concepts/t5888lib/ca.nim b/tests/concepts/t5888lib/ca.nim new file mode 100644 index 000000000..4a811f797 --- /dev/null +++ b/tests/concepts/t5888lib/ca.nim @@ -0,0 +1,4 @@ +type + CA* = concept c + c.x is int + diff --git a/tests/concepts/t5888lib/opt.nim b/tests/concepts/t5888lib/opt.nim new file mode 100644 index 000000000..65d16addc --- /dev/null +++ b/tests/concepts/t5888lib/opt.nim @@ -0,0 +1,6 @@ +import ca + +type + Opt* = object + x*: int + |