Enum deprecated syntax detection implemented and integrated into DeclarationsChecker.
A lot of tests was changed to refactor deprecated syntax. Six new tests were added to check deprecated syntax detection. Diagnostic for "enum entry uses deprecated super constructor": constructor is highlighted Diagnostic for "enum entry uses deprecated or no delimiter". One warning removed.
This commit is contained in:
@@ -4,7 +4,7 @@ object A {
|
||||
}
|
||||
|
||||
enum class B {
|
||||
X : B() {
|
||||
X() {
|
||||
<!SECONDARY_CONSTRUCTOR_IN_OBJECT!>constructor()
|
||||
<!>}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
enum class A {
|
||||
W: A(1) X: A(1, 2) Y: A(3.0) Z: A("") E: A()
|
||||
W(1), X(1, 2), Y(3.0), Z(""), E();
|
||||
|
||||
constructor()
|
||||
constructor(x: Int)
|
||||
@@ -10,7 +10,7 @@ enum class A {
|
||||
}
|
||||
|
||||
enum class B(x: Int) {
|
||||
W: B(1) X: B(1, 2) Y: B(3.0) Z: B("")
|
||||
W(1), X(1, 2), Y(3.0), Z("");
|
||||
|
||||
constructor(x: Int, y: Int): this(x+y)
|
||||
constructor(x: Double): this(x.toInt(), 1)
|
||||
@@ -18,20 +18,20 @@ enum class B(x: Int) {
|
||||
}
|
||||
|
||||
enum class C {
|
||||
EMPTY: C() // may be we should avoid explicit call here
|
||||
EMPTY(); // may be we should avoid explicit call here
|
||||
constructor()
|
||||
}
|
||||
|
||||
enum class D(val prop: Int) {
|
||||
X: D(123) {
|
||||
X(123) {
|
||||
override fun f() = 1
|
||||
}
|
||||
Y: D() {
|
||||
},
|
||||
Y() {
|
||||
override fun f() = prop
|
||||
}
|
||||
Z: D("abc") {
|
||||
},
|
||||
Z("abc") {
|
||||
override fun f() = prop
|
||||
}
|
||||
};
|
||||
|
||||
constructor(): this(1)
|
||||
constructor(x: String): this(x.length())
|
||||
|
||||
Reference in New Issue
Block a user