Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Java 14 switch expressions #428

Open
processing-bot opened this issue Mar 1, 2022 · 1 comment
Open

Add support for Java 14 switch expressions #428

processing-bot opened this issue Mar 1, 2022 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed preprocessor

Comments

@processing-bot
Copy link
Collaborator

Created by: Santarii

Description

Switch expressions were added in Java 14, but produce a strange compile time error in Processing which is on Java 17.0.2.

Expected Behavior

Switch expressions should compile.

Current Behavior

They do not compile, and the first line in my exam,ple produces an error of "Syntax Error - Missing name or ; near ' int b = switch'?".

Steps to Reproduce

void setup() {
  int a = 0;
  int b = switch(a) {
    case 0 -> 0;
    default -> 1;
  };
  exit();
}

This switch expression runs fine in Eclipse and online IDEs that are in Java 17, but not in Processing. Other language features that are newer than switch expressions do work correctly.

Your Environment

  • Processing version: 4.0b6.
  • Operating System and OS version: Windows 10 Home 64-bit. 10.0.19043 Build 19043.
@processing-bot
Copy link
Collaborator Author

Created by: sahilrajput18

Hey , is this issue still open ??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed preprocessor
Projects
None yet
Development

No branches or pull requests

1 participant