-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure private works for mappings
Ensure that optional function and mapping type annotations do not have quantifiers when they also have val specs with quantifiers
- Loading branch information
Showing
11 changed files
with
177 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[93mType error[0m: | ||
[96mfail/duplicate_quant.sail[0m:5.4-7: | ||
5[96m |[0mval foo : forall 'n. int('n) -> unit | ||
[92m |[0m [92m^-^[0m [92mdeclared here[0m | ||
[96mfail/duplicate_quant.sail[0m:7.13-44: | ||
7[96m |[0mfunction foo forall 'n. (x: int('n)) -> unit = () | ||
[91m |[0m [91m^-----------------------------^[0m | ||
[91m |[0m Duplicate quantifier between inline annotation and 'val' declaration |
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,8 @@ | ||
default Order dec | ||
|
||
$include <prelude.sail> | ||
|
||
val foo : forall 'n. int('n) -> unit | ||
|
||
function foo forall 'n. (x: int('n)) -> unit = () | ||
|
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,8 @@ | ||
[93mError[0m: | ||
[96mfail/mapping_body_private.sail[0m:10.4-7: | ||
10[96m |[0mval foo : int <-> unit | ||
[92m |[0m [92m^-^[0m [92mmapping declared here[0m | ||
[96mfail/mapping_body_private.sail[0m:12.0-7: | ||
12[96m |[0mprivate mapping foo = { 0 <-> () } | ||
[91m |[0m[91m^-----^[0m | ||
[91m |[0m Mapping body has private modifier, which should be attached to 'val' declaration instead |
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,14 @@ | ||
$option -dmagic_hash | ||
default Order dec | ||
|
||
$include <prelude.sail> | ||
|
||
$project# A {} B { requires A } | ||
|
||
$start_module# A | ||
|
||
val foo : int <-> unit | ||
|
||
private mapping foo = { 0 <-> () } | ||
|
||
$end_module# |
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,8 @@ | ||
[93mType error[0m: | ||
[96mfail/mapping_two_type.sail[0m:5.4-7: | ||
5[96m |[0mval foo : int <-> unit | ||
[92m |[0m [92m^-^[0m [92mdeclared here[0m | ||
[96mfail/mapping_two_type.sail[0m:7.14-26: | ||
7[96m |[0mmapping foo : unit <-> int = { 0 <-> () } | ||
[91m |[0m [91m^----------^[0m | ||
[91m |[0m int <-> unit and unit <-> int do not match between mapping and 'val' declaration |
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,7 @@ | ||
default Order dec | ||
|
||
$include <prelude.sail> | ||
|
||
val foo : int <-> unit | ||
|
||
mapping foo : unit <-> int = { 0 <-> () } |
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,8 @@ | ||
[93mError[0m: | ||
[96mfail/pub_val_priv_fn.sail[0m:10.4-7: | ||
10[96m |[0mval foo : unit -> unit | ||
[92m |[0m [92m^-^[0m [92mfunction declared here[0m | ||
[96mfail/pub_val_priv_fn.sail[0m:12.0-7: | ||
12[96m |[0mprivate function foo() = print_endline("Hello, World!") | ||
[91m |[0m[91m^-----^[0m | ||
[91m |[0m Function body has private modifier, which should be attached to 'val' declaration instead |
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,22 @@ | ||
$option -dmagic_hash | ||
default Order dec | ||
|
||
$include <prelude.sail> | ||
|
||
$project# A {} B { requires A } | ||
|
||
$start_module# A | ||
|
||
val foo : unit -> unit | ||
|
||
private function foo() = print_endline("Hello, World!") | ||
|
||
$end_module# | ||
|
||
$start_module# B | ||
|
||
function bar() -> unit = { | ||
foo() | ||
} | ||
|
||
$end_module# |
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 @@ | ||
$option -dmagic_hash | ||
default Order dec | ||
|
||
$include <prelude.sail> | ||
|
||
$project# A {} B { requires A } | ||
|
||
$start_module# A | ||
|
||
private function foo() -> unit = print_endline("Hello, World!") | ||
|
||
$end_module# |