File tree 1 file changed +9
-0
lines changed
compiler/src/dotty/tools/dotc/typer 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,13 @@ class FrontEnd extends Phase {
86
86
case ex : CompilationUnit .SuspendException =>
87
87
}
88
88
89
+ def javaCheck (using Context ): Unit = monitor(" checking java" ) {
90
+ val unit = ctx.compilationUnit
91
+ if unit.isJava then
92
+ JavaChecks .check(unit.tpdTree)
93
+ }
94
+
95
+
89
96
private def firstTopLevelDef (trees : List [tpd.Tree ])(using Context ): Symbol = trees match {
90
97
case PackageDef (_, defs) :: _ => firstTopLevelDef(defs)
91
98
case Import (_, _) :: defs => firstTopLevelDef(defs)
@@ -115,6 +122,8 @@ class FrontEnd extends Phase {
115
122
116
123
unitContexts.foreach(typeCheck(using _))
117
124
record(" total trees after typer" , ast.Trees .ntrees)
125
+ unitContexts.foreach(javaCheck(using _)) // after typechecking to avoid cycles
126
+
118
127
val newUnits = unitContexts.map(_.compilationUnit).filterNot(discardAfterTyper)
119
128
val suspendedUnits = ctx.run.suspendedUnits
120
129
if newUnits.isEmpty && suspendedUnits.nonEmpty && ! ctx.reporter.errorsReported then
You can’t perform that action at this time.
0 commit comments