This commit is contained in:
Zahary Karadjov
2017-06-19 20:44:28 +03:00
committed by Andreas Rumpf
parent 8f4b374327
commit 16eb4b1fee
5 changed files with 60 additions and 32 deletions

View File

@@ -1777,7 +1777,7 @@ proc semStmtList(c: PContext, n: PNode, flags: TExprFlags): PNode =
let verdict = semConstExpr(c, n[i])
if verdict.intVal == 0:
localError(result.info, "type class predicate failed")
localError(result.info, "concept predicate failed")
of tyUnknown: continue
else: discard
if n.sons[i].typ == enforceVoidContext: #or usesResult(n.sons[i]):

View File

@@ -1040,11 +1040,12 @@ proc typeRelImpl(c: var TCandidate, f, aOrig: PType,
else: isNone
of tyUserTypeClass, tyUserTypeClassInst:
# consider this: 'var g: Node' *within* a concept where 'Node'
# is a concept too (tgraph)
let x = typeRel(c, a, f, flags + {trDontBind})
if x >= isGeneric:
return isGeneric
if c.c.matchedConcept != nil:
# consider this: 'var g: Node' *within* a concept where 'Node'
# is a concept too (tgraph)
let x = typeRel(c, a, f, flags + {trDontBind})
if x >= isGeneric:
return isGeneric
else: discard
case f.kind