Skip to content

[Enhanced Switch] ECJ tolerates fall through to default from a case with pattern label while javac rejects it. #3318

@srikanth-sankaran

Description

@srikanth-sankaran

Found by code inspection:

This program is rejected by javac (illegal fall-through from a pattern) while ECJ compiles it:

public class X {	
	static /* @NonNull */ Object foo(/*@NonNull */ Object o) {
	    switch (o) {
	        case String s:
	        default:
	        	System.out.println();
	    }
	    return o;
	}
}  

Metadata

Metadata

Labels

javacecj not compatible with javac

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions