Skip to content

Commit

Permalink
Remove gates check
Browse files Browse the repository at this point in the history
  • Loading branch information
d0cd committed Apr 19, 2023
1 parent 581a671 commit 6a660c4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
1 change: 0 additions & 1 deletion compiler/passes/src/type_checking/check_program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> {
}
};
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() {
Expand Down
11 changes: 9 additions & 2 deletions tests/expectations/compiler/records/balance_wrong_ty.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
---
namespace: Compile
expectation: Fail
expectation: Pass
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: ""
9 changes: 4 additions & 5 deletions tests/tests/compiler/records/balance_wrong_ty.leo
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
/*
namespace: Compile
expectation: Fail
input_files: inputs/add.in
expectation: Pass
*/

program test.aleo {
// This record does define the `gates` variable but with the wrong type.
record Token {
gates: address,
owner: address,
}

function main(a: u8, b:u8) -> u8 {
transition main(a: u8, b:u8) -> u8 {
return a + b;
}}
}
}

0 comments on commit 6a660c4

Please sign in to comment.