mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 17:34:43 +00:00
further progress
This commit is contained in:
@@ -853,6 +853,8 @@ type
|
||||
align*: int16 # the type's alignment requirements
|
||||
lockLevel*: TLockLevel # lock level as required for deadlock checking
|
||||
loc*: TLoc
|
||||
typeInst*: PType # for generic instantiations the tyGenericInst that led to this
|
||||
# type.
|
||||
|
||||
TPair* = object
|
||||
key*, val*: RootRef
|
||||
|
||||
@@ -758,7 +758,6 @@ proc getTypeDescAux(m: BModule, origTyp: PType, check: var IntSet): Rope =
|
||||
excl(check, t.id)
|
||||
|
||||
proc getTypeDesc(m: BModule, typ: PType): Rope =
|
||||
echo "getTypeDesc called!"
|
||||
var check = initIntSet()
|
||||
result = getTypeDescAux(m, typ, check)
|
||||
|
||||
|
||||
@@ -310,6 +310,9 @@ proc handleGenericInvocation(cl: var TReplTypeVars, t: PType): PType =
|
||||
# generics *when the type is constructed*:
|
||||
newbody.deepCopy = cl.c.instTypeBoundOp(cl.c, dc, result, cl.info,
|
||||
attachedDeepCopy, 1)
|
||||
newbody.typeInst = result
|
||||
if newbody.kind == tyRef:
|
||||
newbody.lastSon.typeInst = result
|
||||
let asgn = newbody.assignment
|
||||
if asgn != nil and sfFromGeneric notin asgn.flags:
|
||||
# '=' needs to be instantiated for generics when the type is constructed:
|
||||
|
||||
@@ -159,10 +159,14 @@ proc hashType(c: var MD5Context, t: PType; flags: set[ConsiderFlag]) =
|
||||
# Every cyclic type in Nim need to be constructed via some 't.sym', so this
|
||||
# is actually safe without an infinite recursion check:
|
||||
if t.sym != nil:
|
||||
if "Future:" in t.sym.name.s:
|
||||
writeStackTrace()
|
||||
echo "yes ", t.sym.name.s
|
||||
#quit 1
|
||||
#if "Future:" in t.sym.name.s and t.typeInst == nil:
|
||||
# writeStackTrace()
|
||||
# echo "yes ", t.sym.name.s
|
||||
# #quit 1
|
||||
if t.typeInst != nil:
|
||||
assert t.typeInst.kind == tyGenericInst
|
||||
for i in countup(1, sonsLen(t.typeInst) - 2):
|
||||
c.hashType t.typeInst.sons[i], flags
|
||||
c.hashSym(t.sym)
|
||||
else:
|
||||
lowlevel(t.id)
|
||||
|
||||
Reference in New Issue
Block a user