--- Comment #5 from Kenji Hara <k.hara...@gmail.com> 2012-06-14 01:13:26 PDT ---
(In reply to comment #4)
> (In reply to comment #3)
> > typeof(null) is a subtype of array/class/pointer types. By return type
> > covariance rule, B.foo should be able to override A.foo.
> Since A is not a base class of null, I do not think this is valid. foo could
> return B, and that will work, because A is a base class of B.
No. Indeed A is not a base class of null _liteal_, but A is a base _type_ of
Current dmd compiles following tests:
static assert(is(typeof(null) : int)); // int is a base type of
static assert(is(typeof(null) : Object)); // Object is a base type of
static assert(is(typeof(null) : int*)); // int* is a base type of
I have implemented typeof(null) as like Scala's Nothing type, so this is
In other words, typeof(null) is the most derived class type from all of class
types. So dmd should compile the original code.
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------