Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-11224

Reconsider name duplication for groovysh

    XMLWordPrintableJSON

Details

    Description

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

      Attachments

        Issue Links

          Activity

            People

              paulk Paul King
              paulk Paul King
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: