-
Notifications
You must be signed in to change notification settings - Fork 471
[Super errors] Tweak missing param msg #2548
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@cristianoc doesn't work if it's like this: let a: int => option(string) = Some("hi"); This still gives:
Does this mean we need to write our own equal comparator to compare between Edit: we're gonna bail on this case. |
^ Will fix this in another issue |
chenglou
added a commit
to chenglou/rescript-compiler
that referenced
this pull request
Feb 28, 2018
See for example rescript-lang#2548 (comment) So `option('a)` is the same as `option('b)`, `array(string)` is the same as `array(string)`, but `list('a)` isn't the same as `list(string)`. Along with rescript-lang#2548, this fixes reasonml-community/error-message-improvement#10 I believe
chenglou
added a commit
that referenced
this pull request
Feb 28, 2018
See for example #2548 (comment) So `option('a)` is the same as `option('b)`, `array(string)` is the same as `array(string)`, but `list('a)` isn't the same as `list(string)`. Along with #2548, this fixes reasonml-community/error-message-improvement#10 I believe
chenglou
added a commit
to chenglou/rescript-compiler
that referenced
this pull request
Feb 28, 2018
Continuation of rescript-lang#2548 Mini usability testing result out. Apparently the previous message was too confusing, so I'm adding back the fallback type clash msg. Additionally, I'm now using `Ctype.matches`, which considers `option('a)` and `option(string)` as equal. This, along with the original code in rescript-lang#2548, fixes reasonml-community/error-message-improvement#14 But since this produces false positives "missing parameters" msg for such code below: ```reason let a: int => float => option(int) = (a) => Some(""); ``` Where `option(int)` matches `option('a)` inferred from `Some("")`, I've also tweaked the msg to indicate that we're _guessing_ that it _might_ be because of missing parameters (but that we're not sure). The fallback type clash msg gives us leeway to guess. cc @cristianoc
chenglou
added a commit
to chenglou/rescript-compiler
that referenced
this pull request
Feb 28, 2018
Continuation of rescript-lang#2548 Mini usability testing result out. Apparently the previous message was too confusing, so I'm adding back the fallback type clash msg. Additionally, I'm now using `Ctype.matches`, which considers `option('a)` and `option(string)` as equal. This, along with the original code in rescript-lang#2548, fixes reasonml-community/error-message-improvement#14 But since this produces false positives "missing parameters" msg for such code below: ```reason let a: int => float => option(int) = (a) => Some(""); ``` Where `option(int)` matches `option('a)` inferred from `Some("")`, I've also tweaked the msg to indicate that we're _guessing_ that it _might_ be because of missing parameters (but that we're not sure). The fallback type clash msg gives us leeway to guess. cc @cristianoc
chenglou
added a commit
that referenced
this pull request
Feb 28, 2018
* [Super errors] Better missing param msg Continuation of #2548 Mini usability testing result out. Apparently the previous message was too confusing, so I'm adding back the fallback type clash msg. Additionally, I'm now using `Ctype.matches`, which considers `option('a)` and `option(string)` as equal. This, along with the original code in #2548, fixes reasonml-community/error-message-improvement#14 But since this produces false positives "missing parameters" msg for such code below: ```reason let a: int => float => option(int) = (a) => Some(""); ``` Where `option(int)` matches `option('a)` inferred from `Some("")`, I've also tweaked the msg to indicate that we're _guessing_ that it _might_ be because of missing parameters (but that we're not sure). The fallback type clash msg gives us leeway to guess. cc @cristianoc * Clean up code
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.