Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 578552

Summary: [18] Keyword yield is not highlighted for nested switch expressions
Product: [Eclipse Project] JDT Reporter: Jay Arthanareeswaran <jarthana>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: jjohnstn
Version: 4.22   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
Whiteboard:

Description Jay Arthanareeswaran CLA 2022-02-02 23:29:32 EST
When we have nested switch expressions, only the yield from the outer switch expression gets highlighted in the editor and not the inner one, like in the below testcase:

	static Long foo(Number n) {
		return switch (n) {
	     case (Long l) && l.equals("0") -> {
	    	 yield (switch(l) {
	    	 	case Long l1 && l1.equals("1") -> {
	    	 		l++;  
	    	 		yield 0L;
	    	 	}
	    	 	default -> throw new IAE());
	    	 }); 
	     }
		default -> throw new IAE());
	   };
	}
Comment 1 Jeff Johnston CLA 2022-02-03 13:07:33 EST

*** This bug has been marked as a duplicate of bug 578551 ***