[NI] discriminate Nothing for reified parameters
Related issues: KT-32836, KT-35728
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// !WITH_NEW_INFERENCE
|
||||
|
||||
inline fun <reified T> parse(json: String): T? = TODO()
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// !WITH_NEW_INFERENCE
|
||||
|
||||
inline fun <reified T> parse(json: String): T? = TODO()
|
||||
|
||||
@@ -7,7 +6,7 @@ class MyType
|
||||
|
||||
fun parseMyData(json: String): MyType =
|
||||
try {
|
||||
<!NI;REIFIED_TYPE_FORBIDDEN_SUBSTITUTION, NI;REIFIED_TYPE_FORBIDDEN_SUBSTITUTION!>parse<!>(json) // error with new inf only: Cannot use 'Nothing?' as reified type parameter
|
||||
parse(json) // error with new inf only: Cannot use 'Nothing?' as reified type parameter
|
||||
?: throw IllegalArgumentException("Can't parse")
|
||||
} catch (e: Exception) {
|
||||
throw IllegalArgumentException("Can't parse")
|
||||
|
||||
Reference in New Issue
Block a user