-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Builtin methods shall not be publicly visible #6282
Comments
Is this still true? If so push back down! |
Yes, I can still reproduce this issue. |
Rather than improving builtins as this issue suggests, we should make sure they are more hidden!
E.g. let's restrict usage of
|
@JaroslavTulach That makes sense. Generally, it is very difficult to achieve the same dispatch mechanism for builtin methods as for standard methods. Making sure that builtin methods can be invoked only in either
I agree with both points. @hubertp - As one of the original builtin methods mechanism creators, can you see something that could potentially go wrong with this idea? If not, let's do this. |
…reverting adding private; probably to be resolved in #6282
I've just investigated the current status and here are my findings. Make all
|
The
@Builtin_Method
are "different" to regular methods. Originally we wanted to make them behave the same as regular methods, but there is other solution: hide builtin methods!Let's restrict usage of
@Builtin_Method
:@Builtin_Method
annotation is used in non-private
module@Builtin_Method
annotation is used elsewhere thanStandard.Base
(or ratherStandard.Builtins
module)The first rule hides the builtin methods from Enso users. The second rule makes sure the builtin methods are only used by experienced developers working on Enso.
Original Report
The following snippet
outputs:
In other words, a builtin method can be called as an instance method (
dur1.plus_builtin dur2
), but cannot be called as a static methodDuration.plus_builtin dur1 dur2
. This works for all the other non-builtin methods.Tasks
The text was updated successfully, but these errors were encountered: