-
Notifications
You must be signed in to change notification settings - Fork 548
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
Static methods #1847
Comments
Introducing static methods at this point seems reasonable, especially since Go+ already has the concept of classfile. However, the "right cast" appears somewhat peculiar. It seems to create more problems than it solves. For instance, in this example:
It's unclear which method |
eg. func T.rcast(v T) int // convert T to int |
parser/printer: Static methods (#1848) |
Basic
Go syntax:
Go+ syntax:
Go+ classfile syntax:
Here
T.New
is a normal static method. The general static method syntax is:Typecast
explicit cast:
implicit cast:
right cast:
Note: Here static method
cast
,icast
,rcast
are special functions likeinit
in Go.The text was updated successfully, but these errors were encountered: