Open alexandru opened 1 year ago
Is it ready for use? e.g. @SethTisue on Discord a few months ago:
seconded that -Yexplicit-nulls isn't really that usable yet, but I just want to note that it's being worked on: https://github.com/lampepfl/dotty/pull/18112
https://discord.com/channels/632150470000902164/632150470000902166/1131611679566872698
Anyway, in general -Y
flags should be considered guilty until proven innocent. -Y
is a signal that something is internal and/or not-ready-for-prime-time
I'd enable it 🤷♂️
sbt-tpolecat
is a plugin that enables errors in case of unused imports or unused variables, and there's nothing more annoying than that.
The “platform types” in Kotlin are well implemented, as the compiler is also looking at @NonNull
and @Nullable
annotations from Java's ecosystem. I hope that Scala implements that as well, but meanwhile, while we're waiting, I want explicit nulls for protection against Java APIs, and I don't mind using .nn
all over the place.
IMHO this issue also seems like a major impediment to using explicit null
s.
This use of
Option
is idiomatic for handling possibly-null
values, so it seems ironic that it isn't available when using explicit nulls.
That untagged unions aren't used yet in the stdlib is such a pity, as it would improve type safety by a lot.
Anyway, in general
-Y
flags should be considered guilty until proven innocent.-Y
is a signal that something is internal and/or not-ready-for-prime-time
honestly the compiler/language doesn't do a great job at marketing this, I've worked in scala for 9 years and it's the first time I'm hearing that these aren't prime time 😅
Hello,
I noticed that version 0.5.0 doesn't enable
-Yexplicit-nulls
on Scala 3.Any reasons for it?