Debugger: Allow to touch experimental stuff from evaluator (KT-30216)

This commit is contained in:
Yan Zhulanow
2019-03-27 22:13:42 +03:00
parent b7ea4ccc7e
commit 0d04dc6f99
4 changed files with 30 additions and 1 deletions
@@ -383,7 +383,8 @@ class KotlinEvaluator(val codeFragment: KtCodeFragment, val sourcePosition: Sour
override fun getModifier() = null
companion object {
private val IGNORED_DIAGNOSTICS: Set<DiagnosticFactory<*>> = Errors.INVISIBLE_REFERENCE_DIAGNOSTICS
private val IGNORED_DIAGNOSTICS: Set<DiagnosticFactory<*>> =
Errors.INVISIBLE_REFERENCE_DIAGNOSTICS + setOf(Errors.EXPERIMENTAL_API_USAGE_ERROR)
private val DEFAULT_METHOD_MARKERS = listOf(AsmTypes.OBJECT_TYPE, AsmTypes.DEFAULT_CONSTRUCTOR_MARKER)
@@ -0,0 +1,15 @@
package experimentalApi
@Experimental(Experimental.Level.ERROR)
annotation class UnstableApi
@UnstableApi
fun foo() = 5
fun main() {
//Breakpoint!
val a = 5
}
// EXPRESSION: foo()
// RESULT: 5: I
@@ -0,0 +1,8 @@
LineBreakpoint created at experimentalApi.kt:11
Run Java
Connected to the target VM
experimentalApi.kt:11
Compile bytecode for foo()
Disconnected from the target VM
Process finished with exit code 0
@@ -141,6 +141,11 @@ public class KotlinEvaluateExpressionTestGenerated extends AbstractKotlinEvaluat
runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/escapedNames.kt");
}
@TestMetadata("experimentalApi.kt")
public void testExperimentalApi() throws Exception {
runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/experimentalApi.kt");
}
@TestMetadata("extractLocalVariables.kt")
public void testExtractLocalVariables() throws Exception {
runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/extractLocalVariables.kt");