mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
It's needed when declarations are parsed as a part of previous expression (see tests) Currently we apply this kind of recovery in a conservative way, only when declaration starts at the next line, and while the condition could be relaxed, there's no need to do this #KT-4948 Fixed #KT-7118 Fixed
30 lines
446 B
Kotlin
Vendored
30 lines
446 B
Kotlin
Vendored
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
|
|
|
fun foo(x: Any) {
|
|
x.<!SYNTAX!><!>
|
|
val foo = 1
|
|
|
|
x.<!SYNTAX!><!>
|
|
fun bar() = 2
|
|
|
|
x.
|
|
<!ILLEGAL_SELECTOR!>fun String.() = 3<!>
|
|
|
|
var a = 24.<!SYNTAX!><!>
|
|
var b = 42.0
|
|
}
|
|
|
|
class A {
|
|
val z = "a".<!SYNTAX!><!>
|
|
val x = 4
|
|
|
|
val y = "b".<!SYNTAX!><!>
|
|
fun baz() = 5
|
|
|
|
val q = "c".
|
|
<!ILLEGAL_SELECTOR!>fun String.() = 6<!>
|
|
|
|
var a = 24.<!SYNTAX!><!>
|
|
var b = 42.0
|
|
}
|