Skip to content

Commit

Permalink
Merge branch 'master' into volsa/to-string
Browse files Browse the repository at this point in the history
  • Loading branch information
mhasel authored Nov 20, 2024
2 parents 15bdf13 + 5432616 commit 667fc88
Show file tree
Hide file tree
Showing 7 changed files with 614 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/codegen/generators/expression_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,14 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> {
// no function
let (class_ptr, call_ptr) = match pou {
PouIndexEntry::Method { .. } => {
let class_ptr = self.generate_lvalue(operator)?;
let class_ptr = self.generate_lvalue(operator).or_else(|_| {
// this might be a local method
function_context
.function
.get_first_param()
.map(|class_ptr| class_ptr.into_pointer_value())
.ok_or_else(|| Diagnostic::cannot_generate_call_statement(operator))
})?;
let call_ptr =
self.allocate_function_struct_instance(implementation.get_call_name(), operator)?;
(Some(class_ptr), call_ptr)
Expand Down
Loading

0 comments on commit 667fc88

Please sign in to comment.