-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix is_storable_type for custom ADTs (#411)
* Create message with ADT value * Make ADTs with unstorable constructor arguments unstorable * fixes based on review comments * remove redundant test
- Loading branch information
1 parent
0148f83
commit bcf7299
Showing
4 changed files
with
82 additions
and
11 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,29 @@ | ||
{ | ||
"errors": [ | ||
{ | ||
"error_message": "Type error(s) in contract UnstorableADT:\n", | ||
"start_location": { | ||
"file": "checker/bad/unstorable_adt.scilla", | ||
"line": 15, | ||
"column": 10 | ||
}, | ||
"end_location": { "file": "", "line": 0, "column": 0 } | ||
}, | ||
{ | ||
"error_message": "Type error in field last_input:\n", | ||
"start_location": { | ||
"file": "checker/bad/unstorable_adt.scilla", | ||
"line": 19, | ||
"column": 7 | ||
}, | ||
"end_location": { "file": "", "line": 0, "column": 0 } | ||
}, | ||
{ | ||
"error_message": | ||
"Values of the type \"Option (Test)\" cannot be stored.", | ||
"start_location": { "file": "", "line": 0, "column": 0 }, | ||
"end_location": { "file": "", "line": 0, "column": 0 } | ||
} | ||
], | ||
"warnings": [] | ||
} |
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,19 @@ | ||
scilla_version 0 | ||
|
||
(***************************************************) | ||
(* Associated library *) | ||
(***************************************************) | ||
|
||
library UnstorableADT | ||
|
||
type Test = | ||
| Bad of (Uint32 -> Uint32) | ||
|
||
(***************************************************) | ||
(* The contract definition *) | ||
(***************************************************) | ||
contract UnstorableADT | ||
( | ||
) | ||
|
||
field last_input : Option Test = None {Test} |