diff options
author | Zahary Karadjov <zahary@gmail.com> | 2013-01-21 02:03:13 +0200 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2013-01-21 02:03:13 +0200 |
commit | 41cbd1c980c7298a1d3a246c45d41a508eae14f8 (patch) | |
tree | 915eaddc7eb0b606a4fc759fa06a42d43040e9d1 /compiler | |
parent | 8be307713ef040c4371f51fa21c8843e5a4484f5 (diff) | |
download | Nim-41cbd1c980c7298a1d3a246c45d41a508eae14f8.tar.gz |
minor bug fixes to make some tests green
Diffstat (limited to 'compiler')
-rwxr-xr-x | compiler/ast.nim | 9 | ||||
-rwxr-xr-x | compiler/semtypinst.nim | 1 |
2 files changed, 8 insertions, 2 deletions
diff --git a/compiler/ast.nim b/compiler/ast.nim index 419c1f2d8..8763e750e 100755 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -603,11 +603,18 @@ type PLib* = ref TLib TSym* = object of TIdObj + # proc and type instantiations are cached in the generic symbol case kind*: TSymKind - of skType: # generic instantiation caches + of skType: typeInstCache*: seq[PType] of routineKinds: procInstCache*: seq[PInstantiation] + of skModule: + # modules keep track of the generic symbols they use from other modules. + # this is because in incremental compilation, when a module is about to + # be replaced with a newer version, we must decrement the usage count + # of all previously used generics. + usedGenerics*: seq[PInstantiation] else: nil magic*: TMagic diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 82ebc4b5f..03b6e3961 100755 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -41,7 +41,6 @@ proc searchInstTypes(key: PType): PType = return for inst in genericTyp.sym.typeInstCache: - InternalAssert inst.sons.len == key.sons.len + 1 if inst.id == key.id: return inst block MatchType: for j in 1 .. high(key.sons): |