Add warning for initializers with obsolete syntax
Expected 'init' keyword before class initializer
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ fun test(x: Any) {
|
||||
fun foo(y: Any) {
|
||||
if (y !is String) return
|
||||
class Local {
|
||||
{
|
||||
init {
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.length()
|
||||
<!DEBUG_INFO_SMARTCAST!>y<!>.length()
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
fun f(a: Any?) {
|
||||
if (a is B) {
|
||||
class C : X(<!DEBUG_INFO_SMARTCAST!>a<!>) {
|
||||
{
|
||||
init {
|
||||
<!DEBUG_INFO_SMARTCAST!>a<!>.foo()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ fun test(x: Any) {
|
||||
|
||||
class LocalOuter {
|
||||
inner class Local {
|
||||
{
|
||||
init {
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.length()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user