Is there a plan to do something about the platform...
# language-evolution
l
Is there a plan to do something about the platform type marker
!
? 'Cause Java is introducing
T!
as non-null type marker and it could be a bit confusing from Kotlin's perspective in the future.
c
I wonder. It's an important part of the language, so changing it is difficult. But also, it can't appear in code, so maybe it's a purely cosmetic change? I mean, using another symbol shouldn't break existing code, right?
b
Petition to move to the interrobang for platform types šŸ‘€ Mostly joking, though it could be a pretty intuitive analogy for communicating unknown nullable/non-null (`?
/
!`) types
ā£ļø 1
c
I mean… If we can't type it anyway, does it matter that it's unicode?
I do like the idea,
String‽
has a nice look
the Slack font makes it a bit hard to read though
šŸ‘† 1
šŸ˜… 1
ā‰ļø 1
e
there's so many possibilities with unicode ;)
Copy code
String⁉
String⁈
String‼
āø®String
ĀæString
”String
⸘String
šŸ™ƒ 2
m
No plans so far, the proposal is still in its early stages, and as you mentioned, our
T!
notation is used only internally. For instance, in the IDE, we could treat
String!
as regular non-null
String
types in Kotlin, but load
String
from Java as
String..String?
to avoid confusion
ā¤ļø 2
k
I hope not! I wouldn't like to see a platform type referred to as
ConcurrentNavigableMap<AsynchronousByteChannel..AsynchronousByteChannel?, RandomAccessFile..RandomAccessFile?>..ConcurrentNavigableMap?<AsynchronousByteChannel..AsynchronousByteChannel?, RandomAccessFile..RandomAccessFile?>
āž• 3
l
How about
ConcurrentNavigableMap<AsynchronousByteChannel(?), RandomAccessFile(?)>(?)
? Just mark it as "optional"?
Also another similar thing I'd like to propose: When using Java builtin collection types, show them as
(Mutable)X
, such as
(Mutable)List
. Currently the
MutableList..List
thing is a little obscuring. So combined with
(?)
, it now shows
(Mutable)List<String(?)>(?)
(try to imagine the
..
form).
k
But the
ClassName(?)
syntax would look a little bit like a constructor call.
m
Maybe just 😬
Copy code
ConcurrentNavigableMap<AsynchronousByteChannel!?, RandomAccesFile!?>!?
n
why is the code screaming at me!?
🐱 1
m
because it's Java (interop), thats cause for screaming 😬
😿 1