Summary: | Can't have two classes in different packages named the same | ||
---|---|---|---|
Product: | [Applications] umbrello | Reporter: | Anthony Parent <tonyp> |
Component: | general | Assignee: | Umbrello Development Group <umbrello-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Anthony Parent
2004-06-15 23:37:22 UTC
> I have a class in the global namespace [...]
> I figured I would create the same name in the sub
> namespace, copy things to it, then delete the original.
The hitch here is the class in the global namespace.
Inner classes have visibility to outer classes.
If you move the class from the global namespace to
a different package then things should be fine -
can you verify?
Because of issues documented in bug #83448 I can't move the class in the global namespace into a sub package. However, if I create a new class of a different name in a sub-package, then attempt to create a class of the same name in a different sub-package, it works. It shouldn't matter what the package path is however. I should be able to create a class in any package that doesn't already have a class of that name. Foo::bar is not the same as ::bar or Foo::Foo2::bar > It shouldn't matter what the package path is however. > I should be able to create a class in any package that > doesn't already have a class of that name. In principle I agree, but we have to be careful here: > Foo::bar is not the same as ::bar or Foo::Foo2::bar However, Foo::Foo2::bar has visibility of Foo::bar which in turn has visibility of (i.e. re-declares) ::bar. Now, it might be that a given programming language has a rule that says that inner declarations hide same-named outer declarations, but that behaviour is still programming language dependent. > However, Foo::Foo2::bar has visibility of Foo::bar which
> in turn has visibility of (i.e. re-declares) ::bar.
> Now, it might be that a given programming language has
> a rule that says that inner declarations hide same-named
> outer declarations, but that behaviour is still programming
> language dependent.
OK, I understand that a specific language may not handle this type of declaration hiding. However, does it make more sense to put the smarts for this in the UML editor, or in the code generation? Just my $0.02, the smarts for different languages should be in the I/O for the particular language, not burried in the more generic UML editor. (Some languages don't handle enums or for that matter namespaces, but that doesn't mean we leave them out of the UML diagrams.)
I think umbrello is a great tool, and getting better all the time, allowing this type of (IMHO) just another increment towards being the best.
*** Bug has been marked as fixed ***. |