DIP66 v1.1 (Multiple) alias this.

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Tue Dec 23 22:17:27 PST 2014


On 12/23/14 8:54 PM, Walter Bright wrote:
>
> The current behavior of:
>
>      is (D : B)
>
> is the expression will evaluate to false if D does not compile. However,
> a compile time error will be issued if B does not compile.
>
> If D and B compile, then it will evaluate to false if B is not
> implicitly convertible to D. This suggests to me Option 1, i.e. if the
> implicit conversion fails due to ambiguity errors, then it should return
> false (not issue a compile time error).

Though I agree it makes sense to just return false, I think it would be 
more sensible and useful to issue an error. If B is reachable from B 
through multiple paths, that's a new situation distinct from yes/no.

In fact a better thought: as soon as D is defined, repeated subtyping 
should be detected as an error. Then there's no question about "is" in 
the first place :o).


Andrei



More information about the Digitalmars-d mailing list