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.
This commit is contained in:
parent
8e435d7b0c
commit
96de224a63
5 changed files with 20 additions and 2 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue