Implement members: fix it works correctly if primary constructor has implemented member

#KT-37312 Fixed
This commit is contained in:
Toshiaki Kameyama
2020-03-11 19:21:48 +09:00
committed by Ilya Kirillov
parent 5eabc1117f
commit e455e926aa
8 changed files with 95 additions and 1 deletions
@@ -0,0 +1,10 @@
// "Implement members" "true"
// WITH_RUNTIME
abstract class B {
abstract val p: String?
abstract fun test()
}
<caret>class MyImpl(
override val p: String? = null
) : B()
@@ -0,0 +1,14 @@
// "Implement members" "true"
// WITH_RUNTIME
abstract class B {
abstract val p: String?
abstract fun test()
}
class MyImpl(
override val p: String? = null
) : B() {
override fun test() {
TODO("Not yet implemented")
}
}
@@ -0,0 +1,11 @@
// "Implement members" "true"
// WITH_RUNTIME
abstract class B {
abstract val p: String?
abstract fun test()
}
<caret>class MyImpl2(
override val p: String? = null
) : B() {
}
@@ -0,0 +1,14 @@
// "Implement members" "true"
// WITH_RUNTIME
abstract class B {
abstract val p: String?
abstract fun test()
}
class MyImpl2(
override val p: String? = null
) : B() {
override fun test() {
TODO("Not yet implemented")
}
}
@@ -0,0 +1,13 @@
// "Implement members" "true"
// WITH_RUNTIME
abstract class C {
abstract val p: String?
abstract val q: Int
abstract fun test()
}
<caret>class MyImpl3(
override val p: String? = null
) : C() {
override val q: Int = 0
}
@@ -0,0 +1,16 @@
// "Implement members" "true"
// WITH_RUNTIME
abstract class C {
abstract val p: String?
abstract val q: Int
abstract fun test()
}
class MyImpl3(
override val p: String? = null
) : C() {
override val q: Int = 0
override fun test() {
TODO("Not yet implemented")
}
}