Do not create error types in deserialization on not found classes
For a class which cannot be resolved in the current deserialization session, create a special ClassDescriptor instance with an empty scope and put in the correct package under the current module. Codegen will perfectly map such class to its JVM signature (because only the precise FQ name is needed, which is available). For more details on this approach, see the issue description. #KT-4328 Fixed #KT-11497 Fixed
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
package a
|
||||
|
||||
class A<T> {
|
||||
inner class Inner<X : Number, Y>
|
||||
}
|
||||
|
||||
class AA<T> {
|
||||
inner class Inner<U, V>
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package b
|
||||
|
||||
import a.A
|
||||
import a.AA
|
||||
|
||||
interface B1 {
|
||||
fun produceA(): A<String>.Inner<Int, Unit>
|
||||
fun produceAA(): AA<Int>.Inner<Unit, String>
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package a
|
||||
|
||||
class A<T, U: CharSequence, V> {
|
||||
inner class Inner<Z>
|
||||
}
|
||||
|
||||
class AA<T, U> {
|
||||
inner class Inner<V>
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package b
|
||||
|
||||
import a.A
|
||||
import a.AA
|
||||
|
||||
interface B2 {
|
||||
fun consumeA(a: A<Int, String, Double>.Inner<B2>)
|
||||
fun consumeAA(a: AA<Int, Unit>.Inner<String>)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/missingDependencyConflictingLibraries/source.kt:7:17: error: type mismatch: inferred type is A<String>.Inner<Int, Unit> but A<Int, String, Double>.Inner<B2> was expected
|
||||
b2.consumeA(b1.produceA())
|
||||
^
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/missingDependencyConflictingLibraries/source.kt:11:18: error: type mismatch: inferred type is AA<Int>.Inner<Unit, String> but AA<Int, Unit>.Inner<String> was expected
|
||||
b2.consumeAA(b1.produceAA())
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/missingDependencyConflictingLibraries/source.kt
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
package c
|
||||
|
||||
import b.B1
|
||||
import b.B2
|
||||
|
||||
fun testA(b1: B1, b2: B2) {
|
||||
b2.consumeA(b1.produceA())
|
||||
}
|
||||
|
||||
fun testAA(b1: B1, b2: B2) {
|
||||
b2.consumeAA(b1.produceAA())
|
||||
}
|
||||
Reference in New Issue
Block a user