Minor: add diag.txt file for label clashes diagnostic tests

This commit is contained in:
Mikhail Glukhikh
2022-03-09 09:23:54 +03:00
committed by Space
parent d30536addc
commit 8c7a8edb75
6 changed files with 45 additions and 2 deletions
@@ -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
^
@@ -1,3 +1,5 @@
// !RENDER_DIAGNOSTICS_FULL_TEXT
fun Int.with() {
with("") {
<!ARGUMENT_TYPE_MISMATCH!>this@with.<!UNRESOLVED_REFERENCE!>inc<!>()<!>
@@ -1,3 +1,5 @@
// !RENDER_DIAGNOSTICS_FULL_TEXT
fun Int.with() {
with("") {
this<!LABEL_RESOLVE_WILL_CHANGE("function with; anonymous function")!>@with<!>.inc()
@@ -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
^
@@ -1,9 +1,10 @@
// !LANGUAGE: +ContextReceivers
// !RENDER_DIAGNOSTICS_FULL_TEXT
class Some {
context(Some, String)
fun foo() {
this<!UNRESOLVED_LABEL!>@foo<!>
//this@foo
this@Some
this<!UNRESOLVED_LABEL!>@String<!>
}
@@ -1,9 +1,10 @@
// !LANGUAGE: +ContextReceivers
// !RENDER_DIAGNOSTICS_FULL_TEXT
class Some {
context(Some, String)
fun foo() {
<!NO_THIS!>this@foo<!>
//this@foo
this<!LABEL_RESOLVE_WILL_CHANGE("class Some; function foo context receiver")!>@Some<!>
this@String
}