Converter:

Omit Unit return type
Refactor handling of Unit type: extract separate object UnitType
This commit is contained in:
Pavel V. Talanov
2013-11-19 13:50:03 +04:00
parent 82b19499e3
commit 21bc2887d2
186 changed files with 253 additions and 245 deletions
+10 -7
View File
@@ -18,6 +18,7 @@ package org.jetbrains.jet.j2k.ast
import org.jetbrains.jet.j2k.ast.types.Type
import java.util.ArrayList
import org.jetbrains.jet.j2k.ast.types.isUnit
public open class Function(val name: Identifier,
val docComments: List<Node>,
@@ -45,7 +46,7 @@ public open class Function(val name: Identifier,
return ""
}
open fun modifiersToKotlin(): String {
private fun modifiersToKotlin(): String {
val modifierList = ArrayList<Modifier>()
val accessModifier = accessModifier()
if (accessModifier != null) {
@@ -74,13 +75,15 @@ public open class Function(val name: Identifier,
return modifierList.toKotlin()
}
private fun returnTypeToKotlin() = if (!`type`.isUnit()) " : " + `type`.toKotlin() + " " else " "
public override fun toKotlin(): String {
return docComments.toKotlin("\n", "", "\n") +
modifiersToKotlin() +
"fun " + name.toKotlin() +
typeParametersToKotlin() +
"(" + params.toKotlin() + ") : " +
`type`.toKotlin() + " " + typeParameterWhereToKotlin() +
block?.toKotlin()
modifiersToKotlin() +
"fun ${name.toKotlin()}${typeParametersToKotlin()}" +
"(${params.toKotlin()})" +
returnTypeToKotlin() +
typeParameterWhereToKotlin() +
block?.toKotlin()
}
}
@@ -20,6 +20,7 @@ import org.jetbrains.jet.j2k.ast.Element
import org.jetbrains.jet.j2k.Converter
public fun Type.isPrimitive(): Boolean = this is PrimitiveType
public fun Type.isUnit(): Boolean = this == UnitType
public abstract class MayBeNullableType(nullable: Boolean, val converter: Converter): Type {
override public val nullable: Boolean = !converter.settings.forceNotNullTypes && nullable
@@ -30,6 +31,10 @@ public trait NotNullType : Type {
get() = false
}
public object UnitType: NotNullType {
override fun toKotlin() = "Unit"
}
public trait Type : Element {
public val nullable: Boolean
@@ -38,7 +38,7 @@ public open class TypeVisitor(private val myConverter: Converter) : PsiTypeVisit
public override fun visitPrimitiveType(primitiveType: PsiPrimitiveType?): Type {
val name: String = primitiveType?.getCanonicalText()!!
if (name == "void") {
myResult = PrimitiveType(Identifier("Unit"))
myResult = UnitType
}
else if (PRIMITIVE_TYPES_NAMES.contains(name)) {
myResult = PrimitiveType(Identifier(StringUtil.capitalize(name)))
@@ -91,7 +91,7 @@ public abstract class AbstractJavaToKotlinConverterTest(val kotlinFileExtension:
private fun statementToKotlin(converter: Converter, text: String?): String {
var result = methodToKotlin(converter, "void main() {" + text + "}")
val pos = result.lastIndexOf("}")
result = result.substring(0, pos).replaceFirst("fun main\\(\\) : Unit \\{", "")
result = result.substring(0, pos).replaceFirst("fun main\\(\\) \\{", "")
return prettify(result)
}
@@ -1,13 +1,13 @@
package test
public open class Test(str : String) {
var myStr : String = "String2"
public open fun sout(str : String) : Unit {
public open fun sout(str : String) {
System.out.println(str)
}
public open fun dummy(str : String) : String {
return str
}
public open fun test() : Unit {
public open fun test() {
sout("String")
val test = "String2"
sout(test)
@@ -1,13 +1,13 @@
package test
public open class Test(str : String) {
var myStr : String = "String2"
public open fun sout(str : String) : Unit {
public open fun sout(str : String) {
System.out?.println(str)
}
public open fun dummy(str : String) : String {
return str
}
public open fun test() : Unit {
public open fun test() {
sout("String")
var test : String = "String2"
sout(test)
@@ -1,6 +1,6 @@
package test
open class Foo() {
open fun execute() : Unit {
open fun execute() {
}
}
open class Bar() {
@@ -8,7 +8,7 @@ var fooNotNull : Foo = Foo()
var fooNullable : Foo = null
}
open class Test() {
public open fun test(barNotNull : Bar, barNullable : Bar) : Unit {
public open fun test(barNotNull : Bar, barNullable : Bar) {
barNotNull.fooNotNull.execute()
barNotNull.fooNullable.execute()
barNullable.fooNotNull.execute()
@@ -1,6 +1,6 @@
package test
open class Foo() {
open fun execute() : Unit {
open fun execute() {
}
}
open class Bar() {
@@ -8,7 +8,7 @@ var fooNotNull : Foo = Foo()
var fooNullable : Foo? = null
}
open class Test() {
public open fun test(barNotNull : Bar, barNullable : Bar?) : Unit {
public open fun test(barNotNull : Bar, barNullable : Bar?) {
barNotNull.fooNotNull.execute()
barNotNull.fooNullable?.execute()
barNullable?.fooNotNull?.execute()
@@ -1,2 +1,2 @@
fun fromArrayToCollection(a : Array<Foo>) : Unit {
fun fromArrayToCollection(a : Array<Foo>) {
}
@@ -1,2 +1,2 @@
fun fromArrayToCollection(a : Array<Foo?>?) : Unit {
fun fromArrayToCollection(a : Array<Foo?>?) {
}
@@ -1,6 +1,6 @@
import java.util.BitSet
open class Foo() {
open fun foo(o : BitSet) : Unit {
open fun foo(o : BitSet) {
val o2 = o
val foo = 0
foo = o2.size()
@@ -1,6 +1,6 @@
import java.util.BitSet
open class Foo() {
open fun foo(o : BitSet?) : Unit {
open fun foo(o : BitSet?) {
var o2 : BitSet? = o
var foo : Int = 0
foo = o2?.size()!!
@@ -1,6 +1,6 @@
import java.util.ArrayList
open class Boxing() {
open fun test() : Unit {
open fun test() {
val i = 0
val n = 0.0.toFloat()
i = 1
+1 -1
View File
@@ -1,6 +1,6 @@
import java.util.ArrayList
open class Boxing() {
open fun test() : Unit {
open fun test() {
var i : Int? = 0
var n : Number? = 0.0.toFloat()
i = 1
@@ -1,6 +1,6 @@
package demo
open class Test() {
open fun test() : Unit {
open fun test() {
val i = Integer.valueOf(100)
val s = 3
val ss = java.lang.Short.valueOf(s)
+1 -1
View File
@@ -1,6 +1,6 @@
package demo
open class Test() {
open fun test() : Unit {
open fun test() {
var i : Int? = Integer.valueOf(100)
var s : Short = 3
var ss : Short? = java.lang.Short.valueOf(s)
@@ -4,7 +4,7 @@ val ourOut : java.io.PrintStream = 0
}
}
open class User() {
open fun main() : Unit {
open fun main() {
Library.ourOut.print()
}
}
@@ -4,7 +4,7 @@ val ourOut : java.io.PrintStream? = null
}
}
open class User() {
open fun main() : Unit {
open fun main() {
Library.ourOut?.print()
}
}
@@ -1,6 +1,6 @@
open class Library() {
class object {
open fun call() : Unit {
open fun call() {
}
open fun getString() : String {
return ""
@@ -8,7 +8,7 @@ return ""
}
}
open class User() {
open fun main() : Unit {
open fun main() {
Library.call()
Library.getString().isEmpty()
}
@@ -1,6 +1,6 @@
open class Library() {
class object {
open fun call() : Unit {
open fun call() {
}
open fun getString() : String? {
return ""
@@ -8,7 +8,7 @@ return ""
}
}
open class User() {
open fun main() : Unit {
open fun main() {
Library.call()
Library.getString()?.isEmpty()
}
@@ -1,12 +1,12 @@
open class Library() {
open fun call() : Unit {
open fun call() {
}
open fun getString() : String {
return ""
}
}
open class User() {
open fun main() : Unit {
open fun main() {
val lib = Library()
lib.call()
lib.getString().isEmpty()
@@ -1,12 +1,12 @@
open class Library() {
open fun call() : Unit {
open fun call() {
}
open fun getString() : String? {
return ""
}
}
open class User() {
open fun main() : Unit {
open fun main() {
var lib : Library? = Library()
lib?.call()
lib?.getString()?.isEmpty()
@@ -2,7 +2,7 @@ open class Library() {
public val myString : String = 0
}
open class User() {
open fun main() : Unit {
open fun main() {
Library.myString.isEmpty()
}
}
@@ -2,7 +2,7 @@ open class Library() {
public val myString : String? = null
}
open class User() {
open fun main() : Unit {
open fun main() {
Library.myString?.isEmpty()
}
}
@@ -8,7 +8,7 @@ return Short()
}
open class Test() {
class object {
public open fun test() : Unit {
public open fun test() {
test.Short.valueOf("1")
test.Short.valueOf("1")
java.lang.Short.valueOf("1")
@@ -8,7 +8,7 @@ return Short()
}
open class Test() {
class object {
public open fun test() : Unit {
public open fun test() {
test.Short.valueOf("1")
test.Short.valueOf("1")
java.lang.Short.valueOf("1")
@@ -1,6 +1,6 @@
abstract class A() {
abstract fun callme() : Unit
open fun callmetoo() : Unit {
abstract fun callme()
open fun callmetoo() {
print("This is a concrete method.")
}
}
@@ -1,6 +1,6 @@
abstract class A() {
abstract fun callme() : Unit
open fun callmetoo() : Unit {
abstract fun callme()
open fun callmetoo() {
print("This is a concrete method.")
}
}
@@ -1,6 +1,6 @@
abstract class Shape() {
public var color : String = 0
public open fun setColor(c : String) : Unit {
public open fun setColor(c : String) {
color = c
}
public open fun getColor() : String {
@@ -1,6 +1,6 @@
abstract class Shape() {
public var color : String? = null
public open fun setColor(c : String?) : Unit {
public open fun setColor(c : String?) {
color = c
}
public open fun getColor() : String? {
@@ -1,5 +1,5 @@
class T() {
fun main() : Unit {
fun main() {
}
fun i() : Int {
}
@@ -1,5 +1,5 @@
class T() {
fun main() : Unit {
fun main() {
}
fun i() : Int {
}
+1 -1
View File
@@ -13,7 +13,7 @@ return __
}
}
open class User() {
open fun main() : Unit {
open fun main() {
val m = HashMap(1)
val m2 = HashMap(10)
val t1 = Test.init()
+1 -1
View File
@@ -13,7 +13,7 @@ return __
}
}
open class User() {
open fun main() : Unit {
open fun main() {
var m : HashMap<Any?, Any?>? = HashMap(1)
var m2 : HashMap<Any?, Any?>? = HashMap(10)
var t1 : Test? = Test.init()
@@ -1,4 +1,4 @@
public open class MyClass() {
private fun init(arg1 : Int, arg2 : Int, arg3 : Int) : Unit {
private fun init(arg1 : Int, arg2 : Int, arg3 : Int) {
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
public open class MyClass() {
private fun init(arg1 : Int, arg2 : Int, arg3 : Int) : Unit {
private fun init(arg1 : Int, arg2 : Int, arg3 : Int) {
}
}
@@ -12,7 +12,7 @@ return __
}
public open class User() {
class object {
public open fun main() : Unit {
public open fun main() {
val c1 = C(100, 100, 100)
val c2 = C.init(100, 100)
val c3 = C.init(100)
@@ -12,7 +12,7 @@ return __
}
public open class User() {
class object {
public open fun main() : Unit {
public open fun main() {
var c1 : C? = C(100, 100, 100)
var c2 : C? = C.init(100, 100)
var c3 : C? = C.init(100)
@@ -24,7 +24,7 @@ return __
}
public open class User() {
class object {
public open fun main() : Unit {
public open fun main() {
val c1 = C.init(100, 100, 100)
val c2 = C.init(100, 100)
val c3 = C(100)
@@ -24,7 +24,7 @@ return __
}
public open class User() {
class object {
public open fun main() : Unit {
public open fun main() {
var c1 : C? = C.init(100, 100, 100)
var c2 : C? = C.init(100, 100)
var c3 : C? = C(100)
@@ -8,9 +8,9 @@ return _firstName
public open fun getLastName() : String {
return _lastName
}
private fun doSmthBefore() : Unit {
private fun doSmthBefore() {
}
private fun doSmthAfter() : Unit {
private fun doSmthAfter() {
}
{
doSmthBefore()
@@ -36,7 +36,7 @@ return Customer(_firstName, _lastName)
}
public open class User() {
class object {
public open fun main() : Unit {
public open fun main() {
val customer = CustomerBuilder().WithFirstName("Homer").WithLastName("Simpson").Build()
System.out.println(customer.getFirstName())
System.out.println(customer.getLastName())
@@ -8,9 +8,9 @@ return _firstName
public open fun getLastName() : String? {
return _lastName
}
private fun doSmthBefore() : Unit {
private fun doSmthBefore() {
}
private fun doSmthAfter() : Unit {
private fun doSmthAfter() {
}
{
doSmthBefore()
@@ -36,7 +36,7 @@ return Customer(_firstName, _lastName)
}
public open class User() {
class object {
public open fun main() : Unit {
public open fun main() {
var customer : Customer? = CustomerBuilder().WithFirstName("Homer")?.WithLastName("Simpson")?.Build()
System.out?.println(customer?.getFirstName())
System.out?.println(customer?.getLastName())
@@ -28,7 +28,7 @@ return __
}
public open class User() {
class object {
public open fun main() : Unit {
public open fun main() {
val i1 = Identifier.init<String>("name", false, true)
val i2 = Identifier.init<String>("name", false)
val i3 = Identifier.init<String>("name")
@@ -28,7 +28,7 @@ return __
}
public open class User() {
class object {
public open fun main() : Unit {
public open fun main() {
var i1 : Identifier<*>? = Identifier.init<String?>("name", false, true)
var i2 : Identifier<*>? = Identifier.init<String?>("name", false)
var i3 : Identifier<*>? = Identifier.init<String?>("name")
@@ -28,7 +28,7 @@ return __
}
public open class User() {
class object {
public open fun main() : Unit {
public open fun main() {
val i1 = Identifier.init("name", false, true)
val i2 = Identifier.init("name", false)
val i3 = Identifier.init("name")
@@ -28,7 +28,7 @@ return __
}
public open class User() {
class object {
public open fun main() : Unit {
public open fun main() {
var i1 : Identifier? = Identifier.init("name", false, true)
var i2 : Identifier? = Identifier.init("name", false)
var i3 : Identifier? = Identifier.init("name")
@@ -33,7 +33,7 @@ return ""
}
public open class User() {
class object {
public open fun main() : Unit {
public open fun main() {
val t = Test.init("name")
}
}
@@ -33,7 +33,7 @@ return ""
}
public open class User() {
class object {
public open fun main() : Unit {
public open fun main() {
var t : Test? = Test.init("name")
}
}
@@ -1,6 +1,6 @@
enum class E {
FOO
fun foo() : Unit {
fun foo() {
FOO.toString()
}
}
@@ -1,6 +1,6 @@
enum class E {
FOO
fun foo() : Unit {
fun foo() {
FOO.toString()
}
}
@@ -4,7 +4,7 @@ BLACK
RED
YELLOW
BLUE
public override fun run() : Unit {
public override fun run() {
System.out.println("name()=" + name() + ", toString()=" + toString())
}
}
@@ -4,7 +4,7 @@ BLACK
RED
YELLOW
BLUE
public override fun run() : Unit {
public override fun run() {
System.out?.println("name()=" + name() + ", toString()=" + toString())
}
}
@@ -1,2 +1,2 @@
fun main() : Unit {
fun main() {
}
@@ -1,2 +1,2 @@
fun main() : Unit {
fun main() {
}
@@ -12,7 +12,7 @@ return super.clone()
public override fun toString() : String {
return super.toString()
}
protected override fun finalize() : Unit {
protected override fun finalize() {
super.finalize()
}
}
@@ -29,7 +29,7 @@ return super.clone()
public open fun toString() : String {
return getJavaClass<Base>.getName() + '@' + Integer.toHexString(hashCode())
}
protected open fun finalize() : Unit {
protected open fun finalize() {
super.finalize()
}
}
@@ -12,7 +12,7 @@ return super.clone()
public override fun toString() : String? {
return super.toString()
}
protected override fun finalize() : Unit {
protected override fun finalize() {
super.finalize()
}
}
@@ -29,7 +29,7 @@ return super.clone()
public open fun toString() : String? {
return getJavaClass<Base>.getName() + '@' + Integer.toHexString(hashCode())
}
protected open fun finalize() : Unit {
protected open fun finalize() {
super.finalize()
}
}
@@ -1,5 +1,5 @@
package demo
class Final() {
fun test() : Unit {
fun test() {
}
}
@@ -1,5 +1,5 @@
package demo
class Final() {
fun test() : Unit {
fun test() {
}
}
@@ -1,2 +1,2 @@
fun test() : Unit {
fun test() {
}
+1 -1
View File
@@ -1,2 +1,2 @@
fun test() : Unit {
fun test() {
}
+1 -1
View File
@@ -1,4 +1,4 @@
class object {
public fun main(args : Array<String>) : Unit {
public fun main(args : Array<String>) {
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
class object {
public fun main(args : Array<String?>?) : Unit {
public fun main(args : Array<String?>?) {
}
}
@@ -1,8 +1,8 @@
open class A() {
open fun a() : Unit {
open fun a() {
}
}
class B() : A() {
override fun a() : Unit {
override fun a() {
}
}
+2 -2
View File
@@ -1,8 +1,8 @@
open class A() {
open fun a() : Unit {
open fun a() {
}
}
class B() : A() {
override fun a() : Unit {
override fun a() {
}
}
@@ -1,12 +1,12 @@
open class A() {
open fun foo() : Unit {
open fun foo() {
}
}
open class B() : A() {
override fun foo() : Unit {
override fun foo() {
}
}
open class C() : B() {
override fun foo() : Unit {
override fun foo() {
}
}
@@ -1,12 +1,12 @@
open class A() {
open fun foo() : Unit {
open fun foo() {
}
}
open class B() : A() {
override fun foo() : Unit {
override fun foo() {
}
}
open class C() : B() {
override fun foo() : Unit {
override fun foo() {
}
}
@@ -12,7 +12,7 @@ return super.clone()
public open fun toString() : String {
return getJavaClass<Test>.getName() + '@' + Integer.toHexString(hashCode())
}
protected open fun finalize() : Unit {
protected open fun finalize() {
super.finalize()
}
}
@@ -12,7 +12,7 @@ return super.clone()
public open fun toString() : String? {
return getJavaClass<Test>.getName() + '@' + Integer.toHexString(hashCode())
}
protected open fun finalize() : Unit {
protected open fun finalize() {
super.finalize()
}
}
@@ -1,2 +1,2 @@
fun putU<U>(u : U) : Unit {
fun putU<U>(u : U) {
}
@@ -1,2 +1,2 @@
fun putU<U>(u : U?) : Unit {
fun putU<U>(u : U?) {
}
@@ -1,2 +1,2 @@
fun putUVW<U, V, W>(u : U, v : V, w : W) : Unit {
fun putUVW<U, V, W>(u : U, v : V, w : W) {
}
@@ -1,2 +1,2 @@
fun putUVW<U, V, W>(u : U?, v : V?, w : W?) : Unit {
fun putUVW<U, V, W>(u : U?, v : V?, w : W?) {
}
@@ -1,2 +1,2 @@
private fun test() : Unit {
private fun test() {
}
+1 -1
View File
@@ -1,2 +1,2 @@
private fun test() : Unit {
private fun test() {
}
@@ -1,2 +1,2 @@
protected fun test() : Unit {
protected fun test() {
}
+1 -1
View File
@@ -1,2 +1,2 @@
protected fun test() : Unit {
protected fun test() {
}
@@ -1,2 +1,2 @@
public fun test() : Unit {
public fun test() {
}
+1 -1
View File
@@ -1,2 +1,2 @@
public fun test() : Unit {
public fun test() {
}
@@ -1,6 +1,6 @@
package demo
open class Test() {
open fun test(vararg var args : Any) : Unit {
open fun test(vararg var args : Any) {
args = array<Int>(1, 2, 3)
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
package demo
open class Test() {
open fun test(vararg var args : Any?) : Unit {
open fun test(vararg var args : Any?) {
args = array<Int?>(1, 2, 3)
}
}
@@ -1,2 +1,2 @@
fun popAll(dst : Collection<in E>) : Unit {
fun popAll(dst : Collection<in E>) {
}
@@ -1,2 +1,2 @@
fun popAll(dst : Collection<in E?>?) : Unit {
fun popAll(dst : Collection<in E?>?) {
}
@@ -11,7 +11,7 @@ private var i : Int = 0
/**
* This is a function doc comment.
*/
public open fun foo() : Unit {
public open fun foo() {
/* This is a function comment */
}
}
+1 -1
View File
@@ -11,7 +11,7 @@ private var i : Int = 0
/**
* This is a function doc comment.
*/
public open fun foo() : Unit {
public open fun foo() {
/* This is a function comment */
}
}
+2 -2
View File
@@ -2,11 +2,11 @@ import java.util.HashMap
open class G<T : String>(t : T) {
}
public open class Java() {
open fun test() : Unit {
open fun test() {
val m = HashMap()
m.put(1, 1)
}
open fun test2() : Unit {
open fun test2() {
val m = HashMap()
val g = G("")
val g2 = G<String>("")
+2 -2
View File
@@ -2,11 +2,11 @@ import java.util.HashMap
open class G<T : String?>(t : T?) {
}
public open class Java() {
open fun test() : Unit {
open fun test() {
var m : HashMap<Any?, Any?>? = HashMap()
m?.put(1, 1)
}
open fun test2() : Unit {
open fun test2() {
var m : HashMap<*, *>? = HashMap()
var g : G<String?>? = G("")
var g2 : G<String?>? = G<String?>("")
+1 -1
View File
@@ -1,7 +1,7 @@
package demo
open class Test() {
class object {
open fun subListRangeCheck(fromIndex : Int, toIndex : Int, size : Int) : Unit {
open fun subListRangeCheck(fromIndex : Int, toIndex : Int, size : Int) {
if (fromIndex < 0)
throw IndexOutOfBoundsException("fromIndex = " + fromIndex)
if (toIndex > size)
+1 -1
View File
@@ -1,7 +1,7 @@
package demo
open class Test() {
class object {
open fun subListRangeCheck(fromIndex : Int, toIndex : Int, size : Int) : Unit {
open fun subListRangeCheck(fromIndex : Int, toIndex : Int, size : Int) {
if (fromIndex < 0)
throw IndexOutOfBoundsException("fromIndex = " + fromIndex)
if (toIndex > size)
@@ -1,8 +1,8 @@
package demo
open class Test() {
open fun putInt(i : Int) : Unit {
open fun putInt(i : Int) {
}
open fun test() : Unit {
open fun test() {
val b = 10
putInt(b.toInt())
val b2 = 10
@@ -1,8 +1,8 @@
package demo
open class Test() {
open fun putInt(i : Int?) : Unit {
open fun putInt(i : Int?) {
}
open fun test() : Unit {
open fun test() {
var b : Byte = 10
putInt(b.toInt())
var b2 : Byte? = 10
@@ -1,8 +1,8 @@
package demo
open class Test() {
open fun putInt(i : Int) : Unit {
open fun putInt(i : Int) {
}
open fun test() : Unit {
open fun test() {
val i = 10
putInt(i)
}
@@ -1,8 +1,8 @@
package demo
open class Test() {
open fun putInt(i : Int?) : Unit {
open fun putInt(i : Int?) {
}
open fun test() : Unit {
open fun test() {
var i : Int = 10
putInt(i)
}
+2 -2
View File
@@ -1,8 +1,8 @@
package demo
open class Test() {
open fun putInt(i : Int) : Unit {
open fun putInt(i : Int) {
}
open fun test() : Unit {
open fun test() {
val b = 10
putInt(b.toInt())
}
+2 -2
View File
@@ -1,8 +1,8 @@
package demo
open class Test() {
open fun putInt(i : Int) : Unit {
open fun putInt(i : Int) {
}
open fun test() : Unit {
open fun test() {
var b : Byte = 10
putInt(b.toInt())
}
+1 -1
View File
@@ -28,7 +28,7 @@ return __
}
public open class User() {
class object {
public open fun main(args : Array<String>) : Unit {
public open fun main(args : Array<String>) {
val i1 = Identifier.init<String>("name", false, true)
val i2 = Identifier.init<String>("name", false)
val i3 = Identifier.init<String>("name")
+1 -1
View File
@@ -28,7 +28,7 @@ return __
}
public open class User() {
class object {
public open fun main(args : Array<String?>?) : Unit {
public open fun main(args : Array<String?>?) {
var i1 : Identifier<*>? = Identifier.init<String?>("name", false, true)
var i2 : Identifier<*>? = Identifier.init<String?>("name", false)
var i3 : Identifier<*>? = Identifier.init<String?>("name")
@@ -1,6 +1,6 @@
package demo
open class Test(i : Int) {
open fun test() : Unit {
open fun test() {
val i = 10
Test(i)
}
@@ -1,6 +1,6 @@
package demo
open class Test(i : Int?) {
open fun test() : Unit {
open fun test() {
var i : Int = 10
Test(i)
}
+1 -1
View File
@@ -1,6 +1,6 @@
package demo
open class Test(i : Int) {
open fun test() : Unit {
open fun test() {
val b = 10
Test(b.toInt())
}
+1 -1
View File
@@ -1,6 +1,6 @@
package demo
open class Test(i : Int) {
open fun test() : Unit {
open fun test() {
var b : Byte = 10
Test(b.toInt())
}

Some files were not shown because too many files have changed in this diff Show More