Skip to content

Reuse -Yscala2Unpickler to check Scala 2 library compilation #19430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
assert(moduleRoot.isTerm)

checkVersion(using ictx)
checkScala2Stdlib(using ictx)

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

Expand Down Expand Up @@ -238,9 +237,6 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
" in " + source)
}

private def checkScala2Stdlib(using Context): Unit =
assert(!ctx.settings.YcompileScala2Library.value, "No Scala 2 libraries should be unpickled under -Ycompile-scala2-library")

/** The `decls` scope associated with given symbol */
protected def symScope(sym: Symbol): Scope = symScopes.getOrElseUpdate(sym, newScope(0))

Expand Down
1 change: 1 addition & 0 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,7 @@ object Build {
},
Compile / doc / scalacOptions += "-Ydocument-synthetic-types",
scalacOptions += "-Ycompile-scala2-library",
scalacOptions += "-Yscala2Unpickler:never",
scalacOptions -= "-Xfatal-warnings",
Compile / compile / logLevel := Level.Error,
ivyConfigurations += SourceDeps.hide,
Expand Down