MCPcopy Create free account
hub / github.com/compilets/compilets / constructor

Method constructor

src/cpp-syntax.ts:131–138  ·  view source on GitHub ↗
(type: Type, expression: Expression)

Source from the content-addressed store, hash-verified

129 expression: Expression;
130
131 constructor(type: Type, expression: Expression) {
132 super(type);
133 // Make "as unknown as type" work.
134 if (expression instanceof AsExpression && expression.type.category == 'any')
135 expression = expression.expression;
136 // Do conversion.
137 this.expression = castExpression(expression, type);
138 }
139
140 override print(ctx: PrintContext) {
141 return this.expression.print(ctx);

Callers

nothing calls this directly

Calls 1

castExpressionFunction · 0.90

Tested by

no test coverage detected