Can be parameter inspection #KT-10819 Fixed
This commit is contained in:
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.inspections.CanBeParameterInspection
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Remove 'val' from parameter" "true"
|
||||
open class Base(open <caret>val x: Int) {
|
||||
val y = x
|
||||
}
|
||||
|
||||
class Derived(y: Int) : Base(y)
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Remove 'val' from parameter" "true"
|
||||
open class Base(x: Int) {
|
||||
val y = x
|
||||
}
|
||||
|
||||
class Derived(y: Int) : Base(y)
|
||||
@@ -0,0 +1,4 @@
|
||||
// "Remove 'var' from parameter" "true"
|
||||
class UsedInProperty(<caret>var x: Int) {
|
||||
var y = x
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// "Remove 'var' from parameter" "true"
|
||||
class UsedInProperty(x: Int) {
|
||||
var y = x
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Remove 'val' from parameter" "true"
|
||||
class UsedInProperty(private <caret>val x: Int) {
|
||||
var y: String
|
||||
|
||||
init {
|
||||
y = x.toString()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Remove 'val' from parameter" "true"
|
||||
class UsedInProperty(x: Int) {
|
||||
var y: String
|
||||
|
||||
init {
|
||||
y = x.toString()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user