DIPX: Enum Literals / Implicit Selector Expression

Walter Bright newshound2 at digitalmars.com
Fri Jul 1 05:28:24 UTC 2022


On 6/30/2022 8:41 AM, ryuukk_ wrote:
>      Color color = .orange; <--- it obviously pick orange, it already expect an 
> enum

That is top-down type inference. D is designed to be bottom-up type inference. 
Because of overloading, having both top-down and bottom-up in play would be very 
confusing and likely a rich source of confusing bugs. People find overloading 
confusing enough already.


More information about the Digitalmars-d mailing list