rascal icon indicating copy to clipboard operation
rascal copied to clipboard

Rascal type-checker crashed unexpectedly with: No module scope found for analysis::diff::TextEditsat: |lib://rascal-core/lang/rascalcore/check/Import.rsc|(9426,2,<234,57>,<234,59>)

Open DavyLandman opened this issue 1 year ago • 2 comments

Context:

module A

import analysis::diff::TextEdits;

Exception thrown:

|lib://rascal-core/lang/rascalcore/check/Import.rsc|:234,57: "No module scope found for analysis::diff::TextEdits"

Stacktrace:

	at getModuleScope(|lib://rascal-core/lang/rascalcore/check/Import.rsc|(9047,384,<225,0>,<235,1>))
	at prepareForCompilation(|lib://rascal-core/lang/rascalcore/check/Import.rsc|(10886,38,<263,17>,<263,55>))
	at rascalTModelForLocs(|lib://rascal-core/lang/rascalcore/check/Checker.rsc|(16482,77,<385,38>,<385,115>))
	at check(|lib://rascal-core/lang/rascalcore/check/Checker.rsc|(22699,64,<545,9>,<545,73>))
	at $shell$(|main://$shell$|)

DavyLandman avatar Aug 30 '24 09:08 DavyLandman

Okay, this message appears when the module doesn't exist. it should have been analysis::diff::edits::TextEdits

DavyLandman avatar Aug 30 '24 13:08 DavyLandman

@PaulKlint maybe this should not be an exception, but an error reported via the summary? since we know for which import this holds?

DavyLandman avatar Aug 30 '24 14:08 DavyLandman

This is a long overdue improvement that looks simpler than it actually is. Reason: the natural place to check for a non-existing module is the collect rule for import/extend. However, the modular structure of the Rascal program is analyzed long before those rules are reached. Therefore non-existing modules could create havoc during this analysis. The module existence check is now implemented in that early fase, hopefully making the checker much more robust.

PaulKlint avatar Aug 31 '24 19:08 PaulKlint

After testing, I will push this fix.

PaulKlint avatar Aug 31 '24 19:08 PaulKlint