diff --git a/src/compiler/crystal/codegen/call.cr b/src/compiler/crystal/codegen/call.cr index 0096c7c84376..5934ffeb0c14 100644 --- a/src/compiler/crystal/codegen/call.cr +++ b/src/compiler/crystal/codegen/call.cr @@ -340,6 +340,9 @@ class Crystal::CodeGenVisitor # Create self var if available if node_obj + # call `#remove_indirection` here so that the downcast call in + # `#visit(Var)` doesn't spend time expanding module types again and again + # (it should be the only use site of `node_obj.type`) new_vars["%self"] = LLVMVar.new(@last, node_obj.type.remove_indirection, true) end