Refined types [almost OT]

Meta via Digitalmars-d digitalmars-d at puremagic.com
Sun Oct 12 12:41:34 PDT 2014


On Sunday, 12 October 2014 at 19:36:35 UTC, bearophile wrote:
> Meta:
>
>> On Sunday, 12 October 2014 at 16:21:50 UTC, bearophile wrote:
>> What happens if one of these conditions fails? Is an exception 
>> thrown?
>
> If you are using refined types, and D is somewhat assuming they 
> are refinements of those types, and one of those condition 
> fails, then you surely have a compile-time type error, because 
> those conditions are an intrinsic part of those type definition.
>
> Bye,
> bearophile

It's not possible to issue a compile-time error for runtime 
arguments, though, and it can already be done in D using template 
constraints for compile-time arguments.


More information about the Digitalmars-d mailing list