Component functions are indexed 1-based
This commit is contained in:
+1
-1
@@ -139,7 +139,7 @@ public class ExpressionTypingVisitorForStatements extends ExpressionTypingVisito
|
||||
if (expressionReceiver == null) {
|
||||
return JetTypeInfo.create(null, context.dataFlowInfo);
|
||||
}
|
||||
int componentIndex = 0;
|
||||
int componentIndex = 1;
|
||||
for (JetMultiDeclarationEntry entry : multiDeclaration.getEntries()) {
|
||||
final Name componentName = Name.identifier("component" + componentIndex);
|
||||
componentIndex++;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package a
|
||||
|
||||
class MyClass {
|
||||
fun component0(<!UNUSED_PARAMETER!>i<!>: Int) {}
|
||||
fun component1(<!UNUSED_PARAMETER!>i<!>: Int) {}
|
||||
}
|
||||
|
||||
class MyClass2 {}
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun MyClass2.component0()<!> = 1.2
|
||||
<!CONFLICTING_OVERLOADS!>fun MyClass2.component0()<!> = 1.3
|
||||
<!CONFLICTING_OVERLOADS!>fun MyClass2.component1()<!> = 1.2
|
||||
<!CONFLICTING_OVERLOADS!>fun MyClass2.component1()<!> = 1.3
|
||||
|
||||
fun test(<!UNUSED_PARAMETER!>mc1<!>: MyClass, <!UNUSED_PARAMETER!>mc2<!>: MyClass2) {
|
||||
val (a, b) = <!COMPONENT_FUNCTION_MISSING, COMPONENT_FUNCTION_MISSING!>mc1<!>
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
package a
|
||||
|
||||
class MyClass {
|
||||
fun component0() = 1
|
||||
fun component1() = "a"
|
||||
fun component1() = 1
|
||||
fun component2() = "a"
|
||||
}
|
||||
|
||||
class MyClass2 {}
|
||||
|
||||
fun MyClass2.component0() = 1.2
|
||||
fun MyClass2.component1() = 1.2
|
||||
|
||||
fun test(<!UNUSED_PARAMETER!>mc1<!>: MyClass, <!UNUSED_PARAMETER!>mc2<!>: MyClass2) {
|
||||
val (a, b) = mc1
|
||||
|
||||
Reference in New Issue
Block a user