ballerina-lang icon indicating copy to clipboard operation
ballerina-lang copied to clipboard

`(1|2|3)[]` type in diagnostics is printed as `'1|2|3[]'` instead of `'(1|2|3)[]'`

Open lochana-chathura opened this issue 3 years ago • 13 comments
trafficstars

Description:

public function main() {
    (1|2|3)[] ar = 3; // incompatible types: expected '1|2|3[]', found 'int'
}

As with type precedence, '1|2|3|[]' means 1|2|(3[]). Correct error msg should be incompatible types: expected '(1|2|3)[]', found 'int'

Affected Versions: 2201.0.0

lochana-chathura avatar Feb 10 '22 17:02 lochana-chathura