| 1216 | } |
| 1217 | |
| 1218 | static const CBMType *eval_array_access(JavaLSPContext *ctx, TSNode node) { |
| 1219 | TSNode arr = ts_node_child_by_field_name(node, "array", 5); |
| 1220 | if (ts_node_is_null(arr)) |
| 1221 | return cbm_type_unknown(); |
| 1222 | const CBMType *t = java_eval_expr_type(ctx, arr); |
| 1223 | if (t && t->kind == CBM_TYPE_SLICE) |
| 1224 | return t->data.slice.elem; |
| 1225 | /* List<T>[i] in Java is illegal — but at runtime we sometimes see |
| 1226 | * Collection.get-style indexing through the array_access node. Stay |
| 1227 | * conservative. */ |
| 1228 | return cbm_type_unknown(); |
| 1229 | } |
| 1230 | |
| 1231 | static const CBMType *eval_cast(JavaLSPContext *ctx, TSNode node) { |
| 1232 | TSNode type_node = ts_node_child_by_field_name(node, "type", 4); |
no test coverage detected