[
https://issues.apache.org/jira/browse/GROOVY-11224?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King resolved GROOVY-11224.
--------------------------------
Fix Version/s: 5.0.0-alpha-3
(was: 5.x)
Assignee: Paul King
Resolution: Fixed
Proposed PR merged. Behavior as described in the PR.
> Reconsider name duplication for groovysh
> ----------------------------------------
>
> Key: GROOVY-11224
> URL: https://issues.apache.org/jira/browse/GROOVY-11224
> Project: Groovy
> Issue Type: Bug
> Reporter: Paul King
> Assignee: Paul King
> Priority: Major
> Labels: breaking, breaking_change
> Fix For: 5.0.0-alpha-3
>
>
> This is a follow-on of GROOVY-8254 for groovysh. We may end up closing this
> issue with no change but a few aspects seem worth considering:
> * Following the stricter interpretation by the compiler, adding a second
> (duplicate) import via the groovysh now causes a compiler "evaluate" error.
> Do we want to be more lenient in the repl context and in fact treat the
> import "list" like a simple name to class map and override old entries. This
> would be more repl-like in style.
> * If I define a class and then do an import, then the class is ignored with
> no error. Perhaps we want an error in that case.
> {code}
> groovy:000> class Date{}
> ===> true
> groovy:000> :show classes
> Classes:
> class Date
> ===> [class Date]
> groovy:000> import java.sql.Date
> ===> java.sql.Date
> groovy:000> println Date
> class java.sql.Date
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)