Skip to content

Commit

Permalink
fix typecheck (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
rcannood authored Oct 4, 2023
1 parent b2ab479 commit e089dbf
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ def typeCheck(String stage, Map par, Object value, String id, String key) {
value = value.toLong()
}
expectedClass = value instanceof Long ? null : "Long"
} else if (par.type == "double") {
if (value instanceof java.math.BigDecimal) {
value = value.doubleValue()
}
if (value instanceof Float || value instanceof Integer || value instanceof Long) {
value = value.toDouble()
}
expectedClass = value instanceof Double ? null : "Double"
} else if (par.type == "boolean" | par.type == "boolean_true" | par.type == "boolean_false") {
expectedClass = value instanceof Boolean ? null : "Boolean"
} else if (par.type == "file") {
Expand Down

0 comments on commit e089dbf

Please sign in to comment.