-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Arity check types and functions (->) (#2049)
This pr fixes the following: This example causes the compiler to crash with "implicitness mismatch". ``` f : id Bool -> Bool; f _ := false; ``` The reason is that `id` expects an implicit argument but finds `Bool`, which is explicit. The arity checker was not inserting any hole because it was ignoring the whole type. Moreover the aritychecker was never checking `->` types as we never expected to have to insert holes in `->` types (since the only fragment of defined functions that we accept in types are those which do not have implicit arguments). We now properly arity check all types and process the function type `->` correctly.
- Loading branch information
1 parent
b0c566f
commit 9a64184
Showing
4 changed files
with
49 additions
and
3 deletions.
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
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,10 @@ | ||
module IdInType; | ||
|
||
type Unit := | ||
| unit : Unit; | ||
|
||
id : {a : Type} -> a -> a; | ||
id a := a; | ||
|
||
f : id Unit -> Unit; | ||
f _ := unit; |