Skip to content

Commit

Permalink
buildLogical2physical: wrap MultipleKey exception as error
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulKlint committed Oct 4, 2024
1 parent 93b1024 commit 2ee8e1d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/analysis/typepal/Collector.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,14 @@ Collector newCollector(str modelName, map[str,Tree] namedTrees, TypePalConfig co

map[loc,loc] buildLogical2physical(Defines defines){
map[loc,loc] my_logical2physical = logical2physical;
map[loc,loc] my_physical2logical = invertUnique(logical2physical);
map[loc,loc] my_physical2logical = ();
try {
my_physical2logical = invertUnique(logical2physical);
} catch MultipleKey(value key, value first, value second):{
where = loc l := key ? l : |unknown:///|;
messages += error("Probably some tpl files are outdated, please clean project", where);
return ();
}
for(Define def <- defines){
logicalLoc = my_physical2logical[def.defined] ? config.createLogicalLoc(def, modelName, config.typepalPathConfig);
if(logicalLoc != def.defined){
Expand Down

0 comments on commit 2ee8e1d

Please sign in to comment.