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:
@@ -0,0 +1,36 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// SKIP_TXT
|
||||
// FILE: Outer.kt
|
||||
package abc
|
||||
class Outer {
|
||||
inner class Inner() {
|
||||
constructor(x: Int) : this() {}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
fun baz() {
|
||||
<!RESOLUTION_TO_CLASSIFIER!>Inner<!>()
|
||||
<!RESOLUTION_TO_CLASSIFIER!>Inner<!>(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
Outer.<!RESOLUTION_TO_CLASSIFIER!>Inner<!>()
|
||||
Outer.<!RESOLUTION_TO_CLASSIFIER!>Inner<!>(1)
|
||||
}
|
||||
|
||||
// FILE: imported.kt
|
||||
import abc.Outer
|
||||
import abc.Outer.Inner
|
||||
|
||||
fun bar() {
|
||||
<!RESOLUTION_TO_CLASSIFIER!>Inner<!>()
|
||||
<!RESOLUTION_TO_CLASSIFIER!>Inner<!>(1)
|
||||
|
||||
with(Outer()) {
|
||||
Inner()
|
||||
Inner(1)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user