-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TC: retry return type unification only after all arguments
This can provide more natural instantiations for (e.g.) bitvector concatenation.
- Loading branch information
Showing
2 changed files
with
12 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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,11 @@ | ||
default Order dec | ||
$include <prelude.sail> | ||
|
||
/* An example where inference of the type parameters needs | ||
unification on the arguments before unification on the result type can | ||
provide 'y, but there's no need to go back to the arguments afterwards. */ | ||
|
||
val f : forall 'x 'y 'z, 'x + 'y > 0. (int('x), int('z)) -> bits('x + 'y) | ||
|
||
val g : unit -> bits(1) | ||
function g() = f(0,2) |