Create From Usage: Fix rendering of nullable types
This commit is contained in:
+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