Groovy
  1. Groovy
  2. GROOVY-4620

Primitive type references have invalid source locations

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • 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.

        Activity

        No work has yet been logged on this issue.

          People

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

            Dates

            • Created:
              Updated:

              Development