Gleb Minaev
03/15/2026, 9:28 PMCodegenTestDirectives.DUMP_IR directive. But now it does not dump IR of generated top-level declarations (that are not placed in user files, but in generated file instead). What directive should I add to see generated top-level functions again?dmitriy.novozhilov
03/16/2026, 8:26 AM// DUMP_IR
package foo
@org.jetbrains.kotlin.plugin.sandbox.TestTopLevelPrivateSuspendFun
fun box(): String = "OK"
FILE fqName:foo fileName:/topLevelPrivateSuspendFun.kt
FUN name:box visibility:public modality:FINAL returnType:kotlin.String
annotations:
TestTopLevelPrivateSuspendFun
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in foo'
CONST String type=kotlin.String value="OK"
FILE fqName:foo fileName:foo/__GENERATED__CALLABLES__.kt
FUN GENERATED[org.jetbrains.kotlin.plugin.sandbox.fir.generators.TopLevelPrivateSuspendFunctionGenerator.TopLevelPrivateSuspendFunctionGeneratorKey] name:testFun_generated visibility:private modality:FINAL returnType:kotlin.Unit [suspend]
BLOCK_BODYGleb Minaev
03/16/2026, 9:18 AMFirDiagnosticsDirectives.EXPLICITLY_GENERATE_PLUGIN_FILES to my test configuration. (I do all the directives specification in test code generator.) But it still does not print the declarations in IR. For example:
// SUPPRESS_WARNINGS: PRE_RELEASE_CLASS
package foo.bar
import dev.lounres.kone.suppliedTypes.*
@Suppliable
fun <@Supply Gee> baz(): Gee? = null
FILE: function1.kt
package foo.bar
@R|dev/lounres/kone/suppliedTypes/Suppliable|() public final fun <@R|dev/lounres/kone/suppliedTypes/Supply|() Gee> baz(): R|Gee?| {
^baz Null(null)
}
FILE: foo/bar/__GENERATED__CALLABLES__.kt
package foo.bar
@R|dev/lounres/kone/suppliedTypes/SupplianceProvided|() public final fun <Gee> baz(@R|dev/lounres/kone/suppliedTypes/SupplianceProvided|() suppliedTypeParameterForGee: R|dev/lounres/kone/suppliedTypes/SuppliedType| = throw R|kotlin/Throwable.Throwable|(String(Stub for declaration generated by Plugin[SuppliableFunctionsDuplicatesGenerationExtension.Key]))): R|Gee?|
FILE fqName:foo.bar fileName:/function1.kt
FUN name:baz visibility:public modality:FINAL returnType:Gee of foo.bar.baz?
TYPE_PARAMETER name:Gee index:0 variance: superTypes:[kotlin.Any?] reified:false
annotations:
Supply
annotations:
Suppliable
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun baz <Gee> (): Gee of foo.bar.baz? declared in foo.bar'
CONST Null type=kotlin.Nothing? value=null
Maybe something is wrong with my setup... But I don't know where to start to investigate the issue.dmitriy.novozhilov
03/16/2026, 9:22 AMIrTextDumpHandler in dependencies and put the breakpoint at processModule function.Gleb Minaev
03/16/2026, 9:57 AMinfo argument. There is only one file with only one declaration in the info. I am trying to find out why the function disappears from the IrModuleFragment. But for now I have to go : ( I'll continue investigation some time later.dmitriy.novozhilov
03/16/2026, 11:41 AMdmitriy.novozhilov
03/16/2026, 11:42 AM::FirCliJvmFacade, ::Fir2IrCliJvmFacade and ::BackendCliJvmFacade respectfully.Gleb Minaev
03/16/2026, 3:52 PMbaseFirDiagnosticTestConfiguration (which uses ::FirFrontendFacade by default), ::Fir2IrResultsConverter, and ::JvmIrBackendFacade. I replaced them with the ones you mentioned and removed +FirDiagnosticsDirectives.EXPLICITLY_GENERATE_PLUGIN_FILES, and now both FIR and IR are dumped correctly! Thank you!
But now multimodule tests are not working : ( For example, test
// SUPPRESS_WARNINGS: PRE_RELEASE_CLASS
// MODULE: foo
import dev.lounres.kone.suppliedTypes.*
@Suppliable
interface Foo<@Supply T>
// MODULE: bar(foo)
import dev.lounres.kone.suppliedTypes.*
@Suppliable
interface Bar<@Supply U> : Foo<Map<out U, *>>
fails with
// SUPPRESS_WARNINGS: PRE_RELEASE_CLASS
// MODULE: foo
import dev.lounres.kone.suppliedTypes.*
@Suppliable
interface Foo<@Supply T>
// MODULE: bar(foo)
import dev.lounres.kone.suppliedTypes.*
@Suppliable
interface Bar<@Supply U> : <!UNRESOLVED_REFERENCE!>Foo<!><Map<out U, *>>dmitriy.novozhilov
03/16/2026, 3:56 PMGleb Minaev
03/16/2026, 3:57 PMGleb Minaev
03/16/2026, 4:05 PMexperiment branch. I just pushed a commit with last changes. The plugin lies in /plugins/suppliedTypes directory. All test generation logic is placed in testGeneration subdirectory.dmitriy.novozhilov
03/17/2026, 7:26 AM// RUN_PIPELINE_TILL: PHASE directive, where PHASE is FRONTEND, FIR2IR or BACKEND (link). You put it in each test to define until which phase the latest module is expected to be compiled (note that all previous modules should be compilable, otherwise binary artifact won't be produced). This functionality is implemented in PhasedPipelineChecker after analysis checker.
As a reference you could check the AbstractFirPhasedDiagnosticTest which is currently the base class for all diagnostic tests in the kotlin repo.dmitriy.novozhilov
03/17/2026, 7:30 AMPhasedPipelineChecker will automatically suggest you to insert the directive with a proper phase if it's missing.
And also it will ensure that the phase should be changed to the next one if there were no compilation errors.Gleb Minaev
03/20/2026, 9:19 AM+CodegenTestDirectives.IGNORE_DEXING, because It was throwing java.lang.NoClassDefFoundError: com/android/tools/r8/origin/Origin. I guess I have to add Android compiler into compiler test runtime classpath. But I think it's not that necessary, so I just suppressed it.
I hope I didn't irritate you much with my silly questions.dmitriy.novozhilov
03/20/2026, 9:22 AMBut I had to apply +CodegenTestDirectives.IGNORE_DEXINGThat's correct, you don't need this checker.
I hope I didn't irritate you much with my silly questions.You're welcome.