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

Enforcing Protocol Conformance for Standard Constraints #78

Open
1 task done
PSchmiedmayer opened this issue Aug 2, 2023 · 0 comments
Open
1 task done

Enforcing Protocol Conformance for Standard Constraints #78

PSchmiedmayer opened this issue Aug 2, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@PSchmiedmayer
Copy link
Member

PSchmiedmayer commented Aug 2, 2023

Use Case

At the current point, we can not enforce that a Standard Constraint actually conforms to the Standard protocol.

Problem

We need to enforce protocol conformance for existential types at compile time or runtime.
Currently, it is possible to define a constraint without conforming it to Standard, resulting in issues with actor isolation and undefined runtime behavior or runtime crashes:

protocol StandardConstraint {
    // ...
}

Solution

We have created a forum thread to ask for advice on this problem: https://forums.swift.org/t/enforcing-protocol-conformance-for-existential-types-at-compiletime-or-runtime/66215.

We are unaware of any possible solutions to enforce the protocol conformance on runtime or compile time.

A possible element to explore might be the usage of a macro instead of a property wrapper for the @StandardActor usage. Using a macro might give us more insights about the type and possible enforce more elements.

Code of Conduct

  • I agree to follow this project's Code of Conduct and Contributing Guidelines
@PSchmiedmayer PSchmiedmayer added the enhancement New feature or request label Aug 2, 2023
@PSchmiedmayer PSchmiedmayer moved this to Backlog in Project Planning Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

1 participant