Bug 545118 - [12][switch expression] Wrong compiler error message
Summary: [12][switch expression] Wrong compiler error message
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.11   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug bulk move
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-06 06:11 EST by Noopur Gupta CLA
Modified: 2023-08-08 12:03 EDT (History)
2 users (show)

See Also:


Attachments
Screenshot (10.44 KB, image/png)
2019-03-06 06:11 EST, Noopur Gupta CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Noopur Gupta CLA 2019-03-06 06:11:36 EST
Created attachment 277778 [details]
Screenshot

void throwing (int i) {
			int next = switch (i) {
			case 1 -> 2;
			default -> try {
					throw new Exception();
				} catch (Exception e) {
				}
			};
		}

See attached screenshot for the error messages. No ':' is used in the code and expecting a ':' to be added is also not correct.
Comment 1 Manoj N Palat CLA 2019-03-07 05:44:54 EST
Initial Dev Notes:
At the parsing stage, compilation enters the recovery stage and the recovery parser takes a different route (directly going to consumeDefaultLabel() instead of going to consumeDefaultLabelExpr and hence does not set flag this (to be an arrow). This flag is consumed later in SE analysis which currently does not have a true value for arrow. This causes the "mixing of : and -> error" to be shown.
Comment 2 Manoj N Palat CLA 2019-08-27 01:13:20 EDT
Bulk move to 4.14
Comment 3 Manoj N Palat CLA 2019-08-27 02:07:42 EDT
Bulk move out of 4.13
Comment 4 Eclipse Genie CLA 2021-08-17 16:38:41 EDT
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.
Comment 5 Eclipse Genie CLA 2023-08-08 12:03:49 EDT
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.