Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Better error message on capitalized type #424

Closed
wants to merge 2 commits into from

Conversation

ryyppy
Copy link
Member

@ryyppy ryyppy commented May 26, 2021

First attempt tackling #122

There are a few tests breaking bc of this, not sure how to solve them.

src/res_core.ml Outdated
| Dot -> parseValuePathTail p startPos (Longident.Lident ident)
| _ ->
Parser.err p ~startPos:identStartPos ~endPos:identEndPos (Diagnostics.message "Type names need to start with a lower-cased letter.");
Location.mkloc (Longident.Lident ident) (mkLoc identStartPos identEndPos)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if startPos / endPos is correct here

@ryyppy
Copy link
Member Author

ryyppy commented May 27, 2021

Probably worth adding a suggestion in the error message as well: Did you mean foo? Should I try adding that?

@IwanKaramazow
Copy link
Contributor

Yes, definitely worth a try. In general I like having an error message follow the format "what" + "this-is-how-you-could-fix-it".

@ryyppy ryyppy added this to the Possible 9.4 milestone May 3, 2022
@cristianoc cristianoc closed this Sep 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants