-
Notifications
You must be signed in to change notification settings - Fork 658
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 #28474 from ProvableHQ/height_type_check
Typecheck block.height.
- Loading branch information
Showing
3 changed files
with
28 additions
and
1 deletion.
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
9 changes: 9 additions & 0 deletions
9
tests/expectations/compiler/constants/block_height_type_fail.out
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 @@ | ||
namespace = "Compile" | ||
expectation = "Fail" | ||
outputs = [""" | ||
Error [ETYC0372003]: Expected type `u64` but type `u32` was found | ||
--> compiler-test:5:22 | ||
| | ||
5 | let x: u64 = block.height; | ||
| ^^^^^^^^^^^^ | ||
"""] |
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 @@ | ||
/* | ||
namespace = "Compile" | ||
expectation = "Fail" | ||
*/ | ||
|
||
program test.aleo { | ||
async function bar() { | ||
let x: u64 = block.height; | ||
} | ||
|
||
async transition foo() -> Future { | ||
return bar(); | ||
} | ||
} |