J2K: Do not specify type of for loop parameter
This commit is contained in:
@@ -77,7 +77,7 @@ public open class DoWhileStatement(condition: Expression, body: Element) : While
|
|||||||
public open class ForeachStatement(val variable: Parameter,
|
public open class ForeachStatement(val variable: Parameter,
|
||||||
val expression: Expression,
|
val expression: Expression,
|
||||||
val body: Element) : Statement() {
|
val body: Element) : Statement() {
|
||||||
public override fun toKotlin() = "for (" + variable.toKotlin() + " in " +
|
public override fun toKotlin() = "for (" + variable.identifier.name + " in " +
|
||||||
expression.toKotlin() + ")\n" + body.toKotlin()
|
expression.toKotlin() + ")\n" + body.toKotlin()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
for (n : Node? in list)
|
for (n in list)
|
||||||
{
|
{
|
||||||
var i : Int = 1
|
var i : Int = 1
|
||||||
i++
|
i++
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
for (n : Node? in list)
|
for (n in list)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
for (n : Node? in list)
|
for (n in list)
|
||||||
i++
|
i++
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
for (n : Node? in list)
|
for (n in list)
|
||||||
return n
|
return n
|
||||||
@@ -3,11 +3,11 @@ public open class ForEach() {
|
|||||||
public open fun test() : Unit {
|
public open fun test() : Unit {
|
||||||
var xs : ArrayList<Any?>? = ArrayList<Any?>()
|
var xs : ArrayList<Any?>? = ArrayList<Any?>()
|
||||||
var ys : MutableList<Any?>? = LinkedList<Any?>()
|
var ys : MutableList<Any?>? = LinkedList<Any?>()
|
||||||
for (x : Any? in xs!!)
|
for (x in xs!!)
|
||||||
{
|
{
|
||||||
ys?.add(x)
|
ys?.add(x)
|
||||||
}
|
}
|
||||||
for (y : Any? in ys!!)
|
for (y in ys!!)
|
||||||
{
|
{
|
||||||
xs?.add(y)
|
xs?.add(y)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user