diff --git a/explorer/interpreter/interpreter.cpp b/explorer/interpreter/interpreter.cpp index 3b49579f931c..9592b889815e 100644 --- a/explorer/interpreter/interpreter.cpp +++ b/explorer/interpreter/interpreter.cpp @@ -502,6 +502,11 @@ auto Interpreter::EvalAssociatedConstant( auto Interpreter::InstantiateType(Nonnull type, SourceLocation source_loc) -> ErrorOr> { + if (trace_stream_->is_enabled()) { + trace_stream_->Start() << "instantiating type `" << *type << "` (" + << source_loc << ")\n"; + } + switch (type->kind()) { case Value::Kind::VariableType: { CARBON_ASSIGN_OR_RETURN( diff --git a/explorer/testdata/trace/phase_execution.carbon b/explorer/testdata/trace/phase_execution.carbon index 0c409879fd35..895444f2e142 100644 --- a/explorer/testdata/trace/phase_execution.carbon +++ b/explorer/testdata/trace/phase_execution.carbon @@ -4,9 +4,10 @@ package ExplorerTest api; -interface TestInterface {} +class T {} fn Main() -> i32 { + var x: T = {}; return 0; } @@ -19,26 +20,27 @@ fn Main() -> i32 { // CHECK:STDOUT: ------------------------------------------------------------ // CHECK:STDOUT: - - - - - initializing globals - - - - - // CHECK:STDOUT: ------------------------------------------ -// CHECK:STDOUT: >[] stack-push: DeclarationAction pos: 0 `interface TestInterface` (phase_execution.carbon:7) -// CHECK:STDOUT: ->> step DeclarationAction pos: 0 `interface TestInterface` (phase_execution.carbon:7) ---> +// CHECK:STDOUT: >[] stack-push: DeclarationAction pos: 0 `class T` (phase_execution.carbon:7) +// CHECK:STDOUT: ->> step DeclarationAction pos: 0 `class T` (phase_execution.carbon:7) ---> // CHECK:STDOUT: *** declaration at (phase_execution.carbon:7) // CHECK:STDOUT: ``` -// CHECK:STDOUT: interface TestInterface { +// CHECK:STDOUT: class T { // CHECK:STDOUT: } // CHECK:STDOUT: ``` -// CHECK:STDOUT: <[] stack-pop: DeclarationAction pos: 0 `interface TestInterface` (phase_execution.carbon:7) -// CHECK:STDOUT: >[] stack-push: DeclarationAction pos: 0 `fn Main` (phase_execution.carbon:11) -// CHECK:STDOUT: ->> step DeclarationAction pos: 0 `fn Main` (phase_execution.carbon:11) ---> -// CHECK:STDOUT: *** declaration at (phase_execution.carbon:11) +// CHECK:STDOUT: <[] stack-pop: DeclarationAction pos: 0 `class T` (phase_execution.carbon:7) +// CHECK:STDOUT: >[] stack-push: DeclarationAction pos: 0 `fn Main` (phase_execution.carbon:12) +// CHECK:STDOUT: ->> step DeclarationAction pos: 0 `fn Main` (phase_execution.carbon:12) ---> +// CHECK:STDOUT: *** declaration at (phase_execution.carbon:12) // CHECK:STDOUT: ``` // CHECK:STDOUT: fn Main ()-> i32 { // CHECK:STDOUT: { +// CHECK:STDOUT: var x: T = {}.(interface ImplicitAs(T = class T).Convert)(); // CHECK:STDOUT: return 0; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: ``` -// CHECK:STDOUT: <[] stack-pop: DeclarationAction pos: 0 `fn Main` (phase_execution.carbon:11) +// CHECK:STDOUT: <[] stack-pop: DeclarationAction pos: 0 `fn Main` (phase_execution.carbon:12) // CHECK:STDOUT: - - - - - calling main function - - - - - // CHECK:STDOUT: ------------------------------------------- // CHECK:STDOUT: >[] stack-push: ValueExpressionAction pos: 0 `Main()` (:0) @@ -57,40 +59,166 @@ fn Main() -> i32 { // CHECK:STDOUT: match pattern () // CHECK:STDOUT: from value expression with value () // CHECK:STDOUT: >[] stack-push: ScopeAction pos: 0 scope: [] (None) -// CHECK:STDOUT: >[] stack-push: StatementAction pos: 0 `{return 0;}` (phase_execution.carbon:11) -// CHECK:STDOUT: ->> step StatementAction pos: 0 `{return 0;}` (phase_execution.carbon:11) ---> -// CHECK:STDOUT: *** statement at (phase_execution.carbon:11) +// CHECK:STDOUT: >[] stack-push: StatementAction pos: 0 `{var x: T = {}.(interface ImplicitAs(T = class T).Convert)();return 0;}` (phase_execution.carbon:12) +// CHECK:STDOUT: ->> step StatementAction pos: 0 `{var x: T = {}.(interface ImplicitAs(T = class T).Convert)();return 0;}` (phase_execution.carbon:12) ---> +// CHECK:STDOUT: *** statement at (phase_execution.carbon:12) // CHECK:STDOUT: ``` // CHECK:STDOUT: { +// CHECK:STDOUT: var x: T = {}.(interface ImplicitAs(T = class T).Convert)(); // CHECK:STDOUT: return 0; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ``` -// CHECK:STDOUT: >[] stack-push: StatementAction pos: 0 `return 0;` (phase_execution.carbon:10) -// CHECK:STDOUT: ->> step StatementAction pos: 0 `return 0;` (phase_execution.carbon:10) ---> +// CHECK:STDOUT: >[] stack-push: StatementAction pos: 0 `var x: T = {}.(interface ImplicitAs(T = class T).Convert)();` (phase_execution.carbon:10) +// CHECK:STDOUT: ->> step StatementAction pos: 0 `var x: T = {}.(interface ImplicitAs(T = class T).Convert)();` (phase_execution.carbon:10) ---> // CHECK:STDOUT: *** statement at (phase_execution.carbon:10) // CHECK:STDOUT: ``` -// CHECK:STDOUT: return 0; +// CHECK:STDOUT: var x: T = {}.(interface ImplicitAs(T = class T).Convert)(); // CHECK:STDOUT: ``` -// CHECK:STDOUT: >[] stack-push: ValueExpressionAction pos: 0 `0` (phase_execution.carbon:10) -// CHECK:STDOUT: ->> step ValueExpressionAction pos: 0 `0` (phase_execution.carbon:10) ---> -// CHECK:STDOUT: >[] stack-push: ExpressionAction pos: 0 `0` (phase_execution.carbon:10) -// CHECK:STDOUT: ->> step ExpressionAction pos: 0 `0` (phase_execution.carbon:10) ---> -// CHECK:STDOUT: <[] stack-pop: ExpressionAction pos: 0 `0` (phase_execution.carbon:10) -// CHECK:STDOUT: ->> step ValueExpressionAction pos: 1 `0` results: [`0`] (phase_execution.carbon:10) ---> -// CHECK:STDOUT: <[] stack-pop: ValueExpressionAction pos: 1 `0` results: [`0`] (phase_execution.carbon:10) -// CHECK:STDOUT: ->> step StatementAction pos: 1 `return 0;` results: [`0`] (phase_execution.carbon:10) ---> -// CHECK:STDOUT: *** statement at (phase_execution.carbon:10) +// CHECK:STDOUT: ++# memory-alloc: #1 `Uninit` uninitialized +// CHECK:STDOUT: >[] stack-push: ExpressionAction pos: 0 `{}.(interface ImplicitAs(T = class T).Convert)()` (phase_execution.carbon:10) +// CHECK:STDOUT: ->> step ExpressionAction pos: 0 `{}.(interface ImplicitAs(T = class T).Convert)()` (phase_execution.carbon:10) ---> +// CHECK:STDOUT: >[] stack-push: ValueExpressionAction pos: 0 `{}.(interface ImplicitAs(T = class T).Convert)` (phase_execution.carbon:10) +// CHECK:STDOUT: ->> step ValueExpressionAction pos: 0 `{}.(interface ImplicitAs(T = class T).Convert)` (phase_execution.carbon:10) ---> +// CHECK:STDOUT: >[] stack-push: ExpressionAction pos: 0 `{}.(interface ImplicitAs(T = class T).Convert)` (phase_execution.carbon:10) +// CHECK:STDOUT: ->> step ExpressionAction pos: 0 `{}.(interface ImplicitAs(T = class T).Convert)` (phase_execution.carbon:10) ---> +// CHECK:STDOUT: >[] stack-push: ValueExpressionAction pos: 0 `{}` (phase_execution.carbon:10) +// CHECK:STDOUT: ->> step ValueExpressionAction pos: 0 `{}` (phase_execution.carbon:10) ---> +// CHECK:STDOUT: >[] stack-push: ExpressionAction pos: 0 `{}` (phase_execution.carbon:10) +// CHECK:STDOUT: ->> step ExpressionAction pos: 0 `{}` (phase_execution.carbon:10) ---> +// CHECK:STDOUT: <[] stack-pop: ExpressionAction pos: 0 `{}` (phase_execution.carbon:10) +// CHECK:STDOUT: ->> step ValueExpressionAction pos: 1 `{}` results: [`{}`] (phase_execution.carbon:10) ---> +// CHECK:STDOUT: <[] stack-pop: ValueExpressionAction pos: 1 `{}` results: [`{}`] (phase_execution.carbon:10) +// CHECK:STDOUT: ->> step ExpressionAction pos: 1 `{}.(interface ImplicitAs(T = class T).Convert)` results: [`{}`] (phase_execution.carbon:10) ---> +// CHECK:STDOUT: >[] stack-push: WitnessAction pos: 0 `witness for impl T as ImplicitAs(U)` (phase_execution.carbon:10) +// CHECK:STDOUT: ->> step WitnessAction pos: 0 `witness for impl T as ImplicitAs(U)` (phase_execution.carbon:10) ---> +// CHECK:STDOUT: <[] stack-pop: WitnessAction pos: 0 `witness for impl T as ImplicitAs(U)` (phase_execution.carbon:10) +// CHECK:STDOUT: ->> step ExpressionAction pos: 2 `{}.(interface ImplicitAs(T = class T).Convert)` results: [`{}`, `witness for impl T as ImplicitAs(U)`] (phase_execution.carbon:10) ---> +// CHECK:STDOUT: >[] stack-push: TypeInstantiationAction pos: 0 `interface As(T = class T)` (phase_execution.carbon:10) +// CHECK:STDOUT: ->> step TypeInstantiationAction pos: 0 `interface As(T = class T)` (phase_execution.carbon:10) ---> +// CHECK:STDOUT: ->> instantiating type `interface As(T = class T)` (phase_execution.carbon:10) +// CHECK:STDOUT: ->> instantiating type `class T` (phase_execution.carbon:10) +// CHECK:STDOUT: <[] stack-pop: TypeInstantiationAction pos: 0 `interface As(T = class T)` (phase_execution.carbon:10) +// CHECK:STDOUT: ->> step ExpressionAction pos: 3 `{}.(interface ImplicitAs(T = class T).Convert)` results: [`{}`, `witness for impl T as ImplicitAs(U)`, `interface As(T = class T)`] (phase_execution.carbon:10) ---> +// CHECK:STDOUT: ->> step ExpressionAction pos: 4 `{}.(interface ImplicitAs(T = class T).Convert)` results: [`{}`, `witness for impl T as ImplicitAs(U)`, `interface As(T = class T)`] (phase_execution.carbon:10) ---> +// CHECK:STDOUT: <[] stack-pop: ExpressionAction pos: 4 `{}.(interface ImplicitAs(T = class T).Convert)` results: [`{}`, `witness for impl T as ImplicitAs(U)`, `interface As(T = class T)`] (phase_execution.carbon:10) +// CHECK:STDOUT: ->> step ValueExpressionAction pos: 1 `{}.(interface ImplicitAs(T = class T).Convert)` results: [`bound_method`] (phase_execution.carbon:10) ---> +// CHECK:STDOUT: <[] stack-pop: ValueExpressionAction pos: 1 `{}.(interface ImplicitAs(T = class T).Convert)` results: [`bound_method`] (phase_execution.carbon:10) +// CHECK:STDOUT: ->> step ExpressionAction pos: 1 `{}.(interface ImplicitAs(T = class T).Convert)()` results: [`bound_method`] scope: [] (phase_execution.carbon:10) ---> +// CHECK:STDOUT: -() calling function: bound_method +// CHECK:STDOUT: match pattern () +// CHECK:STDOUT: from value expression with value () +// CHECK:STDOUT: >[] stack-push: ScopeAction pos: 0 scope: [`self: Self`: `{}`] (None) +// CHECK:STDOUT: >[] stack-push: StatementAction pos: 0 `{return __intrinsic_implicit_as_convert(self, U);}` (prelude.carbon:{{\d+}}) +// CHECK:STDOUT: ->> step StatementAction pos: 0 `{return __intrinsic_implicit_as_convert(self, U);}` (prelude.carbon:{{\d+}}) ---> +// CHECK:STDOUT: *** statement at (prelude.carbon:{{\d+}}) // CHECK:STDOUT: ``` -// CHECK:STDOUT: return 0; +// CHECK:STDOUT: { +// CHECK:STDOUT: return __intrinsic_implicit_as_convert(self, U); +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: ``` -// CHECK:STDOUT: <[] stack-pop: StatementAction pos: 1 `return 0;` results: [`0`] (phase_execution.carbon:10) -// CHECK:STDOUT: <[] stack-pop: StatementAction pos: 1 `{return 0;}` scope: [] (phase_execution.carbon:11) -// CHECK:STDOUT: <[] stack-pop: ScopeAction pos: 0 scope: [] (None) -// CHECK:STDOUT: >[] stack-push: CleanUpAction pos: 0 scope: [] (stack cleanup:1) +// CHECK:STDOUT: >[] stack-push: StatementAction pos: 0 `return __intrinsic_implicit_as_convert(self, U);` (prelude.carbon:{{\d+}}) +// CHECK:STDOUT: ->> step StatementAction pos: 0 `return __intrinsic_implicit_as_convert(self, U);` (prelude.carbon:{{\d+}}) ---> +// CHECK:STDOUT: *** statement at (prelude.carbon:{{\d+}}) +// CHECK:STDOUT: ``` +// CHECK:STDOUT: return __intrinsic_implicit_as_convert(self, U); +// CHECK:STDOUT: ``` +// CHECK:STDOUT: >[] stack-push: ValueExpressionAction pos: 0 `__intrinsic_implicit_as_convert(self, U)` (prelude.carbon:{{\d+}}) +// CHECK:STDOUT: ->> step ValueExpressionAction pos: 0 `__intrinsic_implicit_as_convert(self, U)` (prelude.carbon:{{\d+}}) ---> +// CHECK:STDOUT: >[] stack-push: ExpressionAction pos: 0 `__intrinsic_implicit_as_convert(self, U)` (prelude.carbon:{{\d+}}) +// CHECK:STDOUT: ->> step ExpressionAction pos: 0 `__intrinsic_implicit_as_convert(self, U)` (prelude.carbon:{{\d+}}) ---> +// CHECK:STDOUT: <[] stack-pop: ExpressionAction pos: 0 `__intrinsic_implicit_as_convert(self, U)` (prelude.carbon:{{\d+}}) +// CHECK:STDOUT: >[] stack-push: ExpressionAction pos: 0 `self` (prelude.carbon:{{\d+}}) +// CHECK:STDOUT: ->> step ExpressionAction pos: 0 `self` (prelude.carbon:{{\d+}}) ---> +// CHECK:STDOUT: >[] stack-push: ValueExpressionAction pos: 0 `self` (prelude.carbon:{{\d+}}) +// CHECK:STDOUT: ->> step ValueExpressionAction pos: 0 `self` (prelude.carbon:{{\d+}}) ---> +// CHECK:STDOUT: >[] stack-push: ExpressionAction pos: 0 `self` (prelude.carbon:{{\d+}}) +// CHECK:STDOUT: ->> step ExpressionAction pos: 0 `self` (prelude.carbon:{{\d+}}) ---> +// CHECK:STDOUT: <[] stack-pop: ExpressionAction pos: 0 `self` (prelude.carbon:{{\d+}}) +// CHECK:STDOUT: ->> step ValueExpressionAction pos: 1 `self` results: [`{}`] (prelude.carbon:{{\d+}}) ---> +// CHECK:STDOUT: <[] stack-pop: ValueExpressionAction pos: 1 `self` results: [`{}`] (prelude.carbon:{{\d+}}) +// CHECK:STDOUT: ->> step ExpressionAction pos: 1 `self` results: [`{}`] (prelude.carbon:{{\d+}}) ---> +// CHECK:STDOUT: >[] stack-push: TypeInstantiationAction pos: 0 `class T` (prelude.carbon:{{\d+}}) +// CHECK:STDOUT: ->> step TypeInstantiationAction pos: 0 `class T` (prelude.carbon:{{\d+}}) ---> +// CHECK:STDOUT: <[] stack-pop: TypeInstantiationAction pos: 0 `class T` (prelude.carbon:{{\d+}}) +// CHECK:STDOUT: ->> step ExpressionAction pos: 2 `self` results: [`{}`, `class T`] (prelude.carbon:{{\d+}}) ---> +// CHECK:STDOUT: ->> instantiating type `class T` (prelude.carbon:{{\d+}}) +// CHECK:STDOUT: <[] stack-pop: ExpressionAction pos: 2 `self` results: [`{}`, `class T`] (prelude.carbon:{{\d+}}) +// CHECK:STDOUT: ->> step ValueExpressionAction pos: 1 `__intrinsic_implicit_as_convert(self, U)` results: [`T{}`] (prelude.carbon:{{\d+}}) ---> +// CHECK:STDOUT: <[] stack-pop: ValueExpressionAction pos: 1 `__intrinsic_implicit_as_convert(self, U)` results: [`T{}`] (prelude.carbon:{{\d+}}) +// CHECK:STDOUT: ->> step StatementAction pos: 1 `return __intrinsic_implicit_as_convert(self, U);` results: [`T{}`] (prelude.carbon:{{\d+}}) ---> +// CHECK:STDOUT: *** statement at (prelude.carbon:{{\d+}}) +// CHECK:STDOUT: ``` +// CHECK:STDOUT: return __intrinsic_implicit_as_convert(self, U); +// CHECK:STDOUT: ``` +// CHECK:STDOUT: --> memory-write: #1 `T{}` +// CHECK:STDOUT: <[] stack-pop: StatementAction pos: 1 `return __intrinsic_implicit_as_convert(self, U);` results: [`T{}`] (prelude.carbon:{{\d+}}) +// CHECK:STDOUT: <[] stack-pop: StatementAction pos: 1 `{return __intrinsic_implicit_as_convert(self, U);}` scope: [] (prelude.carbon:{{\d+}}) +// CHECK:STDOUT: <[] stack-pop: ScopeAction pos: 0 scope: [`self: Self`: `{}`] (None) +// CHECK:STDOUT: >[] stack-push: CleanUpAction pos: 0 scope: [`self: Self`: `{}`] (stack cleanup:1) // CHECK:STDOUT: >[] stack-push: CleanUpAction pos: 0 scope: [] (stack cleanup:1) // CHECK:STDOUT: ->> step CleanUpAction pos: 0 scope: [] (stack cleanup:1) ---> // CHECK:STDOUT: <[] stack-pop: CleanUpAction pos: 0 scope: [] (stack cleanup:1) +// CHECK:STDOUT: ->> step CleanUpAction pos: 0 scope: [`self: Self`: `{}`] (stack cleanup:1) ---> +// CHECK:STDOUT: <[] stack-pop: CleanUpAction pos: 0 scope: [`self: Self`: `{}`] (stack cleanup:1) +// CHECK:STDOUT: ->> step ExpressionAction pos: 2 `{}.(interface ImplicitAs(T = class T).Convert)()` results: [`bound_method`, `T{}`] scope: [] (phase_execution.carbon:10) ---> +// CHECK:STDOUT: <[] stack-pop: ExpressionAction pos: 2 `{}.(interface ImplicitAs(T = class T).Convert)()` results: [`bound_method`, `T{}`] scope: [] (phase_execution.carbon:10) +// CHECK:STDOUT: >[] stack-push: CleanUpAction pos: 0 scope: [] (stack cleanup:1) +// CHECK:STDOUT: ->> step CleanUpAction pos: 0 scope: [] (stack cleanup:1) ---> +// CHECK:STDOUT: <[] stack-pop: CleanUpAction pos: 0 scope: [] (stack cleanup:1) +// CHECK:STDOUT: ->> step StatementAction pos: 1 `var x: T = {}.(interface ImplicitAs(T = class T).Convert)();` results: [`T{}`] (phase_execution.carbon:10) ---> +// CHECK:STDOUT: *** statement at (phase_execution.carbon:10) +// CHECK:STDOUT: ``` +// CHECK:STDOUT: var x: T = {}.(interface ImplicitAs(T = class T).Convert)(); +// CHECK:STDOUT: ``` +// CHECK:STDOUT: <-- memory-read: #1 `T{}` +// CHECK:STDOUT: match pattern Placeholder +// CHECK:STDOUT: from initializing expression with value T{} +// CHECK:STDOUT: <[] stack-pop: StatementAction pos: 1 `var x: T = {}.(interface ImplicitAs(T = class T).Convert)();` results: [`T{}`] (phase_execution.carbon:10) +// CHECK:STDOUT: ->> step StatementAction pos: 1 `{var x: T = {}.(interface ImplicitAs(T = class T).Convert)();return 0;}` scope: [`x: T`: `lval`] (phase_execution.carbon:12) ---> +// CHECK:STDOUT: *** statement at (phase_execution.carbon:12) +// CHECK:STDOUT: ``` +// CHECK:STDOUT: { +// CHECK:STDOUT: var x: T = {}.(interface ImplicitAs(T = class T).Convert)(); +// CHECK:STDOUT: return 0; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ``` +// CHECK:STDOUT: >[] stack-push: StatementAction pos: 0 `return 0;` (phase_execution.carbon:11) +// CHECK:STDOUT: ->> step StatementAction pos: 0 `return 0;` (phase_execution.carbon:11) ---> +// CHECK:STDOUT: *** statement at (phase_execution.carbon:11) +// CHECK:STDOUT: ``` +// CHECK:STDOUT: return 0; +// CHECK:STDOUT: ``` +// CHECK:STDOUT: >[] stack-push: ValueExpressionAction pos: 0 `0` (phase_execution.carbon:11) +// CHECK:STDOUT: ->> step ValueExpressionAction pos: 0 `0` (phase_execution.carbon:11) ---> +// CHECK:STDOUT: >[] stack-push: ExpressionAction pos: 0 `0` (phase_execution.carbon:11) +// CHECK:STDOUT: ->> step ExpressionAction pos: 0 `0` (phase_execution.carbon:11) ---> +// CHECK:STDOUT: <[] stack-pop: ExpressionAction pos: 0 `0` (phase_execution.carbon:11) +// CHECK:STDOUT: ->> step ValueExpressionAction pos: 1 `0` results: [`0`] (phase_execution.carbon:11) ---> +// CHECK:STDOUT: <[] stack-pop: ValueExpressionAction pos: 1 `0` results: [`0`] (phase_execution.carbon:11) +// CHECK:STDOUT: ->> step StatementAction pos: 1 `return 0;` results: [`0`] (phase_execution.carbon:11) ---> +// CHECK:STDOUT: *** statement at (phase_execution.carbon:11) +// CHECK:STDOUT: ``` +// CHECK:STDOUT: return 0; +// CHECK:STDOUT: ``` +// CHECK:STDOUT: <[] stack-pop: StatementAction pos: 1 `return 0;` results: [`0`] (phase_execution.carbon:11) +// CHECK:STDOUT: <[] stack-pop: StatementAction pos: 2 `{var x: T = {}.(interface ImplicitAs(T = class T).Convert)();return 0;}` scope: [`x: T`: `lval`] (phase_execution.carbon:12) +// CHECK:STDOUT: <[] stack-pop: ScopeAction pos: 0 scope: [] (None) +// CHECK:STDOUT: >[] stack-push: CleanUpAction pos: 0 scope: [] (stack cleanup:1) +// CHECK:STDOUT: >[] stack-push: CleanUpAction pos: 0 scope: [`x: T`: `lval`] (stack cleanup:1) +// CHECK:STDOUT: ->> step CleanUpAction pos: 0 scope: [`x: T`: `lval`] (stack cleanup:1) ---> +// CHECK:STDOUT: <-- memory-read: #1 `T{}` +// CHECK:STDOUT: >[] stack-push: DestroyAction pos: 0 (None) +// CHECK:STDOUT: ->> step DestroyAction pos: 0 (None) ---> +// CHECK:STDOUT: ->> step DestroyAction pos: 1 (None) ---> +// CHECK:STDOUT: ->> step DestroyAction pos: 2 (None) ---> +// CHECK:STDOUT: <[] stack-pop: DestroyAction pos: 2 (None) +// CHECK:STDOUT: ->> step CleanUpAction pos: 1 scope: [`x: T`: `lval`] (stack cleanup:1) ---> +// CHECK:STDOUT: --# memory-dealloc: #1 `T{}` +// CHECK:STDOUT: ->> step CleanUpAction pos: 2 scope: [`x: T`: `lval`] (stack cleanup:1) ---> +// CHECK:STDOUT: <[] stack-pop: CleanUpAction pos: 2 scope: [`x: T`: `lval`] (stack cleanup:1) // CHECK:STDOUT: ->> step CleanUpAction pos: 0 scope: [] (stack cleanup:1) ---> // CHECK:STDOUT: <[] stack-pop: CleanUpAction pos: 0 scope: [] (stack cleanup:1) // CHECK:STDOUT: ->> step ExpressionAction pos: 2 `Main()` results: [`fun
`, `0`] scope: [] (:0) --->