Stream: cimpl
Topic: Namespace query
Kurt Allen (Jul 09 2019 at 21:55):
Hello @Mark Kramer and @Chris Moesel
I created an entry called 'Orientation' in the namespace 'breastrad'. There is also an Orientation in shr.core. I get the following error message.
ERROR shr: Found conflicting definitions for Orientation in multiple namespaces: breastrad,shr.core. ERROR_CODE:11022 (module=shr-text-input, file=CIMPL\Generated\Resources\BreastAbnormality.txt, shrId=breastrad.BreastAbnormality)
Is it the design to not allow entries having the same name in different namespaces? If so, what does a namespace do other than sit there and look pretty :-) ?
Mark Kramer (Jul 09 2019 at 21:58):
It shouldn’t be an error, but you may have to use the fully qualified name in certain places. Or it might be a CIMPL compiler bug.
Kurt Allen (Jul 09 2019 at 22:07):
Hey @Mark Kramer
That was my bad. I thought it was complaining that I created an item with the same name, but the error was that I was referencing Orientation without fully qualifying the name so it didn't know which one to use. I referenced it with the fully qualified name and the error went away.
The Orientation reference was from an entry property defined in the same namespace as the Orientation element definition, so it might make sense when the name is not fully qualified to automatically use the 'local' definition even if there is a non local definition.
Chris Moesel (Jul 10 2019 at 02:31):
Oops. I just wrote a whole long-winded response to your question, and then just noticed Mark already responded and it is resolved. That said, I agree -- I think it makes sense to prefer the current namespace when resolving names, even if there is a conflict. You should only need the FQN to resolve an element to an external namespace.
Chris Moesel (Jul 10 2019 at 02:33):
I'll log a bug so it's on our list.
Kurt Allen (Jul 10 2019 at 21:23):
Thanks!
Last updated: Apr 12 2022 at 19:14 UTC