Bug 575719 - [17][switch pattern][eval] JEP 406 - eval
Summary: [17][switch pattern][eval] JEP 406 - eval
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.21   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Sarika Sinha CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on: 573947
Blocks: 576371
  Show dependency tree
 
Reported: 2021-08-31 08:16 EDT by Sarika Sinha CLA
Modified: 2024-05-12 07:51 EDT (History)
1 user (show)

See Also:


Attachments
Patch for gerrit (5.98 KB, application/octet-stream)
2022-03-24 07:13 EDT, Sarika Sinha CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sarika Sinha CLA 2021-08-31 08:16:33 EDT
While working on Bug 573947, Tried with the snippet:
private static void foo4(Object o) {
		  switch (o) {
		   
		   case Integer i && i > 10 : 
			   System.out.println("Greater than 10"+ i );
	   
		   case null, default : System.out.println(o.toString() );
		  }
	}

When evaluating - case Integer i && i > 10, it gives error
Syntax error on token "&&", = expected.
Comment 1 Sarika Sinha CLA 2021-08-31 08:17:28 EDT
Expect the changes in org.eclipse.jdt.internal.debug.eval.ast.engine.SourceBasedSourceGenerator.
Comment 2 Sarika Sinha CLA 2021-09-05 10:55:41 EDT
This is a big change and will avoid delivering so close to the Java 17 GA.
Comment 3 Eclipse Genie CLA 2021-10-21 15:22:21 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.debug/+/186790
Comment 4 Sarika Sinha CLA 2021-10-21 15:25:00 EDT
(In reply to Eclipse Genie from comment #3)
> New Gerrit change created:
> https://git.eclipse.org/r/c/jdt/eclipse.jdt.debug/+/186790

Even after setting the latest compliance and preview enabled option, Parser is still throwing the same error.

I verified that Parser is getting the correct compliance and preview enabled options.
Comment 5 Sarika Sinha CLA 2022-03-24 07:13:54 EDT
Created attachment 288284 [details]
Patch for gerrit
Comment 6 Eclipse Genie CLA 2024-05-12 07:51:27 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.