-
Key: KERML_-73
-
Status: open
-
Source: Model Driven Solutions ( Mr. Ed Seidewitz)
-
Summary:
It is allowable to have imports at the top-level in a root namespace. If such an import is public, then anything so imported becomes visible in the scope of the global namespace, without qualification. This can potentially introduce name resolution ambiguities that makes global namespace resolution much more difficult.
For example, consider the following three root namespaces (perhaps from separate textual notation files);
package Namespace1 { classifier A; classifier B; }
public import Namespace1::*; package Namespace2 { ... }
public import Namespace1::*; package Namespace3 { ... }
The classifiers A and B are now globally available not only as Namespace1::A and Namespace1::B from the first root namespace, but also by the unqualified names A and B from both of the other two root namespaces. (And this ambiguity is not invalid according to the global namespace name resolutions rules in 8.2.3.5.4.)
While it can be useful to be able to import names at the top-level into a root namespace, it does not seem necessary to be able to publicly re-export such names into the global namespace. So, disallowing public imports in the root namespace would simplify global name resolution without really removing any particularly useful functionality.
-
Reported: KerML 1.0b2 — Sun, 5 May 2024 23:30 GMT
-
Updated: Wed, 17 Jul 2024 03:48 GMT
KERML_ — Disallow public imports at root level
- Key: KERML_-73
- OMG Task Force: Kernel Modeling Language (KerML) 1.0 FTF 2