[NBL] fails to resolve in the presence of multiple references to different namespaces
Doesn’t properly resolve a Var(x) where x refers to a Field. We think this is due to the presence of multiple namespaces in the rule for Var since the Type(x) rules resolve properly.
namespacesModule Class Field Function Variable
rules
Submitted by Hassan Chafi on 28 October 2012 at 06:11Module(x, _) : defines Module x scopes Class Class(x, _) : defines Class x of type Type(x) scopes Field Parameter(t, x) : defines Variable x of type t Field(t, x) : defines Field x of type t Function(x,p*,b) : defines Function x scopes Variable Type(x) : refers to Class x refers to Class "String" refers to Class "Int" Var(x): refers to Variable x refers to Field x
Issue Log
This is a bug in the name resolution algorithm.
A workaround is to change every “scopes Field” and “scopes Variable” to scope both Fields and variables:Class(x, _) : defines Class x of type Type(x) scopes Variable, Field Function(x,p*,b) : defines Function x scopes Variable, Field
I made the changes, but still having an issue. resolution fails for Fields inside a function.
Can you show me your project so I can have a look?
I will email you the code.
Should work with 1.1 already.
This should at least be confirmed before 1.1.
This issue is caused by a missing scope.
Currently, classes scope fields. A field
f
in classc
gets a URIField://c/f
. Functions scope variables. A variablev
in functionf
gets a URIVar://f/v
. When a variable or field referencevf
is resolved, the following URIs can be resolved:Var://f/vf
,Field://f/vf
,Var://vf
,Field://vf
. None of these URIs will meet the URI of an actual field, since the class name is missing in the URI.The definition can be fixed by classes scoping functions. This will include class names in the URIs:
Var://c/f/vf
,Field://c/f/vf
,Var://c/vf
,Field://c/vf
(this one will actually match fields in the surrounding class),Var://vf
,Field://vf
.
Log in to post comments