diff options
author | Martin Odersky <odersky@gmail.com> | 2013-01-22 14:31:50 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-01-22 14:31:50 +0100 |
commit | 41c884462cb017398573a19412e987991f15a232 (patch) | |
tree | c066551c06ae7faedc15a21e03f5f2ae3b8ee66c /src/dotty/tools | |
parent | 5bbc8bc0bb0930b9199959e48aaf7b90ce8374f6 (diff) | |
download | dotty-41c884462cb017398573a19412e987991f15a232.tar.gz dotty-41c884462cb017398573a19412e987991f15a232.tar.bz2 dotty-41c884462cb017398573a19412e987991f15a232.zip |
Made classOfId grow to match superId range.
Diffstat (limited to 'src/dotty/tools')
-rw-r--r-- | src/dotty/tools/dotc/core/Contexts.scala | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala index 131f72c65..74b6e851f 100644 --- a/src/dotty/tools/dotc/core/Contexts.scala +++ b/src/dotty/tools/dotc/core/Contexts.scala @@ -55,7 +55,7 @@ object Contexts { // Symbols state /** A map from a superclass id to the class that has it */ - private[core] var classOfId = Array.ofDim[ClassSymbol](InitialSuperIdsSize) + private[core] var classOfId = new Array[ClassSymbol](InitialSuperIdsSize) /** A map from a superclass to its superclass id */ private[core] val superIdOfClass = new mutable.HashMap[ClassSymbol, Int] @@ -64,7 +64,15 @@ object Contexts { private[core] var lastSuperId = -1 /** Allocate and return next free superclass id */ - private[core] def nextSuperId: Int = { lastSuperId += 1; lastSuperId } + private[core] def nextSuperId: Int = { + lastSuperId += 1; + if (lastSuperId >= classOfId.length) { + val tmp = new Array[ClassSymbol](classOfId.length * 2) + classOfId.copyToArray(tmp) + classOfId = tmp + } + lastSuperId + } // SymDenotations state private[core] val uniqueBits = new util.HashSet[BitSet]("superbits", 1024) |