diff --git a/compiler/testData/diagnostics/testsWithStdLib/labelClashes.diag.txt b/compiler/testData/diagnostics/testsWithStdLib/labelClashes.diag.txt new file mode 100644 index 00000000000..080018e1fd8 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/labelClashes.diag.txt @@ -0,0 +1,24 @@ +/labelClashes.kt:5:13: warning: this label is now resolved to 'function with' but soon it will be resolved to the closest 'anonymous function'. Please consider introducing or changing explicit label name + this@with.inc() + ^ +/labelClashes.kt:11:13: warning: this label is now resolved to 'function bar' but soon it will be resolved to the closest 'anonymous function'. Please consider introducing or changing explicit label name + this@bar.inc() + ^ +/labelClashes.kt:15:9: warning: parameter 'f' is never used +fun foo(f: with.() -> Unit) {} + ^ +/labelClashes.kt:20:17: warning: this label is now resolved to 'class with' but soon it will be resolved to the closest 'anonymous function'. Please consider introducing or changing explicit label name + this@with.foo() + ^ +/labelClashes.kt:24:17: warning: this label is now resolved to 'class with' but soon it will be resolved to the closest 'anonymous function'. Please consider introducing or changing explicit label name + this@with.foo() + ^ +/labelClashes.kt:37:9: warning: the expression is unused + this@TypedThis + ^ +/labelClashes.kt:37:13: warning: this label is now resolved to 'class TypedThis' but soon it will be resolved to the closest 'function baz extension receiver'. Please consider introducing or changing explicit label name + this@TypedThis + ^ +/labelClashes.kt:41:9: warning: the expression is unused + this@TypedThis + ^ diff --git a/compiler/testData/diagnostics/testsWithStdLib/labelClashes.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/labelClashes.fir.kt index 50824c20ceb..eb27632a72e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/labelClashes.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/labelClashes.fir.kt @@ -1,3 +1,5 @@ +// !RENDER_DIAGNOSTICS_FULL_TEXT + fun Int.with() { with("") { this@with.inc() diff --git a/compiler/testData/diagnostics/testsWithStdLib/labelClashes.kt b/compiler/testData/diagnostics/testsWithStdLib/labelClashes.kt index f0920ec1605..f3cd65cbff5 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/labelClashes.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/labelClashes.kt @@ -1,3 +1,5 @@ +// !RENDER_DIAGNOSTICS_FULL_TEXT + fun Int.with() { with("") { this@with.inc() diff --git a/compiler/testData/diagnostics/testsWithStdLib/labelClashesWithContextReceivers.diag.txt b/compiler/testData/diagnostics/testsWithStdLib/labelClashesWithContextReceivers.diag.txt new file mode 100644 index 00000000000..bdaa3110e2a --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/labelClashesWithContextReceivers.diag.txt @@ -0,0 +1,13 @@ +/labelClashesWithContextReceivers.kt:8:9: warning: the expression is unused + this@Some + ^ +/labelClashesWithContextReceivers.kt:8:13: warning: this label is now resolved to 'class Some' but soon it will be resolved to the closest 'function foo context receiver'. Please consider introducing or changing explicit label name + this@Some + ^ +/labelClashesWithContextReceivers.kt:9:9: warning: the expression is unused + this@String + ^ +/labelClashesWithContextReceivers.kt:14:21: warning: this label is now resolved to 'class Some' but soon it will be resolved to the closest 'property self context receiver'. Please consider introducing or changing explicit label name + get() = this@Some + ^ + diff --git a/compiler/testData/diagnostics/testsWithStdLib/labelClashesWithContextReceivers.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/labelClashesWithContextReceivers.fir.kt index 3e1552315a8..bdb6010bff1 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/labelClashesWithContextReceivers.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/labelClashesWithContextReceivers.fir.kt @@ -1,9 +1,10 @@ // !LANGUAGE: +ContextReceivers +// !RENDER_DIAGNOSTICS_FULL_TEXT class Some { context(Some, String) fun foo() { - this@foo + //this@foo this@Some this@String } diff --git a/compiler/testData/diagnostics/testsWithStdLib/labelClashesWithContextReceivers.kt b/compiler/testData/diagnostics/testsWithStdLib/labelClashesWithContextReceivers.kt index 6a76c4f0e54..1dccf21c8a7 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/labelClashesWithContextReceivers.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/labelClashesWithContextReceivers.kt @@ -1,9 +1,10 @@ // !LANGUAGE: +ContextReceivers +// !RENDER_DIAGNOSTICS_FULL_TEXT class Some { context(Some, String) fun foo() { - this@foo + //this@foo this@Some this@String }