Currently, there is no compile-time validation of the enforcement of constraints to the Standard in the configuration. E.g., the following code would compile even though the ExampleStandard does not conform to ExampleConstraint:
protocol ExampleConstraint: Standard {
// ...
}
class ExampleComponent: Component {
@StandardActor var standard: any ExampleConstraint
// ...
}
actor ExampleStandard: Standard {
// ...
}
var configuration: Configuration {
Configuration(standard: ExampleStandard()) {
ExampleComponent()
// ...
}
}
Solution
The compiler should emit a warning that the ExampleStandard does not conform to ExampleConstraint when defining it in the Configuration.
Unfortunately, this doesn't seem to be easily achievable in Swift and needs some further investigation.
Additional context
No response
Code of Conduct
[X] I agree to follow this project's Code of Conduct and Contributing Guidelines
Problem
Currently, there is no compile-time validation of the enforcement of constraints to the
Standard
in the configuration. E.g., the following code would compile even though theExampleStandard
does not conform toExampleConstraint
:Solution
The compiler should emit a warning that the
ExampleStandard
does not conform toExampleConstraint
when defining it in theConfiguration
.Unfortunately, this doesn't seem to be easily achievable in Swift and needs some further investigation.
Additional context
No response
Code of Conduct