[FIR] Fix default message for PRIVATE_CLASS_MEMBER_FROM_INLINE
Error message was only printing the calling inline function and not the class member being accessed. Make sure both pieces for diagnostic information are included in the error message. #KT-58972 Fixed
This commit is contained in:
+1
-1
@@ -2161,7 +2161,7 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() {
|
|||||||
)
|
)
|
||||||
map.put(
|
map.put(
|
||||||
PRIVATE_CLASS_MEMBER_FROM_INLINE,
|
PRIVATE_CLASS_MEMBER_FROM_INLINE,
|
||||||
"Non-private inline function cannot access members of private classes: ''{1}''",
|
"Non-private inline function ''{1}'' cannot access members of private classes: ''{0}''",
|
||||||
SYMBOL,
|
SYMBOL,
|
||||||
SYMBOL
|
SYMBOL
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
/kt55179.kt:16:5: error: non-private inline function cannot access members of private classes: 'public constructor Foo() defined in Foo'
|
||||||
|
Foo()
|
||||||
|
^
|
||||||
|
/kt55179.kt:17:9: error: non-private inline function cannot access members of private classes: 'public companion object defined in Foo'
|
||||||
|
Foo.Companion
|
||||||
|
^
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
/kt55179.fir.kt:(217,223): warning: Expected performance impact from inlining is insignificant. Inlining works best for functions with parameters of functional types
|
||||||
|
|
||||||
|
/kt55179.fir.kt:(240,243): error: Non-private inline function 'fun foo(): Unit' cannot access members of private classes: 'constructor(): Foo'
|
||||||
|
|
||||||
|
/kt55179.fir.kt:(254,263): error: Non-private inline function 'fun foo(): Unit' cannot access members of private classes: 'companion object Companion : Any'
|
||||||
|
|
||||||
|
/kt55179.fir.kt:(272,280): error: Non-private inline function 'fun foo(): Unit' cannot access members of private classes: 'fun buildFoo(): Foo'
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
// ISSUE: KT-55179
|
// ISSUE: KT-55179
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
|
// !RENDER_DIAGNOSTICS_FULL_TEXT
|
||||||
|
|
||||||
private class Foo {
|
private class Foo {
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// ISSUE: KT-55179
|
// ISSUE: KT-55179
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
|
// !RENDER_DIAGNOSTICS_FULL_TEXT
|
||||||
|
|
||||||
private class Foo {
|
private class Foo {
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
Reference in New Issue
Block a user