Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/java/assertThatOnMap.kt
T
Denis.Zharkov f70ae2df3a FIR: Refine inference constraints when type variable in flexible position
That issue might be fixed via changing
TypeVariableMarker.shouldBeFlexible at ConeConstraintSystemUtilContext
but this and some other tricks have been added because of incorrect
handling of constraints where type variable has a flexible bound

^KT-51168 Fixed
2022-05-19 16:53:59 +00:00

37 lines
782 B
Kotlin
Vendored

// FIR_IDENTICAL
// SKIP_TXT
// FILE: AbstractMapAssert.java
import java.util.Map;
public abstract class AbstractMapAssert<SELF extends AbstractMapAssert<SELF, ACTUAL, K, V>, ACTUAL extends Map<K, V>, K, V> {
public SELF isNotNull() {
return (SELF) this;
}
}
// FILE: MapAssert.java
import java.util.Map;
public class MapAssert<KEY, VALUE> extends AbstractMapAssert<MapAssert<KEY, VALUE>, Map<KEY, VALUE>, KEY, VALUE> {
public MapAssert(Map<KEY, VALUE> actual) {}
}
// FILE: Assertions.java
import java.util.Map;
public class Assertions {
public static <K, V> MapAssert<K, V> assertThat(Map<K, V> actual) {
return new MapAssert<>(actual);
}
}
// FILE: test.kt
fun <S : Map<*,*>> S?.must() {
Assertions.assertThat(this).isNotNull
}