Skip to content

Commit

Permalink
Handle async messages for identifier calls
Browse files Browse the repository at this point in the history
When calling async messages as identifier (e.g. just `foo` instead of
`self.foo` or `foo()`), the compiler now correctly compiles the call to
a message send, instead of a virtual call.

Changelog: fixed
  • Loading branch information
yorickpeterse committed Sep 20, 2022
1 parent c155e63 commit 9cee2ea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compiler/src/mir/passes.rs
Expand Up @@ -3054,7 +3054,10 @@ impl<'a> LowerMethod<'a> {

let args = Vec::new();

if info.dynamic {
if info.id.is_async(self.db()) {
self.current_block_mut()
.send_and_wait(rec, info.id, args, loc);
} else if info.dynamic {
self.current_block_mut().call_dynamic(rec, id, args, loc);
} else {
self.current_block_mut().call(rec, id, args, loc);
Expand Down

0 comments on commit 9cee2ea

Please sign in to comment.