mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-23 23:23:50 +03:00
Clippy; add compiler check
This commit is contained in:
parent
264e60c6ee
commit
1f9f1750fe
@ -506,9 +506,12 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> {
|
||||
.iter()
|
||||
.find(|member| member.identifier.name == identifier.name)
|
||||
{
|
||||
if let Some(expr) = &actual.expression {
|
||||
self.visit_expression(expr, &Some(type_.clone()));
|
||||
}
|
||||
match &actual.expression {
|
||||
// If `expression` is None, then the member uses the identifier shorthand, e.g. `Foo { a }`
|
||||
None => self.visit_identifier(&actual.identifier, &Some(type_.clone())),
|
||||
// Otherwise, visit the associated expression.
|
||||
Some(expr) => self.visit_expression(expr, &Some(type_.clone())),
|
||||
};
|
||||
} else {
|
||||
self.emit_err(TypeCheckerError::missing_struct_member(
|
||||
struct_.identifier,
|
||||
|
@ -412,7 +412,7 @@ fn analyze_source_file(src: &str, source_file_start_pos: BytePos) -> (Vec<BytePo
|
||||
let src_bytes = src.as_bytes();
|
||||
|
||||
while i < src.len() {
|
||||
let i_usize = i as usize;
|
||||
let i_usize = i;
|
||||
let byte = src_bytes[i_usize];
|
||||
|
||||
// How much to advance to get to the next UTF-8 char in the string.
|
||||
|
Loading…
Reference in New Issue
Block a user