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
@@ -11,7 +11,7 @@ class Foo {
private val privateProperty = object : MyClass(), MyTrait {}
{
init {
privateProperty.f1()
privateProperty.f2()
}
@@ -27,7 +27,7 @@ class Foo {
private fun privateFunction() = object : MyClass(), MyTrait {}
{
init {
privateFunction().f1()
privateFunction().f2()
}
@@ -45,7 +45,7 @@ class Foo {
class FooInner {
private val privatePropertyInner = object : MyClass(), MyTrait {}
{
init {
privatePropertyInner.f1()
privatePropertyInner.f2()
}
@@ -61,7 +61,7 @@ class Foo {
private fun privateFunctionInner() = object : MyClass(), MyTrait {}
{
init {
privateFunctionInner().f1()
privateFunctionInner().f2()
}