Skip to content

Commit b3169e5

Browse files
committed
Error out on unspported indexing
1 parent b21b91c commit b3169e5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

semantic/metac_expr_semantic.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,12 @@ metac_sema_expr_t* MetaCSemantic_doIndexSemantic_(metac_sema_state_t* self,
310310
result->TypeIndex = charType;
311311
// result->Chars[
312312
}
313+
else
314+
{
315+
SemanticError(expr->LocationIndex,
316+
"%s is not supported for indexing",
317+
MetaCExprKind_toChars(indexed->Kind));
318+
}
313319

314320
return result;
315321
}

0 commit comments

Comments
 (0)