Create from Usage: Add operator modifier to indexing get/set functions

#KT-10185 Fixed
This commit is contained in:
Alexey Sedunov
2015-11-26 13:34:20 +03:00
parent 7a40239e64
commit 5b90c09ab1
17 changed files with 17 additions and 17 deletions
@@ -4,7 +4,7 @@ class Foo<T> {
val z: Iterable<T> = y[""]
}
private fun get(s: String): T {
private operator fun get(s: String): T {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -4,7 +4,7 @@ class Foo<T> {
val z: Iterable<T> = y["", w]
}
private fun get(s: String, w: T): T {
private operator fun get(s: String, w: T): T {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -1,6 +1,6 @@
// "Create member function 'get'" "true"
class Foo<T> {
fun get(s: String, w: T): T {
operator fun get(s: String, w: T): T {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -1,6 +1,6 @@
// "Create member function 'get'" "true"
class Foo<T> {
fun get(s: String, w: T): Any {
operator fun get(s: String, w: T): Any {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -8,7 +8,7 @@ class Foo<T> {
bar(z)
}
private fun <V> get(s: String, w: ArrayList<V>): String {
private operator fun <V> get(s: String, w: ArrayList<V>): String {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -3,6 +3,6 @@ fun x (y: Any) {
val z: Any = y[""]
}
fun Any.get(s: String): Any {
operator fun Any.get(s: String): Any {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@@ -4,7 +4,7 @@ class Foo<T> {
val z: Iterable<S> = y[""]
}
private fun get(s: String): T {
private operator fun get(s: String): T {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -4,7 +4,7 @@ class Foo<T, S: Iterable<T>> {
val z: U = y[""]
}
private fun get(s: String): T {
private operator fun get(s: String): T {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -4,7 +4,7 @@ class Foo<T> {
val z: Iterable<T> = y["", w]
}
private fun <V> get(s: String, w: Iterable<V>): T {
private operator fun <V> get(s: String, w: Iterable<V>): T {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -6,7 +6,7 @@ class Foo<T> {
val z: Iterable<T> = y["", w, v]
}
private fun <V, T1> get(s: String, w: ArrayList<V>, v: T1): T {
private operator fun <V, T1> get(s: String, w: ArrayList<V>, v: T1): T {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -6,7 +6,7 @@ class Foo<T> {
val z: Iterable<T> = y["", w]
}
private fun get(s: String, w: T): T {
private operator fun get(s: String, w: T): T {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -6,7 +6,7 @@ class Foo<S> {
val z: Iterable<T> = y["", w]
}
private fun get(s: String, w: S): S {
private operator fun get(s: String, w: S): S {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}