From 2ee8e1d19b82a265f59b95f1c5c254800fa85771 Mon Sep 17 00:00:00 2001 From: paulklint Date: Fri, 4 Oct 2024 13:09:32 +0200 Subject: [PATCH] buildLogical2physical: wrap MultipleKey exception as error --- src/analysis/typepal/Collector.rsc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/analysis/typepal/Collector.rsc b/src/analysis/typepal/Collector.rsc index 816635d..c2dc95d 100644 --- a/src/analysis/typepal/Collector.rsc +++ b/src/analysis/typepal/Collector.rsc @@ -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){