|
@@ -508,12 +508,20 @@ fn resolve_member_access(
|
|
|
Some(StorageLocation::Calldata(_)),
|
|
Some(StorageLocation::Calldata(_)),
|
|
|
_,
|
|
_,
|
|
|
) => {
|
|
) => {
|
|
|
- if dims[0].is_none() && id.name != "offset" && id.name != "length" {
|
|
|
|
|
|
|
+ if dims.last().unwrap().is_none() && id.name != "offset" && id.name != "length" {
|
|
|
ns.diagnostics.push(Diagnostic::error(
|
|
ns.diagnostics.push(Diagnostic::error(
|
|
|
resolved_expr.loc(),
|
|
resolved_expr.loc(),
|
|
|
- "calldata variables only support \".offset\" and \".length\"".to_string(),
|
|
|
|
|
|
|
+ "calldata variables only support ‘.offset‘ and ‘.length‘".to_string(),
|
|
|
));
|
|
));
|
|
|
return Err(());
|
|
return Err(());
|
|
|
|
|
+ } else if dims.last().unwrap().is_some() {
|
|
|
|
|
+ ns.diagnostics.push(Diagnostic::error(
|
|
|
|
|
+ resolved_expr.loc(),
|
|
|
|
|
+ format!(
|
|
|
|
|
+ "the given expression does not support ‘.{}‘ suffixes",
|
|
|
|
|
+ suffix_type.to_string()
|
|
|
|
|
+ ),
|
|
|
|
|
+ ));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -533,7 +541,7 @@ fn resolve_member_access(
|
|
|
if id.name != "selector" && id.name != "address" {
|
|
if id.name != "selector" && id.name != "address" {
|
|
|
ns.diagnostics.push(Diagnostic::error(
|
|
ns.diagnostics.push(Diagnostic::error(
|
|
|
id.loc,
|
|
id.loc,
|
|
|
- "variables of type function pointer only support \".selector\" and \".address\" suffixes".to_string()
|
|
|
|
|
|
|
+ "variables of type function pointer only support ‘.selector‘ and ‘.address‘ suffixes".to_string()
|
|
|
));
|
|
));
|
|
|
return Err(());
|
|
return Err(());
|
|
|
}
|
|
}
|
|
@@ -544,7 +552,7 @@ fn resolve_member_access(
|
|
|
if id.name != "slot" && id.name != "offset" {
|
|
if id.name != "slot" && id.name != "offset" {
|
|
|
ns.diagnostics.push(Diagnostic::error(
|
|
ns.diagnostics.push(Diagnostic::error(
|
|
|
id.loc,
|
|
id.loc,
|
|
|
- "state variables only support \".slot\" and \".offset\"".to_string(),
|
|
|
|
|
|
|
+ "state variables only support ‘.slot‘ and ‘.offset‘".to_string(),
|
|
|
));
|
|
));
|
|
|
return Err(());
|
|
return Err(());
|
|
|
}
|
|
}
|