avoid unsafe Nim features in preparation for --gc:arc (#14431)

This commit is contained in:
Andreas Rumpf 2020-05-22 20:24:37 +02:00 • committed by GitHub
commit c61f746629
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 16 deletions

View file

@ -178,13 +178,13 @@ proc instGenericContainer(c: PContext, info: TLineInfo, header: PType,
internalAssert c.config, header.kind == tyGenericInvocation
var
typeMap: LayeredIdTable
cl: TReplTypeVars
initIdTable(cl.symMap)
initIdTable(cl.localCache)
initIdTable(typeMap.topLayer)
cl.typeMap = addr(typeMap)
cl.typeMap = LayeredIdTable()
initIdTable(cl.typeMap.topLayer)
cl.info = info
cl.c = c
cl.allowMetaTypes = allowMetaTypes
@ -244,7 +244,7 @@ proc instantiateProcType(c: PContext, pt: TIdTable,
#addDecl(c, prc)
pushInfoContext(c.config, info)
var typeMap = initLayeredTypeMap(pt)
var cl = initTypeVars(c, addr(typeMap), info, nil)
var cl = initTypeVars(c, typeMap, info, nil)
var result = instCopyType(cl, prc.typ)
let originalParams = result.n
result.n = originalParams.shallowCopy