Let me do this:
const x: String | Int
Instead of enum MyEnum {
case string(String)
case int(Int)
}
There's an existing proposal for this here:https://forums.swift.org/t/re-proposal-type-only-unions/7270...
To understand the difference, `String | String` is just `String`. It's a union, not a sum type. There's no tag or identifier, so you cannot distinguish whether it's the first or the second string.
If this sounds pedantic, this has pretty important ramifications, especially once generics get involved.
I am a hardcore DayZ player. DayZ does not work on Proton[0]. I cannot use Linux as my main gaming platform. Battlefield 6 does not work. Latest Call of Duty does not work. You can talk about voting with your wallet, but when millions of people are buying the game, your one non-vote means nothing.
So either you punish yourself and refuse to play with friends, or you punish yourself and install windows. It’s a damned situation regardless of your choice
[0] point me to as many compatibility databases as you want, the game will not start on my vanilla Ubuntu build
https://store.steampowered.com/app/2121980/Void_Stranger/
For all that is holy, please don't read anything about it. And I really mean that! Just trust and go in blind. You will have an amazing time. It is truly one of the most unique gaming experiences and it is the kind of game you can only play once.
Hypothetically, no, the float type would not admit NaNs. You would be prevented from storing NaNs in them explicitly, and operations capable of producing NaNs would produce a `float | nan` type that is distinct from float, and can't be treated like float until it's checked for NaN.
And I'm not sure why it's being discussed as though this is some esoteric language feature. This is precisely the way non-nullable types work in languages like Kotlin and TypeScript. The underlying machine representation of the object is capable of containing null values, yes, but the compiler doesn't let you treat it as such (without certain workarounds).
This is fine, I guess, but it will cause a bunch of problems since e.g. Division of two floats has to be able to return NaNs. At that point you either need to require a check to see if the value is NaN (inconvenient and annoying) or allow people to just proceed. Not sure I am exactly sold on this so far.
I really do wonder whats the chain here. Did Sam see the Opus announcement and DM someone a minute later?