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

Primitive type references have invalid source locations

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.7.5
    • None
    • ast builder
    • None

    Description

      In GRECLIPSE-951, I noticed that all references to primitive types are using the same cached singleton. So in this code:

      int x() {
        int z
      }
      

      both references to int are represented in the AST by the same ClassNode object. This means that source locations for the int singleton ClassNode are always the last time it is used in the file.

      This is a problem for Groovy-Eclipse since we rely on source locations for searching and marking occurrences.

      It seems to me that the solution is to add a redirect to the primitive ClassNode and set its source location.

      Attachments

        Activity

          People

            Unassigned Unassigned
            werdna Andrew Eisenberg
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: