nabl-uri throws trace
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 theThis()
construct triggers a stack traceInternal 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
Submitted by Daco Harkes on 20 November 2014 at 18:33This()
constructor refers to an implicitly definedimplicitly defines This This()
maybe this causes the error (that there is a definition but no uri)
Issue Log
nabl-constraint
is called during task collection, butnabl-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.
Is there also task equivalents of
nabl-uri
,nabl-uri-namespace
,nabl-uri-parent
andnabl-uri-name
?
Oh, btw, it works fine on all the other names in the program. Even if reset&reanalyse is called.
Shouldn’tnabl-uri
fail on all calls during collection?
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.
Log in to post comments