Fix superTypes test by adding parameter to primary constructor

This commit is contained in:
Ivan Cilcic
2019-08-28 16:22:44 +03:00
committed by Mikhail Glukhikh
parent f0c7aadb20
commit f0e7dcc4f6
2 changed files with 4 additions and 3 deletions
@@ -5,8 +5,9 @@ abstract class Base<T>(var x: T) {
} }
// constructor Base<T>(Int) // constructor Base<T>(Int)
// │ // │ Derived.<init>.x: Int
class Derived(var x: Int): Base<Int>() { // │ │
class Derived(var x: Int): Base<Int>(x) {
override fun replace(newValue: Int) { override fun replace(newValue: Int) {
// var (Derived).x: Int // var (Derived).x: Int
// │ Derived.replace.newValue: Int // │ Derived.replace.newValue: Int
@@ -4,7 +4,7 @@ abstract class Base<T>(var x: T) {
fun replace(newValue: T) fun replace(newValue: T)
} }
class Derived(var x: Int): Base<Int>() { class Derived(var x: Int): Base<Int>(x) {
override fun replace(newValue: Int) { override fun replace(newValue: Int) {
x = newValue x = newValue
} }