Remove gates check

This commit is contained in:
Pranav Gaddamadugu 2023-04-15 19:14:13 -07:00
parent 581a671e31
commit 6a660c4ceb
3 changed files with 13 additions and 8 deletions

View File

@ -119,7 +119,6 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> {
} }
}; };
check_has_field(sym::owner, Type::Address); check_has_field(sym::owner, Type::Address);
check_has_field(sym::gates, Type::Integer(IntegerType::U64));
} }
for Member { mode, identifier, type_, span } in input.members.iter() { for Member { mode, identifier, type_, span } in input.members.iter() {

View File

@ -1,5 +1,12 @@
--- ---
namespace: Compile namespace: Compile
expectation: Fail expectation: Pass
outputs: outputs:
- "Error [ETYC0372020]: The field `gates` in a `record` must have type `u64`.\n --> compiler-test:5:5\n |\n 5 | record Token {\n 6 | gates: address,\n 7 | owner: address,\n 8 | }\n | ^\n" - initial_ast: bc6c3d26d53e50c2d9e55ca513f9f9ca5a51243e168abdabc519b6ab284ab4ca
unrolled_ast: bc6c3d26d53e50c2d9e55ca513f9f9ca5a51243e168abdabc519b6ab284ab4ca
ssa_ast: 9dec3f9ffc327edcbca8cd41fc43ed0ea547b2a21a83011561dcfa4eddc6f805
flattened_ast: 14a0045dc7123f83d6ab8563c0ea931de77226a5debb18eb4f897e3a94c271ed
inlined_ast: 14a0045dc7123f83d6ab8563c0ea931de77226a5debb18eb4f897e3a94c271ed
dce_ast: 14a0045dc7123f83d6ab8563c0ea931de77226a5debb18eb4f897e3a94c271ed
bytecode: 4352ef3dcfd2e624a555a365a9f307cee9a66cf0efb3c7681eb4c0b0014fa403
warnings: ""

View File

@ -1,16 +1,15 @@
/* /*
namespace: Compile namespace: Compile
expectation: Fail expectation: Pass
input_files: inputs/add.in
*/ */
program test.aleo { program test.aleo {
// This record does define the `gates` variable but with the wrong type.
record Token { record Token {
gates: address, gates: address,
owner: address, owner: address,
} }
function main(a: u8, b:u8) -> u8 { transition main(a: u8, b:u8) -> u8 {
return a + b; return a + b;
}} }
}