Skip to content

Commit

Permalink
Fix missing span when overloading fields with mismatch type (#7164)
Browse files Browse the repository at this point in the history
  • Loading branch information
XeniaLu authored Apr 16, 2024
1 parent a0b33dd commit c3b7d7f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion edb/schema/inheriting.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def inherit_fields(
ignore_local=ignore_local_field,
schema=schema,
)
except errors.SchemaDefinitionError as e:
except (errors.SchemaDefinitionError, errors.SchemaError) as e:
if (span := self.get_attribute_span(field_name)):
e.set_span(span)
raise
Expand Down
15 changes: 15 additions & 0 deletions tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,21 @@ def test_schema_overloaded_prop_10(self):
}
"""

@tb.must_fail(errors.SchemaError,
"cannot redefine property 'name' of object type "
"'test::UniqueName_2' as scalar type 'std::bytes'",
position=196)
def test_schema_overloaded_prop_11(self):
"""
type UniqueName {
property name -> str;
};
type UniqueName_2 extending UniqueName {
overloaded property name -> bytes;
};
"""

@tb.must_fail(errors.SchemaDefinitionError,
"it is illegal for the computed link 'foo' "
"of object type 'test::UniqueName_2' to overload "
Expand Down

0 comments on commit c3b7d7f

Please sign in to comment.