New J2K: Fix existing test data
This commit is contained in:
committed by
Ilya Kirillov
parent
76b73542d9
commit
b13f7431f2
@@ -1,5 +1,5 @@
|
|||||||
class Test {
|
class Test {
|
||||||
var someRunnable: Runnable? = object : Runnable {
|
var someRunnable: Runnable = object : Runnable {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
this.run()
|
this.run()
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,7 @@ class Test2 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Handler {
|
class Handler {
|
||||||
fun postDelayed(r: Runnable?, time: Long) {}
|
fun postDelayed(r: Runnable, time: Long) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Test3 {
|
class Test3 {
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
myArray[myLibrary!!.calculateIndex(100)]
|
|
||||||
@@ -1 +1 @@
|
|||||||
val d2: Array<IntArray> = arrayOf()
|
val d2: Array<IntArray?> = arrayOf()
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
val d2: Array<IntArray?> = arrayOfNulls(5)
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
val d3: Array<Array<IntArray>?> = Array(5) { arrayOfNulls<IntArray?>(5) }
|
val d3 = Array<Array<IntArray>>(5) { arrayOfNulls(5) }
|
||||||
@@ -1 +1 @@
|
|||||||
val ss: Array<Array<String?>?> = Array(5) { arrayOfNulls<String>(5) }
|
val ss = Array<Array<String>>(5) { arrayOfNulls(5) }
|
||||||
@@ -1 +1 @@
|
|||||||
val sss: Array<Array<Array<String?>?>?> = Array(5) { Array(5) { arrayOfNulls<String>(5) } }
|
val sss = Array(5) { Array<Array<String>>(5) { arrayOfNulls(5) } }
|
||||||
+3
-3
@@ -2,9 +2,9 @@
|
|||||||
// !specifyLocalVariableTypeByDefault: true
|
// !specifyLocalVariableTypeByDefault: true
|
||||||
|
|
||||||
internal class Foo {
|
internal class Foo {
|
||||||
fun foo(o: HashSet<*>?) {
|
fun foo(o: HashSet<*>) {
|
||||||
val o2: HashSet<*>? = o
|
val o2: HashSet<*> = o
|
||||||
var foo: Int = 0
|
var foo: Int = 0
|
||||||
foo = o2!!.size
|
foo = o2.size
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
internal class Foo {
|
|
||||||
fun foo(o: HashSet<*>?) {
|
|
||||||
var foo = 0
|
|
||||||
foo = o!!.size
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
class Short(s: String?) {
|
||||||
|
companion object {
|
||||||
|
fun valueOf(value: String): Short {
|
||||||
|
return Short(value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal object Test {
|
||||||
|
fun test() {
|
||||||
|
Short.valueOf("1")
|
||||||
|
test.Short.valueOf("1")
|
||||||
|
java.lang.Short.valueOf("1")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
internal class T {
|
|
||||||
var a: String? = "abc"
|
|
||||||
var b = 10
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
internal class T {
|
|
||||||
var a: String? = null
|
|
||||||
var b: String? = null
|
|
||||||
var c: String? = "abc"
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
internal object Util {
|
||||||
|
const val publicStr = ""
|
||||||
|
internal const val protectedStr = ""
|
||||||
|
const val packageStr = ""
|
||||||
|
private const val privateStr = ""
|
||||||
|
fun publicMethod() {}
|
||||||
|
internal fun protectedMethod() {}
|
||||||
|
fun packageMethod() {}
|
||||||
|
private fun privateMethod() {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
// ERROR: Class 'A' is not abstract and does not implement abstract member public abstract fun run(): Unit defined in java.lang.Runnable
|
||||||
|
package foo
|
||||||
|
|
||||||
|
// we use package 'foo'
|
||||||
|
|
||||||
|
// imports:
|
||||||
|
import java.util.ArrayList
|
||||||
|
|
||||||
|
// we need ArrayList
|
||||||
|
// let's declare a class:
|
||||||
|
internal class A /* just a sample name*/ : Runnable /* let's implement Runnable */ {
|
||||||
|
fun foo /* again a sample name */(p: Int /* parameter p */, c: Char /* parameter c */) {
|
||||||
|
// let's print something:
|
||||||
|
println("1") // print 1
|
||||||
|
println("2") // print 2
|
||||||
|
|
||||||
|
println("3") // print 3
|
||||||
|
|
||||||
|
// end of printing
|
||||||
|
|
||||||
|
if (p > 0) { // do this only when p > 0
|
||||||
|
// we print 4 and return
|
||||||
|
println("3")
|
||||||
|
return // do not continue
|
||||||
|
}
|
||||||
|
|
||||||
|
// some code to be added
|
||||||
|
}
|
||||||
|
} // end of class A
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
// ERROR: A 'return' expression required in a function with a block body ('{...}')
|
||||||
|
// ERROR: A 'return' expression required in a function with a block body ('{...}')
|
||||||
|
package foo
|
||||||
|
|
||||||
|
internal class A {
|
||||||
|
private/*it's private*/ val field = 0
|
||||||
|
fun /* nothing to return */ foo(/* no parameters at all */) {
|
||||||
|
// let declare a variable
|
||||||
|
// with 2 comments before
|
||||||
|
val /*int*/ a /* it's a */ = 2 /* it's 2 */ + 1 /* it's 1 */ // variable a declared
|
||||||
|
} // end of foo
|
||||||
|
|
||||||
|
fun /* we return int*/ foo( /*int*/ p: Int/* parameter p */): Int { /* body is empty */
|
||||||
|
}
|
||||||
|
|
||||||
|
/*it's public*/ fun foo(s: String?): Char {}
|
||||||
|
protected/*it's protected*/ fun foo(c: Char) {}
|
||||||
|
/**
|
||||||
|
* Method description.
|
||||||
|
* Multi-line method description.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param param1 param1 description
|
||||||
|
* @param param2 param2 description
|
||||||
|
*
|
||||||
|
* @param param3 param3 description
|
||||||
|
*/
|
||||||
|
fun foo(param1: String?, param2: String?, param3: String?) {}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
/*it's public*/const /*and static*/ val/*and final*/ C = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1 +0,0 @@
|
|||||||
if (a!!.isEmpty()) 0 else 1
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// ERROR: Property must be initialized or be abstract
|
// ERROR: Property must be initialized or be abstract
|
||||||
class Test {
|
class Test {
|
||||||
private val s: String?
|
private val s: String
|
||||||
internal var b = false
|
internal var b = false
|
||||||
internal var d = 0.0
|
internal var d = 0.0
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ class Test {
|
|||||||
b = true
|
b = true
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(s: String?) {
|
constructor(s: String) {
|
||||||
this.s = s
|
this.s = s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ internal class Customer(val firstName: String, val lastName: String) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal class CustomerBuilder {
|
internal class CustomerBuilder {
|
||||||
|
var _firstName = "Homer"
|
||||||
var _firstName = "Homer"
|
var _firstName = "Homer"
|
||||||
var _lastName = "Simpson"
|
var _lastName = "Simpson"
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package org.test.customer
|
package org.test.customer
|
||||||
|
|
||||||
internal class Customer(val firstName: String?, val lastName: String?) {
|
internal class Customer(val firstName: String, val lastName: String) {
|
||||||
init {
|
init {
|
||||||
doSmthBefore()
|
doSmthBefore()
|
||||||
doSmthAfter()
|
doSmthAfter()
|
||||||
@@ -12,14 +12,14 @@ internal class Customer(val firstName: String?, val lastName: String?) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal class CustomerBuilder {
|
internal class CustomerBuilder {
|
||||||
var _firstName: String? = "Homer"
|
var _firstName = "Homer"
|
||||||
var _lastName: String? = "Simpson"
|
var _lastName = "Simpson"
|
||||||
fun WithFirstName(firstName: String?): CustomerBuilder {
|
fun WithFirstName(firstName: String): CustomerBuilder {
|
||||||
_firstName = firstName
|
_firstName = firstName
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
fun WithLastName(lastName: String?): CustomerBuilder {
|
fun WithLastName(lastName: String): CustomerBuilder {
|
||||||
_lastName = lastName
|
_lastName = lastName
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
internal class C(x: String?) {
|
internal class C(x: String) {
|
||||||
var x: Any?
|
var x: Any
|
||||||
|
|
||||||
init {
|
init {
|
||||||
this.x = x
|
this.x = x
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
class Identifier<T> {
|
class Identifier<T> {
|
||||||
val name: T?
|
val name: T
|
||||||
private var myHasDollar = false
|
private var myHasDollar = false
|
||||||
private var myNullable = true
|
private var myNullable = true
|
||||||
|
|
||||||
constructor(name: T?) {
|
constructor(name: T) {
|
||||||
this.name = name
|
this.name = name
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(name: T?, isNullable: Boolean) {
|
constructor(name: T, isNullable: Boolean) {
|
||||||
this.name = name
|
this.name = name
|
||||||
myNullable = isNullable
|
myNullable = isNullable
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(name: T?, hasDollar: Boolean, isNullable: Boolean) {
|
constructor(name: T, hasDollar: Boolean, isNullable: Boolean) {
|
||||||
this.name = name
|
this.name = name
|
||||||
myHasDollar = hasDollar
|
myHasDollar = hasDollar
|
||||||
myNullable = isNullable
|
myNullable = isNullable
|
||||||
@@ -22,7 +22,7 @@ class Identifier<T> {
|
|||||||
object User {
|
object User {
|
||||||
fun main() {
|
fun main() {
|
||||||
val i1: Identifier<*> = Identifier<String?>("name", false, true)
|
val i1: Identifier<*> = Identifier<String?>("name", false, true)
|
||||||
val i2 = Identifier<String?>("name", false)
|
val i2 = Identifier("name", false)
|
||||||
val i3 = Identifier<String?>("name")
|
val i3 = Identifier("name")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,19 @@
|
|||||||
// ERROR: Property must be initialized or be abstract
|
// ERROR: Property must be initialized or be abstract
|
||||||
class Identifier {
|
class Identifier {
|
||||||
val name: String?
|
val name: String
|
||||||
private var myHasDollar = false
|
private var myHasDollar = false
|
||||||
private var myNullable = true
|
private var myNullable = true
|
||||||
|
|
||||||
constructor(name: String?) {
|
constructor(name: String) {
|
||||||
this.name = name
|
this.name = name
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(name: String?, isNullable: Boolean) {
|
constructor(name: String, isNullable: Boolean) {
|
||||||
this.name = name
|
this.name = name
|
||||||
myNullable = isNullable
|
myNullable = isNullable
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(name: String?, hasDollar: Boolean, isNullable: Boolean) {
|
constructor(name: String, hasDollar: Boolean, isNullable: Boolean) {
|
||||||
this.name = name
|
this.name = name
|
||||||
myHasDollar = hasDollar
|
myHasDollar = hasDollar
|
||||||
myNullable = isNullable
|
myNullable = isNullable
|
||||||
|
|||||||
+3
-1
@@ -1,6 +1,8 @@
|
|||||||
internal class A @JvmOverloads constructor(nested: Nested? = Nested(Nested.FIELD)) {
|
internal class A @JvmOverloads constructor(nested: Nested = Nested(Nested.FIELD)) {
|
||||||
|
|
||||||
internal class Nested(p: Int) {
|
internal class Nested(p: Int) {
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
const val FIELD = 0
|
const val FIELD = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
internal class A @JvmOverloads constructor(nested: Nested? = Nested(Nested.FIELD)) {
|
internal class A @JvmOverloads constructor(nested: Nested = Nested(Nested.FIELD)) {
|
||||||
internal class Nested(p: Int) {
|
internal class Nested(p: Int) {
|
||||||
companion object {
|
companion object {
|
||||||
const val FIELD = 0
|
const val FIELD = 0
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package pack
|
package pack
|
||||||
|
|
||||||
internal class A @JvmOverloads constructor(nested: Nested? = Nested(Nested.FIELD)) {
|
internal class A @JvmOverloads constructor(nested: Nested = Nested(Nested.FIELD)) {
|
||||||
internal class Nested(p: Int) {
|
internal class Nested(p: Int) {
|
||||||
companion object {
|
companion object {
|
||||||
const val FIELD = 0
|
const val FIELD = 0
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package pack
|
package pack
|
||||||
|
|
||||||
internal class A @JvmOverloads constructor(nested: Nested? = Nested(Nested.FIELD)) {
|
internal class A @JvmOverloads constructor(nested: Nested = Nested(Nested.FIELD)) {
|
||||||
internal class Nested(p: Int) {
|
internal class Nested(p: Int) {
|
||||||
companion object {
|
companion object {
|
||||||
const val FIELD = 0
|
const val FIELD = 0
|
||||||
|
|||||||
+2
-2
@@ -1,11 +1,11 @@
|
|||||||
internal class A {
|
internal class A {
|
||||||
private var s: String? = ""
|
private var s = ""
|
||||||
private var x = 0
|
private var x = 0
|
||||||
|
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
@JvmOverloads
|
@JvmOverloads
|
||||||
constructor(p: Int, s: String?, x: Int = 1) {
|
constructor(p: Int, s: String, x: Int = 1) {
|
||||||
this.s = s
|
this.s = s
|
||||||
this.x = x
|
this.x = x
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
internal class A() {
|
internal class A() {
|
||||||
private var s: String? = ""
|
private var s = ""
|
||||||
private var x = 0
|
private var x = 0
|
||||||
|
|
||||||
@JvmOverloads
|
@JvmOverloads
|
||||||
constructor(p: Int, s: String?, x: Int = 1) : this() {
|
constructor(p: Int, s: String, x: Int = 1) : this() {
|
||||||
this.s = s
|
this.s = s
|
||||||
this.x = x
|
this.x = x
|
||||||
}
|
}
|
||||||
|
|||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
// 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,6 +1,6 @@
|
|||||||
// ERROR: Property must be initialized or be abstract
|
// ERROR: Property must be initialized or be abstract
|
||||||
class Test {
|
class Test {
|
||||||
private val myName: String?
|
private val myName: String
|
||||||
internal var a = false
|
internal var a = false
|
||||||
internal var b = 0.0
|
internal var b = 0.0
|
||||||
internal var c = 0f
|
internal var c = 0f
|
||||||
@@ -11,13 +11,13 @@ class Test {
|
|||||||
|
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
constructor(name: String?) {
|
constructor(name: String) {
|
||||||
myName = foo(name)
|
myName = foo(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
internal fun foo(n: String?): String {
|
internal fun foo(n: String): String {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
class C {
|
||||||
|
var x = ""
|
||||||
|
internal
|
||||||
|
set(x) {
|
||||||
|
println("setter invoked")
|
||||||
|
if (other != null) {
|
||||||
|
other!!.x = x
|
||||||
|
}
|
||||||
|
field = x
|
||||||
|
}
|
||||||
|
internal var other: C? = null
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
class Test(var id: String?, val name: String?, val age: Int) {
|
class Test(var id: String, val name: String, val age: Int) {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
println(age)
|
println(age)
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
internal annotation class TestAnnotation
|
internal annotation class TestAnnotation
|
||||||
|
|
||||||
class Test(@field:TestAnnotation @set:TestAnnotation @get:TestAnnotation @param:TestAnnotation var arg: String?)
|
class Test(@field:TestAnnotation @set:TestAnnotation @get:TestAnnotation @param:TestAnnotation var arg: String)
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
class C {
|
class C {
|
||||||
private var myX: String? = ""
|
private var myX = ""
|
||||||
|
|
||||||
var x: String?
|
var x: String
|
||||||
get() {
|
get() {
|
||||||
println("getter invoked")
|
println("getter invoked")
|
||||||
return myX
|
return myX
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
class C {
|
class C {
|
||||||
private var x: String? = ""
|
private var x = ""
|
||||||
|
|
||||||
fun getX(): String? {
|
fun getX(): String {
|
||||||
println("getter invoked")
|
println("getter invoked")
|
||||||
return x
|
return x
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setX(x: String?) {
|
fun setX(x: String) {
|
||||||
this.x = x
|
this.x = x
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
class C {
|
class C {
|
||||||
var x: String? = ""
|
var x = ""
|
||||||
|
|
||||||
fun getX(): String? {
|
fun getX(): String {
|
||||||
println("getter invoked")
|
println("getter invoked")
|
||||||
return x
|
return x
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setX(x: String?) {
|
fun setX(x: String) {
|
||||||
this.x = x
|
this.x = x
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class C {
|
class C {
|
||||||
var x: String? = ""
|
var x = ""
|
||||||
get() {
|
get() {
|
||||||
println("getter invoked")
|
println("getter invoked")
|
||||||
return field
|
return field
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
class C {
|
|
||||||
var x: String? = ""
|
|
||||||
get() {
|
|
||||||
println("getter invoked")
|
|
||||||
return field
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +1,16 @@
|
|||||||
internal class A {
|
internal class A {
|
||||||
private val list1: ArrayList<String?> = ArrayList()
|
private val list1: ArrayList<String> = ArrayList()
|
||||||
private val list2: MutableList<String?> = ArrayList()
|
private val list2: MutableList<String> = ArrayList()
|
||||||
private val myList3: MutableList<String?> = ArrayList()
|
private val myList3: MutableList<String> = ArrayList()
|
||||||
|
fun getList1(): List<String> {
|
||||||
fun getList1(): List<String?>? {
|
|
||||||
return list1
|
return list1
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getList2(): List<String?>? {
|
fun getList2(): List<String> {
|
||||||
return list2
|
return list2
|
||||||
}
|
}
|
||||||
|
|
||||||
val list3: List<String?>?
|
val list3: List<String>
|
||||||
get() = myList3
|
get() = myList3
|
||||||
|
|
||||||
fun foo() {
|
fun foo() {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class C {
|
class C {
|
||||||
private var myX: String? = ""
|
private var myX = ""
|
||||||
|
|
||||||
var x: String?
|
var x: String
|
||||||
get() = myX
|
get() = myX
|
||||||
set(x) {
|
set(x) {
|
||||||
println("setter invoked")
|
println("setter invoked")
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
class C {
|
class C {
|
||||||
private var x: String? = ""
|
private var x = ""
|
||||||
|
|
||||||
fun getX(): String? {
|
fun getX(): String {
|
||||||
return x
|
return x
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setX(x: String?) {
|
fun setX(x: String) {
|
||||||
println("setter invoked")
|
println("setter invoked")
|
||||||
this.x = x
|
this.x = x
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class C {
|
class C {
|
||||||
var x: String? = ""
|
var x = ""
|
||||||
set(value) {
|
set(value) {
|
||||||
println("setter invoked")
|
println("setter invoked")
|
||||||
field = value
|
field = value
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class C {
|
class C {
|
||||||
var x: String? = ""
|
var x = ""
|
||||||
set(x) {
|
set(x) {
|
||||||
println("setter invoked")
|
println("setter invoked")
|
||||||
field = x
|
field = x
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class C {
|
class C {
|
||||||
var x: String? = ""
|
var x = ""
|
||||||
set(x) {
|
set(x) {
|
||||||
println("old value: " + this.x)
|
println("old value: " + this.x)
|
||||||
field = x
|
field = x
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
internal class CtorComment {
|
internal class CtorComment {
|
||||||
var myA: String?
|
var myA: String
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This constructor is especially useful
|
* This constructor is especially useful
|
||||||
@@ -9,7 +9,7 @@ internal class CtorComment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal class CtorComment2
|
||||||
/**
|
/**
|
||||||
* This constructor is especially useful
|
* This constructor is especially useful
|
||||||
*/
|
*/
|
||||||
internal class CtorComment2
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
package demo
|
||||||
|
|
||||||
|
internal enum class Color(val code: Int)
|
||||||
+1
-1
@@ -23,7 +23,7 @@ internal enum class EE {
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal class X {
|
internal class X {
|
||||||
fun foo(i1: I?, i2: I?, s1: String?, s2: String?, c1: C?, c2: C?, i: Int, o1: O?, o2: O?, e1: E?, e2: E?, bb1: BB?, bb2: BB?, arr1: IntArray, arr2: IntArray, ee1: EE?, ee2: EE?) {
|
fun foo(i1: I?, i2: I?, s1: String, s2: String, c1: C, c2: C, i: Int, o1: O, o2: O, e1: E, e2: E, bb1: BB, bb2: BB, arr1: IntArray, arr2: IntArray, ee1: EE?, ee2: EE) {
|
||||||
if (i1 === i2) return
|
if (i1 === i2) return
|
||||||
if (s1 === s2) return
|
if (s1 === s2) return
|
||||||
if (c1 == c2) return
|
if (c1 == c2) return
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
internal class C {
|
|
||||||
fun foo1(s1: String?, s2: String?): Boolean {
|
|
||||||
return s1 == s2
|
|
||||||
}
|
|
||||||
|
|
||||||
fun foo2(s1: String?, s2: String?): Boolean {
|
|
||||||
return s1 != s2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
internal class C {
|
|
||||||
fun equals(c: C?): Boolean {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
fun foo(c1: C, c2: C?): Boolean {
|
|
||||||
return c1.equals(c2)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
internal class C {
|
|
||||||
fun foo(s1: String?, s2: String?, s3: String?, s4: String?): Boolean {
|
|
||||||
return s1 == s2 == (s3 != s4)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
import java.util.Objects
|
||||||
|
|
||||||
internal interface I
|
internal interface I
|
||||||
|
|
||||||
internal class C {
|
internal class C {
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
internal class A {
|
||||||
|
private var i = byte.toInt()
|
||||||
|
|
||||||
|
fun foo() {
|
||||||
|
i = 10
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
|
||||||
|
val byte: Byte
|
||||||
|
get() = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
class Init {
|
class Init {
|
||||||
var field1: String?
|
var field1: String
|
||||||
var field2: String? = null
|
var field2: String? = null
|
||||||
|
|
||||||
var field3: Int
|
var field3: Int
|
||||||
|
|||||||
+14
-15
@@ -1,21 +1,20 @@
|
|||||||
import java.util.ArrayList
|
import java.util.*
|
||||||
|
|
||||||
internal class A {
|
internal class A {
|
||||||
private val field1: List<String?> = ArrayList()
|
private val field1: List<String> = ArrayList()
|
||||||
val field2: List<String?> = ArrayList()
|
val field2: List<String> = ArrayList()
|
||||||
val field3 = 0
|
val field3 = 0
|
||||||
protected val field4 = 0
|
protected val field4 = 0
|
||||||
private var field5: List<String?>? = ArrayList()
|
private var field5: List<String> = ArrayList()
|
||||||
var field6: List<String?>? = ArrayList()
|
var field6: List<String> = ArrayList()
|
||||||
private var field7 = 0
|
private var field7 = 0
|
||||||
var field8 = 0
|
var field8 = 0
|
||||||
private var field9: String? = "a"
|
private var field9: String? = "a"
|
||||||
private var field10: String? = foo()
|
private var field10: String? = foo()
|
||||||
private val anonymous: I = object : I {
|
private val anonymous: I = object : I {}
|
||||||
}
|
var anonymous2: I = object : I {}
|
||||||
var anonymous2: I? = object : I {}
|
private var anonymous3: I = object : I {}
|
||||||
private var anonymous3: I? = object : I {}
|
private var iimpl = anonymous
|
||||||
private var iimpl: I? = anonymous
|
|
||||||
fun foo(): String {
|
fun foo(): String {
|
||||||
return "x"
|
return "x"
|
||||||
}
|
}
|
||||||
@@ -30,17 +29,17 @@ internal class A {
|
|||||||
|
|
||||||
internal interface I
|
internal interface I
|
||||||
|
|
||||||
fun testAnonymousObject(i: Any?) {
|
fun testAnonymousObject(i: Any) {
|
||||||
if (true) {
|
if (true) {
|
||||||
iimpl = i as I?
|
iimpl = i as I
|
||||||
} else if (true) {
|
} else if (true) {
|
||||||
anonymous3 = i as I?
|
anonymous3 = i as I
|
||||||
}
|
}
|
||||||
val anonymousLocal1: I = object : I {}
|
val anonymousLocal1: I = object : I {}
|
||||||
var anonymousLocal2: I? = object : I {}
|
var anonymousLocal2: I = object : I {}
|
||||||
val iimpl = anonymousLocal1
|
val iimpl = anonymousLocal1
|
||||||
if (true) {
|
if (true) {
|
||||||
anonymousLocal2 = i as I?
|
anonymousLocal2 = i as I
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
internal class Foo(a: Int, b: Int)
|
internal class Foo(a: Int, b: Int)
|
||||||
|
|
||||||
internal class C {
|
internal class C {
|
||||||
var f: Foo? = Foo(1, 2)
|
var f = Foo(1, 2)
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
internal class C {
|
internal class C {
|
||||||
fun foo1(list: MutableList<String?>) {
|
fun foo1(list: MutableList<String>) {
|
||||||
for (i in list.indices) {
|
for (i in list.indices) {
|
||||||
list[i] = "a"
|
list[i] = "a"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun foo2(list: ArrayList<String?>) {
|
fun foo2(list: ArrayList<String>) {
|
||||||
for (i in list.indices) {
|
for (i in list.indices) {
|
||||||
list[i] = "a"
|
list[i] = "a"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
|
import java.util.ArrayList
|
||||||
|
|
||||||
internal class C {
|
internal class C {
|
||||||
fun foo(list: MutableList<String?>) {
|
fun foo(list: MutableList<String>) {
|
||||||
for (i in list.indices) {
|
for (i in list.indices) {
|
||||||
list[i] = "a"
|
list[i] = "a"
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
internal object Test {
|
internal object Test {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
val resultMap: Map<String?, String?> = HashMap()
|
val resultMap: Map<String, String> = HashMap()
|
||||||
for ((key, type) in resultMap) {
|
for ((key, type) in resultMap) {
|
||||||
if (key == "myKey") {
|
if (key == "myKey") {
|
||||||
println(type)
|
println(type)
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
internal class F {
|
||||||
|
var i = 0
|
||||||
|
|
||||||
|
fun f1() {}
|
||||||
|
|
||||||
|
|
||||||
|
fun f2() {}
|
||||||
|
|
||||||
|
fun f3() {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
internal class F {
|
||||||
|
var i = 0
|
||||||
|
|
||||||
|
//c1
|
||||||
|
|
||||||
|
/*c2*/
|
||||||
|
|
||||||
|
fun f1() {}
|
||||||
|
|
||||||
|
|
||||||
|
//c3
|
||||||
|
|
||||||
|
|
||||||
|
//c4
|
||||||
|
|
||||||
|
fun f2() {}
|
||||||
|
|
||||||
|
fun f3() {}
|
||||||
|
|
||||||
|
//c5
|
||||||
|
}
|
||||||
+31
@@ -0,0 +1,31 @@
|
|||||||
|
internal class F {
|
||||||
|
|
||||||
|
|
||||||
|
//c3
|
||||||
|
|
||||||
|
|
||||||
|
//c4
|
||||||
|
|
||||||
|
fun f2() {}
|
||||||
|
|
||||||
|
fun f3() {}
|
||||||
|
|
||||||
|
fun f4() {}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
|
||||||
|
//c1
|
||||||
|
|
||||||
|
/*c2*/
|
||||||
|
|
||||||
|
fun f1() {}
|
||||||
|
var i = 0
|
||||||
|
|
||||||
|
//c5
|
||||||
|
|
||||||
|
fun f5() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
//c6
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
internal object F {
|
||||||
|
var i = 0
|
||||||
|
|
||||||
|
//c1
|
||||||
|
|
||||||
|
/*c2*/
|
||||||
|
|
||||||
|
fun f1() {}
|
||||||
|
|
||||||
|
|
||||||
|
//c3
|
||||||
|
|
||||||
|
|
||||||
|
//c4
|
||||||
|
|
||||||
|
fun f2() {}
|
||||||
|
|
||||||
|
fun f3() {}
|
||||||
|
|
||||||
|
//c5
|
||||||
|
}
|
||||||
+1
-1
@@ -2,7 +2,7 @@ package demo
|
|||||||
|
|
||||||
internal class Test {
|
internal class Test {
|
||||||
fun test(vararg args: Any?) {
|
fun test(vararg args: Any?) {
|
||||||
var args: Any? = args
|
var argsx = args
|
||||||
args = arrayOf(1, 2, 3)
|
args = arrayOf(1, 2, 3)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
internal open class Base<T>(name: T?)
|
internal open class Base<T>(name: T?)
|
||||||
|
|
||||||
internal class One<T, K>(name: T?, private val mySecond: K?) : Base<T?>(name)
|
internal class One<T, K>(name: T?, private val mySecond: K) : Base<T>(name)
|
||||||
Vendored
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
internal open class Base(name: String?)
|
internal open class Base(name: String)
|
||||||
|
|
||||||
internal class One(name: String?, private val mySecond: String?) : Base(name)
|
internal class One(name: String, private val mySecond: String) : Base(name)
|
||||||
@@ -1 +0,0 @@
|
|||||||
c!!.getType().getName() is String
|
|
||||||
+33
@@ -0,0 +1,33 @@
|
|||||||
|
// ERROR: Modifier 'protected' is not applicable inside 'object'
|
||||||
|
internal object Outer {
|
||||||
|
fun foo() {
|
||||||
|
val nested1 = Nested1(1)
|
||||||
|
val nested2 = Nested2(2)
|
||||||
|
val nested3 = Nested3(3)
|
||||||
|
val nested4 = Nested4(4)
|
||||||
|
}
|
||||||
|
|
||||||
|
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() {}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1 +0,0 @@
|
|||||||
class AppInfo(internal var mName: String?, internal var mIcon: String?, internal var mLastUpdateTime: Long)
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
class TestBoxedEqEqPrimitive {
|
||||||
|
fun test(value: Double): Boolean {
|
||||||
|
return value == 3.14
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
internal class X(private val list: List<Y?>?) {
|
|
||||||
internal inner class Y
|
|
||||||
}
|
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
package demo
|
package demo
|
||||||
|
|
||||||
internal class Test {
|
internal class Test {
|
||||||
fun putInt(i: Int?) {}
|
fun putInt(i: Int) {}
|
||||||
|
|
||||||
fun test() {
|
fun test() {
|
||||||
val b: Byte = 10
|
val b: Byte = 10
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package demo
|
||||||
|
|
||||||
|
internal class Test {
|
||||||
|
fun putInt(i: Int) {}
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
val i = 10
|
||||||
|
putInt(i)
|
||||||
|
}
|
||||||
|
}
|
||||||
+6
-6
@@ -1,18 +1,18 @@
|
|||||||
class Identifier<T> {
|
class Identifier<T> {
|
||||||
val name: T?
|
val name: T
|
||||||
private var myHasDollar = false
|
private var myHasDollar = false
|
||||||
private var myNullable = true
|
private var myNullable = true
|
||||||
|
|
||||||
constructor(name: T?) {
|
constructor(name: T) {
|
||||||
this.name = name
|
this.name = name
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(name: T?, isNullable: Boolean) {
|
constructor(name: T, isNullable: Boolean) {
|
||||||
this.name = name
|
this.name = name
|
||||||
myNullable = isNullable
|
myNullable = isNullable
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(name: T?, hasDollar: Boolean, isNullable: Boolean) {
|
constructor(name: T, hasDollar: Boolean, isNullable: Boolean) {
|
||||||
this.name = name
|
this.name = name
|
||||||
myHasDollar = hasDollar
|
myHasDollar = hasDollar
|
||||||
myNullable = isNullable
|
myNullable = isNullable
|
||||||
@@ -23,7 +23,7 @@ object User {
|
|||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
val i1: Identifier<*> = Identifier<String?>("name", false, true)
|
val i1: Identifier<*> = Identifier<String?>("name", false, true)
|
||||||
val i2 = Identifier<String?>("name", false)
|
val i2 = Identifier("name", false)
|
||||||
val i3 = Identifier<String?>("name")
|
val i3 = Identifier("name")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package demo
|
||||||
|
|
||||||
|
internal class Test {
|
||||||
|
fun getInteger(i: Int): Int {
|
||||||
|
return i
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
val i = getInteger(10)
|
||||||
|
}
|
||||||
|
}
|
||||||
+5
-5
@@ -1,19 +1,19 @@
|
|||||||
package demo
|
package demo
|
||||||
|
|
||||||
internal class Container {
|
internal class Container {
|
||||||
var myString: String? = "1"
|
var myString = "1"
|
||||||
}
|
}
|
||||||
|
|
||||||
internal object One {
|
internal object One {
|
||||||
var myContainer: Container? = Container()
|
var myContainer = Container()
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class StringContainer(s: String?)
|
internal class StringContainer(s: String?)
|
||||||
|
|
||||||
internal class Test {
|
internal class Test {
|
||||||
fun putString(s: String?) {}
|
fun putString(s: String) {}
|
||||||
fun test() {
|
fun test() {
|
||||||
putString(One.myContainer!!.myString)
|
putString(One.myContainer.myString)
|
||||||
StringContainer(One.myContainer!!.myString)
|
StringContainer(One.myContainer.myString)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
-19
@@ -1,19 +0,0 @@
|
|||||||
package demo
|
|
||||||
|
|
||||||
internal class Container {
|
|
||||||
var myInt = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
internal object One {
|
|
||||||
var myContainer: Container? = Container()
|
|
||||||
}
|
|
||||||
|
|
||||||
internal class IntContainer(i: Int)
|
|
||||||
|
|
||||||
internal class Test {
|
|
||||||
fun putInt(i: Int) {}
|
|
||||||
fun test() {
|
|
||||||
putInt(One.myContainer!!.myInt)
|
|
||||||
IntContainer(One.myContainer!!.myInt)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package demo
|
|
||||||
|
|
||||||
internal class Container {
|
|
||||||
var myInt = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
internal object One {
|
|
||||||
var myContainer: Container? = Container()
|
|
||||||
}
|
|
||||||
|
|
||||||
internal class Test {
|
|
||||||
var b = One.myContainer!!.myInt.toByte()
|
|
||||||
}
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
package demo
|
|
||||||
|
|
||||||
internal class Container {
|
|
||||||
var myInt = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
internal object One {
|
|
||||||
var myContainer: Container? = Container()
|
|
||||||
}
|
|
||||||
|
|
||||||
internal class Test {
|
|
||||||
fun test() {
|
|
||||||
val b = One.myContainer!!.myInt.toByte()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+5
-10
@@ -5,21 +5,16 @@ internal class Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal object One {
|
internal object One {
|
||||||
var myContainer: Container? = Container()
|
var myContainer = Container()
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class Test {
|
internal class Test {
|
||||||
fun test() {
|
fun test() {
|
||||||
if (One.myContainer!!.myBoolean)
|
if (One.myContainer.myBoolean) println("Ok")
|
||||||
println("Ok")
|
val s = if (One.myContainer.myBoolean) "YES" else "NO"
|
||||||
|
while (One.myContainer.myBoolean) println("Ok")
|
||||||
val s = if (One.myContainer!!.myBoolean) "YES" else "NO"
|
|
||||||
|
|
||||||
while (One.myContainer!!.myBoolean)
|
|
||||||
println("Ok")
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
println("Ok")
|
println("Ok")
|
||||||
} while (One.myContainer!!.myBoolean)
|
} while (One.myContainer.myBoolean)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
-23
@@ -1,23 +0,0 @@
|
|||||||
package com.voltvoodoo.saplo4j.model
|
|
||||||
|
|
||||||
import java.io.Serializable
|
|
||||||
|
|
||||||
class Language(protected var code: String?) : Serializable {
|
|
||||||
override fun toString(): String {
|
|
||||||
return code
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal open class Base {
|
|
||||||
internal open fun test() {}
|
|
||||||
override fun toString(): String {
|
|
||||||
return "BASE"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal class Child : Base() {
|
|
||||||
override fun test() {}
|
|
||||||
override fun toString(): String {
|
|
||||||
return "Child"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
import java.util.ArrayList
|
|
||||||
|
|
||||||
internal class A {
|
|
||||||
var list: List<String?>? = ArrayList()
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
//file
|
//file
|
||||||
|
|
||||||
import kotlinApi.KotlinClass;
|
import kotlinApi.KotlinClass;
|
||||||
|
|
||||||
class C {
|
class C {
|
||||||
int foo() {
|
int foo() {
|
||||||
KotlinClass.staticVar = KotlinClass.staticVar * 2;
|
KotlinClass.Companion.getStaticVar()
|
||||||
KotlinClass.Companion.setStaticProperty(KotlinClass.Companion.getStaticVar() + KotlinClass.Companion.getStaticProperty());
|
|
||||||
return KotlinClass.Companion.staticFun(1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
test@ for (i in 0..max) {
|
test@ for (i in 0..max) {
|
||||||
var n: Int = substring!!.length()
|
var n: Int = substring.length()
|
||||||
var j = i
|
var j = i
|
||||||
var k = 0
|
var k = 0
|
||||||
while (n-- != 0) {
|
while (n-- != 0) {
|
||||||
if (searchMe!!.charAt(j++) !== substring!!.charAt(k++)) {
|
if (searchMe.charAt(j++) !== substring.charAt(k++)) {
|
||||||
continue@test
|
continue@test
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -1,10 +1,10 @@
|
|||||||
// ERROR: Unresolved reference: LinkedList
|
// ERROR: Unresolved reference: LinkedList
|
||||||
import java.util.ArrayList
|
import java.util.*
|
||||||
|
|
||||||
class ForEach {
|
class ForEach {
|
||||||
fun test() {
|
fun test() {
|
||||||
val xs: ArrayList<Any?> = ArrayList()
|
val xs: ArrayList<Any?> = ArrayList()
|
||||||
val ys: MutableList<Any?> = LinkedList<Any?>()
|
val ys: MutableList<Any?> = LinkedList<Any>()
|
||||||
for (x in xs) {
|
for (x in xs) {
|
||||||
ys.add(x)
|
ys.add(x)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-4
@@ -1,12 +1,10 @@
|
|||||||
// ERROR: Unresolved reference: LinkedList
|
// ERROR: Unresolved reference: LinkedList
|
||||||
// ERROR: Null can not be a value of a non-null type Any
|
import java.util.*
|
||||||
// ERROR: Null can not be a value of a non-null type Any
|
|
||||||
import java.util.ArrayList
|
|
||||||
|
|
||||||
class Lists {
|
class Lists {
|
||||||
fun test() {
|
fun test() {
|
||||||
val xs: MutableList<Any?> = ArrayList()
|
val xs: MutableList<Any?> = ArrayList()
|
||||||
val ys: MutableList<Any?> = LinkedList<Any?>()
|
val ys: MutableList<Any?> = LinkedList<Any>()
|
||||||
val zs: ArrayList<Any?> = ArrayList()
|
val zs: ArrayList<Any?> = ArrayList()
|
||||||
xs.add(null)
|
xs.add(null)
|
||||||
ys.add(null)
|
ys.add(null)
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
internal class A {
|
||||||
|
private var d1 = 1.0
|
||||||
|
private var d2 = 1.0
|
||||||
|
private val d3 = 1.0
|
||||||
|
private val d4 = 1.0
|
||||||
|
private val d5 = 1.0
|
||||||
|
private val d6 = 1.0
|
||||||
|
private val d7 = Math.sqrt(2.0) - 1
|
||||||
|
private val d8 = 1.0
|
||||||
|
private val d9 = 1.0
|
||||||
|
private val x = 1 / (1.0 + 0)
|
||||||
|
|
||||||
|
fun foo1(d: Double) {}
|
||||||
|
fun foo2(d: Double) {}
|
||||||
|
|
||||||
|
fun bar() {
|
||||||
|
foo1(1.0)
|
||||||
|
foo1(1.0)
|
||||||
|
foo1(1.0)
|
||||||
|
foo2(1.0)
|
||||||
|
d1 = 1.0
|
||||||
|
d2 = 1.0
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
class Exponent {
|
||||||
|
private val doubles = doubleArrayOf(
|
||||||
|
5e5, +5e5, -5e5, 5e+5, 5e-5,
|
||||||
|
5E5, +5E5, -5E5, 5E+5, 5E-5,
|
||||||
|
2.5e5, +2.5e5, -2.5e5, 2.5e+5, 2.5e-5,
|
||||||
|
2.5E5, +2.5E5, -2.5E5, 2.5E+5, 2.5E-5, 5e5, 5e5, 5e5, 5e5,
|
||||||
|
5e-6, 7e+8, 9e-1, 2e+3, 4e5, 6e7
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
class Exponent {
|
||||||
|
private val floats = floatArrayOf(
|
||||||
|
5e5f, +5e5f, -5e5f, 5e+5f, 5e-5f,
|
||||||
|
5E5f, +5E5f, -5E5f, 5E+5f, 5E-5f,
|
||||||
|
2.5e5f, +2.5e5f, -2.5e5f, 2.5e+5f, 2.5e-5f,
|
||||||
|
2.5E5f, +2.5E5f, -2.5E5f, 2.5E+5f, 2.5E-5f,
|
||||||
|
5e5f, 5e5f,
|
||||||
|
5e-6f, 7e+8f, 9e-1f, 2e+3f, 4e5f, 6e7f
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
internal class A {
|
||||||
|
private var f1 = 1.0f
|
||||||
|
private val f2 = 1.0f
|
||||||
|
private val f3 = 1f
|
||||||
|
private var f4 = 1f
|
||||||
|
private val f5 = 1f
|
||||||
|
private val f6 = -1f
|
||||||
|
private val f7 = -1f
|
||||||
|
private val f8 = +1f
|
||||||
|
private val f9 = 1f
|
||||||
|
private val f10 = 1f
|
||||||
|
|
||||||
|
fun foo1(f: Float) {}
|
||||||
|
fun foo2(f: Float) {}
|
||||||
|
|
||||||
|
fun bar() {
|
||||||
|
foo1(1f)
|
||||||
|
foo2(1f)
|
||||||
|
foo1(1f)
|
||||||
|
foo1(1f)
|
||||||
|
foo1(-1f)
|
||||||
|
foo1(-1f)
|
||||||
|
f1 = 1f
|
||||||
|
f4 = 1.0f
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,7 +9,7 @@ internal class A {
|
|||||||
private val l8 = +1L
|
private val l8 = +1L
|
||||||
|
|
||||||
fun foo1(l: Long) {}
|
fun foo1(l: Long) {}
|
||||||
fun foo2(l: Long?) {}
|
fun foo2(l: Long) {}
|
||||||
|
|
||||||
fun bar() {
|
fun bar() {
|
||||||
foo1(1)
|
foo1(1)
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
class A {
|
|
||||||
var a: String? = "\u003f0123"
|
|
||||||
var b: String? = "\u00490123"
|
|
||||||
var c: String? = "\u00ff0123"
|
|
||||||
var d: String? = "\u0000Text"
|
|
||||||
var f: String? = "\u00009"
|
|
||||||
}
|
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
package demo
|
package demo
|
||||||
|
|
||||||
internal class Map {
|
internal class Map {
|
||||||
fun <K, V> put(k: K?, v: V?) {}
|
fun <K, V> put(k: K?, v: V) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class U {
|
internal class U {
|
||||||
fun test() {
|
fun test() {
|
||||||
val m = Map()
|
val m = Map()
|
||||||
m.put<String?, Int?>(null, 10)
|
m.put<String, Int>(null, 10)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
import java.util.ArrayList
|
import java.util.*
|
||||||
|
|
||||||
internal class A {
|
internal class A {
|
||||||
fun createCollection(): MutableCollection<String?> {
|
fun createCollection(): MutableCollection<String> {
|
||||||
return ArrayList()
|
return ArrayList()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun foo(): Collection<String?> {
|
fun foo(): Collection<String> {
|
||||||
val collection = createCollection()
|
val collection = createCollection()
|
||||||
collection.add("a")
|
collection.add("a")
|
||||||
return collection
|
return collection
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
import java.util.ArrayList
|
import java.util.*
|
||||||
|
|
||||||
internal class A {
|
internal class A {
|
||||||
private val collection: MutableCollection<String?>?
|
private val collection: MutableCollection<String>
|
||||||
|
|
||||||
init {
|
init {
|
||||||
collection = createCollection()
|
collection = createCollection()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun createCollection(): MutableCollection<String?> {
|
fun createCollection(): MutableCollection<String> {
|
||||||
return ArrayList()
|
return ArrayList()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun foo() {
|
fun foo() {
|
||||||
collection!!.add("1")
|
collection.add("1")
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getCollection(): Collection<String?>? {
|
fun getCollection(): Collection<String> {
|
||||||
return collection
|
return collection
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
class TestMutableCollection {
|
class TestMutableCollection {
|
||||||
val list: MutableList<String?> = ArrayList()
|
val list: MutableList<String> = ArrayList()
|
||||||
|
|
||||||
fun test() {
|
fun test() {
|
||||||
val it = list.iterator()
|
val it = list.iterator()
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
internal class User {
|
internal class User {
|
||||||
fun main() {
|
fun main() {
|
||||||
val list: List<String?> = ArrayList()
|
val list: List<String> = ArrayList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
package org.test
|
package org.test
|
||||||
|
|
||||||
|
import java.util.ArrayList
|
||||||
|
|
||||||
internal class Member
|
internal class Member
|
||||||
|
|
||||||
internal class User {
|
internal class User {
|
||||||
fun main() {
|
fun main() {
|
||||||
val members: MutableList<Member?> = ArrayList()
|
val members: MutableList<Member> = ArrayList()
|
||||||
members.add(Member())
|
members.add(Member())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
class Test {
|
||||||
|
private var myProp: String? = null
|
||||||
|
private var myIntProp: Int? = null
|
||||||
|
fun onCreate() {
|
||||||
|
myProp = ""
|
||||||
|
myIntProp = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test1() {
|
||||||
|
foo1(myProp!!)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test2() {
|
||||||
|
foo2(myProp)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test3() {
|
||||||
|
foo3(myProp)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test4() {
|
||||||
|
myProp!![myIntProp!!]
|
||||||
|
println(myProp)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test5() {
|
||||||
|
val b = "aaa" == myProp
|
||||||
|
val s = "aaa$myProp"
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test6() {
|
||||||
|
myProp!!.compareTo(myProp!!, ignoreCase = true)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test7() {
|
||||||
|
val list: MutableList<Int> = ArrayList()
|
||||||
|
list.remove(myIntProp!!)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun foo1(s: String) {}
|
||||||
|
fun foo2(s: String?) {}
|
||||||
|
fun foo3(s: String?) {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
class TestJava {
|
||||||
|
private var notNullInitializerFieldNullableUsage: String? = "aaa"
|
||||||
|
private var notNullInitializerFieldNotNullUsage = "aaa"
|
||||||
|
private var nullInitializerFieldNullableUsage: String? = null
|
||||||
|
private var nullInitializerFieldNotNullUsage: String? = null
|
||||||
|
fun testNotNull(obj: Any?) {
|
||||||
|
if (true) {
|
||||||
|
notNullInitializerFieldNullableUsage = obj as String?
|
||||||
|
notNullInitializerFieldNotNullUsage = "str"
|
||||||
|
notNullInitializerFieldNullableUsage!![1]
|
||||||
|
notNullInitializerFieldNotNullUsage[1]
|
||||||
|
} else {
|
||||||
|
nullInitializerFieldNullableUsage = obj as String?
|
||||||
|
nullInitializerFieldNotNullUsage = "str"
|
||||||
|
nullInitializerFieldNullableUsage!![1]
|
||||||
|
nullInitializerFieldNotNullUsage!![1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+2
-4
@@ -1,5 +1,3 @@
|
|||||||
// ERROR: Type mismatch: inferred type is Any? but Any was expected
|
|
||||||
// ERROR: Type mismatch: inferred type is Any? but Any was expected
|
|
||||||
internal class A {
|
internal class A {
|
||||||
@JvmOverloads
|
@JvmOverloads
|
||||||
fun foo(s: String? = null): Any {
|
fun foo(s: String? = null): Any {
|
||||||
@@ -13,7 +11,7 @@ internal class A {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun bar(): Any {
|
fun bar(): Any {
|
||||||
return bar(null)
|
return bar(null)!!
|
||||||
}
|
}
|
||||||
|
|
||||||
fun bar1(s: String?): Any? {
|
fun bar1(s: String?): Any? {
|
||||||
@@ -22,7 +20,7 @@ internal class A {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun bar1(): Any {
|
fun bar1(): Any {
|
||||||
return bar1(null)
|
return bar1(null)!!
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated("")
|
@Deprecated("")
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user