Add tests for KT-20824, KT-23745, KT-23124, KT-20605, KT-23760

#KT-20824 Fixed
 #KT-23745 Fixed
 #KT-23124 Fixed
 #KT-20605 Fixed
 #KT-23760 Fixed
This commit is contained in:
Pavel V. Talanov
2018-04-20 15:09:12 +02:00
parent 94fe170b7b
commit 521357a22d
15 changed files with 126 additions and 0 deletions
@@ -0,0 +1,5 @@
// KT-23745
expect interface A
expect interface B
interface Both : A, B
@@ -0,0 +1,10 @@
actual interface A
actual interface B {
fun z()
fun x()
}
<error descr="[ABSTRACT_MEMBER_NOT_IMPLEMENTED] Class 'Impl' is not abstract and does not implement abstract member public abstract fun x(): Unit defined in Both">class Impl</error> : Both {
override fun z() {
}
}
@@ -0,0 +1,4 @@
// KT-23124
package com.example
expect class Decimal
@@ -0,0 +1,7 @@
package com.example.bar
import com.example.Decimal
class Foo(
val bar: Decimal
)
@@ -0,0 +1,3 @@
package com.example
actual typealias Decimal = Double
@@ -0,0 +1,5 @@
package com.example
import com.example.bar.Foo
val a = Foo(0.toDouble())
@@ -0,0 +1,5 @@
package com.example
import java.math.BigDecimal
actual typealias Decimal = BigDecimal
@@ -0,0 +1,6 @@
package com.example
import com.example.bar.Foo
import java.math.BigDecimal
val a = Foo(BigDecimal(1))
@@ -0,0 +1,10 @@
// KT-23760
package foo
expect interface Upper
expect interface BaseI {
fun f(p: Upper)
}
interface I : BaseI
@@ -0,0 +1,13 @@
package foo
interface X
actual typealias Upper = X
actual interface BaseI {
actual fun f(p: Upper)
}
internal class Impl : I {
override fun f(p: Upper) {
}
}
@@ -0,0 +1,4 @@
// KT-20824
package foo
fun <O : Appendable> O.appendMe(): O = this // kotlin.text.Appendable
@@ -0,0 +1,7 @@
package foo
fun tryIt() {
buildString { // kotlin.text.StringBuilder = java.lang.StringBuilder
appendMe()
}
}
@@ -0,0 +1,7 @@
// KT-20605
package foo
expect class C {
}
fun getC(): C? = null
@@ -0,0 +1,15 @@
package foo
actual class C {
fun zzz() {
}
}
fun works() {
C().zzz()
}
fun doesnNot() {
getC()?.zzz()
getC()?.zzz()
}
@@ -25,6 +25,11 @@ public class MultiModuleHighlightingTestGenerated extends AbstractMultiModuleHig
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
}
@TestMetadata("additionalMembersInPlatformInterface")
public void testAdditionalMembersInPlatformInterface() throws Exception {
runTest("idea/testData/multiModuleHighlighting/multiplatform/additionalMembersInPlatformInterface/");
}
public void testAllFilesPresentInMultiplatform() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/multiModuleHighlighting/multiplatform"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, false);
}
@@ -84,6 +89,11 @@ public class MultiModuleHighlightingTestGenerated extends AbstractMultiModuleHig
runTest("idea/testData/multiModuleHighlighting/multiplatform/nestedClassWithoutImpl/");
}
@TestMetadata("platformTypeAliasInterchangebleWithAliasedClass")
public void testPlatformTypeAliasInterchangebleWithAliasedClass() throws Exception {
runTest("idea/testData/multiModuleHighlighting/multiplatform/platformTypeAliasInterchangebleWithAliasedClass/");
}
@TestMetadata("suppressHeaderWithoutImpl")
public void testSuppressHeaderWithoutImpl() throws Exception {
runTest("idea/testData/multiModuleHighlighting/multiplatform/suppressHeaderWithoutImpl/");
@@ -104,11 +114,26 @@ public class MultiModuleHighlightingTestGenerated extends AbstractMultiModuleHig
runTest("idea/testData/multiModuleHighlighting/multiplatform/triangleWithDependency/");
}
@TestMetadata("typeAliasedParameter")
public void testTypeAliasedParameter() throws Exception {
runTest("idea/testData/multiModuleHighlighting/multiplatform/typeAliasedParameter/");
}
@TestMetadata("useAppendable")
public void testUseAppendable() throws Exception {
runTest("idea/testData/multiModuleHighlighting/multiplatform/useAppendable/");
}
@TestMetadata("useCorrectBuiltInsForCommonModule")
public void testUseCorrectBuiltInsForCommonModule() throws Exception {
runTest("idea/testData/multiModuleHighlighting/multiplatform/useCorrectBuiltInsForCommonModule/");
}
@TestMetadata("usePlatformSpecificMember")
public void testUsePlatformSpecificMember() throws Exception {
runTest("idea/testData/multiModuleHighlighting/multiplatform/usePlatformSpecificMember/");
}
@TestMetadata("withOverrides")
public void testWithOverrides() throws Exception {
runTest("idea/testData/multiModuleHighlighting/multiplatform/withOverrides/");