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

Give warnings when type parameters do not have multiple solutions #278

Open
6 tasks
MeAmAnUsername opened this issue Mar 29, 2022 · 0 comments
Open
6 tasks
Labels
Component: editor Priority: low Status: proposal Enhancement in the proposal stage Type: enhancement New feature or request

Comments

@MeAmAnUsername
Copy link
Owner

Summary
Give warnings when no solutions or only one solution exists for the constraints on type parameters

Todo

  • Figure out general rules when constraints do not have multiple solutions
    • Find more examples of places where there is only one solution
    • Minimize examples
    • Figure out general rules when constraints do not have multiple solutions
  • Write tests (use minimized examples)
  • Implement

Reason
Using type parameters is useless if there is only one possible instantiation, so it should give a warning when detected.

Examples

// don't know for sure if this is an example, but I think it is
data Fruit[A <: Fruit[B, A], B :> Fruit[B, A]] = foreign java Fruit {}
@MeAmAnUsername MeAmAnUsername added Type: enhancement New feature or request Status: proposal Enhancement in the proposal stage Priority: low Component: editor labels Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: editor Priority: low Status: proposal Enhancement in the proposal stage Type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant