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

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

View file

@ -579,10 +579,12 @@ proc patchBody(c: PContext; n: PNode; info: TLineInfo) =
template inst(field, t) = template inst(field, t) =
if field.ast != nil and field.ast[genericParamsPos].kind != nkEmpty: if field.ast != nil and field.ast[genericParamsPos].kind != nkEmpty:
assert t.typeInst != nil if t.typeInst != nil:
field = c.instTypeBoundOp(c, field, t.typeInst, info, attachedAsgn, 1) field = c.instTypeBoundOp(c, field, t.typeInst, info, attachedAsgn, 1)
if field.ast != nil: if field.ast != nil:
patchBody(c, field.ast, info) 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 proc isTrival(s: PSym): bool {.inline.} = s == nil or s.ast[bodyPos].len == 0