Skip to content

Using tpl files created using an older version of Rascal causes clashing declarations during type checking #2455

@rodinaarssen

Description

@rodinaarssen

This issue documents what happens when a user is first presented with an updated Rascal extension, after having worked on a Rascal project that would type check perfectly fine on the previous version of the extension. The example presented in the remainder is a severely reduced case of a real-world situation.

Context:

  • In this example, there is a notion of "old extension" and "new extension". This bug is observable with the latest public release of the extension (0.12.2, "old") and a very recent CI build (2630, "new").
  • The example project has sole dependency on Rascal (0.40.19, latest public release).

Consider the following modules:
A.rsc:

module A
import IO;

B.rsc:

module B
import A;
import IO;

These modules are obviously perfectly fine, and type checking succeeds using the old extension. In particular, the target folder contains $A.tpl and $B.tpl.

Now, if the same project is opened using the new extension and a trivial whitespace change is performed on module B, the following error is generated.

Image

The exact message is the following

error("Name `IO` is ambiguous",
    |file:///<...>/src/main/rascal/B.rsc|(30,2,<4,7>,<4,9>),
    causes=[
        info("Definition of `IO`", |std:///IO.rsc|(0,28560,<1,0>,<824,50>)),
        info("Definition of `IO`", |std:///IO.rsc|(0,25567,<1,0>,<759,85>))
    ])

Observations:

  • The size of A's tpl file remains the same, whereas the size of B's tpl is more than doubled.
  • The version of Rascal the project depends on is not critical: this also occurs for other versions of Rascal.
  • This error is generated here.
  • A's tpl file has tm.logical2physical[|rascal+module:///IO|] == |std:///IO.rsc|(0,25567,<1,0>,<759,85>).
  • B's tpl file has tm.logical2physical[|rascal+module:///IO|] == |std:///IO.rsc|(0,28560,<1,0>,<824,50>).
  • The error disappears after a mvn clean, of forced recompilation of A followed by B.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions