Converter:
Fix assert statement
This commit is contained in:
@@ -17,12 +17,12 @@
|
|||||||
package org.jetbrains.jet.j2k.ast
|
package org.jetbrains.jet.j2k.ast
|
||||||
|
|
||||||
|
|
||||||
public open class AssertStatement(val condition: Expression, val detail: Expression) : Statement() {
|
public class AssertStatement(val condition: Expression, val detail: Expression) : Statement() {
|
||||||
public override fun toKotlin(): String {
|
public override fun toKotlin(): String {
|
||||||
var detail: String? = (if (detail != Expression.EMPTY_EXPRESSION)
|
val lazyStringMessage = if (detail != Expression.EMPTY_EXPRESSION)
|
||||||
"(" + detail.toKotlin() + ")"
|
" {" + detail.toKotlin() + "}"
|
||||||
else
|
else
|
||||||
"")
|
""
|
||||||
return "assert" + detail + " {" + condition.toKotlin() + "}"
|
return "assert(${condition.toKotlin()})$lazyStringMessage"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
assert {boolMethod()}
|
assert(boolMethod())
|
||||||
@@ -1 +1 @@
|
|||||||
assert {boolMethod()}
|
assert(boolMethod())
|
||||||
@@ -1 +1 @@
|
|||||||
assert {(boolMethod())}
|
assert((boolMethod()))
|
||||||
@@ -1 +1 @@
|
|||||||
assert {(boolMethod())}
|
assert((boolMethod()))
|
||||||
@@ -1 +1 @@
|
|||||||
assert("string details") {true}
|
assert(true) {"string details"}
|
||||||
@@ -1 +1 @@
|
|||||||
assert("string details") {true}
|
assert(true) {"string details"}
|
||||||
Reference in New Issue
Block a user