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

New constraint to check type parameter of constaining class #1139

Open
lars-reimann opened this issue May 3, 2024 · 0 comments
Open

New constraint to check type parameter of constaining class #1139

lars-reimann opened this issue May 3, 2024 · 0 comments
Labels
enhancement 💡 New feature or request

Comments

@lars-reimann
Copy link
Member

Is your feature request related to a problem?

We need a way to hide methods of a class based on the substitution for some type parameter. This can be used to hide the predict method of models that are not fitted

Desired solution

Add a new constraint:

class Model<State = TrainingState.Unfitted> {
    fun predict() where {
        State sub TrainingState.Fitted
    }
}

Possible alternatives (optional)

No response

Screenshots (optional)

No response

Additional Context (optional)

No response

@lars-reimann lars-reimann added the enhancement 💡 New feature or request label May 3, 2024
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