On Wednesday, 13 January 2021 at 19:38:55 UTC, Paul Backus wrote:
That's what Variant is--a struct that models the universal
supertype (sometimes called "Top" or "Any").
Ahh right. Good point, so it already fits.
On Wednesday, 13 January 2021 at 18:09:08 UTC, sighoya wrote:
A more natural conclusion would be to infer c to the most
common supertype as other inferences would unnecessarily
exclude future assignments to c. But the most common supertype
doesn't seem to exist, and I'm unsure if this type can
On Wednesday, 13 January 2021 at 16:17:02 UTC, Marcone wrote:
import std;
void a(int b){
}
void main()
{
Variant c = 10;
a(c); // Error
}
Need more sugar.
Two problems:
1.) Variant is library defined, compared to the language level
there isn't a default strategy to choose int32 here, i
On 1/13/21 8:17 AM, Marcone wrote:
> import std;
>
> void a(int b){
> }
>
> void main()
> {
>Variant c = 10;
>a(c); // Error
> }
>
> Need more sugar.
That can't work in a strongly statically typed language. The call a(c)
is decided at compile time but Variant is not an int at compile ti
import std;
void a(int b){
}
void main()
{
Variant c = 10;
a(c); // Error
}
Need more sugar.