Change MISSING_CONSTRUCTOR_KEYWORD severity to error

And adjust testData
This commit is contained in:
Denis Zharkov
2015-06-10 12:46:14 +03:00
parent eb7114bd53
commit e3c3af6aab
22 changed files with 26 additions and 20 deletions
@@ -1,4 +1,4 @@
class Foo private(val param: String = "OK") {
class Foo private constructor(val param: String = "OK") {
companion object {
val s = Foo()
}
@@ -1,6 +1,6 @@
var state: String = "Fail"
class A private(x: String = "OK") {
class A private constructor(x: String = "OK") {
init {
state = x
}
+1 -1
View File
@@ -1,6 +1,6 @@
package someTest
public class Some private(val v: String) {
public class Some private constructor(val v: String) {
companion object {
public fun init(v: String): Some {
return Some(v)
@@ -12,7 +12,7 @@ data class A1(val prop1: String) {
fun f(): String = "$prop1#$prop2#$prop3"
}
data class A2 private () {
data class A2 private constructor() {
var prop1: String = ""
var prop2: String = "const2"
var prop3: String = ""
@@ -1,6 +1,6 @@
var sideEffects: String = ""
abstract class B protected(val arg: Int) {
abstract class B protected constructor(val arg: Int) {
val parentProp: String
init {
sideEffects += "zero#"
@@ -2,7 +2,7 @@
// This is crucial for some JVM frameworks like Quasar which rely on the bytecode being similar to the one generated by javac
// See https://youtrack.jetbrains.com/issue/KT-6870
class PrivateConstructor private() {
class PrivateConstructor private constructor() {
class Nested { val a = PrivateConstructor() }
}
@@ -1,4 +1,4 @@
class Foo private(val a: Int = 1) {}
class Foo private constructor(val a: Int = 1) {}
// CLASS: Foo
// HAS_DEFAULT_CONSTRUCTOR: false