Safe-DS / DSL

Statically checked Data Science programs.
https://dsl.safeds.com
MIT License
11 stars 0 forks source link

Don't check whether type parameters with a default value can be inferred #1084

Closed lars-reimann closed 2 months ago

lars-reimann commented 2 months ago

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:

enum TrainingState {
    Untrained
    Trained
}

class Regressor1<State sub TrainingState = TrainingState.Untrained>() {
    @Pure fun fit() -> regressor: Regressor1<TrainingState.Trained>
}

Desired solution

Possible alternatives (optional)

No response

Screenshots (optional)

No response

Additional Context (optional)

No response

lars-reimann commented 2 months ago

:tada: This issue has been resolved in version 0.13.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: