Frontend: create component functions for properties with error types

Fixes an inconsistency in light classes where we could have different
  class structure depending on whether the type was resolved
This commit is contained in:
Pavel V. Talanov
2017-03-02 17:35:25 +03:00
parent fa58f1b4d7
commit d94da5af40
4 changed files with 50 additions and 1 deletions
@@ -0,0 +1,16 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE
data class A(val i: Int, val j: <!UNRESOLVED_REFERENCE!>G<!>)
data class B(val i: <!UNRESOLVED_REFERENCE!>G<!>, val j: <!UNRESOLVED_REFERENCE!>G<!>)
fun fa(a: A) {
val (i, j) = a
val i2 = a.component1()
val j2 = a.component2()
}
fun fb(b: B) {
val (i, j) = b
val i2 = b.component1()
val j2 = b.component2()
}
@@ -0,0 +1,28 @@
package
public fun fa(/*0*/ a: A): kotlin.Unit
public fun fb(/*0*/ b: B): kotlin.Unit
public final data class A {
public constructor A(/*0*/ i: kotlin.Int, /*1*/ j: [ERROR : G])
public final val i: kotlin.Int
public final val j: [ERROR : G]
public final operator /*synthesized*/ fun component1(): kotlin.Int
public final operator /*synthesized*/ fun component2(): [ERROR : G]
public final /*synthesized*/ fun copy(/*0*/ i: kotlin.Int = ..., /*1*/ j: [ERROR : G] = ...): A
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
}
public final data class B {
public constructor B(/*0*/ i: [ERROR : G], /*1*/ j: [ERROR : G])
public final val i: [ERROR : G]
public final val j: [ERROR : G]
public final operator /*synthesized*/ fun component1(): [ERROR : G]
public final operator /*synthesized*/ fun component2(): [ERROR : G]
public final /*synthesized*/ fun copy(/*0*/ i: [ERROR : G] = ..., /*1*/ j: [ERROR : G] = ...): B
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
}