fixes #6755; error message could be better but oh well

This commit is contained in:
Araq
2019-05-28 21:58:59 +02:00
parent e68adca0c9
commit 950f2d7c2f

View File

@@ -579,10 +579,12 @@ proc patchBody(c: PContext; n: PNode; info: TLineInfo) =
template inst(field, t) =
if field.ast != nil and field.ast[genericParamsPos].kind != nkEmpty:
assert t.typeInst != nil
field = c.instTypeBoundOp(c, field, t.typeInst, info, attachedAsgn, 1)
if field.ast != nil:
patchBody(c, field.ast, info)
if t.typeInst != nil:
field = c.instTypeBoundOp(c, field, t.typeInst, info, attachedAsgn, 1)
if field.ast != nil:
patchBody(c, field.ast, info)
else:
localError(c.graph.config, info, "unresolved generic parameter")
proc isTrival(s: PSym): bool {.inline.} = s == nil or s.ast[bodyPos].len == 0