An idiom for disabling implicit conversions

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Tue Aug 26 09:48:08 PDT 2014


On 08/26/2014 05:46 PM, Uranuz wrote:
> In the pre-last paragraph please read text^
> Also notice that C is language with weak type system but D is
> declared to have type system.
>
> as:
> Also notice that C is language with weak type system but D is
> declared to have *strong* type system.

It's not _that_ strong. Also, this is a library problem.

I'd suggest you file a bug report/enhancement request against Phobos, if 
it is not already there.
https://issues.dlang.org/

It seems that adding some constructor(s)/opAssign(s) to Nullable will 
solve this problem.

( BTW: You are more likely to get a quick response if your post looks a 
little bit more digestible, like:

On 08/26/2014 05:38 PM, Uranuz could have written:
> // ---
> import std.typecons;
> void main(){
>     Nullable!ubyte x;
>     Nullable!int y=x; // AssertError: Called 'get' on null Nullable!ubyte
> }
> // ---
> import std.typecons;
> void main(){
>     Nullable!ubyte x;
>     Nullable!int y;
>     y=x; // AssertError: Called 'get' on null Nullable!ubyte
> }
> // ---
>
> Is this a bug?

Or you could have gone straight to https://issues.dlang.org/. :) )


More information about the Digitalmars-d mailing list