Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
d0cd committed Aug 11, 2022
1 parent 974e93c commit 67f9890
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions compiler/passes/src/type_checking/checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,8 @@ impl<'a> TypeChecker<'a> {
pub(crate) fn assert_type_is_valid(&self, span: Span, type_: &Type) {
match type_ {
// Check that the named composite type has been defined.
Type::Identifier(identifier) => {
if self.symbol_table.borrow().lookup_circuit(identifier.name).is_none() {
self.emit_err(TypeCheckerError::undefined_type(identifier.name, span));
}
Type::Identifier(identifier) if self.symbol_table.borrow().lookup_circuit(identifier.name).is_none() => {
self.emit_err(TypeCheckerError::undefined_type(identifier.name, span));
}
// Check that the constituent types are valid.
Type::Tuple(tuple_type) => {
Expand Down
2 changes: 1 addition & 1 deletion tests/compiler/circuits/unknown_member_type_fail.leo
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ circuit Foo {
@program
function main(a: u8) -> u8 {
return a + 1u8;
}
}

0 comments on commit 67f9890

Please sign in to comment.