Skip to content

Commit

Permalink
add fix for issue #17997 affecting the global object initialization c…
Browse files Browse the repository at this point in the history
…hecker
  • Loading branch information
EnzeXing committed Jul 24, 2023
1 parent 96ca0b6 commit f5313ae
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion compiler/src/dotty/tools/dotc/transform/init/Objects.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,16 @@ object Objects:
ref match
case Select(supert: Super, _) =>
val SuperType(thisTp, superTp) = supert.tpe: @unchecked
val thisValue2 = extendTrace(ref) { resolveThis(thisTp.classSymbol.asClass, thisV, klass) }
val thisValue2 = extendTrace(ref) {
thisTp match
case thisTp: ThisType =>
evalType(thisTp, thisV, klass)
case AndType(thisTp: ThisType, _) =>
evalType(thisTp, thisV, klass)
case _ =>
report.warning("[Internal error] Unexpected type " + thisTp.show + ", trace:\n" + Trace.show, ref)
Bottom
}
withTrace(trace2) { call(thisValue2, ref.symbol, args, thisTp, superTp) }

case Select(qual, _) =>
Expand Down

0 comments on commit f5313ae

Please sign in to comment.