Import all components and delegates accessors if possible

This commit is contained in:
Nikolay Krasko
2015-10-23 16:07:38 +03:00
parent 1517a099d0
commit 3c07bc3df7
10 changed files with 489 additions and 110 deletions
@@ -0,0 +1,54 @@
// FILE: first.before.kt
// "Import" "true"
// ERROR: Multi-declaration initializer of type aaa.Some must have a 'component1()' function
// ERROR: Multi-declaration initializer of type aaa.Some must have a 'component2()' function
package testing
import aaa.Some
fun testing() {
val (a, b) = <caret>Some()
}
//-----------------------
// FILE: second.kt
package aaa
public class Some
@Deprecated("Use componenents from other")
operator fun Some.component1() = 1
operator fun Some.component2() = 3
//-----------------------
// FILE: second.kt
package other
import aaa.Some
operator fun Some.component1() = 1
operator fun Some.component2() = 3
//-----------------------
// FILE: first.after.kt
// "Import" "true"
// ERROR: Multi-declaration initializer of type aaa.Some must have a 'component1()' function
// ERROR: Multi-declaration initializer of type aaa.Some must have a 'component2()' function
package testing
import aaa.Some
import other.component1
import other.component2
fun testing() {
val (a, b) = <caret>Some()
}
//-----------------------