diff options
author | zah <zahary@gmail.com> | 2018-08-21 23:14:12 +0300 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-08-21 22:14:12 +0200 |
commit | 96de224a63f44e7e5a40004b490519f895d1068d (patch) | |
tree | 6033422293317dcb2553f08c9fd008631a496762 /tests | |
parent | 8e435d7b0c4ec2547023c9a2d4ff60f587601ae5 (diff) | |
download | Nim-96de224a63f44e7e5a40004b490519f895d1068d.tar.gz |
Fix #8126 (#8712)
This is a temporary fix that will be reworked in a follow up commit that aims to eliminate the tfExplicit flag from the compiler. The complete and proper fix was considered too risky for inclusion just before our 0.19 release.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/concepts/tmonoid.nim | 12 | ||||
-rw-r--r-- | tests/parser/ttypeclasses.nim | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/concepts/tmonoid.nim b/tests/concepts/tmonoid.nim index 49b3239bd..e0e19adbc 100644 --- a/tests/concepts/tmonoid.nim +++ b/tests/concepts/tmonoid.nim @@ -11,3 +11,15 @@ type Monoid = concept x, y proc z(x: typedesc[int]): int = 0 echo(int is Monoid) + +# https://github.com/nim-lang/Nim/issues/8126 +type AdditiveMonoid* = concept x, y, type T + x + y is T + + # some redundant checks to test an alternative approaches: + type TT = type(x) + x + y is type(x) + x + y is TT + +doAssert(1 is AdditiveMonoid) + diff --git a/tests/parser/ttypeclasses.nim b/tests/parser/ttypeclasses.nim index 46fd20686..06146dcb6 100644 --- a/tests/parser/ttypeclasses.nim +++ b/tests/parser/ttypeclasses.nim @@ -40,3 +40,7 @@ static: assert y isnot tuple assert z isnot seq + # XXX: These cases don't work properly at the moment: + # assert type[int] isnot int + # assert type(int) isnot int + |