[FIR] Implement DEFINITELY_NON_NULLABLE_AS_REIFIED diagnostic
#KT-55646 Fixed
This commit is contained in:
committed by
Space Team
parent
509a97a7b5
commit
0a2477585a
-8
@@ -1,8 +0,0 @@
|
||||
// SKIP_TXT
|
||||
// !LANGUAGE: +DefinitelyNonNullableTypes
|
||||
|
||||
inline fun <reified T : Any> foo() {}
|
||||
|
||||
inline fun <reified F> bar() {
|
||||
foo<F & Any>()
|
||||
}
|
||||
compiler/testData/diagnostics/tests/explicitDefinitelyNotNullableViaIntersection/reifiedArguments.kt
Vendored
+10
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// SKIP_TXT
|
||||
// !LANGUAGE: +DefinitelyNonNullableTypes
|
||||
|
||||
@@ -6,3 +7,12 @@ inline fun <reified T : Any> foo() {}
|
||||
inline fun <reified F> bar() {
|
||||
foo<<!DEFINITELY_NON_NULLABLE_AS_REIFIED!>F & Any<!>>()
|
||||
}
|
||||
|
||||
class KAnnotatedElement(val annotations: List<Any>)
|
||||
|
||||
inline fun <reified T : Any> Iterable<*>.firstIsInstanceOrNull(): T? {
|
||||
return null
|
||||
}
|
||||
|
||||
private inline fun <reified T> KAnnotatedElement.findAnnotation(): T? =
|
||||
annotations.firstIsInstanceOrNull()
|
||||
Reference in New Issue
Block a user