What is the reasoning behind the lack of conversions when passing parameters
Walter Bright
newshound2 at digitalmars.com
Wed Feb 14 04:41:45 UTC 2024
On 2/13/2024 4:38 PM, Carl Sturtivant wrote:
> Variant is important to some of us because of its universality. If all
> conversions are blocked for parameter passing, can a replacement of Variant (say
> Any) be added to the list to be a part of the language?
>
> This would be so that any literal or value of any type can be passed to a
> parameter of type Any, enabling naive scripting and experimenting in any context
> without an import.
Isn't that what a sumtype is?
More information about the Digitalmars-d
mailing list