Repository navigation
Explicit Type Parameters #502
Replies: 2 comments 8 replies
|
I like the idea in general, but I do not like yet another keyword. In my mental model there are two different kinds of "modifiers":
The key difference is that every programmer is expected to know all keywords, but not all annotations. They have different level of requirements. Of course, there are bad examples of annotations like So, I suggest using annotation for this instead. |
|
I also like the idea but i would agree that introducing new modifiers and keywords can increase the complexity for both people that already are using the language and new learners. I'm not sure but is it possible to achieve this with contracts? If doing this with contracts is not possible then i agree that using an annotation for this is more appropriate since the frequency of it is not that high Also a note, in the document you mention:
I believe its safe to say that a big percentage of users is not aware when the type would affect the runtime behaviour. Will the compiler/ide give hints about this? Or how can we "force" defining a type as explicit? |
Uh oh!
There was an error while loading. Please reload this page.
This is a discussion of explicit type parameters KEEP.
The proposal introduces explicit type parameters for Kotlin functions.
Type arguments have to be passed explicitly for such type parameters on all call-sites:
All reactions