diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnHasTypeNothing.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnHasTypeNothing.kt new file mode 100644 index 00000000000..58d855b0c29 --- /dev/null +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnHasTypeNothing.kt @@ -0,0 +1,7 @@ +fun test() { + run1 @f{(): Int -> + (return@f 1): Nothing + } +} + +fun run1(f: () -> T): T { return f() } \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java index 6c60028a515..20e237ce7ad 100644 --- a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java @@ -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");