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

Primitive type references have invalid source locations

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.7.5
    • Fix Version/s: None
    • Component/s: ast builder
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: