Add diagnostic on calling inner classes constructors without receiver

Otherwise there will be just an unresolved reference that doesn't give
any useful information

 #KT-8959 Fixed
This commit is contained in:
Denis Zharkov
2017-02-28 15:28:20 +03:00
parent 1e0ae04aba
commit a7fc32c8da
17 changed files with 133 additions and 37 deletions
@@ -1,15 +1,15 @@
class Outer1 {
class Nested
class C1 { val b = Nested() }
class C2(val b: Any = Nested())
inner class C3 { val b = Nested() }
inner class C4(val b: Any = Nested())
inner class Inner
class C5 { val b = <!UNRESOLVED_REFERENCE!>Inner<!>() }
class C6(val b: Any = <!UNRESOLVED_REFERENCE!>Inner<!>())
class C5 { val b = <!RESOLUTION_TO_CLASSIFIER!>Inner<!>() }
class C6(val b: Any = <!RESOLUTION_TO_CLASSIFIER!>Inner<!>())
inner class C7 { val b = Inner() }
inner class C8(val b: Any = Inner())
}
@@ -18,15 +18,15 @@ class Outer1 {
class Outer2 {
class Nested {
fun foo() = Outer2()
fun bar() = <!UNRESOLVED_REFERENCE!>Inner<!>()
fun bar() = <!RESOLUTION_TO_CLASSIFIER!>Inner<!>()
}
inner class Inner {
fun foo() = Outer2()
fun bar() = Nested()
}
fun foo() {
Nested()
Inner()
}
}
}