Skip to content

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

@lochana-chathura

Description

@lochana-chathura

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions