edgeql: Make the error message for indexing less obscure.
@@ -386,7 +386,9 @@ def __infer_slice(ir, schema):
base_name = 'array'
else:
# the base type is not valid
- return None
+ raise ql_errors.EdgeQLError(
+ f'cannot index {base_name}',
+ context=ir.start.context)
for index in [ir.start, ir.stop]:
index_type = infer_type(index, schema)
@@ -443,6 +445,11 @@ def __infer_index(ir, schema):
result = node_type.element_type
+ else:
+ raise ql_errors.EdgeQLError(
+ f'cannot index {node_type.name}',
+ context=ir.index.context)
+
return result
