Skip to content

Commit acbbd42

Browse files
bishaboshaWojciechMazur
authored andcommitted
emit generatedNonLocalClass in backend when callback is not enabled
1 parent 879e820 commit acbbd42

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

compiler/src/dotty/tools/backend/jvm/CodeGen.scala

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,15 @@ class CodeGen(val int: DottyBackendInterface, val primitives: DottyPrimitives)(
133133
if (ctx.compilerCallback != null)
134134
ctx.compilerCallback.onClassGenerated(sourceFile, convertAbstractFile(clsFile), className)
135135

136-
if isLocal then
137-
ctx.withIncCallback(_.generatedLocalClass(sourceFile, clsFile.jpath))
136+
ctx.withIncCallback: cb =>
137+
if isLocal then
138+
cb.generatedLocalClass(sourceFile, clsFile.jpath)
139+
else if !cb.enabled() then
140+
// callback is not enabled, so nonLocalClasses were not reported in ExtractAPI
141+
val fullClassName = atPhase(sbtExtractDependenciesPhase) {
142+
ExtractDependencies.classNameAsString(claszSymbol)
143+
}
144+
cb.generatedNonLocalClass(sourceFile, clsFile.jpath, className, fullClassName)
138145
}
139146
}
140147

0 commit comments

Comments
 (0)