Allow to import members from object by name

Wrap object members so they do not require dispatch receiver
Hack jvm backend to make it work
This commit is contained in:
Pavel V. Talanov
2015-10-02 16:01:09 +03:00
parent 507293e1ff
commit 37d5c4b223
22 changed files with 713 additions and 45 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
package c
import c.A.Companion.B
import c.<!CANNOT_IMPORT_MEMBERS_FROM_SINGLETON!>M<!>.*
import c.<!CANNOT_ALL_UNDER_IMPORT_FROM_SINGLETON!>M<!>.*
fun foo() {
val <!UNUSED_VARIABLE!>b<!>: B = B()
+3 -3
View File
@@ -2,9 +2,9 @@ package d
//import from objects before properties resolve
import d.<!CANNOT_IMPORT_MEMBERS_FROM_SINGLETON!>A<!>.*
import d.<!CANNOT_ALL_UNDER_IMPORT_FROM_SINGLETON!>A<!>.*
import d.M.R
import d.M.R.<!CANNOT_IMPORT_MEMBERS_FROM_SINGLETON!>bar<!>
import d.M.R.bar
import d.M.T
import d.M.Y
@@ -12,7 +12,7 @@ var r: T = T()
val y: T = Y
fun f() {
<!UNRESOLVED_REFERENCE!>bar<!>()
bar()
R.bar()
B.foo()
}