Refactor external overidability conditions

Before this change they could only negatively affect on result
Now they may force success result

Also refine overridavility condition for java fields:
two java fields having the same name are seen as overrides even
if they have different type
This commit is contained in:
Denis Zharkov
2015-12-01 23:10:48 +03:00
parent 8838e46578
commit 4f06cece37
7 changed files with 89 additions and 15 deletions
@@ -0,0 +1,19 @@
// !CHECK_TYPE
// FILE: A.java
public class A {
public int size = 1;
}
// FILE: B.java
public class B extends A {
public String size = 1;
}
// FILE: main.kt
fun foo() {
B().size.checkType { _<String>() }
}
@@ -0,0 +1,19 @@
package
public fun foo(): kotlin.Unit
public open class A {
public constructor A()
public final var size: kotlin.Int
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public open class B : A {
public constructor B()
public final override /*1*/ var size: kotlin.String
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}