mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
fixes #3686
This commit is contained in:
@@ -1301,11 +1301,8 @@ proc paramTypesMatchAux(m: var TCandidate, f, argType: PType,
|
||||
arg.typ.n = evaluated
|
||||
argType = arg.typ
|
||||
|
||||
var
|
||||
a = if c.inTypeClass > 0: argType.skipTypes({tyTypeDesc, tyFieldAccessor})
|
||||
else: argType
|
||||
|
||||
r = typeRel(m, f, a)
|
||||
var a = argType
|
||||
var r = typeRel(m, f, a)
|
||||
|
||||
if r != isNone and m.calleeSym != nil and
|
||||
m.calleeSym.kind in {skMacro, skTemplate}:
|
||||
|
||||
13
tests/concepts/tmonoid.nim
Normal file
13
tests/concepts/tmonoid.nim
Normal file
@@ -0,0 +1,13 @@
|
||||
discard """
|
||||
output: '''true'''
|
||||
"""
|
||||
|
||||
# bug #3686
|
||||
|
||||
type Monoid = concept x, y
|
||||
x + y is type(x)
|
||||
type(z(type(x))) is type(x)
|
||||
|
||||
proc z(x: typedesc[int]): int = 0
|
||||
|
||||
echo(int is Monoid)
|
||||
Reference in New Issue
Block a user