[Issue 3231] Function declared to return a type with its same name doesn't compile

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Aug 7 09:58:06 PDT 2009


--- Comment #7 from BCS <shro8822 at vandals.uidaho.edu>  2009-08-07 09:58:05 PDT ---
(In reply to comment #5)
> The bug was filed as a blocker for the .net implementation because there are
> cases like this System.Text.RegularExpressions that has a static Match
> Match(System.String, System.String) method.
> I think that marking the bug as invalid because of a limitation in the
> implementation is ridiculous.
> The fix (which I am applying to the my source tree at
> http://dnet.codeplex.com/) is very simple: continue the look up in enclosing
> scope.

Short of cases like this (illegal in both C# and D):

    class Foo
        class Bar { }
        Bar Bar() { return new Bar(); }

There is no need to alter the compiler, just require fully qualified names.
Heck, for imports of other CLR code via meta-data, that isn't even needed as
IIRC assemblies alway use fully qualified names internally.

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