Quick-fix for UNNECESSARY_LATEINIT

(cherry picked from commit 77f7bb0)
This commit is contained in:
Mikhail Glukhikh
2016-09-26 11:40:31 +03:00
committed by Mikhail Glukhikh
parent 025d063b27
commit 67cc83af05
14 changed files with 194 additions and 0 deletions
@@ -0,0 +1,9 @@
// "Remove 'lateinit' modifier" "true"
class Foo {
<caret>lateinit var bar: String
constructor(baz: Int) {
bar = ""
}
}
@@ -0,0 +1,9 @@
// "Remove 'lateinit' modifier" "true"
class Foo {
var bar: String
constructor(baz: Int) {
bar = ""
}
}
@@ -0,0 +1,9 @@
// "Remove 'lateinit' modifier" "true"
class Foo {
<caret>lateinit var bar: String
init {
bar = ""
}
}
@@ -0,0 +1,9 @@
// "Remove 'lateinit' modifier" "true"
class Foo {
var bar: String
init {
bar = ""
}
}
@@ -0,0 +1,13 @@
// "Remove 'lateinit' modifier" "true"
class Foo {
<caret>lateinit var bar: String
constructor() {
bar = ""
}
constructor(baz: Int) {
bar = ""
}
}
@@ -0,0 +1,13 @@
// "Remove 'lateinit' modifier" "true"
class Foo {
var bar: String
constructor() {
bar = ""
}
constructor(baz: Int) {
bar = ""
}
}
@@ -0,0 +1,15 @@
// "Remove 'lateinit' modifier" "true"
class Foo {
<caret>lateinit var bar: String
constructor() {
bar = ""
}
constructor(a: Int) : this() {
}
constructor(a: Int, b: Int) : this(a) {
}
}
@@ -0,0 +1,15 @@
// "Remove 'lateinit' modifier" "true"
class Foo {
var bar: String
constructor() {
bar = ""
}
constructor(a: Int) : this() {
}
constructor(a: Int, b: Int) : this(a) {
}
}
@@ -0,0 +1,14 @@
// "Remove 'lateinit' modifier" "true"
class Foo {
<caret>lateinit var bar: String
var baz: Int
init {
baz = 1
}
init {
bar = ""
}
}
@@ -0,0 +1,14 @@
// "Remove 'lateinit' modifier" "true"
class Foo {
var bar: String
var baz: Int
init {
baz = 1
}
init {
bar = ""
}
}
@@ -0,0 +1,14 @@
// "Remove 'lateinit' modifier" "true"
// ERROR: There's a cycle in the delegation calls chain
class Foo {
<caret>lateinit var bar: String
constructor() {
bar = ""
}
constructor(a: Int) : this(a) {
bar = "a"
}
}
@@ -0,0 +1,14 @@
// "Remove 'lateinit' modifier" "true"
// ERROR: There's a cycle in the delegation calls chain
class Foo {
<caret>var bar: String
constructor() {
bar = ""
}
constructor(a: Int) : this(a) {
bar = "a"
}
}