KT-12846 Forbid vararg of type 'Nothing' and 'Nothing?'
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun testVarargOfNothing(<!FORBIDDEN_VARARG_PARAMETER_TYPE!>vararg<!> v: Nothing) {}
|
||||
|
||||
fun testVarargOfNNothing(<!FORBIDDEN_VARARG_PARAMETER_TYPE!>vararg<!> v: Nothing?) {}
|
||||
|
||||
fun <T : Nothing?> testVarargOfT(<!FORBIDDEN_VARARG_PARAMETER_TYPE!>vararg<!> v: T) {}
|
||||
|
||||
fun outer() {
|
||||
fun testVarargOfNothing(<!FORBIDDEN_VARARG_PARAMETER_TYPE!>vararg<!> v: Nothing) {}
|
||||
|
||||
fun testVarargOfNNothing(<!FORBIDDEN_VARARG_PARAMETER_TYPE!>vararg<!> v: Nothing?) {}
|
||||
|
||||
fun <T : Nothing?> testVarargOfT(<!FORBIDDEN_VARARG_PARAMETER_TYPE!>vararg<!> v: T) {}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package
|
||||
|
||||
public fun outer(): kotlin.Unit
|
||||
public fun testVarargOfNNothing(/*0*/ vararg v: kotlin.Nothing? /*kotlin.Array<out kotlin.Nothing?>*/): kotlin.Unit
|
||||
public fun testVarargOfNothing(/*0*/ vararg v: kotlin.Nothing /*kotlin.Array<out kotlin.Nothing>*/): kotlin.Unit
|
||||
public fun </*0*/ T : kotlin.Nothing?> testVarargOfT(/*0*/ vararg v: T /*kotlin.Array<out T>*/): kotlin.Unit
|
||||
Reference in New Issue
Block a user