Skip to content

Commit aefd681

Browse files
committed
post-rebase fixes
1 parent 88fece2 commit aefd681

File tree

6 files changed

+7
-5
lines changed

6 files changed

+7
-5
lines changed

compiler/src/dotty/tools/dotc/classpath/DirectoryClassPath.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ case class DirectoryClassPath(dir: JFile) extends JFileDirectoryLookup[BinaryFil
285285
protected def createFileEntry(file: AbstractFile): BinaryFileEntry = BinaryFileEntry(file)
286286

287287
protected def isMatchingFile(f: JFile): Boolean =
288-
f.isTasty || f.isBestEffortTasty || (f.isClass && f.hasSiblingTasty)
288+
f.isTasty || f.isBestEffortTasty || (f.isClass && !f.hasSiblingTasty)
289289

290290
private[dotty] def classes(inPackage: PackageName): Seq[BinaryFileEntry] = files(inPackage)
291291
}

compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ class ClassfileLoader(val classfile: AbstractFile) extends SymbolLoader {
418418
}
419419

420420
class TastyLoader(val tastyFile: AbstractFile) extends SymbolLoader {
421-
val isBestEffortTasty = tastyFile.extension == "betasty"
421+
val isBestEffortTasty = tastyFile.hasBetastyExtension
422422
private val unpickler: tasty.DottyUnpickler =
423423
handleUnpicklingExceptions:
424424
val tastyBytes = tastyFile.toByteArray

compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ object TastyPrinter:
6161
val jar = JarArchive.open(Path(arg), create = false)
6262
try
6363
for file <- jar.iterator() if file.hasTastyExtension do
64-
printTasty(s"$arg ${file.path}", file.toByteArray)
64+
printTasty(s"$arg ${file.path}", file.toByteArray, isBestEffortTasty = false)
6565
finally jar.close()
6666
else
6767
println(s"Not a '.tasty' or '.jar' file: $arg")

compiler/src/dotty/tools/dotc/transform/Pickler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class Pickler extends Phase {
6161
override def isRunnable(using Context): Boolean =
6262
(super.isRunnable || ctx.isBestEffort)
6363
&& !ctx.settings.fromTasty.value
64-
&& (!ctx.usesBestEffortTasty || ctx.isBestEffort)
64+
&& (!ctx.usedBestEffortTasty || ctx.isBestEffort)
6565
// we do not want to pickle `.betasty` if will not create the file either way
6666

6767
// when `-Yjava-tasty` is set we actually want to run this phase on Java sources

compiler/src/dotty/tools/io/FileExtension.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ object FileExtension:
6363
case "java" => Java
6464
case "zip" => Zip
6565
case "inc" => Inc
66+
case "betasty" => Betasty
6667
case _ => slowLookup(s)
6768

6869
// slower than initialLookup, keep in sync with initialLookup
@@ -75,6 +76,7 @@ object FileExtension:
7576
else if s.equalsIgnoreCase("java") then Java
7677
else if s.equalsIgnoreCase("zip") then Zip
7778
else if s.equalsIgnoreCase("inc") then Inc
79+
else if s.equalsIgnoreCase("betasty") then Betasty
7880
else External(s)
7981

8082
def from(s: String): FileExtension =

compiler/test/dotc/neg-best-effort-unpickling.blacklist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ i4653.scala
1414
overrideClass.scala
1515

1616
# repeating <error> on a top level type definition
17-
# i18750.scala
17+
i18750.scala

0 commit comments

Comments
 (0)