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()
}