Test that local return has type Nothing
This commit is contained in:
+7
@@ -0,0 +1,7 @@
|
||||
fun test() {
|
||||
run1 @f{(): Int ->
|
||||
(return@f 1): Nothing
|
||||
}
|
||||
}
|
||||
|
||||
fun run1<T>(f: () -> T): T { return f() }
|
||||
@@ -2452,6 +2452,11 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage
|
||||
doTest("compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelParens.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("LocalReturnHasTypeNothing.kt")
|
||||
public void testLocalReturnHasTypeNothing() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnHasTypeNothing.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("LocalReturnInNestedFunction.kt")
|
||||
public void testLocalReturnInNestedFunction() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedFunction.kt");
|
||||
|
||||
Reference in New Issue
Block a user