-
Notifications
You must be signed in to change notification settings - Fork 118
experiment: use ctx dot instantiation #5560
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
Draft
Kamirus
wants to merge
32
commits into
master
Choose a base branch
from
kamil/inf-errors
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.
Draft
Changes from 28 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
dae6841
add repro of old message
crusso 9be4af9
report apparent function type and instantiated parameters
crusso 1e38e88
attempt to improve type inference erros by suppressing receiver and d…
crusso 066db75
recompute receiver instantiation when necessary
crusso c0ec205
extend test
crusso 18dfe71
refactor receiver stripping
crusso e716b63
record, don't recompute, initial instantiation
crusso 7861213
refactor to avoid recomputing match on receiver
crusso fef3a56
reduce diff
crusso 8be12c3
reduce diff
crusso 6514808
spacing
crusso 2e5e4c6
suppress showing implicits when holes present
crusso ab989c9
add and update tests
crusso 60b6d38
adjust test output
crusso dffb683
adjust formal signature too, dropping params according to holes
crusso cd8c10a
adjust test output
crusso 2a80431
accept test output
crusso 0cdc9c9
experiment: Claudio/inf errors merge (#5556)
crusso ab62dc4
Merge branch 'claudio/inf-errors' of github.com:dfinity/motoko into c…
crusso 87b2412
instantiate function before reporting signature, drop redundant param…
crusso b54b859
remove holes from ordinary functions too
crusso fae694f
update test output
crusso 5ac369d
suppress explanation that mentions type parameters
crusso caa2dcd
comment out dead-code for now
crusso 476a853
simplify message
crusso c5cfa55
bimatch
Kamirus 6a23d90
merge
Kamirus c2373c8
merge
Kamirus f98dc9d
fix instantiation
Kamirus e72115d
fix bimatch docs
Kamirus 87b134d
refactor
Kamirus be30721
turn off full instantiation check for now
Kamirus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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 |
---|---|---|
@@ -1,37 +1,35 @@ | ||
inf-error-small.mo:44.13-44.34: type error [M0098], cannot apply function `.get` of type | ||
(n : Nat) -> ?Text | ||
to argument of type | ||
inf-error-small.mo:44.27-44.33: type error [M0050], literal of type | ||
Text | ||
to produce result of expected type | ||
Text | ||
inf-error-small.mo:45.13-45.47: type error [M0098], cannot apply function `.get` of type | ||
(compare : (implicit : (Nat, Nat) -> Order), n : Nat) -> ?Text | ||
to argument of type | ||
((n : Nat, m : Nat) -> Order, Text) | ||
to produce result of expected type | ||
does not have expected type | ||
Nat | ||
inf-error-small.mo:45.40-45.46: type error [M0050], literal of type | ||
Text | ||
inf-error-small.mo:47.13-47.45: type error [M0098], cannot apply function `.get` of type | ||
(compare : (implicit : (Nat, Nat) -> Order), n : Nat) -> ?Text | ||
to argument of type | ||
({map : [(Nat, [var Text])]}, Text) | ||
to produce result of expected type | ||
does not have expected type | ||
Nat | ||
inf-error-small.mo:47.27-47.36: type error [M0096], expression of type | ||
{map : [(Nat, [var Text])]} | ||
cannot produce expected type | ||
(Nat, Nat) -> Order | ||
inf-error-small.mo:47.38-47.44: type error [M0050], literal of type | ||
Text | ||
does not have expected type | ||
Nat | ||
inf-error-small.mo:48.26-48.58: type error [M0233], wrong number of arguments: expected 1 but got 3 | ||
Expected 1 argument of type: | ||
(n : K) | ||
But got 3 arguments of type: | ||
{map : [(Nat, [var Text])]} | ||
(n : Nat, m : Nat) -> Order | ||
Text | ||
inf-error-small.mo:49.13-49.45: type error [M0098], cannot apply function `.get` of type | ||
(compare : (implicit : (Nat, Nat) -> Order), n : Nat) -> ?Text | ||
to argument of type | ||
({map : [(Nat, [var Text])]}, Text) | ||
to produce result of expected type | ||
inf-error-small.mo:49.27-49.36: type error [M0096], expression of type | ||
{map : [(Nat, [var Text])]} | ||
cannot produce expected type | ||
(Nat, Nat) -> Order | ||
inf-error-small.mo:49.38-49.44: type error [M0050], literal of type | ||
Text | ||
inf-error-small.mo:51.13-51.29: type error [M0098], cannot apply function `.get` of type | ||
(n : Nat) -> ?Text | ||
to argument of type | ||
does not have expected type | ||
Nat | ||
to produce result of expected type | ||
inf-error-small.mo:51.13-51.29: type error [M0096], expression of type | ||
?Text | ||
cannot produce expected type | ||
Bool |
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
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
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,8 @@ | ||
contextual-dot.mo:50.33-50.40: type error [M0050], literal of type | ||
Text | ||
does not have expected type | ||
B | ||
Kamirus marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
contextual-dot.mo:56.39-56.46: type error [M0050], literal of type | ||
Text | ||
does not have expected type | ||
B |
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 @@ | ||
Return code 1 |
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this actually complete? The full instantiation might be too specific to match the other args?
I.e. if you had inferred with the arguments in hand, you might have chosen a different, weaker, instantiation to accommodate them as well as the receiver.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's "safe" in that it'll never infer anything non-principal, right? It might reject more programs than we accepted before. Maybe we could weaken this to a "second pass" in the error case in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, fixing parts of the instantiation early based on the receiver can be more restrictive.
If we want the same inference results for both dot and without dot syntax then we should not use the partial instantiation.
I'd like to explore an alternative of reporting better bimatch errors