[FIR] Fix incorrect matching of nested classes when actualized via typealias
There are still some places in `.fir.kt` where false-positive reports remained. This is because of IR checker, which will be fixed in next commit. ^KT-31636
This commit is contained in:
committed by
Space Team
parent
a768ece70d
commit
4aaf290c99
+2
-2
@@ -14,7 +14,7 @@ annotation class AnnImpl {
|
||||
annotation class Nested
|
||||
}
|
||||
|
||||
actual typealias <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Ann<!> = AnnImpl
|
||||
actual typealias Ann = AnnImpl
|
||||
|
||||
<!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>@AnnImpl.Nested
|
||||
actual fun <!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>foo<!>() {}<!>
|
||||
actual fun foo() {}<!>
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@ annotation class AnnImpl {
|
||||
annotation class Nested
|
||||
}
|
||||
|
||||
actual typealias <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Ann<!> = AnnImpl
|
||||
actual typealias Ann = AnnImpl
|
||||
|
||||
@AnnImpl.Nested
|
||||
actual fun <!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>foo<!>() {}
|
||||
actual fun foo() {}
|
||||
|
||||
+1
-1
@@ -11,4 +11,4 @@ class DefaultArgsInNestedClassImpl {
|
||||
}
|
||||
|
||||
// Incompatible because of bug KT-31636
|
||||
actual typealias <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>DefaultArgsInNestedClass<!> = DefaultArgsInNestedClassImpl
|
||||
actual typealias DefaultArgsInNestedClass = DefaultArgsInNestedClassImpl
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ class FooImpl {
|
||||
class Inner
|
||||
}
|
||||
|
||||
actual typealias <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> = FooImpl
|
||||
actual typealias Foo = FooImpl
|
||||
|
||||
class SeveralInnerImpl {
|
||||
class Inner1 {
|
||||
@@ -28,4 +28,4 @@ class SeveralInnerImpl {
|
||||
}
|
||||
}
|
||||
|
||||
actual typealias <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>SeveralInner<!> = SeveralInnerImpl
|
||||
actual typealias SeveralInner = SeveralInnerImpl
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ class FooImpl {
|
||||
class Inner
|
||||
}
|
||||
|
||||
actual typealias <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> = FooImpl
|
||||
actual typealias Foo = FooImpl
|
||||
|
||||
class SeveralInnerImpl {
|
||||
class Inner1 {
|
||||
@@ -28,4 +28,4 @@ class SeveralInnerImpl {
|
||||
}
|
||||
}
|
||||
|
||||
actual typealias <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>SeveralInner<!> = SeveralInnerImpl
|
||||
actual typealias SeveralInner = SeveralInnerImpl
|
||||
|
||||
Vendored
+34
@@ -0,0 +1,34 @@
|
||||
// False-positive reports in K1, because fixed only in K2
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
expect class Foo {
|
||||
class Inner<T>
|
||||
}
|
||||
|
||||
expect fun substituted(p: Foo.Inner<Any>)
|
||||
<!EXPECT_ACTUAL_MISMATCH{JVM}!>expect fun substitutedIncorrect(p: Foo.Inner<Any>)<!>
|
||||
|
||||
expect fun <T> withTypeParam(p: Foo.Inner<T>)
|
||||
<!EXPECT_ACTUAL_MISMATCH{JVM}!>expect fun <T, R> withTypeParamIncorrect(p: Foo.Inner<R>)<!>
|
||||
|
||||
expect fun star(p: Foo.Inner<*>)
|
||||
<!EXPECT_ACTUAL_MISMATCH{JVM}!>expect fun starVsNonStar(p: Foo.Inner<*>)<!>
|
||||
|
||||
|
||||
// MODULE: m2-jvm()()(m1-common)
|
||||
// FILE: jvm.kt
|
||||
class FooImpl {
|
||||
class Inner<T>
|
||||
}
|
||||
|
||||
actual typealias Foo = FooImpl
|
||||
|
||||
actual fun substituted(p: Foo.Inner<Any>) {}
|
||||
actual fun <!ACTUAL_WITHOUT_EXPECT!>substitutedIncorrect<!>(p: Foo.Inner<String>) {}
|
||||
|
||||
actual fun <T> withTypeParam(p: Foo.Inner<T>) {}
|
||||
actual fun <T, R> <!ACTUAL_WITHOUT_EXPECT!>withTypeParamIncorrect<!>(p: Foo.Inner<T>) {}
|
||||
|
||||
actual fun star(p: Foo.Inner<*>) {}
|
||||
actual fun <!ACTUAL_WITHOUT_EXPECT!>starVsNonStar<!>(p: Foo.Inner<Any>) {}
|
||||
|
||||
Vendored
+34
@@ -0,0 +1,34 @@
|
||||
// False-positive reports in K1, because fixed only in K2
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
expect class Foo {
|
||||
class Inner<T>
|
||||
}
|
||||
|
||||
expect fun substituted<!NO_ACTUAL_FOR_EXPECT{JVM}!>(p: Foo.<!UNRESOLVED_REFERENCE{JVM}!>Inner<!><Any>)<!>
|
||||
expect fun substitutedIncorrect<!NO_ACTUAL_FOR_EXPECT{JVM}!>(p: Foo.<!UNRESOLVED_REFERENCE{JVM}!>Inner<!><Any>)<!>
|
||||
|
||||
expect fun <T> withTypeParam<!NO_ACTUAL_FOR_EXPECT{JVM}!>(p: Foo.<!UNRESOLVED_REFERENCE{JVM}!>Inner<!><T>)<!>
|
||||
expect fun <T, R> withTypeParamIncorrect<!NO_ACTUAL_FOR_EXPECT{JVM}!>(p: Foo.<!UNRESOLVED_REFERENCE{JVM}!>Inner<!><R>)<!>
|
||||
|
||||
expect fun star<!NO_ACTUAL_FOR_EXPECT{JVM}!>(p: Foo.<!UNRESOLVED_REFERENCE{JVM}!>Inner<!><*>)<!>
|
||||
expect fun starVsNonStar<!NO_ACTUAL_FOR_EXPECT{JVM}!>(p: Foo.<!UNRESOLVED_REFERENCE{JVM}!>Inner<!><*>)<!>
|
||||
|
||||
|
||||
// MODULE: m2-jvm()()(m1-common)
|
||||
// FILE: jvm.kt
|
||||
class FooImpl {
|
||||
class Inner<T>
|
||||
}
|
||||
|
||||
actual typealias Foo = FooImpl
|
||||
|
||||
actual fun substituted<!ACTUAL_WITHOUT_EXPECT!>(p: Foo.<!UNRESOLVED_REFERENCE!>Inner<!><Any>)<!> {}
|
||||
actual fun substitutedIncorrect<!ACTUAL_WITHOUT_EXPECT!>(p: Foo.<!UNRESOLVED_REFERENCE!>Inner<!><String>)<!> {}
|
||||
|
||||
actual fun <T> withTypeParam<!ACTUAL_WITHOUT_EXPECT!>(p: Foo.<!UNRESOLVED_REFERENCE!>Inner<!><T>)<!> {}
|
||||
actual fun <T, R> withTypeParamIncorrect<!ACTUAL_WITHOUT_EXPECT!>(p: Foo.<!UNRESOLVED_REFERENCE!>Inner<!><T>)<!> {}
|
||||
|
||||
actual fun star<!ACTUAL_WITHOUT_EXPECT!>(p: Foo.<!UNRESOLVED_REFERENCE!>Inner<!><*>)<!> {}
|
||||
actual fun starVsNonStar<!ACTUAL_WITHOUT_EXPECT!>(p: Foo.<!UNRESOLVED_REFERENCE!>Inner<!><Any>)<!> {}
|
||||
|
||||
Vendored
+33
@@ -0,0 +1,33 @@
|
||||
// False-positive reports in K1, because fixed only in K2
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
expect class Foo {
|
||||
class Inner<T>
|
||||
}
|
||||
|
||||
expect fun substituted(p: Foo.Inner<Any>)
|
||||
expect fun substitutedIncorrect(p: Foo.Inner<Any>)
|
||||
|
||||
expect fun <T> withTypeParam(p: Foo.Inner<T>)
|
||||
expect fun <T, R> withTypeParamIncorrect(p: Foo.Inner<R>)
|
||||
|
||||
expect fun star(p: Foo.Inner<*>)
|
||||
expect fun starVsNonStar(p: Foo.Inner<*>)
|
||||
|
||||
|
||||
// MODULE: m2-jvm()()(m1-common)
|
||||
// FILE: jvm.kt
|
||||
class FooImpl {
|
||||
class Inner<T>
|
||||
}
|
||||
|
||||
actual typealias Foo = FooImpl
|
||||
|
||||
actual fun substituted(p: Foo.Inner<Any>) {}
|
||||
actual fun <!ACTUAL_WITHOUT_EXPECT!>substitutedIncorrect<!>(p: Foo.Inner<String>) {}
|
||||
|
||||
actual fun <T> withTypeParam(p: Foo.Inner<T>) {}
|
||||
actual fun <T, R> <!ACTUAL_WITHOUT_EXPECT!>withTypeParamIncorrect<!>(p: Foo.Inner<T>) {}
|
||||
|
||||
actual fun star(p: Foo.Inner<*>) {}
|
||||
actual fun <!ACTUAL_WITHOUT_EXPECT!>starVsNonStar<!>(p: Foo.Inner<Any>) {}
|
||||
Reference in New Issue
Block a user