42 ms·
Yes, IDE support would help developers find the method that is being called. This is already quite a problem given we have complex class hierarchies and interf
by rogerkeays 3y ago
Yes, IDE support would help developers find the method that is being called. This is already quite a problem given we have complex class hierarchies and interfaces with default methods. I'm not sure I see the need for an annotation though.
- haspok 3y agoA compile-time annotation could at least control whether your plugin is allowed to transform the ADT in the given context (say: for a class). Otherwise is it not possible that it transforms the ADT even when the user did not intend to? Can this be a source of mysterious bugs?
- rogerkeays 3y agoThe syntax tree is only transformed when instance method lookup fails. i.e. when your code doesn't compile in standard java form. You would be doing pretty well to accidentally call an extension method seeing as you either have to write them or import them.
- Etheryte 3y agoThis whole what-if scenario is a complete non-issue. Many other languages do this out of the box and have no issues with it.
- tsimionescu 3y agoThe key point is that they do it out of the box, so everyone is aware of it. As it is, it could easily interfere with some other non-standard extension plugin, for example.
- Etheryte 3y agoLiterally any code you write could interfere with some non-standard extension plugin, this is all pointless hot air.
- tsimionescu 3y agoWhich is one of the reasons not many use non-standard extension plug-ins for their compilers.