[Issue 10616] class C: C.D{static class D{}} does not work

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 18 10:53:28 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10616



--- Comment #2 from timon.gehr at gmx.ch 2013-07-18 10:53:27 PDT ---
(In reply to comment #1)
> That's a borderline enhancement request.

No, it is a bug report. C.D is a perfectly fine base class.

> It might potentially break code too,
> e.g. this currently works:
> 
> -----
> class D
> {
> }
> 
> class C : D
> {
>     static class D
>     {
>     }
> }
> -----
> 
> With the enhancement this would have to become a conflict,

I am not arguing for any enhancement that would change the meaning of the above
code.

> although the
> workaround would be easy: one could use 'class C : .D' (dot expression) for the
> global class and 'class C : D' for the nested one. But I'm not fond of such
> lookup rules where something in an inner scope ends up conflicting with an
> expression in an outer scope.
> ...

I generally like shadowing, but it would indeed be utterly pointless to look up
a classes' parents inside its own scope.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list