[FIR] Make reporting of local class diagnostics more consistent with K1
It would be nice to report more appropriate diagnostics at the corresponding places, but right now it's more important to fix greenness-redness problems. Plus, this is already how K1 works. ^KT-59900 Fixed
This commit is contained in:
committed by
Space Team
parent
9b114335fb
commit
0d19942d2c
+1
-1
@@ -6,7 +6,7 @@ enum class Enum {
|
||||
|
||||
<!NESTED_CLASS_NOT_ALLOWED!>class TestNested<!>
|
||||
|
||||
<!LOCAL_INTERFACE_NOT_ALLOWED, NESTED_CLASS_NOT_ALLOWED!>interface TestInterface<!>
|
||||
<!NESTED_CLASS_NOT_ALLOWED!>interface TestInterface<!>
|
||||
|
||||
<!LOCAL_OBJECT_NOT_ALLOWED!>object TestObject<!>
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ enum class Enum {
|
||||
|
||||
<!NESTED_CLASS_NOT_ALLOWED!>class TestNested<!>
|
||||
|
||||
<!LOCAL_INTERFACE_NOT_ALLOWED, NESTED_CLASS_NOT_ALLOWED!>interface TestInterface<!>
|
||||
<!NESTED_CLASS_NOT_ALLOWED!>interface TestInterface<!>
|
||||
|
||||
<!LOCAL_OBJECT_NOT_ALLOWED!>object TestObject<!>
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
// KT-6026 Exception on instantiating a nested class in an anonymous object
|
||||
|
||||
val oo = object {
|
||||
// Forbidden in KT-13510
|
||||
class Nested
|
||||
|
||||
fun f1() = Nested(<!TOO_MANY_ARGUMENTS!>11<!>)
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// KT-6026 Exception on instantiating a nested class in an anonymous object
|
||||
|
||||
val oo = object {
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
|
||||
fun foo() {
|
||||
<!LOCAL_INTERFACE_NOT_ALLOWED!>interface a<!> {}
|
||||
val b = object {
|
||||
<!LOCAL_INTERFACE_NOT_ALLOWED!>interface c<!> {}
|
||||
}
|
||||
class A {
|
||||
<!LOCAL_INTERFACE_NOT_ALLOWED, NESTED_CLASS_NOT_ALLOWED!>interface d<!> {}
|
||||
}
|
||||
val f = {
|
||||
<!LOCAL_INTERFACE_NOT_ALLOWED!>interface e<!> {}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
|
||||
fun foo() {
|
||||
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
class X {
|
||||
val foo = object {
|
||||
class Foo
|
||||
}
|
||||
|
||||
fun test() {
|
||||
object {
|
||||
class Foo
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
class X {
|
||||
val foo = object {
|
||||
<!NESTED_CLASS_NOT_ALLOWED!>class Foo<!>
|
||||
|
||||
Reference in New Issue
Block a user