MCPcopy Create free account
hub / github.com/dfranx/ShaderDebugger / SubScriptingOpTypeChecking

Method SubScriptingOpTypeChecking

libs/wgtcc/ast.cc:272–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270
271
272 void BinaryOp::SubScriptingOpTypeChecking() {
273 auto lhsType = lhs_->Type()->ToPointer();
274 if (!lhsType) {
275 Error(this, "an pointer expected");
276 }
277 if (!rhs_->Type()->IsInteger()) {
278 Error(this, "the operand of [] should be intger");
279 }
280
281 // The type of [] operator is the derived type
282 type_ = lhsType->Derived();
283 }
284
285
286 void BinaryOp::MemberRefOpTypeChecking() {

Callers

nothing calls this directly

Calls 5

ErrorFunction · 0.85
DerivedMethod · 0.80
ToPointerMethod · 0.45
TypeMethod · 0.45
IsIntegerMethod · 0.45

Tested by

no test coverage detected