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:
+5
@@ -0,0 +1,5 @@
|
||||
// KT-23745
|
||||
expect interface A
|
||||
expect interface B
|
||||
|
||||
interface Both : A, B
|
||||
Vendored
+10
@@ -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() {
|
||||
}
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// KT-23124
|
||||
package com.example
|
||||
|
||||
expect class Decimal
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package com.example.bar
|
||||
|
||||
import com.example.Decimal
|
||||
|
||||
class Foo(
|
||||
val bar: Decimal
|
||||
)
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package com.example
|
||||
|
||||
actual typealias Decimal = Double
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package com.example
|
||||
|
||||
import com.example.bar.Foo
|
||||
|
||||
val a = Foo(0.toDouble())
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package com.example
|
||||
|
||||
import java.math.BigDecimal
|
||||
|
||||
actual typealias Decimal = BigDecimal
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package com.example
|
||||
|
||||
import com.example.bar.Foo
|
||||
import java.math.BigDecimal
|
||||
|
||||
val a = Foo(BigDecimal(1))
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// KT-23760
|
||||
package foo
|
||||
|
||||
expect interface Upper
|
||||
|
||||
expect interface BaseI {
|
||||
fun f(p: Upper)
|
||||
}
|
||||
|
||||
interface I : BaseI
|
||||
+13
@@ -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) {
|
||||
}
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
// KT-20824
|
||||
package foo
|
||||
|
||||
fun <O : Appendable> O.appendMe(): O = this // kotlin.text.Appendable
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package foo
|
||||
|
||||
fun tryIt() {
|
||||
buildString { // kotlin.text.StringBuilder = java.lang.StringBuilder
|
||||
appendMe()
|
||||
}
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// KT-20605
|
||||
package foo
|
||||
|
||||
expect class C {
|
||||
}
|
||||
|
||||
fun getC(): C? = null
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package foo
|
||||
|
||||
actual class C {
|
||||
fun zzz() {
|
||||
}
|
||||
}
|
||||
|
||||
fun works() {
|
||||
C().zzz()
|
||||
}
|
||||
|
||||
fun doesnNot() {
|
||||
getC()?.zzz()
|
||||
getC()?.zzz()
|
||||
}
|
||||
Reference in New Issue
Block a user