TypeConstructor's equality for classes relies on FqNames
This is needed because different modules/libraries may define classes with the same FqNames, which may be identical or slightly different. Such classes must be considered equal, because your dependencies may rely on different packagings of the same codebase, and the classes there will be distinct though identical (think intellij-core vs idea-full).
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
// MODULE: m1
|
||||
// FILE: a.kt
|
||||
|
||||
package p
|
||||
|
||||
public class A
|
||||
public class B {
|
||||
public val a: A = A()
|
||||
}
|
||||
|
||||
// MODULE: m2(m1)
|
||||
// FILE: b.kt
|
||||
|
||||
package p
|
||||
|
||||
class A {
|
||||
fun foo() {}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val a: A = B().a
|
||||
a.foo()
|
||||
}
|
||||
Reference in New Issue
Block a user