Prohibit local objects and enum classes

#KT-5402 Fixed
  #KT-4838 Fixed

Resolve type of object inside local object as special, not supertype('Any').
Changed visibility of constructor of anonymous object to 'internal' to be able to resolve the following:
fun box(): String {
    var foo = object {
        val bar = object {
            val baz = "ok"
        }
    }
    return foo.bar.baz
}
The containing declaration of property initializers is constructor, so 'baz' was invisible inside private constructor.
This commit is contained in:
Svetlana Isakova
2014-08-12 17:19:02 +04:00
parent eaeed78154
commit 9d366cb896
39 changed files with 158 additions and 126 deletions
@@ -15,4 +15,4 @@ class MyClass(
//public constructor MyClass(a: test.A = ...) defined in test.MyClass
//value-parameter val a: test.A = ... defined in test.MyClass.<init>
//internal final class <no name provided> : test.A defined in test.MyClass.<init>
//private constructor <no name provided>() defined in test.MyClass.<init>.<no name provided>
//internal constructor <no name provided>() defined in test.MyClass.<init>.<no name provided>