Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/notNullAnnotation.fir.kt
T
Ilya Kirillov 1bbcae5ed2 [FIR] fix resolve contract violation from scopes
We cannot call lazy resolve to STATUS phase from scopes as scopes may be accessed on a STATUS phase or earlier

^KT-54890
^KTIJ-23587 fixed
2023-01-13 21:32:51 +00:00

27 lines
712 B
Kotlin
Vendored

// !LANGUAGE: -TypeEnhancementImprovementsInStrictMode
// FILE: SmartFMap.java
public class SmartFMap<K, V> implements java.util.Map<K, V> {
public static < K, V> SmartFMap<K, V> emptyMap() {
return null;
}
public SmartFMap < K, V> plus(@org.jetbrains.annotations.NotNull K key, V value) {
return null;
}
}
// FILE: main.kt
class KotlinType
interface TypePredicate : (KotlinType) -> Boolean {
override fun invoke(typeToCheck: KotlinType): Boolean
}
fun <T : Any?> TypePredicate.expectedTypeFor(keys: Iterable<T>): Map<T, TypePredicate> =
keys.fold(SmartFMap.emptyMap<T, TypePredicate>()) { map, key ->
map.plus(<!ARGUMENT_TYPE_MISMATCH!>key<!>, this)
}