[FE] Fix checker of DEFAULT_ARGUMENTS_IN_EXPECT_WITH_ACTUAL_TYPEALIAS

...not reporting on companion object members as well as other
nested classes.

Annotation classes are accepted because this is how it already worked,
see other tests, for example `annotationsViaActualTypeAlias.kt`.

Test for nested annotation classes will be added in subsequent commit,
because it currently will fail in test
`TreeCompareTest.testCompareDiagnostics` because light-tree2fir
produces different tree due to a bug when converting properties
from expect primary constructor. See subsequent commit for a fix.

Review: KT-MR-12107

^KT-61784
This commit is contained in:
Roman Efremov
2023-09-08 12:23:45 +02:00
committed by Space Team
parent e0e2a57e3d
commit c6d7f15070
7 changed files with 128 additions and 20 deletions
@@ -0,0 +1,18 @@
// FIR_IDENTICAL
// MODULE: m1-common
// FILE: common.kt
expect class DefaultArgsInCompanion {
companion object {
fun foo(p: String = "")
}
}
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
class DefaultArgsInCompanionImpl {
companion object {
fun foo(p: String) {}
}
}
<!DEFAULT_ARGUMENTS_IN_EXPECT_WITH_ACTUAL_TYPEALIAS!>actual typealias DefaultArgsInCompanion = DefaultArgsInCompanionImpl<!>
@@ -0,0 +1,18 @@
// FIR_IDENTICAL
// MODULE: m1-common
// FILE: common.kt
expect class DefaultArgsInNestedClass {
class Nested {
fun foo(p: String = "")
}
}
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
class DefaultArgsInNestedClassImpl {
class Nested {
fun foo(p: String) {}
}
}
<!DEFAULT_ARGUMENTS_IN_EXPECT_WITH_ACTUAL_TYPEALIAS!>actual typealias DefaultArgsInNestedClass = DefaultArgsInNestedClassImpl<!>