Create from usage: Assume String return type for function whch is called inside of string template
#KT-6083 Fixed
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
// "Create function 'foo'" "true"
|
||||
|
||||
fun test() {
|
||||
println("a = ${foo()}")
|
||||
}
|
||||
|
||||
fun foo(): String {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Create function 'foo'" "true"
|
||||
|
||||
class A {
|
||||
fun foo(): String {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
println("a = ${A().foo()}")
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// "Create function 'foo'" "true"
|
||||
|
||||
fun test() {
|
||||
println("a = ${<caret>foo()}")
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Create function 'foo'" "true"
|
||||
|
||||
class A
|
||||
|
||||
fun test() {
|
||||
println("a = ${A().<caret>foo()}")
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Create property 'foo'" "true"
|
||||
// ERROR: Property must be initialized or be abstract
|
||||
|
||||
class A {
|
||||
val foo: String
|
||||
}
|
||||
|
||||
fun test() {
|
||||
println("a = ${A().foo}")
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Create property 'foo'" "true"
|
||||
// ERROR: Property must be initialized
|
||||
|
||||
fun test() {
|
||||
println("a = $foo")
|
||||
}
|
||||
|
||||
val foo: String
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Create property 'foo'" "true"
|
||||
// ERROR: Property must be initialized or be abstract
|
||||
|
||||
class A
|
||||
|
||||
fun test() {
|
||||
println("a = ${A().<caret>foo}")
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Create property 'foo'" "true"
|
||||
// ERROR: Property must be initialized
|
||||
|
||||
fun test() {
|
||||
println("a = $<caret>foo")
|
||||
}
|
||||
Reference in New Issue
Block a user