Match triangle & diamond intersections in FirTypeIntersectionScope

This commit is contained in:
Mikhail Glukhikh
2021-03-22 16:13:27 +03:00
parent a7a1b678bd
commit 9f27362ee1
19 changed files with 590 additions and 176 deletions
@@ -0,0 +1,41 @@
FILE: doubleGenericDiamond.kt
public abstract interface Left : R|kotlin/Any| {
}
public abstract interface Right : R|kotlin/Any| {
}
public final class Bottom : R|Left|, R|Right| {
public constructor(): R|Bottom| {
super<R|kotlin/Any|>()
}
}
public abstract interface A<T> : R|kotlin/Any| {
public open fun f(): R|T?| {
^f Null(null)
}
}
public abstract interface B<T : R|Left|> : R|A<T>| {
public open override fun f(): R|T?| {
^f Null(null)
}
}
public abstract class C<T> : R|A<T>| {
public constructor<T>(): R|C<T>| {
super<R|kotlin/Any|>()
}
}
public abstract class D<T : R|Right|> : R|C<T>| {
public constructor<T : R|Right|>(): R|D<T>| {
super<R|C<T>|>()
}
}
public final class Z : R|D<Bottom>|, R|B<Bottom>| {
public constructor(): R|Z| {
super<R|D<Bottom>|>()
}
}