Skip to content

Typecheck error only when typechecking importing module #2150

Open
@PieterOlivier

Description

Describe the bug

When typechecking a specific (seemingly correct) Rascal module, no errors are generated.
But when typechecking a module that imports this module an error is generated:
"Invalid check return type; type of one or more subparts could not be inferred"

To Reproduce

  1. Add two modules:
module sandbox::A

int() fGen() {
    int f() = 1;
    default int f() = 0;
    return f;
}

and:

module sandbox::C

import sandbox::A;
  1. Make a whitespace change in module A and save it to trigger the typechecker. The module should typecheck ok.
  2. Make a whitespace change in module B and save it to trigger the typechecker. A typecheck error will appear in module A.

Expected behavior
Typechecking should not result in errors (only a warning about the import of module A not being used).

Screenshots

Image

Version info
VS Code extension version 0.12.2 and self-built VS Code extension with the latest rascal and rascal core from main.

Additional context

Note that changing module A like this:

module sandbox::A

int() fGen() {
    int f() = 1;
    default int f() = 0;
    
    int() returnF = f;
    return returnF;
}

makes the issue go away completely.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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