Skip to content

Unused import not always reported in a cyclic import #2152

@PieterOlivier

Description

@PieterOlivier

Describe the bug

When two modules import each other but one of them does not use anything from the other, the typechecker does not always report an "Unused import".

To Reproduce

Create the following completely symmetric modules:

module sandbox::unused::A

import sandbox::unused::B;

and

module sandbox::unused::B

import sandbox::unused::A;

Now trigger a typecheck in both by saving.
The import of module A in B generates an "unused import" warning.
The import of module B in A does not generate a warning.

Expected behavior
The imports in both modules should generate an "unused import" warning.

Screenshots

Image

Version info
Latest version from rascal-core (commit 31efb70521dc7ae1ae114f60dd6960138af95a40),

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions