Skip to content
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 methods of a an exported object are publicly exported #18

Open
SamuraiCrow opened this issue Nov 13, 2021 · 1 comment
Open
Labels
bug Something isn't working

Comments

@SamuraiCrow
Copy link
Contributor

EXPORT OBJECT arf PRIVATE
  bla
ENDOBJECT

EXPORT PROC dog() OF arf IS WriteF('I should be exported.')

PROC cat() OF arf IS WriteF('I should not be exported.')

Using viewmodule reveals that the cat() method is also exported.

As a workaround, make cat a local function and pass in self as a PTR TO arf so it is not a method of arf directly.

PROC cat(self:PTR TO arf) IS WriteF('I am not exported now.')
@SamuraiCrow SamuraiCrow added bug Something isn't working Low priority labels Nov 13, 2021
@SamuraiCrow
Copy link
Contributor Author

Note that:
self.cat()
becomes
cat(self)
when using the workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant