diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java index 4881e7917ad..3e316baeffe 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java @@ -1697,6 +1697,8 @@ public class ExpressionCodegen extends JetVisitor implem // If it does not end with return we should return something // because if we don't there can be VerifyError (specific cases with Nothing-typed expressions) if (!endsWithReturn(expr)) { + markLineNumber(expr, true); + if (isBlockedNamedFunction && !Type.VOID_TYPE.equals(expressionType(expr))) { StackValue.none().put(returnType, v); } diff --git a/idea/testData/debugger/tinyApp/outs/returnVoid.out b/idea/testData/debugger/tinyApp/outs/returnVoid.out new file mode 100644 index 00000000000..d7665944e15 --- /dev/null +++ b/idea/testData/debugger/tinyApp/outs/returnVoid.out @@ -0,0 +1,8 @@ +LineBreakpoint created at returnVoid.kt:5 +!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! returnVoid.ReturnVoidPackage +Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' +returnVoid.kt:5 +returnVoid.kt:6 +Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' + +Process finished with exit code 0 diff --git a/idea/testData/debugger/tinyApp/outs/skipClassloader.out b/idea/testData/debugger/tinyApp/outs/skipClassloader.out index e161c76d64d..c26aad70073 100644 --- a/idea/testData/debugger/tinyApp/outs/skipClassloader.out +++ b/idea/testData/debugger/tinyApp/outs/skipClassloader.out @@ -2,7 +2,7 @@ LineBreakpoint created at skipClassloader.kt:7 !JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! skipClassloader.SkipClassloaderPackage Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' skipClassloader.kt:7 -skipClassloader.kt:11 +skipClassloader.kt:13 Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' Process finished with exit code 0 diff --git a/idea/testData/debugger/tinyApp/outs/syntheticMethods.out b/idea/testData/debugger/tinyApp/outs/syntheticMethods.out index fb19b6abf57..4db52349115 100644 --- a/idea/testData/debugger/tinyApp/outs/syntheticMethods.out +++ b/idea/testData/debugger/tinyApp/outs/syntheticMethods.out @@ -3,6 +3,7 @@ LineBreakpoint created at syntheticMethods.kt:6 Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' syntheticMethods.kt:6 syntheticMethods.kt:18 +syntheticMethods.kt:19 syntheticMethods.kt:16 syntheticMethods.kt:7 Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' diff --git a/idea/testData/debugger/tinyApp/src/stepInto/stepInto/returnVoid.kt b/idea/testData/debugger/tinyApp/src/stepInto/stepInto/returnVoid.kt new file mode 100644 index 00000000000..83d7a445231 --- /dev/null +++ b/idea/testData/debugger/tinyApp/src/stepInto/stepInto/returnVoid.kt @@ -0,0 +1,8 @@ +package returnVoid + +fun main(args: Array) { + //Breakpoint! + val a = 3 +} + +// STEP_INTO: 1 \ No newline at end of file diff --git a/idea/testData/debugger/tinyApp/src/stepInto/stepInto/syntheticMethods.kt b/idea/testData/debugger/tinyApp/src/stepInto/stepInto/syntheticMethods.kt index 09d74fa8eff..cc5baa86324 100644 --- a/idea/testData/debugger/tinyApp/src/stepInto/stepInto/syntheticMethods.kt +++ b/idea/testData/debugger/tinyApp/src/stepInto/stepInto/syntheticMethods.kt @@ -19,4 +19,4 @@ class Derived: Base() { } } -// STEP_INTO: 3 \ No newline at end of file +// STEP_INTO: 4 \ No newline at end of file diff --git a/idea/tests/org/jetbrains/jet/plugin/debugger/KotlinSteppingTestGenerated.java b/idea/tests/org/jetbrains/jet/plugin/debugger/KotlinSteppingTestGenerated.java index a816b3c0310..8f1b86a14ef 100644 --- a/idea/tests/org/jetbrains/jet/plugin/debugger/KotlinSteppingTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/plugin/debugger/KotlinSteppingTestGenerated.java @@ -225,6 +225,12 @@ public class KotlinSteppingTestGenerated extends AbstractKotlinSteppingTest { doStepIntoTest(fileName); } + @TestMetadata("returnVoid.kt") + public void testReturnVoid() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepInto/stepInto/returnVoid.kt"); + doStepIntoTest(fileName); + } + @TestMetadata("syntheticMethods.kt") public void testSyntheticMethods() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepInto/stepInto/syntheticMethods.kt");