- Notifications
You must be signed in to change notification settings - Fork471
PoC %typeof#7870
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Draft
zth wants to merge4 commits intomasterChoose a base branch frompoc-typeof
base:master
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Uh oh!
There was an error while loading.Please reload this page.
Draft
PoC %typeof#7870
Changes from1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
NextNext commit
simple %typeof poc
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commit7d7016b7588bd3db038d3e84de14daacadfb0975
There are no files selected for viewing
22 changes: 20 additions & 2 deletionscompiler/ml/typetexp.ml
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
5 changes: 5 additions & 0 deletionstests/analysis_tests/tests/src/Hover.res
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
3 changes: 3 additions & 0 deletionstests/analysis_tests/tests/src/expected/Hover.res.txt
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
12 changes: 12 additions & 0 deletionstests/build_tests/super_errors/expected/typeof_mismatch.res.expected
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/typeof_mismatch.res[0m:[2m6:28[0m | ||
| 4 [2m│[0m | ||
| 5 [2m│[0m let f: fnType = myFn | ||
| [1;31m6[0m [2m│[0m let ff: fnType = (a, b) => [1;31ma[0m->Int.toString + b | ||
| This has type: [1;31mstring[0m | ||
| But this function argument is expecting: [1;33mint[0m | ||
| You can convert [1;33mstring[0m to [1;33mint[0m with [1;33mInt.fromString[0m. |
6 changes: 6 additions & 0 deletionstests/build_tests/super_errors/fixtures/typeof_mismatch.res
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| let myFn = (a, b) => a ++ b->Int.toString | ||
| type fnType = %typeof(myFn) | ||
| let f: fnType = myFn | ||
| let ff: fnType = (a, b) => a->Int.toString + b |
5 changes: 5 additions & 0 deletionstests/tests/src/Typeof.res
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| let myFn = (a, b) => a ++ b->Int.toString | ||
| type fnType = %typeof(myFn) | ||
| let f: fnType = myFn |
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.