If type parameters cannot be inferred from the context, an error is shown. This includes optional type parameters. For classes, this behavior prevents initializing the type parameters to some initial state:
enum TrainingState {
Untrained
Trained
}
class Regressor1<State sub TrainingState = TrainingState.Untrained>() {
@Pure fun fit() -> regressor: Regressor1<TrainingState.Trained>
}
Desired solution
For classes, don't show this error for optional type parameters.
Is your feature request related to a problem?
If type parameters cannot be inferred from the context, an error is shown. This includes optional type parameters. For classes, this behavior prevents initializing the type parameters to some initial state:
Desired solution
Possible alternatives (optional)
No response
Screenshots (optional)
No response
Additional Context (optional)
No response