Add warning for initializers with obsolete syntax

Expected 'init' keyword before class initializer
This commit is contained in:
Denis Zharkov
2015-02-18 12:05:26 +03:00
parent 0dc155d8c9
commit f07566d30d
61 changed files with 175 additions and 131 deletions
@@ -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()
}