- error(binary, format("No matching operator '%s' found for '%s' and '%s'",
- binary.oper->token, binary.left->type->name, binary.right->type->name));
+ {
+ if(binary.oper->token[0]=='[')
+ error(binary, format("Can't index element of '%s' with '%s'",
+ binary.left->type->name, binary.right->type->name));
+ else
+ error(binary, format("No matching operator '%s' found for '%s' and '%s'",
+ binary.oper->token, binary.left->type->name, binary.right->type->name));
+ }