Skip to content

Load tasty files directly in -from-tasty tests #10009

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
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
7 changes: 3 additions & 4 deletions compiler/src/dotty/tools/dotc/ast/TreeInfo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -740,10 +740,9 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
def sliceTopLevel(tree: Tree, cls: ClassSymbol)(using Context): List[Tree] = tree match {
case PackageDef(pid, stats) =>
val slicedStats = stats.flatMap(sliceTopLevel(_, cls))
if (!slicedStats.isEmpty)
cpy.PackageDef(tree)(pid, slicedStats) :: Nil
else
Nil
val isEffectivelyEmpty = slicedStats.forall(_.isInstanceOf[Import])
if isEffectivelyEmpty then Nil
else cpy.PackageDef(tree)(pid, slicedStats) :: Nil
case tdef: TypeDef =>
val sym = tdef.symbol
assert(sym.isClass)
Expand Down
18 changes: 5 additions & 13 deletions compiler/test/dotc/pos-from-tasty.blacklist
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
# has location not matching its contents: contains class mixins.Collections
collections_1.scala

# Infinite loop
t3612.scala

# Other failure
# java.lang.AssertionError: assertion failed:
# Found: (File.this.parens0 : => Test.this.parens.BraceImpl)
# Required: ((Test.this.parens : Test.this.ParensImpl) | (Test.this.bracks : Test.this.BracksImpl))#BraceImpl
t802.scala

# Matchtype
i7087.scala

# Nullability
nullable.scala
notNull.scala

# cyclic reference involving @uncheckedVariance
annot-bootstrap.scala
# missing position
rbtree.scala
5 changes: 0 additions & 5 deletions compiler/test/dotc/run-from-tasty.blacklist
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
# Closure type miss match
eff-dependent.scala

# We get: class Foo needs to be abstract, since implicit val x$1: TC is not defined
i2567.scala
6 changes: 1 addition & 5 deletions compiler/test/dotty/tools/vulpix/ParallelTesting.scala
Original file line number Diff line number Diff line change
Expand Up @@ -504,11 +504,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
tastyOutput.mkdir()
val flags = flags0 and ("-d", tastyOutput.getPath) and "-from-tasty"

def tastyFileToClassName(f: JFile): String = {
val pathStr = targetDir.toPath.relativize(f.toPath).toString.replace(JFile.separatorChar, '.')
pathStr.stripSuffix(".tasty").stripSuffix(".hasTasty")
}
val classes = flattenFiles(targetDir).filter(isTastyFile).map(tastyFileToClassName)
val classes = flattenFiles(targetDir).filter(isTastyFile).map(_.toString)

val reporter =
TestReporter.reporter(realStdout, logLevel =
Expand Down