[
https://issues.apache.org/jira/browse/GROOVY-11224?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17787973#comment-17787973
]
ASF GitHub Bot commented on GROOVY-11224:
-----------------------------------------
paulk-asert opened a new pull request, #1989:
URL: https://github.com/apache/groovy/pull/1989
(no comment)
> 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
> Priority: Major
> Labels: breaking, breaking_change
> Fix For: 5.x
>
>
> 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)