Fixed KT-4892 Override method generates redundant type arguments in call to super

#KT-4892 Fixed
This commit is contained in:
Valentin Kipyatkov
2014-12-05 07:22:42 +03:00
parent 4b9bcce07a
commit 9f845f0de4
21 changed files with 93 additions and 47 deletions
@@ -6,25 +6,25 @@ open class Base<A, B, C>() {
class C : Base<String, C, Unit>() {
override fun bar(value: () -> Unit): (String) -> Unit {
<selection><caret>return super<Base>.bar(value)</selection>
<selection><caret>return super.bar(value)</selection>
}
override fun equals(other: Any?): Boolean {
return super<Base>.equals(other)
return super.equals(other)
}
override fun foo(value: C): C {
return super<Base>.foo(value)
return super.foo(value)
}
override fun hashCode(): Int {
return super<Base>.hashCode()
return super.hashCode()
}
override val method: (String?) -> String
get() = ?
override fun toString(): String {
return super<Base>.toString()
return super.toString()
}
}
@@ -9,7 +9,7 @@ class C(t :T) : T by t {
}
override fun equals(other: Any?): Boolean {
return super<T>.equals(other)
return super.equals(other)
}
override fun foo() {
@@ -17,11 +17,11 @@ class C(t :T) : T by t {
}
override fun hashCode(): Int {
return super<T>.hashCode()
return super.hashCode()
}
override fun toString(): String {
return super<T>.toString()
return super.toString()
}
}
@@ -4,6 +4,6 @@ import foo.Intf
class Impl(): Intf() {
override fun getFooBar(): String? {
<selection><caret>return super<Intf>.getFooBar()</selection>
<selection><caret>return super.getFooBar()</selection>
}
}
@@ -4,6 +4,6 @@ import foo.Intf
class Impl(): Intf() {
override fun getFooBar(): String? {
<selection><caret>return super<Intf>.getFooBar()</selection>
<selection><caret>return super.getFooBar()</selection>
}
}
@@ -5,22 +5,22 @@ trait A {
class C : A {
override fun bar(): String {
<selection><caret>return super<A>.bar()</selection>
<selection><caret>return super.bar()</selection>
}
override fun equals(other: Any?): Boolean {
return super<A>.equals(other)
return super.equals(other)
}
override fun foo(value: String): Int {
return super<A>.foo(value)
return super.foo(value)
}
override fun hashCode(): Int {
return super<A>.hashCode()
return super.hashCode()
}
override fun toString(): String {
return super<A>.toString()
return super.toString()
}
}
@@ -0,0 +1,11 @@
open class A {
open fun foo() {}
}
trait B {
fun bar()
}
class C : A(), B {
<caret>
}
@@ -0,0 +1,29 @@
open class A {
open fun foo() {}
}
trait B {
fun bar()
}
class C : A(), B {
override fun bar() {
<selection><caret>throw UnsupportedOperationException()</selection>
}
override fun equals(other: Any?): Boolean {
return super<A>.equals(other)
}
override fun foo() {
super<A>.foo()
}
override fun hashCode(): Int {
return super<A>.hashCode()
}
override fun toString(): String {
return super<A>.toString()
}
}
@@ -4,15 +4,15 @@ trait Some {
class Other {
override fun equals(other: Any?): Boolean {
<selection><caret>return super<Any>.equals(other)</selection>
<selection><caret>return super.equals(other)</selection>
}
override fun hashCode(): Int {
return super<Any>.hashCode()
return super.hashCode()
}
override fun toString(): String {
return super<Any>.toString()
return super.toString()
}
fun test() {
@@ -8,15 +8,15 @@ class Other {
}
override fun equals(other: Any?): Boolean {
<selection><caret>return super<Any>.equals(other)</selection>
<selection><caret>return super.equals(other)</selection>
}
override fun hashCode(): Int {
return super<Any>.hashCode()
return super.hashCode()
}
override fun toString(): String {
return super<Any>.toString()
return super.toString()
}
fun otherTest() {
@@ -4,15 +4,15 @@ trait Some {
class Other {
override fun equals(other: Any?): Boolean {
<selection><caret>return super<Any>.equals(other)</selection>
<selection><caret>return super.equals(other)</selection>
}
override fun hashCode(): Int {
return super<Any>.hashCode()
return super.hashCode()
}
override fun toString(): String {
return super<Any>.toString()
return super.toString()
}
fun test() {
@@ -4,6 +4,6 @@ trait A<T> {
class C : A<C> {
override fun foo(value: C) {
<selection><caret>super<A>.foo(value)</selection>
<selection><caret>super.foo(value)</selection>
}
}
@@ -2,6 +2,6 @@ import foo.A
class C : A() {
override fun getAnswer(array: Array<out String>?, number: Int, value: Any?): Int {
<selection><caret>return super<A>.getAnswer(array, number, value)</selection>
<selection><caret>return super.getAnswer(array, number, value)</selection>
}
}
@@ -4,6 +4,6 @@ trait A {
class C : A {
override fun foo(value: String): Int {
<selection><caret>return super<A>.foo(value)</selection>
<selection><caret>return super.foo(value)</selection>
}
}
@@ -10,19 +10,19 @@ class C : A() {
get() = <selection><caret>0</selection>
override fun equals(other: Any?): Boolean {
return super<A>.equals(other)
return super.equals(other)
}
override fun foo(value: Int) {
super<A>.foo(value)
super.foo(value)
}
override fun hashCode(): Int {
return super<A>.hashCode()
return super.hashCode()
}
override fun toString(): String {
return super<A>.toString()
return super.toString()
}
/*
@@ -2,6 +2,6 @@ package foo
class Impl: B() {
override fun foo(r: Runnable?) {
<selection><caret>super<B>.foo(r)</selection>
<selection><caret>super.foo(r)</selection>
}
}
@@ -4,6 +4,6 @@ trait A {
class C : A {
override fun foo(value: String) {
<selection><caret>super<A>.foo(value)</selection>
<selection><caret>super.foo(value)</selection>
}
}
@@ -2,6 +2,6 @@ package foo
class Impl : Bar() {
override fun f(): Any? {
<selection><caret>return super<Bar>.f()</selection>
<selection><caret>return super.f()</selection>
}
}
@@ -8,6 +8,6 @@ public open class B() : A() {
public open class C() : B() {
override fun foo() {
<selection><caret>super<B>.foo()</selection>
<selection><caret>super.foo()</selection>
}
}
@@ -4,6 +4,6 @@ import dependency.D
class C: D<Int>() {
override fun id(t: Int): Int {
<selection><caret>return super<D>.id(t)</selection>
<selection><caret>return super.id(t)</selection>
}
}