From 36ccaa486dcb0b9bc4981b00a65539cf0cc7ceb4 Mon Sep 17 00:00:00 2001 From: paulklint Date: Wed, 11 Mar 2026 13:05:04 +0100 Subject: [PATCH 1/2] Fix typechecker warnings --- src/analysis/typepal/Exception.rsc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/analysis/typepal/Exception.rsc b/src/analysis/typepal/Exception.rsc index 1b23296..96101dc 100644 --- a/src/analysis/typepal/Exception.rsc +++ b/src/analysis/typepal/Exception.rsc @@ -20,12 +20,12 @@ module analysis::typepal::Exception extend analysis::typepal::FailMessage; data RuntimeException - = TypePalUsage(str reason) // TypePal used incorrectly - | TypePalUsage(str reason, list[loc] details) // TypePal used incorrectly, with additional details - | TypePalInternalError(str reason) // TypePal internal error - | TypeUnavailable() // Type is not available: used in control flow of solver - | checkFailed(list[FailMessage] msgs) // Type check failed: used in control flow of solver - | wrongTplVersion(str reason) // Outdated TPL version is used + = TypePalUsage(str msg) // TypePal used incorrectly + | TypePalUsage(str msg, list[loc] details) // TypePal used incorrectly, with additional details + | TypePalInternalError(str msg) // TypePal internal error + | TypeUnavailable() // Type is not available: used in control flow of solver + | checkFailed(list[FailMessage] msgs) // Type check failed: used in control flow of solver + | wrongTplVersion(str msg) // Outdated TPL version is used ; data Exception From 77c94cd62c71f18758cea15b5e7d8228e9dbc851 Mon Sep 17 00:00:00 2001 From: paulklint Date: Sun, 29 Mar 2026 11:02:37 +0200 Subject: [PATCH 2/2] Fixes https://github.com/usethesource/rascal/issues/2442 --- src/analysis/typepal/Collector.rsc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/analysis/typepal/Collector.rsc b/src/analysis/typepal/Collector.rsc index db8a7e7..872093c 100644 --- a/src/analysis/typepal/Collector.rsc +++ b/src/analysis/typepal/Collector.rsc @@ -956,11 +956,11 @@ Collector newCollector(str modelName, map[str,Tree] namedTrees, TypePalConfig co if(logicalLoc != def.defined){ if(logicalLoc in logical2physical){ if(logical2physical[logicalLoc] != def.defined){ - causes = [ info("Clone of ``", logical2physical[logicalLoc]), - info("Clone of ``", def.defined) + causes = [ info("First declaration of ``", logical2physical[logicalLoc]), + info("Second declaration of ``", def.defined) ]; // restrict clone location to first line for readability - messages += error("Remove code clone for ``", limitLocToFirstLine(def.defined), causes=causes); + messages += error("Duplicate declaration of ``", limitLocToFirstLine(def.defined), causes=causes); } } logical2physical[logicalLoc] = def.defined;