mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Add addr self binding support in destructors (#3117)
Refactors `CallDestructor` and `CallFunction` to both call a new method `BindSelfIfPresent`, which includes support for binding `addr self` if specified. Fixes the associated unit test. Closes #2802.
This commit is contained in:
@@ -109,6 +109,8 @@ fn Main() -> i32 {
|
||||
// CHECK:STDOUT: <[] stack-pop: ValueExpressionAction pos: 1 `{}.(interface ImplicitAs(T = class T).Convert)` results: [`bound_method<Convert>`] (phase_execution.carbon:10)
|
||||
// CHECK:STDOUT: ->> step ExpressionAction pos: 1 `{}.(interface ImplicitAs(T = class T).Convert)()` results: [`bound_method<Convert>`] scope: [] (phase_execution.carbon:10) --->
|
||||
// CHECK:STDOUT: -() calling function: bound_method<Convert>
|
||||
// CHECK:STDOUT: === match pattern `Placeholder<self>`
|
||||
// CHECK:STDOUT: from value expression with value `{}`
|
||||
// CHECK:STDOUT: === match pattern `()`
|
||||
// CHECK:STDOUT: from value expression with value `()`
|
||||
// CHECK:STDOUT: >[] stack-push: ScopeAction pos: 0 scope: [`self: Self`: `{}`] (None)
|
||||
|
||||
Reference in New Issue
Block a user