Reverting pull request 240

This commit is contained in:
Andrey Breslav
2013-04-12 15:25:52 +04:00
parent d875bf80cb
commit c422e4194d
73 changed files with 208 additions and 1160 deletions
@@ -4,7 +4,8 @@ trait Trait {
class TraitImpl : Trait {
override fun <A, B: Runnable, E: Map.Entry<A, B>> foo() where B: Cloneable, B: Comparable<B> {
override fun <A, B: Runnable, E: Map.Entry<A, B>> foo()
where B: Cloneable, B: Comparable<B> {
throw UnsupportedOperationException()
}
}
@@ -4,4 +4,4 @@ fun some() {
tes<caret>
}
// EXIST: test@test(a: jet.Int)
// EXIST: test@test(a : jet.Int)
@@ -9,20 +9,20 @@ T</b>
<td align="right" colspan="2" style="white-space:nowrap;font-weight:bold;">
<b>
fun</b>
&lt;T, E : java.lang.Cloneable>
&lt;T, E>
writeToMyList</td>
<td style="white-space:nowrap;font-weight:bold;">
(</td>
<td align="right" style="white-space:nowrap;font-weight:bold;">
l: MyList&lt;in T&gt;,</td>
l : MyList&lt;in T&gt;,</td>
<td align="right" style="white-space:nowrap;font-weight:bold;">
t: T</td>
t : T</td>
<td style="white-space:nowrap;font-weight:bold;">
)</td>
<td style="white-space:nowrap;font-weight:bold;">
: jet.Unit <b>
: jet.Unit <b>
where</b>
E : java.io.Closeable</td>
E : java.lang.Cloneable, E : java.io.Closeable</td>
</tr>
<tr>
<td colspan="8" style="white-space:nowrap;">
@@ -14,9 +14,9 @@ constructor</b>
<td style="white-space:nowrap;font-weight:bold;">
(</td>
<td align="right" style="white-space:nowrap;font-weight:bold;">
l: MyList&lt;in T&gt;,</td>
l : MyList&lt;in T&gt;,</td>
<td align="right" style="white-space:nowrap;font-weight:bold;">
t: T</td>
t : T</td>
<td style="white-space:nowrap;font-weight:bold;">
)</td>
<td style="white-space:nowrap;font-weight:bold;">
@@ -12,11 +12,11 @@ fun</b>
<td style="white-space:nowrap;font-weight:bold;">
(</td>
<td align="right" style="white-space:nowrap;font-weight:bold;">
a: A&lt;T, R&gt;</td>
a : A&lt;T, R&gt;</td>
<td style="white-space:nowrap;font-weight:bold;">
)</td>
<td style="white-space:nowrap;font-weight:bold;">
: A&lt;T, R&gt;</td>
: A&lt;T, R&gt;</td>
</tr>
<tr>
<td colspan="7" style="white-space:nowrap;">
@@ -12,11 +12,11 @@ fun</b>
<td style="white-space:nowrap;font-weight:bold;">
(</td>
<td align="right" style="white-space:nowrap;font-weight:bold;">
a: A&lt;T, R&gt;</td>
a : A&lt;T, R&gt;</td>
<td style="white-space:nowrap;font-weight:bold;">
)</td>
<td style="white-space:nowrap;font-weight:bold;">
: A&lt;T, R&gt;</td>
: A&lt;T, R&gt;</td>
</tr>
<tr>
<td colspan="7" style="white-space:nowrap;">
@@ -12,11 +12,11 @@ fun</b>
<td style="white-space:nowrap;font-weight:bold;">
(</td>
<td align="right" style="white-space:nowrap;font-weight:bold;">
a: A&lt;T, R&gt;</td>
a : A&lt;T, R&gt;</td>
<td style="white-space:nowrap;font-weight:bold;">
)</td>
<td style="white-space:nowrap;font-weight:bold;">
: A&lt;T, R&gt;</td>
: A&lt;T, R&gt;</td>
</tr>
<tr>
<td colspan="7" style="white-space:nowrap;">
@@ -14,13 +14,13 @@ fun</b>
<td style="white-space:nowrap;font-weight:bold;">
(</td>
<td align="right" style="white-space:nowrap;font-weight:bold;">
r: R,</td>
r : R,</td>
<td align="right" style="white-space:nowrap;font-weight:bold;">
list: T</td>
list : T</td>
<td style="white-space:nowrap;font-weight:bold;">
)</td>
<td style="white-space:nowrap;font-weight:bold;">
: jet.Unit</td>
: jet.Unit</td>
</tr>
</table>
is not satisfied: inferred type <font color=red>
@@ -3,7 +3,7 @@ fun test() {
MyClass().<warning descr="'fun test2()' is deprecated. Use A instead">test2</warning>()
MyClass.<warning descr="'fun test3()' is deprecated. Use A instead">test3</warning>()
<warning descr="'fun test4(x: jet.Int, y: jet.Int)' is deprecated. Use A instead">test4</warning>(1, 2)
<warning descr="'fun test4(x : jet.Int, y : jet.Int)' is deprecated. Use A instead">test4</warning>(1, 2)
}
deprecated("Use A instead") fun test1() { }
+1 -1
View File
@@ -6,5 +6,5 @@ fun test() {
val x1 = MyClass()
val x2 = MyClass()
<warning descr="'fun get(i: MyClass)' is deprecated. Use A instead">x1[x2]</warning>
<warning descr="'fun get(i : MyClass)' is deprecated. Use A instead">x1[x2]</warning>
}
@@ -20,19 +20,19 @@ fun test() {
val x1 = MyClass()
val x2 = MyClass()
x1 <warning descr="'fun minus(i: MyClass)' is deprecated. Use A instead">-</warning> x2
x1 <warning descr="'fun div(i: MyClass)' is deprecated. Use A instead">/</warning> x2
x1 <warning descr="'fun times(i: MyClass)' is deprecated. Use A instead">*</warning> x2
x1 <warning descr="'fun minus(i : MyClass)' is deprecated. Use A instead">-</warning> x2
x1 <warning descr="'fun div(i : MyClass)' is deprecated. Use A instead">/</warning> x2
x1 <warning descr="'fun times(i : MyClass)' is deprecated. Use A instead">*</warning> x2
<warning descr="'fun not()' is deprecated. Use A instead">!</warning>x1
<warning descr="'fun plus()' is deprecated. Use A instead">+</warning>x1
x1 <warning descr="'fun contains(i: MyClass)' is deprecated. Use A instead">in</warning> x2
x1 <warning descr="'fun contains(i: MyClass)' is deprecated. Use A instead">!in</warning> x2
x1 <warning descr="'fun contains(i : MyClass)' is deprecated. Use A instead">in</warning> x2
x1 <warning descr="'fun contains(i : MyClass)' is deprecated. Use A instead">!in</warning> x2
x1 <warning descr="'fun plusAssign(i: MyClass)' is deprecated. Use A instead">+=</warning> x2
x1 <warning descr="'fun plusAssign(i : MyClass)' is deprecated. Use A instead">+=</warning> x2
x1 <warning descr="'fun equals(i: jet.Any?)' is deprecated. Use A instead">==</warning> x2
x1 <warning descr="'fun equals(i: jet.Any?)' is deprecated. Use A instead">!=</warning> x2
x1 <warning descr="'fun compareTo(i: MyClass)' is deprecated. Use A instead">></warning> x2
x1 <warning descr="'fun equals(i : jet.Any?)' is deprecated. Use A instead">==</warning> x2
x1 <warning descr="'fun equals(i : jet.Any?)' is deprecated. Use A instead">!=</warning> x2
x1 <warning descr="'fun compareTo(i : MyClass)' is deprecated. Use A instead">></warning> x2
}
@@ -11,7 +11,7 @@ fun test() {
val x1 = MyClass()
val x2 = MyClass()
for (i in x1<warning descr="'fun rangeTo(i: MyClass)' is deprecated. Use A instead">..</warning>x2) {
for (i in x1<warning descr="'fun rangeTo(i : MyClass)' is deprecated. Use A instead">..</warning>x2) {
}
}
@@ -4,19 +4,19 @@
package testData.libraries
[[public abstract class ClassWithAbstractAndOpenMembers() {
[public abstract val abstractVal: jet.String]
[public abstract val abstractVal : jet.String]
[public abstract var abstractVar: jet.String]
[public abstract var abstractVar : jet.String]
[public open val openVal: jet.String] /* compiled code */
[public open val openVal : jet.String] /* compiled code */
[public open val openValWithGetter: jet.String] /* compiled code */
[public open val openValWithGetter : jet.String] /* compiled code */
[public open var openVar: jet.String] /* compiled code */
[public open var openVar : jet.String] /* compiled code */
[public open var openVarWithGetter: jet.String] /* compiled code */
[public open var openVarWithGetter : jet.String] /* compiled code */
[public abstract fun abstractFun(): jet.Unit]
[public abstract fun abstractFun() : jet.Unit]
[public open fun openFun(): jet.Unit { /* compiled code */ }]
}]]
[public open fun openFun() : jet.Unit { /* compiled code */ }]
}]]
@@ -3,6 +3,6 @@
package testData.libraries
[[public final class ClassWithConstructor(a: jet.String, b: jet.Any) {
[internal final val a: jet.String] /* compiled code */
}]]
[[public final class ClassWithConstructor(a : jet.String, b : jet.Any) {
[internal final val a : jet.String] /* compiled code */
}]]
+8 -8
View File
@@ -3,18 +3,18 @@
package testData.libraries
[[public final enum class Color(rgb: jet.Int) : jet.Enum<testData.libraries.Color> {
[[public final enum class Color(rgb : jet.Int) : jet.Enum<testData.libraries.Color> {
public class object {
[public final val BLUE: testData.libraries.Color] /* compiled code */
[public final val BLUE : testData.libraries.Color] /* compiled code */
[public final val GREEN: testData.libraries.Color] /* compiled code */
[public final val GREEN : testData.libraries.Color] /* compiled code */
[public final val RED: testData.libraries.Color] /* compiled code */
[public final val RED : testData.libraries.Color] /* compiled code */
public final fun valueOf(value: jet.String): testData.libraries.Color { /* compiled code */ }
public final fun valueOf(value : jet.String) : testData.libraries.Color { /* compiled code */ }
public final fun values(): jet.Array<testData.libraries.Color> { /* compiled code */ }
public final fun values() : jet.Array<testData.libraries.Color> { /* compiled code */ }
}
[internal final val rgb: jet.Int] /* compiled code */
}]]
[internal final val rgb : jet.Int] /* compiled code */
}]]
@@ -3,34 +3,34 @@
package testData.libraries
[public val globalVal: testData.libraries.Pair<jet.Int, jet.String>] /* compiled code */
[public val globalVal : testData.libraries.Pair<jet.Int, jet.String>] /* compiled code */
[public val globalValWithGetter: jet.Long] /* compiled code */
[public val globalValWithGetter : jet.Long] /* compiled code */
[public val jet.Int.exProp: jet.Int] /* compiled code */
[public val jet.Int.exProp : jet.Int] /* compiled code */
[public val jet.String.exProp: jet.String] /* compiled code */
[public val jet.String.exProp : jet.String] /* compiled code */
[public val <T> testData.libraries.Pair<T, T>.exProp: jet.String] /* compiled code */
[public val <T> testData.libraries.Pair<T, T>.exProp : jet.String] /* compiled code */
[public fun <T : jet.CharSequence> funWithTypeParam(t: T): jet.Unit { /* compiled code */ }]
[public fun <T : jet.CharSequence> funWithTypeParam(t : T) : jet.Unit { /* compiled code */ }]
[public fun <T : jet.Number> funWithTypeParam(t: T): jet.Unit { /* compiled code */ }]
[public fun <T : jet.Number> funWithTypeParam(t : T) : jet.Unit { /* compiled code */ }]
[public fun func(): jet.Unit { /* compiled code */ }]
[public fun func() : jet.Unit { /* compiled code */ }]
[public fun func(cs: jet.CharSequence): jet.Unit { /* compiled code */ }]
[public fun func(cs : jet.CharSequence) : jet.Unit { /* compiled code */ }]
[public fun func(a: jet.Int, b: jet.Int): jet.Unit { /* compiled code */ }]
[public fun func(a : jet.Int, b : jet.Int) : jet.Unit { /* compiled code */ }]
[public fun func(a: jet.Int, b: jet.String = /* compiled code */): jet.Unit { /* compiled code */ }]
[public fun func(a : jet.Int, b : jet.String = /* compiled code */) : jet.Unit { /* compiled code */ }]
[public fun func(str: jet.String): jet.Unit { /* compiled code */ }]
[public fun func(str : jet.String) : jet.Unit { /* compiled code */ }]
[public fun main(args: jet.Array<jet.String>): jet.Unit { /* compiled code */ }]
[public fun main(args : jet.Array<jet.String>) : jet.Unit { /* compiled code */ }]
[public fun processDouble(d: jet.Double): jet.Unit { /* compiled code */ }]
[public fun processDouble(d : jet.Double) : jet.Unit { /* compiled code */ }]
[public fun processDouble(d: testData.libraries.Double): jet.Unit { /* compiled code */ }]
[public fun processDouble(d : testData.libraries.Double) : jet.Unit { /* compiled code */ }]
[public fun <T> T.filter(predicate: (T) -> jet.Boolean): T? { /* compiled code */ }]
[public fun <T> T.filter(predicate : (T) -> jet.Boolean) : T? { /* compiled code */ }]
@@ -4,5 +4,5 @@
package testData.libraries
[[public object NamedObject {
[public final val objectMember: jet.Int] /* compiled code */
[public final val objectMember : jet.Int] /* compiled code */
}]]
@@ -5,12 +5,12 @@ package testData.libraries
[[public final class WithInnerAndObject() {
public class object {
[internal final fun foo(): jet.Unit { /* compiled code */ }]
[internal final fun foo() : jet.Unit { /* compiled code */ }]
}
[[internal final class MyInner() {
[internal trait MyInnerInner {
[internal abstract fun innerInnerMethod(): jet.Unit]
[internal abstract fun innerInnerMethod() : jet.Unit]
}]
}]]
}]]
}]]
@@ -1,8 +0,0 @@
// "Change function signature to 'override fun f(a: Int)'" "true"
trait A {
fun f(a: Int)
}
class B : A {
<caret>override fun f(a: Int) {}
}
@@ -1,10 +0,0 @@
// "Change function signature..." "true"
// ERROR: <html>Class 'B' must be declared abstract or implement abstract member<br/><b>internal</b> <b>abstract</b> <b>fun</b> f(a: jet.String): jet.Unit <i>defined in</i> A</html>
trait A {
fun f(a: Int)
fun f(a: String)
}
class B : A {
<caret>override fun f(a: Int) {}
}
@@ -1,8 +0,0 @@
// "Change function signature to 'public override fun f(a: Int)'" "true"
trait A {
fun f(a: Int)
}
class B : A {
public <caret>override fun f(a: Int) {}
}
@@ -1,8 +0,0 @@
// "Change function signature to 'override fun f(a: Int)'" "true"
open class A {
open fun f(a: Int) {}
}
class B : A(){
<caret>override fun f(a: Int) {}
}
@@ -1,8 +0,0 @@
// "Change function signature to 'override fun f(a: Int)'" "true"
abstract class A {
abstract fun f(a: Int)
}
class B : A(){
<caret>override fun f(a: Int) {}
}
@@ -1,8 +0,0 @@
// "Change function signature to 'override fun f(a: Int)'" "true"
trait A {
fun f(a: Int)
}
trait B : A {
<caret>override fun f(a: Int)
}
@@ -1,8 +0,0 @@
// "Change function signature to 'override fun f(x: Int, t: String, z: Double)'" "true"
open class A {
open fun f(x: Int, y: String, z: Double) {}
}
class B : A(){
<caret>override fun f(x: Int, t: String, z: Double) {}
}
@@ -1,8 +0,0 @@
// "Change function signature to 'override fun f(y: Int, x: String)'" "true"
open class A {
open fun f(a: Int, b: String) {}
}
class B : A(){
<caret>override fun f(y: Int, x: String) {}
}
@@ -1,12 +0,0 @@
// "Change function signature to 'override fun f()'" "true"
open class A {
open fun f() {}
}
open class B : A() {
open override fun f() {}
}
class C : B() {
<caret>override fun f() {}
}
@@ -1,10 +0,0 @@
// "Change function signature to 'override fun f(a: Int): Int'" "true"
open class A {
open fun f(a: Int): Int {
return 0
}
}
class B : A(){
<caret>override fun f(a: Int): Int = 7
}
@@ -1,8 +0,0 @@
// "Change function signature to 'override fun f(a: Int)'" "true"
trait A {
fun f(a: Int)
}
class B : A {
<caret>override fun f(a: Int) {}
}
@@ -1,11 +0,0 @@
// "Change function signature to 'override fun f(a: Int): Int'" "true"
// ERROR: <html>Type mismatch.<table><tr><td>Required:</td><td>jet.Int</td></tr><tr><td>Found:</td><td>jet.String</td></tr></table></html>
open class A {
open fun f(a: Int): Int = 0
}
class B : A(){
// Note that when parameter types match, RETURN_TYPE_MISMATCH_ON_OVERRIDE error is reported
// and "Change function signature" quickfix is not present.
<caret>override fun f(a: Int): Int = "FOO"
}
@@ -1,11 +0,0 @@
// "Change function signature to 'override fun f(a: Int)'" "false"
// ERROR: 'f' overrides nothing
// ACTION: Remove 'override' modifier
open class A {
open fun foo() {}
fun f(a: Int) {}
}
class B : A(){
<caret>override fun f(a: String) {}
}
@@ -1,6 +0,0 @@
// "Change function signature to 'protected override fun next(p0: Int): Int'" "true"
import java.util.Random
class MyRandom : Random() {
<caret>protected override fun next(p0: Int): Int = 4
}
@@ -1,8 +0,0 @@
// "Change function signature to 'override fun f()'" "true"
trait A {
fun f()
}
class B : A {
<caret>override fun f() {}
}
@@ -1,11 +0,0 @@
// "Change function signature to 'override fun f()'" "true"
trait A {
fun f()
}
trait B {
fun f()
}
class C : A, B {
<caret>override fun f() {}
}
@@ -1,8 +0,0 @@
// "Change function signature to 'override fun f(a: Int)'" "true"
trait A {
fun f(a: Int)
}
class B : A {
<caret>override fun f() {}
}
@@ -1,10 +0,0 @@
// "Change function signature..." "true"
// ERROR: <html>Class 'B' must be declared abstract or implement abstract member<br/><b>internal</b> <b>abstract</b> <b>fun</b> f(a: jet.String): jet.Unit <i>defined in</i> A</html>
trait A {
fun f(a: Int)
fun f(a: String)
}
class B : A {
<caret>override fun f() {}
}
@@ -1,8 +0,0 @@
// "Change function signature to 'public override fun f(a: Int)'" "true"
trait A {
fun f(a: Int)
}
class B : A {
public <caret>override fun f() {}
}
@@ -1,8 +0,0 @@
// "Change function signature to 'override fun f(a: Int)'" "true"
open class A {
open fun f(a: Int) {}
}
class B : A(){
<caret>override fun f(a: String) {}
}
@@ -1,8 +0,0 @@
// "Change function signature to 'override fun f(a: Int)'" "true"
abstract class A {
abstract fun f(a: Int)
}
class B : A(){
<caret>override fun f(a: String) {}
}
@@ -1,8 +0,0 @@
// "Change function signature to 'override fun f(a: Int)'" "true"
trait A {
fun f(a: Int)
}
trait B : A {
<caret>override fun f(a: String)
}
@@ -1,8 +0,0 @@
// "Change function signature to 'override fun f(x: Int, t: String, z: Double)'" "true"
open class A {
open fun f(x: Int, y: String, z: Double) {}
}
class B : A(){
<caret>override fun f(z: String, x: String, t: String) {}
}
@@ -1,8 +0,0 @@
// "Change function signature to 'override fun f(y: Int, x: String)'" "true"
open class A {
open fun f(a: Int, b: String) {}
}
class B : A(){
<caret>override fun f(x: String, y: Int) {}
}
@@ -1,12 +0,0 @@
// "Change function signature to 'override fun f()'" "true"
open class A {
open fun f() {}
}
open class B : A() {
open override fun f() {}
}
class C : B() {
<caret>override fun f(a : Int) {}
}
@@ -1,10 +0,0 @@
// "Change function signature to 'override fun f(a: Int): Int'" "true"
open class A {
open fun f(a: Int): Int {
return 0
}
}
class B : A(){
<caret>override fun f(a: String): Int = 7
}
@@ -1,8 +0,0 @@
// "Change function signature to 'override fun f(a: Int)'" "true"
trait A {
fun f(a: Int)
}
class B : A {
<caret>override fun f(a: String) {}
}
@@ -1,11 +0,0 @@
// "Change function signature to 'override fun f(a: Int): Int'" "true"
// ERROR: <html>Type mismatch.<table><tr><td>Required:</td><td>jet.Int</td></tr><tr><td>Found:</td><td>jet.String</td></tr></table></html>
open class A {
open fun f(a: Int): Int = 0
}
class B : A(){
// Note that when parameter types match, RETURN_TYPE_MISMATCH_ON_OVERRIDE error is reported
// and "Change function signature" quickfix is not present.
<caret>override fun f(a : String): String = "FOO"
}
@@ -1,11 +0,0 @@
// "Change function signature to 'override fun f(a: Int)'" "false"
// ERROR: 'f' overrides nothing
// ACTION: Remove 'override' modifier
open class A {
open fun foo() {}
fun f(a: Int) {}
}
class B : A(){
<caret>override fun f(a: String) {}
}
@@ -1,6 +0,0 @@
// "Change function signature to 'protected override fun next(p0: Int): Int'" "true"
import java.util.Random
class MyRandom : Random() {
<caret>override fun next(): Int = 4
}
@@ -1,8 +0,0 @@
// "Change function signature to 'override fun f()'" "true"
trait A {
fun f()
}
class B : A {
<caret>override fun f(a: Int) {}
}
@@ -1,11 +0,0 @@
// "Change function signature to 'override fun f()'" "true"
trait A {
fun f()
}
trait B {
fun f()
}
class C : A, B {
<caret>override fun f(a: String) {}
}
@@ -1,9 +0,0 @@
// "Change function signature to 'override fun f(a: A)'" "true"
// ERROR: 'f' overrides nothing
// ERROR: 'f' overrides nothing
import a.B
import a.A
class BB : B() {
<caret>override fun f(a: A) {}
}
@@ -1,7 +0,0 @@
// "Change function signature to 'override fun f(a: A)'" "true"
// ERROR: 'f' overrides nothing
// ERROR: 'f' overrides nothing
import a.B
class BB : B() {
<caret>override fun f() {}
}
@@ -1,5 +0,0 @@
package a
class A {}
open class B {
override fun f(a: A) {}
}
@@ -1,8 +0,0 @@
// "Change function signature to 'override fun f(a: A)'" "true"
// ERROR: 'f' overrides nothing
// ERROR: 'f' overrides nothing
import a.B
class A {}
class BB : B() {
<caret>override fun f(a: a.A) {}
}
@@ -1,8 +0,0 @@
// "Change function signature to 'override fun f(a: A)'" "true"
// ERROR: 'f' overrides nothing
// ERROR: 'f' overrides nothing
import a.B
class A {}
class BB : B() {
<caret>override fun f() {}
}
@@ -1,5 +0,0 @@
package a
class A {}
open class B {
override fun f(a: A) {}
}
@@ -1,7 +1,7 @@
// "Change 'B.foo' function return type to 'Int'" "false"
// "Change 'B.foo' function return type to 'Long'" "false"
// "Remove explicitly specified return type in 'B.foo' function" "false"
// ERROR: <html>Return type is 'jet.String', which is not a subtype of overridden<br/><b>internal</b> <b>abstract</b> <b>fun</b> foo(): jet.Int <i>defined in</i> A</html>
// ERROR: <html>Return type is 'jet.String', which is not a subtype of overridden<br/><b>internal</b> <b>abstract</b> <b>fun</b> foo() : jet.Int <i>defined in</i> A</html>
abstract class A {
abstract fun foo() : Int;
}