Skip to content

Commit 8ab0035

Browse files
committed
Assert we are loading TASTy with -Yscala2-stdlib
1 parent 5931c37 commit 8ab0035

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
153153
assert(moduleRoot.isTerm)
154154

155155
checkVersion(using ictx)
156+
checkScala2Stdlib(using ictx)
156157

157158
private val loadingMirror = defn(using ictx) // was: mirrorThatLoaded(classRoot)
158159

@@ -239,6 +240,9 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
239240
" in " + source)
240241
}
241242

243+
private def checkScala2Stdlib(using Context): Unit =
244+
assert(!ctx.settings.Yscala2Stdlib.value, "No Scala 2 libraries should be unpickled under -Yscala2-stdlib")
245+
242246
/** The `decls` scope associated with given symbol */
243247
protected def symScope(sym: Symbol): Scope = symScopes.getOrElseUpdate(sym, newScope(0))
244248

0 commit comments

Comments
 (0)