fix: migrations

This commit is contained in:
2019-08-03 00:53:44 +02:00
parent 88d581c529
commit 881a335c90
6 changed files with 29 additions and 20 deletions

View File

@@ -51,7 +51,12 @@ open class Function(
class FunctionNotFound(cause: Throwable? = null): ParseException("Function not found in script", cause)
fun getDefinition(): String {
return "$name (" + parameters.joinToString(", ") + ") $returns"
return parameters
.filter { it.direction == Parameter.Direction.IN }
.joinToString(", ") { "${it.name} ${it.type}" }.let {
"$name ($it) $returns"
}
}
fun getParametersIndexedByName(): Map<String, Parameter> {
@@ -64,8 +69,8 @@ open class Function(
return other.getDefinition() == this.getDefinition()
}
infix fun `is same`(other: Function): Boolean {
return other.script == this.script
infix fun `is different from`(other: Function): Boolean {
return other.script != this.script
}
companion object {