dokka
dokka copied to clipboard
Fix backwards interface method modifiers
Fixes #4279
I cannot figure out how to write the test as
@Test
fun `interface methods should have default when needed`() {
val source = source(
"""
interface A {
fun b() {}
fun c()
}
"""
)
val writerPlugin = TestOutputWriterPlugin()
testInline(
source,
configuration,
pluginOverrides = listOf(writerPlugin)
) {
renderingStage = { _, _ ->
val signatures = writerPlugin.writer
.renderedContent("root/kotlinAsJavaPlugin/-a/index.html")
.signature()
val methodWithBody = signatures[1]
methodWithBody.match(
"public default ", A("Unit"), A("b"), "()"
)
val methodWithoutBody = signatures[2]
methodWithoutBody.match(
"public ", A("Unit"), A("c"), "()"
)
}
}
}
just throws "public default " expected but found: <a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html">Unit</a>