NaBL treats two definitions with same name but different properties as duplicates
If I have a NaBL rule like this:
TypeDef(name, cnt): defines Type name of param-count cnt
Then two
TypeDef
s that only differ onparam-count
, e.g.TypeDef("Func", 1)
andTypeDef("Func", 2)
, result in a Duplicate definition error. I would expect NaBL to distinguish the two definitions by their properties and not generate an error. This is neccesary to implement generics (distinguishingFunc<TResult>
fromFunc<T1, TResult>
) and overloading (distinguishingf(x : int)
fromf(x : string)
).I’ve added a project that demonstrates this issue.
I can’t use the
Submitted by D. Pelsmaeker on 27 June 2014 at 12:26non-unique
keyword here, as that would join all definitions into one, whereas I need separate definitions.
Attachments
Issue Log
You should turn off the default duplicate check and implement your own check instead. See the assignments of IN4303 on how to do this.
This currently is intended behaviour. You can disable the duplicate definition error by adding nabl-check-disable-duplicate(|uri, ns) = ?NablNsType(), and creating your own constraint rule that checks for this.
Log in to post comments