Fix callable code factory (parameter with default value case)
Before we can have end of '<Type>' and '=' joined as '>=' breaking PSI So #KT-15941 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
21bd10da2e
commit
7448042b68
@@ -691,7 +691,7 @@ class KtPsiFactory @JvmOverloads constructor(private val project: Project, val m
|
||||
}
|
||||
sb.append(name).append(": ").append(type)
|
||||
if (defaultValue != null) {
|
||||
sb.append("= ").append(defaultValue)
|
||||
sb.append(" = ").append(defaultValue)
|
||||
}
|
||||
if (state == State.FIRST_PARAM) {
|
||||
state = State.REST_PARAMS
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
class Test<caret>(val a: Array<Int> = arrayOf(0))
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
class Test {
|
||||
val a: Array<Int>
|
||||
|
||||
constructor(a: Array<Int> = arrayOf(0)) {
|
||||
this.a = a
|
||||
}
|
||||
}
|
||||
@@ -5624,6 +5624,12 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("genericParamWithDefaultValue.kt")
|
||||
public void testGenericParamWithDefaultValue() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertPrimaryConstructorToSecondary/genericParamWithDefaultValue.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("independentProperty.kt")
|
||||
public void testIndependentProperty() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertPrimaryConstructorToSecondary/independentProperty.kt");
|
||||
|
||||
Reference in New Issue
Block a user