Skip to content

Improve error messages for type application mismatches #1668

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

kalidatony
Copy link

  • Tests added for any new code
  • Documentation added for any new functionality
  • Entries added to the respective CHANGELOG.md for any new functionality
  • Feature table on README.md updated for any listed functionality

This PR improves error messages for type application mismatches, specifically addressing the confusing errors users receive when using a List where a Set is expected (like in the map function).

Changes

  • Added TypeApplicationErrorDetails interface to store detailed error information
  • Implemented buildTypeApplicationMismatchLeaf function to create more user-friendly error messages
  • Enhanced errorTreeToString to display clearer error messages with expected/actual types
  • Updated unify in constraintSolver.ts to provide operator information when detecting mismatches
    Fix Error messages for type application mismatch are not clear #1361

@kalidatony kalidatony changed the title Improve error messages for type application mismatches (#1361) Improve error messages for type application mismatches May 22, 2025
@kalidatony
Copy link
Author

@bugarela Could you kindly check the implementation #1668 and guide me if I need to fix anything.

@bugarela
Copy link
Collaborator

@kalidatony we are getting some CI failures, seems like we are getting many type errors when there are no type problems.

@kalidatony
Copy link
Author

@bugarela could you check when you are free.

@bugarela
Copy link
Collaborator

bugarela commented Jun 4, 2025

@kalidatony I still see the same CI issues 😿

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error messages for type application mismatch are not clear
2 participants