-
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.
Fix some mapping issues and add additional tests
Make sure variables on both sides of mappings are the same type.
- Loading branch information
Showing
11 changed files
with
170 additions
and
21 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
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,13 @@ | ||
[93mType error[0m: | ||
[96mfail/mapping_length_mismatch.sail[0m:9.21-48: | ||
9[96m |[0mmapping clause foo = x : bits(1) <-> x : bits(2) | ||
[91m |[0m [91m^-------------------------^[0m | ||
[91m |[0m 'x' must have the same type on both sides of the mapping | ||
[91m |[0m | ||
[91m |[0m [96mfail/mapping_length_mismatch.sail[0m:9.21-22: | ||
[91m |[0m 9[96m |[0mmapping clause foo = x : bits(1) <-> x : bits(2) | ||
[91m |[0m [92m |[0m [92m^[0m [92mhas type bits(1)[0m | ||
[91m |[0m [96mfail/mapping_length_mismatch.sail[0m:9.37-38: | ||
[91m |[0m 9[96m |[0mmapping clause foo = x : bits(1) <-> x : bits(2) | ||
[91m |[0m [91m |[0m [91m^[0m [91mhas type bits(2)[0m | ||
[91m |[0m [91m |[0m Integer expressions 1 and 2 are not equal |
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,9 @@ | ||
default Order dec | ||
|
||
$include <prelude.sail> | ||
|
||
val foo : bits(1) <-> bits(2) | ||
|
||
scattered mapping foo | ||
|
||
mapping clause foo = x : bits(1) <-> x : bits(2) |
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,13 @@ | ||
[93mType error[0m: | ||
[96mfail/poly_ab_mapping.sail[0m:9.21-38: | ||
9[96m |[0mmapping clause foo = x : 'a <-> x : 'b | ||
[91m |[0m [91m^---------------^[0m | ||
[91m |[0m 'x' must have the same type on both sides of the mapping | ||
[91m |[0m | ||
[91m |[0m [96mfail/poly_ab_mapping.sail[0m:9.21-22: | ||
[91m |[0m 9[96m |[0mmapping clause foo = x : 'a <-> x : 'b | ||
[91m |[0m [92m |[0m [92m^[0m [92mhas type 'a[0m | ||
[91m |[0m [96mfail/poly_ab_mapping.sail[0m:9.32-33: | ||
[91m |[0m 9[96m |[0mmapping clause foo = x : 'a <-> x : 'b | ||
[91m |[0m [91m |[0m [91m^[0m [91mhas type 'b[0m | ||
[91m |[0m [91m |[0m Type mismatch between 'a and 'b |
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,9 @@ | ||
default Order dec | ||
|
||
$include <prelude.sail> | ||
|
||
val foo : forall ('a 'b : Type). 'a <-> 'b | ||
|
||
scattered mapping foo | ||
|
||
mapping clause foo = x : 'a <-> x : 'b |
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,13 @@ | ||
default Order dec | ||
|
||
$include <prelude.sail> | ||
|
||
union instr = { | ||
Foo : bool | ||
} | ||
|
||
val bar : instr <-> bool | ||
|
||
scattered mapping bar | ||
|
||
mapping clause bar = Foo(b) <-> b |
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,13 @@ | ||
default Order dec | ||
|
||
$include <prelude.sail> | ||
|
||
union instr = { | ||
Foo : (bool, unit) | ||
} | ||
|
||
val bar : instr <-> bool | ||
|
||
scattered mapping bar | ||
|
||
mapping clause bar = Foo(b, ()) <-> b |