Create From Usage: Move "Create function"-related tests to separate directory
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun foo(arg: T, s: String, function: Function1<T, T>): A<T> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val a: A<Int> = A(1).foo(2, "2") { (p: Int) -> p + 1 }
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun foo(function: Function1<T, T>): A<T> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val a: A<Int> = A(1).foo { (p: Int) -> p + 1 }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun foo(a: Int): A<T> = throw Exception()
|
||||
|
||||
fun foo(arg: T, s: String): A<T> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val a: A<Int> = A(1).foo(2, "2")
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun foo(i: Int, s: String): A<T> = throw Exception()
|
||||
|
||||
fun foo(arg: T): A<T> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val a: A<Int> = A(1).foo(2)
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
class object {
|
||||
fun foo(i: Int): Int {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val a: Int = A.foo(2)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
fun test() {
|
||||
val a: Int = Unit.foo(2)
|
||||
}
|
||||
|
||||
fun Unit.foo(i: Int): Int {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
fun test() {
|
||||
val a: A<Int> = 2.foo(A(1))
|
||||
}
|
||||
|
||||
fun Int.foo(A: A<Int>): A<Int> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
object A {
|
||||
fun foo(i: Int): Int {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val a: Int = A.foo(2)
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun foo(arg: T): A<T> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val a: A<Int> = A(1).foo(2)
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun foo(u: T): A<T> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
fun test<U>(u: U) {
|
||||
val a: A<U> = A(u).foo(u)
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun foo(abc: T, ghi: A<T>, def: String): A<T> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val a: A<Int> = A(1).foo(abc = 1, ghi = A(2), def = "s")
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
// ERROR: <html>Type mismatch.<table><tr><td>Required:</td><td>kotlin.Int</td></tr><tr><td>Found:</td><td>A<kotlin.Int></td></tr></table></html>
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun foo(s: String, arg: T): Any {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
fun test(): Int {
|
||||
return A(1).foo("s", 1) as A<Int>
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
fun test() {
|
||||
fun foo(i: Int, s: String): Int {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
fun nestedTest(): Int {
|
||||
return foo(2, "2")
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A {
|
||||
class B {
|
||||
fun test(): Int {
|
||||
return foo(2, "2")
|
||||
}
|
||||
|
||||
fun foo(i: Int, s: String): Int {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A {
|
||||
object B {
|
||||
fun test(): Int {
|
||||
return foo(2, "2")
|
||||
}
|
||||
|
||||
fun foo(i: Int, s: String): Int {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun test(): A<Int> {
|
||||
return this.foo(2, "2")
|
||||
}
|
||||
|
||||
fun foo(i: Int, s: String): A<Int> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun foo(i: Int, s: String): A<Int> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
fun <U> A<U>.test(): A<Int> {
|
||||
return this.foo(2, "2")
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
inner class B<U>(val m: U) {
|
||||
fun test(): A<Int> {
|
||||
return this.foo(2, "2")
|
||||
}
|
||||
|
||||
fun foo(i: Int, s: String): A<Int> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
inner class B<U>(val m: U) {
|
||||
fun test(): A<Int> {
|
||||
return this@A.foo(2, "2")
|
||||
}
|
||||
}
|
||||
|
||||
fun foo(i: Int, s: String): A<Int> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
fun test(): Int {
|
||||
return foo(2, "2")
|
||||
}
|
||||
|
||||
fun foo(i: Int, s: String): Int {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
// ERROR: Unresolved reference: s
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun foo(s: Any, arg: T): T {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
fun test(): Int {
|
||||
return A(1).foo(s, 1)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val a: A<Int> = A(1).<caret>foo(2, "2") { (p: Int) -> p + 1 }
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val a: A<Int> = A(1).<caret>foo { (p: Int) -> p + 1 }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun foo(a: Int): A<T> = throw Exception()
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val a: A<Int> = A(1).foo(2, <caret>"2")
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun foo(i: Int, s: String): A<T> = throw Exception()
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val a: A<Int> = A(1).foo(2<caret>)
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
class object {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val a: Int = A.<caret>foo(2)
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
fun test() {
|
||||
val a: Int = Unit.<caret>foo(2)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
fun test() {
|
||||
val a: A<Int> = 2.<caret>foo(A(1))
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
object A
|
||||
|
||||
fun test() {
|
||||
val a: Int = A.<caret>foo(2)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
fun test() {
|
||||
val a: A<Int> = A(1).<caret>foo(2)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
fun test<U>(u: U) {
|
||||
val a: A<U> = A(u).<caret>foo(u)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
fun test() {
|
||||
val a: A<Int> = A(1).<caret>foo(abc = 1, ghi = A(2), def = "s")
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
// ERROR: <html>Type mismatch.<table><tr><td>Required:</td><td>kotlin.Int</td></tr><tr><td>Found:</td><td>A<kotlin.Int></td></tr></table></html>
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
fun test(): Int {
|
||||
return A(1).<caret>foo("s", 1) as A<Int>
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
fun test() {
|
||||
fun nestedTest(): Int {
|
||||
return <caret>foo(2, "2")
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A {
|
||||
class B {
|
||||
fun test(): Int {
|
||||
return <caret>foo(2, "2")
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A {
|
||||
object B {
|
||||
fun test(): Int {
|
||||
return <caret>foo(2, "2")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun test(): A<Int> {
|
||||
return this.<caret>foo(2, "2")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
fun <U> A<U>.test(): A<Int> {
|
||||
return this.<caret>foo(2, "2")
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
inner class B<U>(val m: U) {
|
||||
fun test(): A<Int> {
|
||||
return this.<caret>foo(2, "2")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
inner class B<U>(val m: U) {
|
||||
fun test(): A<Int> {
|
||||
return this@A.<caret>foo(2, "2")
|
||||
}
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
fun test(): Int {
|
||||
return <caret>foo(2, "2")
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
// ERROR: Unresolved reference: s
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
fun test(): Int {
|
||||
return A(1).<caret>foo(s, 1)
|
||||
}
|
||||
Reference in New Issue
Block a user