From e47feaf0b8b895040b59e33d55d6df933eb42dfd Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Mon, 2 Oct 2017 17:17:44 +0300 Subject: [PATCH] Add test for KT-20007 --- .../implement/doNotAddExpectForVal.kt | 14 +++++++++++++ .../implement/doNotAddExpectForVal.kt.after | 20 +++++++++++++++++++ .../idea/quickfix/QuickFixTestGenerated.java | 6 ++++++ 3 files changed, 40 insertions(+) create mode 100644 idea/testData/quickfix/implement/doNotAddExpectForVal.kt create mode 100644 idea/testData/quickfix/implement/doNotAddExpectForVal.kt.after diff --git a/idea/testData/quickfix/implement/doNotAddExpectForVal.kt b/idea/testData/quickfix/implement/doNotAddExpectForVal.kt new file mode 100644 index 00000000000..bbb6286818e --- /dev/null +++ b/idea/testData/quickfix/implement/doNotAddExpectForVal.kt @@ -0,0 +1,14 @@ +// "Implement members" "true" +// ENABLE_MULTIPLATFORM +// ERROR: Expected interface 'InterfaceWithVals' has no actual declaration in module light_idea_test_case for JVM + +fun TODO(s: String): Nothing = null!! + +expect interface InterfaceWithVals { + fun funInInterface() + + val importantVal: Int +} + +class ChildOfInterface : InterfaceWithVals{ +} diff --git a/idea/testData/quickfix/implement/doNotAddExpectForVal.kt.after b/idea/testData/quickfix/implement/doNotAddExpectForVal.kt.after new file mode 100644 index 00000000000..53a4aca2dc3 --- /dev/null +++ b/idea/testData/quickfix/implement/doNotAddExpectForVal.kt.after @@ -0,0 +1,20 @@ +// "Implement members" "true" +// ENABLE_MULTIPLATFORM +// ERROR: Expected interface 'InterfaceWithVals' has no actual declaration in module light_idea_test_case for JVM + +fun TODO(s: String): Nothing = null!! + +expect interface InterfaceWithVals { + fun funInInterface() + + val importantVal: Int +} + +class ChildOfInterface : InterfaceWithVals{ + override fun funInInterface() { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } + + override val importantVal: Int + get() = TODO("not implemented") //To change initializer of created properties use File | Settings | File Templates. +} diff --git a/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java index 4b6c8199d8a..893ad402df6 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java @@ -6212,6 +6212,12 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest { doTest(fileName); } + @TestMetadata("doNotAddExpectForVal.kt") + public void testDoNotAddExpectForVal() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/quickfix/implement/doNotAddExpectForVal.kt"); + doTest(fileName); + } + @TestMetadata("doNotAddHeader.kt") public void testDoNotAddHeader() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/testData/quickfix/implement/doNotAddHeader.kt");