I’m trying to get a nabl-constraint rule that matches on all defs in the AST.

nabl-constraint(|ctx):
	a -> <fail>
		where
			<debug>a;
			uri := <nabl-uri> a
			// maybe generate constraint-errors

However nabl-uri called on the This() construct triggers a stack trace

Internal error evaluating strategy editor-analyze
...
origin_track_forced_1_0
nabl_siblings_0_4
nabl_collect_1_4
nabl_annotate_properties_0_4
try_1_0
nabl_constraint_0_1
nabl_uri_0_0
fetch_elem_1_0
nabl_uri_0_0
nabl_collect_one_resolved_def_0_0
insert_results_or_delay_0_0
task_delay_0_0

Is nabl-uri not designed to simply fail if there is no url?

The This() constructor refers to an implicitly defined implicitly defines This This() maybe this causes the error (that there is a definition but no uri)

Submitted by Daco Harkes on 20 November 2014 at 18:33

On 20 November 2014 at 18:51 Guido Wachsmuth commented:

nabl-constraint is called during task collection, but nabl-uri tries to get a resolved definition URI, which only works after task evaluation. Your constraint checks should be based on the resolution task, not on the URI of the resolved reference.


On 24 November 2014 at 10:49 Daco Harkes commented:

Is there also task equivalents of nabl-uri, nabl-uri-namespace, nabl-uri-parent and nabl-uri-name?


On 24 November 2014 at 11:01 Daco Harkes commented:

Oh, btw, it works fine on all the other names in the program. Even if reset&reanalyse is called.
Shouldn’t nabl-uri fail on all calls during collection?


On 26 November 2014 at 14:27 Daco Harkes commented:

nabl-uri only works on names that are a Def during collection, not on names that are a use.

Using <not(nabl-has-reference)>name fixes this.


On 26 November 2014 at 14:27 Daco Harkes closed this issue.

Log in to post comments