Create From Usage: Fix rendering of nullable types
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun foo(arg: T?): A<Int> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val a: A<Int> = A(true).foo(false as Boolean?)
|
||||
}
|
||||
+11
@@ -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(arg: T): A<String> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val a: A<String> = A(1 as Int?).foo(2)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
fun test() {
|
||||
val a: A<Int> = A(true).<caret>foo(false as Boolean?)
|
||||
}
|
||||
+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(2)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
fun test() {
|
||||
val a: A<String> = A(1 as Int?).<caret>foo(2)
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Create local variable 'foo'" "true"
|
||||
// ERROR: Variable 'foo' must be initialized
|
||||
|
||||
fun test(): Int? {
|
||||
val foo: Int?
|
||||
|
||||
return foo
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Create local variable 'foo'" "true"
|
||||
// ERROR: Variable 'foo' must be initialized
|
||||
|
||||
fun test(): Int? {
|
||||
return <caret>foo
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Create parameter 'foo'" "true"
|
||||
|
||||
fun test(n: Int,
|
||||
foo: Int?) {
|
||||
val t: Int? = foo
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// "Create parameter 'foo'" "true"
|
||||
|
||||
fun test(n: Int) {
|
||||
val t: Int? = <caret>foo
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Create property 'foo' from usage" "true"
|
||||
// ERROR: Property must be initialized or be abstract
|
||||
|
||||
class A<T>(val n: T) {
|
||||
val foo: A<T>?
|
||||
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val a: A<Int>? = A(1).foo
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Create property 'foo' from usage" "true"
|
||||
// ERROR: Property must be initialized or be abstract
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
fun test() {
|
||||
val a: A<Int>? = A(1).<caret>foo
|
||||
}
|
||||
Reference in New Issue
Block a user