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 types #27

Open
saleynik opened this issue Jun 28, 2022 · 1 comment
Open

Private types #27

saleynik opened this issue Jun 28, 2022 · 1 comment
Labels
T:Feature Type: Feature

Comments

@saleynik
Copy link

It doesn't seem to be possible to define structs with private types. E.g.:

defstruct [
  a: nil,
  b: nil
]
@typep  t :: %__MODULE__{
  a: integer,
  b: binary
}

It would be great if typedstruct had a visibility or accessor attribute to control private|public visibility.

@ejpcmac
Copy link
Owner

ejpcmac commented Jul 16, 2022

Indeed, this is a miss. Not sure if there are much use cases for it, since the struct itself cannot be made private, but there is no reason for this feature not to be present.

We already have opaque: true, which we could replace in a later version by visibility: which could be :public (default), :private or :opaque.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T:Feature Type: Feature
Projects
Status: Backlog
Development

No branches or pull requests

2 participants