Skip to content

Commit 8e9404b

Browse files
oderskyDarkDimius
authored andcommitted
Avoid capturing an old context in Classfile#typeParamCompleter
Previously caused an illegal backwards timetravel in bringForward when compiling all files in tools together twice.
1 parent 1f0b25b commit 8e9404b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/dotty/tools/dotc/core/pickling/ClassfileParser.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,9 @@ class ClassfileParser(
226226
while (!isDelimiter(sig(index))) { index += 1 }
227227
sig.slice(start, index)
228228
}
229-
def sig2type(tparams: immutable.Map[Name,Symbol], skiptvs: Boolean): Type = {
229+
// Warning: sigToType contains nested completers which might be forced in a later run!
230+
// So local methods need their own ctx parameters.
231+
def sig2type(tparams: immutable.Map[Name,Symbol], skiptvs: Boolean)(implicit ctx: Context): Type = {
230232
val tag = sig(index); index += 1
231233
(tag: @switch) match {
232234
case BYTE_TAG => defn.ByteType
@@ -321,7 +323,7 @@ class ClassfileParser(
321323
}
322324
} // sig2type(tparams, skiptvs)
323325

324-
def sig2typeBounds(tparams: immutable.Map[Name, Symbol], skiptvs: Boolean): Type = {
326+
def sig2typeBounds(tparams: immutable.Map[Name, Symbol], skiptvs: Boolean)(implicit ctx: Context): Type = {
325327
val ts = new ListBuffer[Type]
326328
while (sig(index) == ':') {
327329
index += 1

0 commit comments

Comments
 (0)