File tree 2 files changed +6
-4
lines changed
compiler/src/dotty/tools/dotc/core
sbt-test/pipelining/Yjava-tasty-fromjavaobject
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -346,12 +346,14 @@ object Phases {
346
346
def runOn (units : List [CompilationUnit ])(using runCtx : Context ): List [CompilationUnit ] =
347
347
val buf = List .newBuilder[CompilationUnit ]
348
348
// factor out typedAsJava check when not needed
349
- val doSkipJava = ctx.settings.YjavaTasty .value && this <= sbtExtractAPIPhase && skipIfJava
349
+ val doCheckJava =
350
+ ctx.settings.YjavaTasty .value
351
+ && (! sbtExtractAPIPhase.exists || this <= sbtExtractAPIPhase)
350
352
for unit <- units do
351
353
given unitCtx : Context = runCtx.fresh.setPhase(this .start).setCompilationUnit(unit).withRootImports
352
354
if ctx.run.enterUnit(unit) then
353
355
try
354
- if doSkipJava && unit.typedAsJava then
356
+ if doCheckJava && skipIfJava && unit.typedAsJava then
355
357
()
356
358
else
357
359
run
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ lazy val a = project.in(file("a"))
2
2
.settings(
3
3
compileOrder := CompileOrder .Mixed , // ensure we send java sources to Scala compiler
4
4
scalacOptions += " -Yjava-tasty" , // enable pickling of java signatures
5
- scalacOptions ++= Seq (" -Yjava -tasty-output" , ((ThisBuild / baseDirectory).value / " a-enum-java-tasty.jar" ).toString),
5
+ scalacOptions ++= Seq (" -Yearly -tasty-output" , ((ThisBuild / baseDirectory).value / " a-enum-java-tasty.jar" ).toString),
6
6
scalacOptions += " -Ycheck:all" ,
7
7
Compile / classDirectory := ((ThisBuild / baseDirectory).value / " a-enum-classes" ), // send classfiles to a different directory
8
8
)
@@ -14,7 +14,7 @@ lazy val aCheck = project.in(file("a-check"))
14
14
Compile / sources := (a / Compile / sources).value, // use the same sources as a
15
15
compileOrder := CompileOrder .Mixed , // ensure we send java sources to Scala compiler
16
16
scalacOptions += " -Yjava-tasty" , // enable pickling of java signatures
17
- scalacOptions ++= Seq (" -Yjava -tasty-output" , ((ThisBuild / baseDirectory).value / " a-enum-java-tasty-2.jar" ).toString),
17
+ scalacOptions ++= Seq (" -Yearly -tasty-output" , ((ThisBuild / baseDirectory).value / " a-enum-java-tasty-2.jar" ).toString),
18
18
Compile / classDirectory := ((ThisBuild / baseDirectory).value / " a-enum-classes-2" ), // send classfiles to a different directory
19
19
)
20
20
You can’t perform that action at this time.
0 commit comments