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

ASF GitHub Bot commented on GROOVY-11229:
-----------------------------------------

eric-milles commented on PR #1994:
URL: https://github.com/apache/groovy/pull/1994#issuecomment-1826377223

   Do you have some description how this will be integrated?  Adding something 
to `ClassExpression` without changing its `transformExpression` or `visit` does 
not make it clear where this is going.  Perhaps a description in the issue 
ticket before code changes would be helpful.
   
   Was it considered to use something besides a `ClassExpression` on the RHS of 
an `instanceof` binary expression to represent this?  I'm pleased to see "p" 
represented by a variable expression, but the semantic of "Person" is 
represented in the `ClassExpression` and then again in the 
`PatternVariableExpression`.  Where will the source ranges be associated?
   
   There is also the possibility of raising "instanceof" to a new kind of 
`BinaryExpression` subclass that includes the pattern-matching stuff instead of 
adding it to `ClassExpression`.




> 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)

Reply via email to