minor refactoring (#21499)

This commit is contained in:
Andreas Rumpf 2023-03-10 14:20:30 +01:00 • committed by GitHub
commit 46d2161c23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1085,13 +1085,7 @@ proc inst(g: ModuleGraph; c: PContext; t: PType; kind: TTypeAttachedOp; idgen: I
let op = getAttachedOp(g, t, kind) let op = getAttachedOp(g, t, kind)
if op != nil and op.ast != nil and op.ast.isGenericRoutine: if op != nil and op.ast != nil and op.ast.isGenericRoutine:
if t.typeInst != nil: if t.typeInst != nil:
var a: TLiftCtx var a = TLiftCtx(info: info, g: g, kind: kind, c: c, idgen: idgen)
a.info = info
a.g = g
a.kind = kind
a.c = c
a.idgen = idgen
let opInst = instantiateGeneric(a, op, t, t.typeInst) let opInst = instantiateGeneric(a, op, t, t.typeInst)
if opInst.ast != nil: if opInst.ast != nil:
patchBody(g, c, opInst.ast, info, a.idgen) patchBody(g, c, opInst.ast, info, a.idgen)