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

Allow stored properties to satisfy property requirements #1555

Open
kyouko-taiga opened this issue Aug 16, 2024 · 0 comments
Open

Allow stored properties to satisfy property requirements #1555

kyouko-taiga opened this issue Aug 16, 2024 · 0 comments

Comments

@kyouko-taiga
Copy link
Contributor

The following currently doesn't compile but it should:

public trait SliceSource {
  type Base
  property contents: PointerToMutable<Base> { let }
}

public type ImmutableSliceSource<Base: Collection>: SliceSource {
  public let contents: PointerToMutable<Base>
  public memberwise init
}

Until this feature is implemented, the workaround is to declare a property that yields the stored value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant