MCPcopy Index your code
hub / github.com/angular/angular / TcbBlockImplicitVariableOp

Class TcbBlockImplicitVariableOp

packages/compiler/src/typecheck/ops/variables.ts:21–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19 * Executing this operation returns the identifier which can be used to refer to the variable.
20 */
21export class TcbBlockImplicitVariableOp extends TcbOp {
22 constructor(
23 private tcb: Context,
24 private scope: Scope,
25 private type: TcbExpr,
26 private variable: Variable,
27 ) {
28 super();
29 }
30
31 override readonly optional = true;
32
33 override execute(): TcbExpr {
34 const id = new TcbExpr(this.tcb.allocateId());
35 id.addParseSpanInfo(this.variable.keySpan);
36 const variable = declareVariable(id, this.type);
37 variable.addParseSpanInfo(this.variable.sourceSpan);
38 this.scope.addStatement(variable);
39 return id;
40 }
41}
42
43/**
44 * A `TcbOp` which creates an expression for particular let- `Variable` on a

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…