Create From Usage: Generate Unit-typed declaration if result is unused
#KT-5903 Fixed
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create function 'plusAssign' from usage" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun plusAssign(arg: T): Unit {
|
||||
fun plusAssign(arg: T) {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
fun test() {
|
||||
foo(2, "2")
|
||||
}
|
||||
|
||||
fun foo(i: Int, s: String) {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// ERROR: Unresolved reference: B
|
||||
|
||||
class A: B {
|
||||
fun foo(): Any {
|
||||
fun foo() {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
fun test() {
|
||||
<caret>foo(2, "2")
|
||||
}
|
||||
Reference in New Issue
Block a user