Skip to content

51 Function overloads ​

Both declarations use adjust, but their parameter types select different bodies. The call is checked against the available signatures.

norm
Integer adjust(Integer value) {
  return value + 1
}

String adjust(String value) {
  return value + "!"
}

main() {
  printLine(adjust(value: 7))
  printLine(adjust(value: "Norm"))
}

Expected output:

text
8
Norm!

Try it: Add a Boolean overload and call it.

Precise rules: Reference.

Norm 0.25