more robust handling of proc signatures containing inter-param type references
This commit is contained in:
parent
7dcf6ff50b
commit
ac271e76b1
6 changed files with 106 additions and 30 deletions
|
|
@ -944,8 +944,19 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation =
|
|||
|
||||
of tyProxy:
|
||||
result = isEqual
|
||||
|
||||
of tyFromExpr:
|
||||
# fix the expression, so it contains the already instantiated types
|
||||
let instantiated = replaceTypesInBody(c.c, c.bindings, f.n)
|
||||
let reevaluted = c.c.semExpr(c.c, instantiated)
|
||||
if reevaluted.typ.kind != tyTypeDesc:
|
||||
localError(f.n.info, errTypeExpected)
|
||||
result = isNone
|
||||
else:
|
||||
result = typeRel(c, a, reevaluted.typ.base)
|
||||
|
||||
else: internalAssert false
|
||||
else:
|
||||
internalAssert false
|
||||
|
||||
proc cmpTypes*(c: PContext, f, a: PType): TTypeRelation =
|
||||
var m: TCandidate
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue