Create from Usage: Suggest "Create function/secondary constructor" quick fix on argument type mismatch
#KT-11864 Fixed (cherry picked from commit 1912783)
This commit is contained in:
+7
@@ -0,0 +1,7 @@
|
||||
// "Create secondary constructor" "true"
|
||||
// ERROR: None of the following functions can be called with the arguments supplied: <br>public constructor Foo(n: Int) defined in Foo<br>public constructor Foo(n: String) defined in Foo
|
||||
class Foo(val n: Int)
|
||||
|
||||
fun test() {
|
||||
val foo = Foo("a<caret>bc")
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
// "Create secondary constructor" "true"
|
||||
// ERROR: None of the following functions can be called with the arguments supplied: <br>public constructor Foo(n: Int) defined in Foo<br>public constructor Foo(n: String) defined in Foo
|
||||
class Foo(val n: Int) {
|
||||
constructor(n: String) : this(<caret>)
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val foo = Foo("abc")
|
||||
}
|
||||
Reference in New Issue
Block a user