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

JEP 443: lists of patterns as a case label #1643

Closed
datho7561 opened this issue Nov 28, 2023 · 2 comments · Fixed by #2011
Closed

JEP 443: lists of patterns as a case label #1643

datho7561 opened this issue Nov 28, 2023 · 2 comments · Fixed by #2011
Assignees

Comments

@datho7561
Copy link
Contributor

i.e.

record Box<T extends Ball>(T content) { }

sealed abstract class Ball permits RedBall, BlueBall, GreenBall { }
final  class RedBall   extends Ball { }
final  class BlueBall  extends Ball { }
final  class GreenBall extends Ball { }

public class A {
    public static void main(String... args) {
        Box box = null;
        switch (box) {
        case Box(RedBall _), Box(BlueBall _) when args.length == 4:
            System.out.println("hello");
            break;
        default:
            System.out.println("goodbye");
        }
    }
}

see the discussion here: #1517 (comment)

@datho7561
Copy link
Contributor Author

I started work on this as a part of #1517

@srikanth-sankaran
Copy link
Contributor

@datho7561 I have made us joint owners of this. I would like to include this as part of the comprehensive cleaup to pattern code generation rather than rush through this. Hope that is fine with you

@datho7561 datho7561 moved this from 🏗 In progress to 👀 In review in IDE Cloudaptors Jan 30, 2024
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in IDE Cloudaptors Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants