-
Notifications
You must be signed in to change notification settings - Fork 661
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 #28417 from ProvableHQ/empty-closure
Handle closures that are invalid for Aleo.
- Loading branch information
Showing
57 changed files
with
145 additions
and
93 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace = "Compile" | ||
expectation = "Pass" | ||
outputs = [[{ compile = [{ initial_symbol_table = "1594125e96833cb52afcad4c876e44d61b2944a6c146e019b23fa0ad5d39db2a", type_checked_symbol_table = "95d8ce7541440d2568f633e1b7800d3d5d06e1147642eec802bfca4a9115e61c", unrolled_symbol_table = "95d8ce7541440d2568f633e1b7800d3d5d06e1147642eec802bfca4a9115e61c", initial_ast = "45d32cf0414a246717747dc917b07ffe55ff7587589d4c494479e18667e61a03", unrolled_ast = "45d32cf0414a246717747dc917b07ffe55ff7587589d4c494479e18667e61a03", ssa_ast = "eb6eff57864e407c245edbba3ab2949a2536643b3b864a8a42b65c348523a31f", flattened_ast = "6e8cc40e042029b3124b7b9a7e66905525207fb6cf0bfe5b71abfecbf10d7c72", destructured_ast = "22c2d4f79894ead71296929de2982b8289e2b43f7d83dc497a1be4532945ea17", inlined_ast = "e18c2f95e617c4c42c2359ea8a09924311f89c0c3a0bfa1e2ffe23c6ff933846", dce_ast = "e18c2f95e617c4c42c2359ea8a09924311f89c0c3a0bfa1e2ffe23c6ff933846", bytecode = """ | ||
program test.aleo; | ||
|
||
function mint_public: | ||
input r0 as address.public; | ||
input r1 as u64.public; | ||
async mint_public r0 r1 into r2; | ||
output r2 as test.aleo/mint_public.future; | ||
|
||
finalize mint_public: | ||
input r0 as address.public; | ||
input r1 as u64.public; | ||
assert.eq true true; | ||
""", errors = "", warnings = "" }] }]] |
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
tests/expectations/compiler/function/empty_arglist_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,18 @@ | ||
namespace = "Compile" | ||
expectation = "Fail" | ||
outputs = [""" | ||
Error [ETYC0372113]: Cannot define a function with no parameters. | ||
--> compiler-test:4:5 | ||
| | ||
4 | function x() -> u8 { | ||
5 | return 0u8; | ||
6 | } | ||
| ^ | ||
Error [ETYC0372083]: A program must have at least one transition function. | ||
--> compiler-test:1:1 | ||
| | ||
1 | | ||
2 | | ||
3 | program test.aleo { | ||
| ^^^^^^^^^^^^ | ||
"""] |
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,15 @@ | ||
namespace = "Compile" | ||
expectation = "Pass" | ||
outputs = [[{ compile = [{ initial_symbol_table = "4ccc1709fb6b2aad9ee9a247bb37098d9330087d64e14af2a5c064287f701105", type_checked_symbol_table = "979420a8fc4bfbc81aeabe709704af919277f62699a09b0858c37544622a725a", unrolled_symbol_table = "979420a8fc4bfbc81aeabe709704af919277f62699a09b0858c37544622a725a", initial_ast = "52950f91033f987381d1b9a5ff69b626a8911d003da7edb503e97bd6e6637d2c", unrolled_ast = "52950f91033f987381d1b9a5ff69b626a8911d003da7edb503e97bd6e6637d2c", ssa_ast = "5314cb0ebd490a53c7ded487668632260992a4f49a10f1e247980b5c6647ad22", flattened_ast = "85fd8c8ed0cae4cd4b711d8d909d5aec0a176028fa91452fae92fbe5f6091f63", destructured_ast = "fc6b028060914573cc2c1885155f4f2bb5c90ed03caf720bff4d5b05eb299327", inlined_ast = "6b8711898970669f70badb94f5ce2abd87be07fbb764523dd2d9e6d94336e7cd", dce_ast = "6b8711898970669f70badb94f5ce2abd87be07fbb764523dd2d9e6d94336e7cd", bytecode = """ | ||
program test.aleo; | ||
|
||
closure x: | ||
input r0 as boolean; | ||
assert.eq true true; | ||
output 0u8 as u8; | ||
|
||
function t: | ||
input r0 as boolean.private; | ||
call x r0 into r1; | ||
output r1 as u8.private; | ||
""", errors = "", 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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -4,6 +4,6 @@ expectation = "Fail" | |
*/ | ||
|
||
program test.aleo { | ||
function main() { | ||
function main(x: bool) { | ||
let f = 1 field; | ||
}} |
2 changes: 1 addition & 1 deletion
2
...compiler/finalize/empty_finalize_fail.leo → ...ests/compiler/finalize/empty_finalize.leo
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
namespace = "Compile" | ||
expectation = "Fail" | ||
expectation = "Pass" | ||
*/ | ||
|
||
program test.aleo { | ||
|
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,10 @@ | ||
/* | ||
namespace = "Compile" | ||
expectation = "Fail" | ||
*/ | ||
|
||
program test.aleo { | ||
function x() -> u8 { | ||
return 0u8; | ||
} | ||
} |
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,16 @@ | ||
/* | ||
namespace = "Compile" | ||
expectation = "Pass" | ||
*/ | ||
|
||
program test.aleo { | ||
// This should pass and insert | ||
// a dummy instruction into the empty function. | ||
function x(a: bool) -> u8 { | ||
return 0u8; | ||
} | ||
|
||
transition t(a: bool) -> u8 { | ||
return x(a); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ expectation = "Fail" | |
*/ | ||
|
||
program test.aleo { | ||
function main() { | ||
function main(x: bool) { | ||
let i = 1 i128; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ expectation = "Fail" | |
*/ | ||
|
||
program test.aleo { | ||
function main() { | ||
function main(x: bool) { | ||
let i = 1 i16; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ expectation = "Fail" | |
*/ | ||
|
||
program test.aleo { | ||
function main() { | ||
function main(x: bool) { | ||
let i = 1 i32; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ expectation = "Fail" | |
*/ | ||
|
||
program test.aleo { | ||
function main() { | ||
function main(x: bool) { | ||
let i = 1 i64; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,6 +4,6 @@ expectation = "Fail" | |
*/ | ||
|
||
program test.aleo { | ||
function main() { | ||
function main(x: bool) { | ||
let a: i8 = 128i8; | ||
}} |
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ expectation = "Fail" | |
*/ | ||
|
||
program test.aleo { | ||
function main() { | ||
function main(x: bool) { | ||
let i = 1 i8; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ expectation = "Fail" | |
*/ | ||
|
||
program test.aleo { | ||
function main() { | ||
function main(x: bool) { | ||
let a: u128 = -1u128; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ expectation = "Fail" | |
*/ | ||
|
||
program test.aleo { | ||
function main() { | ||
function main(x: bool) { | ||
let i = 1 u128; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ expectation = "Fail" | |
*/ | ||
|
||
program test.aleo { | ||
function main() { | ||
function main(x: bool) { | ||
let a: u16 = -0x1u16; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ expectation = "Fail" | |
*/ | ||
|
||
program test.aleo { | ||
function main() { | ||
function main(x: bool) { | ||
let a: u16 = 65536u16; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ expectation = "Fail" | |
*/ | ||
|
||
program test.aleo { | ||
function main() { | ||
function main(x: bool) { | ||
let a: u16 = -1u16; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ expectation = "Fail" | |
*/ | ||
|
||
program test.aleo { | ||
function main() { | ||
function main(x: bool) { | ||
let i = 1 u16; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ expectation = "Fail" | |
*/ | ||
|
||
program test.aleo { | ||
function main() { | ||
function main(x: bool) { | ||
let a: u32 = -0x1u32; | ||
} | ||
} |
Oops, something went wrong.