Bug 575833 - [17][switch pattern] Error messages to be improved for '&' omission in guarded pattern
Summary: [17][switch pattern] Error messages to be improved for '&' omission in guarde...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.21   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.24   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-06 06:04 EDT by Manoj N Palat CLA
Modified: 2024-02-17 16:17 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manoj N Palat CLA 2021-09-06 06:04:40 EDT
From Remi Forax:


switch((Integer) args.length) {
  case Integer i & false -> System.out.println(i);
  default -> System.out.println("default");
}

several errors are reported and none of them are really helpful
  i cannot be resolved to a variable
  Integer cannot be resolved to a variable
  Syntax error on token "i", delete this token

The reported error should be should along: '&' is an invalid token, '&&' should be used instead
Comment 1 Jay Arthanareeswaran CLA 2021-11-19 01:21:02 EST
Bulk move out of 4.22.

If this is going to make it to 4.22, feel free to set the target back.
Comment 2 Manoj N Palat CLA 2022-02-16 05:10:16 EST
Bulk move out of 4.23
Comment 3 Manoj N Palat CLA 2022-02-16 05:10:21 EST
Bulk move out of 4.23
Comment 4 Manoj N Palat CLA 2022-02-16 05:10:40 EST
Bulk move out of 4.23
Comment 5 Manoj N Palat CLA 2022-02-16 05:12:02 EST
Bulk move out of 4.23
Comment 6 Eclipse Genie CLA 2024-02-17 16:17:23 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.