-
Notifications
You must be signed in to change notification settings - Fork 229
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
Private Method isn't private #240
Comments
PS: I've used Gravity version 0.5.0. |
Hi @felipetesc I should probably explain it better, but in the current implementation private means private from the outside and not from within the class itself. |
Yes, I understood that previously, and I've used the function which the signature is private func get_public() from outside the class, inside the main func. Perhaps the previous example is confuse, so here it's another:
When I execute gravity main.gravity I've got this result: |
@felipetesc seems like an issue that needs to be fixed. Thanks! |
Hello there. I was writing some examples to test and document the access modifiers and I found that the code below works:
As result, from the terminal, I get :
Get public var from private method = I'm public!
I donno, but I guessing that the keyword private before the keyword func should print the same, or almost the same value, as in "puts("Private var holds = " + test.my_hidden_var );", which is :: RUNTIME ERROR: Unable to find my_hidden_var into class TestAccessModifiers
Thanks!
The text was updated successfully, but these errors were encountered: