Change outer scope for nested class and object -- removed implicit outer class receiver.

#KT-5362 Fixed
#KT-8814 Fixed
This commit is contained in:
Stanislav Erokhin
2015-08-18 16:27:40 +03:00
parent b83b298f68
commit 2ee8f1c454
39 changed files with 224 additions and 70 deletions
@@ -4,6 +4,6 @@ class A() {
val x = 1
companion object {
val y = <!INACCESSIBLE_OUTER_CLASS_EXPRESSION!>x<!>
val y = <!UNRESOLVED_REFERENCE!>x<!>
}
}
}
@@ -9,7 +9,7 @@ internal final class A {
public companion object Companion {
private constructor Companion()
internal final val y: kotlin.Int = 1
internal final val y: [ERROR : Type for x]
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
@@ -4,6 +4,6 @@ open class ToResolve<SomeClass>(<!UNUSED_PARAMETER!>f<!> : (Int) -> Int)
fun testFun(<!UNUSED_PARAMETER!>a<!> : Int) = 12
class TestSome<P> {
companion object : ToResolve<<!INACCESSIBLE_OUTER_CLASS_EXPRESSION!>P<!>>({testFun(it)}) {
companion object : ToResolve<<!UNRESOLVED_REFERENCE!>P<!>>({testFun(it)}) {
}
}
@@ -9,7 +9,7 @@ package test {
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
public companion object Companion : test.ToResolve<P> {
public companion object Companion : test.ToResolve<[ERROR : P]> {
private constructor Companion()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
@@ -4,6 +4,6 @@ class Test {
fun test(): Int = 12
companion object {
val a = <!INACCESSIBLE_OUTER_CLASS_EXPRESSION!>test()<!> // Check if resolver will be able to infer type of a variable
val a = <!UNRESOLVED_REFERENCE!>test<!>() // Check if resolver will be able to infer type of a variable
}
}
@@ -11,7 +11,7 @@ package test {
public companion object Companion {
private constructor Companion()
internal final val a: kotlin.Int
internal final val a: [ERROR : Type for test()]
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String