-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2205 from GaloisInc/2204-polymorphic-signatures
Restore support for explicit type signatures on polymorphic functions
- Loading branch information
Showing
6 changed files
with
168 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set -e | ||
|
||
$SAW test1.saw | ||
$SAW test2.saw |
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,6 @@ | ||
let f (x : a) : a = x; | ||
let g (x : a) (y : b) : (a, b) = (x, y); | ||
|
||
let h (x : a) : m a = do { | ||
return x; | ||
}; |
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,4 @@ | ||
rec f (x : a) : b = g x | ||
and g (y : a) : b = h y | ||
and h (z : a) : b = f z | ||
; |
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,12 @@ | ||
Loading file "err045.saw" | ||
err045.saw:2:26-2:27: Type mismatch. | ||
Mismatch of type constructors. Expected: String but got Int | ||
err045.saw:2:17-2:23: The type String arises from this type annotation | ||
err045.saw:2:26-2:27: The type Int arises from the type of this term | ||
|
||
Expected: String | ||
Found: Int | ||
|
||
within "f" (err045.saw:2:6-2:7) | ||
|
||
FAILED |
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,2 @@ | ||
// You'd expect this to be a parse error, wouldn't you... | ||
let (f : Int) : String = 3; |
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