New J2K: Split old j2k and new j2k tests
This commit is contained in:
committed by
Ilya Kirillov
parent
02a206bf7c
commit
b411e8e18e
@@ -1,27 +0,0 @@
|
||||
internal class C(val myArg1: Int) {
|
||||
var myArg2: Int
|
||||
var myArg3: Int
|
||||
|
||||
constructor(arg1: Int, arg2: Int, arg3: Int) : this(arg1) {
|
||||
myArg2 = arg2
|
||||
myArg3 = arg3
|
||||
}
|
||||
|
||||
constructor(arg1: Int, arg2: Int) : this(arg1) {
|
||||
myArg2 = arg2
|
||||
myArg3 = 0
|
||||
}
|
||||
|
||||
init {
|
||||
myArg2 = 0
|
||||
myArg3 = 0
|
||||
}
|
||||
}
|
||||
|
||||
object User {
|
||||
fun main() {
|
||||
val c1 = C(100, 100, 100)
|
||||
val c2 = C(100, 100)
|
||||
val c3 = C(100)
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
// ERROR: Property must be initialized or be abstract
|
||||
class Test {
|
||||
private val s: String
|
||||
internal var b = false
|
||||
internal var d = 0.0
|
||||
|
||||
constructor() {
|
||||
b = true
|
||||
}
|
||||
|
||||
constructor(s: String) {
|
||||
this.s = s
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,6 @@ internal class Customer(val firstName: String, val lastName: String) {
|
||||
}
|
||||
|
||||
internal class CustomerBuilder {
|
||||
var _firstName = "Homer"
|
||||
var _firstName = "Homer"
|
||||
var _lastName = "Simpson"
|
||||
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
package org.test.customer
|
||||
|
||||
internal class Customer(val firstName: String, val lastName: String) {
|
||||
init {
|
||||
doSmthBefore()
|
||||
doSmthAfter()
|
||||
}
|
||||
|
||||
private fun doSmthBefore() {}
|
||||
|
||||
private fun doSmthAfter() {}
|
||||
}
|
||||
|
||||
internal class CustomerBuilder {
|
||||
var _firstName = "Homer"
|
||||
var _lastName = "Simpson"
|
||||
fun WithFirstName(firstName: String): CustomerBuilder {
|
||||
_firstName = firstName
|
||||
return this
|
||||
}
|
||||
|
||||
fun WithLastName(lastName: String): CustomerBuilder {
|
||||
_lastName = lastName
|
||||
return this
|
||||
}
|
||||
|
||||
fun Build(): Customer {
|
||||
return Customer(_firstName, _lastName)
|
||||
}
|
||||
}
|
||||
|
||||
object User {
|
||||
fun main() {
|
||||
val customer = CustomerBuilder()
|
||||
.WithFirstName("Homer")
|
||||
.WithLastName("Simpson")
|
||||
.Build()
|
||||
println(customer.firstName)
|
||||
println(customer.lastName)
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
internal class C(p: Int, c: C) {
|
||||
var p = 0
|
||||
|
||||
init {
|
||||
c.p = p
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
internal class C(p: Int) {
|
||||
var p: Int
|
||||
|
||||
init {
|
||||
this.p = 0
|
||||
if (p > 0) {
|
||||
this.p = p
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
internal class C(x: String) {
|
||||
var x: Any
|
||||
|
||||
init {
|
||||
this.x = x
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
internal class C(x: Any?, b: Boolean) {
|
||||
var x: Any? = null
|
||||
|
||||
init {
|
||||
if (b) {
|
||||
this.x = x
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
internal open class Base(o: Any?, l: Int)
|
||||
|
||||
internal class C(private val string: String) : Base(string, string.length)
|
||||
-1
@@ -1 +0,0 @@
|
||||
internal class C(@Deprecated("") private val p1: Int, private val myP2: Int, @SuppressWarnings("x") var p3: Int)
|
||||
@@ -1,28 +0,0 @@
|
||||
class Identifier<T> {
|
||||
val name: T
|
||||
private var myHasDollar = false
|
||||
private var myNullable = true
|
||||
|
||||
constructor(name: T) {
|
||||
this.name = name
|
||||
}
|
||||
|
||||
constructor(name: T, isNullable: Boolean) {
|
||||
this.name = name
|
||||
myNullable = isNullable
|
||||
}
|
||||
|
||||
constructor(name: T, hasDollar: Boolean, isNullable: Boolean) {
|
||||
this.name = name
|
||||
myHasDollar = hasDollar
|
||||
myNullable = isNullable
|
||||
}
|
||||
}
|
||||
|
||||
object User {
|
||||
fun main() {
|
||||
val i1: Identifier<*> = Identifier<String?>("name", false, true)
|
||||
val i2 = Identifier("name", false)
|
||||
val i3 = Identifier("name")
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
// ERROR: Property must be initialized or be abstract
|
||||
class Identifier {
|
||||
val name: String
|
||||
private var myHasDollar = false
|
||||
private var myNullable = true
|
||||
|
||||
constructor(name: String) {
|
||||
this.name = name
|
||||
}
|
||||
|
||||
constructor(name: String, isNullable: Boolean) {
|
||||
this.name = name
|
||||
myNullable = isNullable
|
||||
}
|
||||
|
||||
constructor(name: String, hasDollar: Boolean, isNullable: Boolean) {
|
||||
this.name = name
|
||||
myHasDollar = hasDollar
|
||||
myNullable = isNullable
|
||||
}
|
||||
}
|
||||
|
||||
object User {
|
||||
fun main() {
|
||||
val i1 = Identifier("name", false, true)
|
||||
val i2 = Identifier("name", false)
|
||||
val i3 = Identifier("name")
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
internal class C(private val arg1: Int, private val arg2: Int, private val arg3: Int) {
|
||||
|
||||
fun foo(p: Int): Int {
|
||||
return p
|
||||
}
|
||||
|
||||
constructor(arg1: Int, arg2: Int, other: C) : this(arg1, arg2, 0) {
|
||||
println(foo(1) + foo(2) + other.foo(3) + staticFoo(4) + staticFoo(5))
|
||||
}
|
||||
|
||||
companion object {
|
||||
private fun staticFoo(p: Int): Int {
|
||||
return p
|
||||
}
|
||||
|
||||
fun staticFoo2(): Int {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
internal class A @JvmOverloads constructor(nested: Nested = Nested(Nested.FIELD)) {
|
||||
|
||||
internal class Nested(p: Int) {
|
||||
companion object {
|
||||
|
||||
const val FIELD = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
internal class A @JvmOverloads constructor(nested: Nested = Nested(Nested.FIELD)) {
|
||||
internal class Nested(p: Int) {
|
||||
companion object {
|
||||
const val FIELD = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class B {
|
||||
var nested: A.Nested? = null
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
package pack
|
||||
|
||||
internal class A @JvmOverloads constructor(nested: Nested = Nested(Nested.FIELD)) {
|
||||
internal class Nested(p: Int) {
|
||||
companion object {
|
||||
const val FIELD = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class B {
|
||||
var nested: A.Nested? = null
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
package pack
|
||||
|
||||
internal class A @JvmOverloads constructor(nested: Nested = Nested(Nested.FIELD)) {
|
||||
internal class Nested(p: Int) {
|
||||
companion object {
|
||||
const val FIELD = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class B {
|
||||
var nested: A.Nested? = null
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
internal open class Base(nested: Nested?) {
|
||||
internal class Nested(p: Int) {
|
||||
companion object {
|
||||
const val FIELD = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class Derived : Base(Base.Nested(Base.Nested.FIELD))
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
internal class A {
|
||||
private var s = ""
|
||||
private var x = 0
|
||||
|
||||
constructor() {}
|
||||
|
||||
@JvmOverloads
|
||||
constructor(p: Int, s: String, x: Int = 1) {
|
||||
this.s = s
|
||||
this.x = x
|
||||
}
|
||||
}
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
internal class A() {
|
||||
private var s = ""
|
||||
private var x = 0
|
||||
|
||||
@JvmOverloads
|
||||
constructor(p: Int, s: String, x: Int = 1) : this() {
|
||||
this.s = s
|
||||
this.x = x
|
||||
}
|
||||
}
|
||||
-46
@@ -1,46 +0,0 @@
|
||||
// ERROR: Modifier 'protected' is not applicable inside 'object'
|
||||
internal object Outer {
|
||||
private class Nested1() {
|
||||
|
||||
constructor(a: Int) : this() {}
|
||||
|
||||
protected constructor(c: Char) : this() {}
|
||||
|
||||
private constructor(b: Boolean) : this() {}
|
||||
}
|
||||
|
||||
protected class Nested2() {
|
||||
|
||||
constructor(a: Int) : this() {}
|
||||
|
||||
protected constructor(c: Char) : this() {}
|
||||
|
||||
private constructor(b: Boolean) : this() {}
|
||||
|
||||
}
|
||||
|
||||
internal class Nested3() {
|
||||
|
||||
constructor(a: Int) : this() {}
|
||||
|
||||
protected constructor(c: Char) : this() {}
|
||||
|
||||
private constructor(b: Boolean) : this() {}
|
||||
}
|
||||
|
||||
class Nested4() {
|
||||
|
||||
constructor(a: Int) : this() {}
|
||||
|
||||
protected constructor(c: Char) : this() {}
|
||||
|
||||
private constructor(b: Boolean) : this() {}
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
val nested1 = Nested1(1)
|
||||
val nested2 = Nested2(2)
|
||||
val nested3 = Nested3(3)
|
||||
val nested4 = Nested4(4)
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
internal class C() {
|
||||
|
||||
constructor(p: Int) : this() {
|
||||
println(staticField1 + staticField2)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val staticField1 = 0
|
||||
private const val staticField2 = 0
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
// ERROR: Property must be initialized or be abstract
|
||||
class Test {
|
||||
private val myName: String
|
||||
internal var a = false
|
||||
internal var b = 0.0
|
||||
internal var c = 0f
|
||||
internal var d: Long = 0
|
||||
internal var e = 0
|
||||
protected var f: Short = 0
|
||||
protected var g = 0.toChar()
|
||||
|
||||
constructor() {}
|
||||
|
||||
constructor(name: String) {
|
||||
myName = foo(name)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
internal fun foo(n: String): String {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
object User {
|
||||
fun main() {
|
||||
val t = Test("name")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user