Don't apply Unit-conversion for expressions that return Nothing type
This commit is contained in:
Vendored
+8
-2
@@ -1,4 +1,4 @@
|
||||
// !LANGUAGE: -SuspendConversion
|
||||
// !LANGUAGE: -UnitConversion
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
|
||||
fun foo(f: () -> Unit) {}
|
||||
@@ -7,9 +7,15 @@ fun bar(): Int = 0
|
||||
|
||||
abstract class SubInt : () -> Int
|
||||
|
||||
fun test(f: () -> String, s: SubInt) {
|
||||
fun <T> T.freeze(): T = TODO()
|
||||
|
||||
fun test(f: () -> String, g: () -> Nothing, h: () -> Nothing?, s: SubInt) {
|
||||
foo { "lambda" }
|
||||
foo(::bar)
|
||||
foo({ TODO() }.freeze())
|
||||
foo(g)
|
||||
|
||||
foo(<!UNSUPPORTED_FEATURE!>h<!>)
|
||||
|
||||
foo(<!UNSUPPORTED_FEATURE!>f<!>)
|
||||
foo(<!UNSUPPORTED_FEATURE!>s<!>)
|
||||
|
||||
Reference in New Issue
Block a user