You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Sun (Jira)" <ji...@apache.org> on 2023/12/01 00:07:00 UTC

[jira] [Commented] (GROOVY-11229) Support pattern matching for `instanceof`

    [ https://issues.apache.org/jira/browse/GROOVY-11229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17791843#comment-17791843 ] 

Daniel Sun commented on GROOVY-11229:
-------------------------------------

Let me refine the ticket according to comments later, it is hard for me to edit with my smart phone.

 {{o instanceof Point(int x, int y) p}} will have a pattern variable {{p}}. Even if Java does not support it, Groovy could support it.

As for VariableExpression, could you elaborate your suggestion by some examples? I wonder what the AST looks like.



> Support pattern matching for `instanceof`
> -----------------------------------------
>
>                 Key: GROOVY-11229
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11229
>             Project: Groovy
>          Issue Type: New Feature
>            Reporter: Daniel Sun
>            Priority: Major
>
> See also https://openjdk.org/jeps/394



--
This message was sent by Atlassian Jira
(v8.20.10#820010)