DFA bug fix: assignment of unstable to stable uses predictable type set (see test)
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
class Bar {
|
||||
fun bar() {}
|
||||
}
|
||||
|
||||
class Foo(var x: Any) {
|
||||
init {
|
||||
if (x is Bar) {
|
||||
val y = x
|
||||
// Error: x is not stable, Type(y) = Any
|
||||
<!SMARTCAST_IMPOSSIBLE!>x<!>.bar()
|
||||
y.<!UNRESOLVED_REFERENCE!>bar<!>()
|
||||
if (y == x) {
|
||||
// Still error
|
||||
y.<!UNRESOLVED_REFERENCE!>bar<!>()
|
||||
}
|
||||
if (x !is Bar && y != x) {
|
||||
// Still error
|
||||
y.<!UNRESOLVED_REFERENCE!>bar<!>()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package
|
||||
|
||||
public final class Bar {
|
||||
public constructor Bar()
|
||||
public final fun bar(): kotlin.Unit
|
||||
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 final class Foo {
|
||||
public constructor Foo(/*0*/ x: kotlin.Any)
|
||||
public final var x: kotlin.Any
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user