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:
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user