From f337ffd255a44fee4518c952cd3d961565d2e781 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Sat, 4 Jun 2016 10:54:21 -0400 Subject: [PATCH] modelbuilder: stop reporting hints again and again. It could be time consuming. Signed-off-by: Jean Privat --- src/modelbuilder_base.nit | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/modelbuilder_base.nit b/src/modelbuilder_base.nit index 85bb115..5cc235f 100644 --- a/src/modelbuilder_base.nit +++ b/src/modelbuilder_base.nit @@ -348,6 +348,12 @@ class ModelBuilder var name = qid.n_id.text var qname = qid.full_name + if bad_class_names[mmodule].has(qname) then + error(qid, "Error: class `{qname}` not found in module `{mmodule}`.") + return + end + bad_class_names[mmodule].add(qname) + var all_classes = model.get_mclasses_by_name(name) var hints = new Array[String] @@ -404,6 +410,10 @@ class ModelBuilder error(qid, "Error: class `{qname}` not found in module `{mmodule}`.") end + # List of already reported bad class names. + # Used to not perform and repeat hints again and again. + private var bad_class_names = new MultiHashMap[MModule, String] + # Return the static type associated to the node `ntype`. # `mmodule` and `mclassdef` is the context where the call is made (used to understand formal types) # In case of problem, an error is displayed on `ntype` and null is returned. -- 1.7.9.5