Skip to content

Commit f3a4640

Browse files
authored
Merge pull request #10009 from dotty-staging/load-tasty-files-directly-in-tests
Load tasty files directly in -from-tasty tests
2 parents fefa7c5 + 4d27bd7 commit f3a4640

File tree

4 files changed

+9
-27
lines changed

4 files changed

+9
-27
lines changed

compiler/src/dotty/tools/dotc/ast/TreeInfo.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -740,10 +740,9 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
740740
def sliceTopLevel(tree: Tree, cls: ClassSymbol)(using Context): List[Tree] = tree match {
741741
case PackageDef(pid, stats) =>
742742
val slicedStats = stats.flatMap(sliceTopLevel(_, cls))
743-
if (!slicedStats.isEmpty)
744-
cpy.PackageDef(tree)(pid, slicedStats) :: Nil
745-
else
746-
Nil
743+
val isEffectivelyEmpty = slicedStats.forall(_.isInstanceOf[Import])
744+
if isEffectivelyEmpty then Nil
745+
else cpy.PackageDef(tree)(pid, slicedStats) :: Nil
747746
case tdef: TypeDef =>
748747
val sym = tdef.symbol
749748
assert(sym.isClass)
Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
1-
# has location not matching its contents: contains class mixins.Collections
2-
collections_1.scala
3-
41
# Infinite loop
52
t3612.scala
63

7-
# Other failure
4+
# java.lang.AssertionError: assertion failed:
5+
# Found: (File.this.parens0 : => Test.this.parens.BraceImpl)
6+
# Required: ((Test.this.parens : Test.this.ParensImpl) | (Test.this.bracks : Test.this.BracksImpl))#BraceImpl
87
t802.scala
98

10-
# Matchtype
11-
i7087.scala
12-
13-
# Nullability
14-
nullable.scala
15-
notNull.scala
16-
17-
# cyclic reference involving @uncheckedVariance
18-
annot-bootstrap.scala
9+
# missing position
10+
rbtree.scala
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +0,0 @@
1-
# Closure type miss match
2-
eff-dependent.scala
3-
4-
# We get: class Foo needs to be abstract, since implicit val x$1: TC is not defined
5-
i2567.scala

compiler/test/dotty/tools/vulpix/ParallelTesting.scala

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -504,11 +504,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
504504
tastyOutput.mkdir()
505505
val flags = flags0 and ("-d", tastyOutput.getPath) and "-from-tasty"
506506

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

513509
val reporter =
514510
TestReporter.reporter(realStdout, logLevel =

0 commit comments

Comments
 (0)