Rename unary plus() and minus() to unaryPlus() and unaryMinus()
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
package h
|
||||
|
||||
import util.minus
|
||||
import util.unaryMinus
|
||||
|
||||
interface H
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
package util
|
||||
|
||||
operator fun h.H?.minus() = ""
|
||||
operator fun h.H?.unaryMinus() = ""
|
||||
@@ -1,9 +1,9 @@
|
||||
// "Import" "true"
|
||||
// ERROR: <html>Unresolved reference. <br/> None of the following candidates is applicable because of receiver type mismatch: <ul><li><b>public</b> operator <b>fun</b> h.A.plus(): kotlin.Int <i>defined in</i> h</li><li><b>public</b> operator <b>fun</b> kotlin.String?.plus(other: kotlin.Any?): kotlin.String <i>defined in</i> kotlin</li></ul></html>
|
||||
// ERROR: <html>Unresolved reference. <br/> None of the following candidates is applicable because of receiver type mismatch: <ul><li><b>public</b> operator <b>fun</b> h.A.unaryPlus(): kotlin.Int <i>defined in</i> h</li></ul></html>
|
||||
|
||||
package h
|
||||
|
||||
import util.plus
|
||||
import util.unaryPlus
|
||||
|
||||
interface H
|
||||
|
||||
@@ -13,4 +13,4 @@ fun f(h: H?) {
|
||||
|
||||
class A()
|
||||
|
||||
operator fun A.plus(): Int = 3
|
||||
operator fun A.unaryPlus(): Int = 3
|
||||
@@ -1,3 +1,3 @@
|
||||
package util
|
||||
|
||||
operator fun h.H.plus() = ""
|
||||
operator fun h.H.unaryPlus() = ""
|
||||
@@ -1,5 +1,5 @@
|
||||
// "Import" "true"
|
||||
// ERROR: <html>Unresolved reference. <br/> None of the following candidates is applicable because of receiver type mismatch: <ul><li><b>public</b> operator <b>fun</b> h.A.plus(): kotlin.Int <i>defined in</i> h</li><li><b>public</b> operator <b>fun</b> kotlin.String?.plus(other: kotlin.Any?): kotlin.String <i>defined in</i> kotlin</li></ul></html>
|
||||
// ERROR: <html>Unresolved reference. <br/> None of the following candidates is applicable because of receiver type mismatch: <ul><li><b>public</b> operator <b>fun</b> h.A.unaryPlus(): kotlin.Int <i>defined in</i> h</li></ul></html>
|
||||
|
||||
package h
|
||||
|
||||
@@ -11,4 +11,4 @@ fun f(h: H?) {
|
||||
|
||||
class A()
|
||||
|
||||
operator fun A.plus(): Int = 3
|
||||
operator fun A.unaryPlus(): Int = 3
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
// "Create member function 'plus'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun plus(): A<T> = throw Exception()
|
||||
operator fun unaryPlus(): A<T> = throw Exception()
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val a: A<Int> = A(1) + <caret>2
|
||||
val a: A<Int> = A(1) +<caret> 2
|
||||
}
|
||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create member function 'plus'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun plus(): A<T> = throw Exception()
|
||||
operator fun unaryPlus(): A<T> = throw Exception()
|
||||
|
||||
operator fun plus(t: T): A<T> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create member function 'getValue', function 'set'" "true"
|
||||
// "Create member function 'getValue', function 'setValue'" "true"
|
||||
class F {
|
||||
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -1,8 +1,8 @@
|
||||
// "Create member function 'setValue'" "true"
|
||||
class F {
|
||||
fun get(x: X, propertyMetadata: PropertyMetadata): Int = 1
|
||||
fun getValue(x: X, propertyMetadata: PropertyMetadata): Int = 1
|
||||
|
||||
fun set(x: X, propertyMetadata: PropertyMetadata, i: Int) {
|
||||
fun setValue(x: X, propertyMetadata: PropertyMetadata, i: Int) {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
// "Create member function 'minus'" "true"
|
||||
// "Create member function 'unaryMinus'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun minus(n: Int): A<T> = throw Exception()
|
||||
operator fun minus(n: Int): A<T> = throw Exception()
|
||||
}
|
||||
|
||||
fun test() {
|
||||
|
||||
Vendored
+3
-3
@@ -1,9 +1,9 @@
|
||||
// "Create member function 'minus'" "true"
|
||||
// "Create member function 'unaryMinus'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun minus(n: Int): A<T> = throw Exception()
|
||||
operator fun minus(n: Int): A<T> = throw Exception()
|
||||
|
||||
operator fun minus(): A<T> {
|
||||
operator fun unaryMinus(): A<T> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create extension function 'minus'" "true"
|
||||
// "Create extension function 'unaryMinus'" "true"
|
||||
|
||||
fun test() {
|
||||
val a = <caret>-false
|
||||
|
||||
Vendored
+2
-2
@@ -1,9 +1,9 @@
|
||||
// "Create extension function 'minus'" "true"
|
||||
// "Create extension function 'unaryMinus'" "true"
|
||||
|
||||
fun test() {
|
||||
val a = -false
|
||||
}
|
||||
|
||||
operator fun Boolean.minus(): Any {
|
||||
operator fun Boolean.unaryMinus(): Any {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create member function 'minus'" "true"
|
||||
// "Create member function 'unaryMinus'" "true"
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -1,7 +1,7 @@
|
||||
// "Create member function 'minus'" "true"
|
||||
// "Create member function 'unaryMinus'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
operator fun minus(): Any {
|
||||
operator fun unaryMinus(): Any {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create member function 'minus'" "true"
|
||||
// "Create member function 'unaryMinus'" "true"
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
// "Create member function 'minus'" "true"
|
||||
// "Create member function 'unaryMinus'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
operator fun minus(): A<T> {
|
||||
operator fun unaryMinus(): A<T> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user