You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2022/02/03 22:35:01 UTC
[jira] [Closed] (GROOVY-10150) Eliminate ambiguities while parsing non-static class creator
[ https://issues.apache.org/jira/browse/GROOVY-10150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King closed GROOVY-10150.
------------------------------
> Eliminate ambiguities while parsing non-static class creator
> ------------------------------------------------------------
>
> Key: GROOVY-10150
> URL: https://issues.apache.org/jira/browse/GROOVY-10150
> Project: Groovy
> Issue Type: Improvement
> Reporter: Daniel Sun
> Assignee: Daniel Sun
> Priority: Major
> Fix For: 4.0.0-beta-1, 3.0.9
>
>
> {code:java}
> public class Computer {
> public class Cpu {
> int coreNumber
> public Cpu(int coreNumber) {
> this.coreNumber = coreNumber
> }
> }
> }
> def coreNumber = new Computer().new Cpu(4).coreNumber // `new` will be parsed as a method name, but it's wrong
> assert 4 == coreNumber
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)