Question

I tried to overload an existing external class's operator with Xtend but it doesn't work. I can't write in the class source, like BigIntegerExtension. How should I do it?

Answer

The answer is pretty simple. We can override any of the operators what we want with operator overload.

// IntVar = IntVar
def static operator_equals(IntVar a, IntVar b) {
    return IntConstraintFactory.arithm(a, "=", b)
}
Was it helpful?

Solution

The answer is pretty simple. We can override any of the operators what we want with operator overload.

// IntVar = IntVar
def static operator_equals(IntVar a, IntVar b) {
    return IntConstraintFactory.arithm(a, "=", b)
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top