Add warning for initializers with obsolete syntax
Expected 'init' keyword before class initializer
This commit is contained in:
@@ -14,7 +14,7 @@ fun f(s: String?) {
|
||||
// more tests
|
||||
class A(a: String?) {
|
||||
val b = if (a != null) <!DEBUG_INFO_SMARTCAST!>a<!>.length() else 1
|
||||
{
|
||||
init {
|
||||
if (a != null) {
|
||||
val <!UNUSED_VARIABLE!>c<!> = <!DEBUG_INFO_SMARTCAST!>a<!>.length()
|
||||
}
|
||||
@@ -22,7 +22,7 @@ class A(a: String?) {
|
||||
|
||||
val i : Int
|
||||
|
||||
{
|
||||
init {
|
||||
if (a is String) {
|
||||
i = <!DEBUG_INFO_SMARTCAST!>a<!>.length()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user