Open rdulmina opened 2 years ago
Description:
The below invalid sample compiles runs and gives the correct output
public function main() { float|decimal a = 44.3d; float b = 2; float c = a * b; // 88.6 }
However, if we interchange the order of union it will fail at compile time
public function main() { decimal|float a = 44.3d; float b = 2; float c = a * b; // error operator '*' not defined for '(decimal|float)' and 'float' }
Result in a compilation error on Swan Lake Update 1 and later versions. Keeping the issue open to add tests.
Description:
The below invalid sample compiles runs and gives the correct output
However, if we interchange the order of union it will fail at compile time