Improve header/impl mismatch diagnostic messages
Try to report most mismatch errors on the 'impl' declaration. Only report a mismatch error on the 'header' declaration if no error would be otherwise reported on any 'impl' declaration in the compilation unit. Also render declaration kind in the message #KT-18447 In Progress
This commit is contained in:
+2
-2
@@ -4,8 +4,8 @@
|
||||
// FILE: common.kt
|
||||
|
||||
header class C1
|
||||
header interface <!JVM:HEADER_WITHOUT_IMPLEMENTATION!>C2<!><A>
|
||||
header interface <!JVM:HEADER_WITHOUT_IMPLEMENTATION!>C3<!><B>
|
||||
header interface C2<A>
|
||||
header interface C3<B>
|
||||
header interface C4<D, E>
|
||||
header interface C5<F, G>
|
||||
header interface C6<H>
|
||||
|
||||
@@ -23,7 +23,7 @@ fun foo() {
|
||||
// FILE: jvm.kt
|
||||
|
||||
class Outer impl constructor() {
|
||||
<!IMPLEMENTATION_WITHOUT_HEADER!>impl<!> class Nested
|
||||
impl class <!IMPLEMENTATION_WITHOUT_HEADER!>Nested<!>
|
||||
|
||||
<!WRONG_MODIFIER_TARGET!>impl<!> init {}
|
||||
}
|
||||
@@ -31,5 +31,5 @@ class Outer impl constructor() {
|
||||
fun foo() {
|
||||
<!WRONG_MODIFIER_TARGET!>impl<!> fun localFun() {}
|
||||
<!WRONG_MODIFIER_TARGET!>impl<!> var <!UNUSED_VARIABLE!>x<!> = 42
|
||||
<!IMPLEMENTATION_WITHOUT_HEADER, WRONG_MODIFIER_TARGET!>impl<!> class Bar
|
||||
<!WRONG_MODIFIER_TARGET!>impl<!> class <!IMPLEMENTATION_WITHOUT_HEADER!>Bar<!>
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -9,10 +9,10 @@ package common
|
||||
// FILE: jvm.kt
|
||||
package jvm
|
||||
|
||||
<!IMPLEMENTATION_WITHOUT_HEADER!>impl<!> fun foo() {}
|
||||
<!IMPLEMENTATION_WITHOUT_HEADER!>impl fun foo()<!> {}
|
||||
|
||||
// MODULE: m3-js(m1-common)
|
||||
// FILE: js.kt
|
||||
package js
|
||||
|
||||
<!IMPLEMENTATION_WITHOUT_HEADER!>impl<!> fun foo() {}
|
||||
<!IMPLEMENTATION_WITHOUT_HEADER!>impl fun foo()<!> {}
|
||||
|
||||
Vendored
+1
-1
@@ -9,4 +9,4 @@ header fun foo()
|
||||
|
||||
<!NON_MEMBER_FUNCTION_NO_BODY!>impl fun foo()<!>
|
||||
|
||||
<!NON_MEMBER_FUNCTION_NO_BODY!><!IMPLEMENTATION_WITHOUT_HEADER!>impl<!> fun bar()<!>
|
||||
<!NON_MEMBER_FUNCTION_NO_BODY, IMPLEMENTATION_WITHOUT_HEADER!>impl fun bar()<!>
|
||||
|
||||
+1
-1
@@ -2,4 +2,4 @@
|
||||
// MODULE: m1-jvm
|
||||
// FILE: jvm.kt
|
||||
|
||||
<!IMPLEMENTATION_WITHOUT_HEADER!>impl<!> fun foo() { }
|
||||
<!IMPLEMENTATION_WITHOUT_HEADER!>impl fun foo()<!> { }
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
<!JVM:HEADER_WITHOUT_IMPLEMENTATION!>inline header fun inlineFun()<!>
|
||||
inline header fun inlineFun()
|
||||
header fun nonInlineFun()
|
||||
|
||||
// MODULE: m2-jvm(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
<!IMPLEMENTATION_WITHOUT_HEADER!>impl<!> fun inlineFun() { }
|
||||
<!IMPLEMENTATION_WITHOUT_HEADER!>impl fun inlineFun()<!> { }
|
||||
impl fun nonInlineFun() { }
|
||||
|
||||
// MODULE: m3-js(m1-common)
|
||||
|
||||
Reference in New Issue
Block a user