@@ -871,32 +871,28 @@ fn resolve_inheritance_attrs_unified(
871871 for ( parent_group_id, included_group) in include_groups {
872872 for parent_attr in included_group. iter ( ) {
873873 let attr_id = parent_attr. spec . id ( ) ;
874- match inherited_attrs. get_mut ( & attr_id) {
875- Some ( existing) => {
876- existing. spec = resolve_inheritance_attr (
877- & parent_attr. spec ,
878- & existing. spec ,
879- & mut existing. lineage ,
880- ) ;
881- existing. lineage . source_group = parent_group_id. to_owned ( ) ;
882- }
883- None => {
884- let lineage =
885- AttributeLineage :: inherit_from ( parent_group_id, & parent_attr. spec ) ;
886- log:: debug!(
887- "Inheriting attribute {} from group {}, resolved to {:#?}" ,
888- attr_id,
889- parent_group_id,
890- lineage. source_group
891- ) ;
892- _ = inherited_attrs. insert (
893- attr_id. clone ( ) ,
894- AttrWithLineage {
895- spec : parent_attr. spec . clone ( ) ,
896- lineage,
897- } ,
898- ) ;
899- }
874+ if let Some ( existing) = inherited_attrs. get_mut ( & attr_id) {
875+ existing. spec = resolve_inheritance_attr (
876+ & parent_attr. spec ,
877+ & existing. spec ,
878+ & mut existing. lineage ,
879+ ) ;
880+ existing. lineage . source_group = parent_group_id. to_owned ( ) ;
881+ } else {
882+ let lineage = AttributeLineage :: inherit_from ( parent_group_id, & parent_attr. spec ) ;
883+ log:: debug!(
884+ "Inheriting attribute {} from group {}, resolved to {:#?}" ,
885+ attr_id,
886+ parent_group_id,
887+ lineage. source_group
888+ ) ;
889+ _ = inherited_attrs. insert (
890+ attr_id. clone ( ) ,
891+ AttrWithLineage {
892+ spec : parent_attr. spec . clone ( ) ,
893+ lineage,
894+ } ,
895+ ) ;
900896 }
901897 }
902898 }
@@ -1181,9 +1177,9 @@ mod tests {
11811177 use crate :: registry:: resolve_inheritance_attrs_unified;
11821178 use crate :: registry:: UnresolvedGroup ;
11831179 use crate :: registry:: UnresolvedRegistry ;
1184- use weaver_resolved_schema:: attribute:: UnresolvedAttribute ;
11851180 use crate :: { WeaverResolver , WeaverResolverConfig } ;
11861181 use std:: sync:: Arc ;
1182+ use weaver_resolved_schema:: attribute:: UnresolvedAttribute ;
11871183
11881184 /// Settings for resolution tests.
11891185 #[ derive( Serialize , Deserialize , Default ) ]
@@ -1904,7 +1900,11 @@ groups:
19041900 } ;
19051901
19061902 // Lowest priority base (parent `extends`): sets conditionally_required.
1907- let parent = vec ! [ bare_ref( "messaging.destination.name" , Some ( cond. clone( ) ) , None ) ] ;
1903+ let parent = vec ! [ bare_ref(
1904+ "messaging.destination.name" ,
1905+ Some ( cond. clone( ) ) ,
1906+ None ,
1907+ ) ] ;
19081908 // Higher priority base (`ref_group`): only sets an example, no level.
19091909 let included = vec ! [ bare_ref(
19101910 "messaging.destination.name" ,
@@ -1939,7 +1939,9 @@ groups:
19391939 "ref_group example override should still win"
19401940 ) ;
19411941 }
1942- other => panic ! ( "expected a Ref attribute, got {other:?}" ) ,
1942+ other @ AttributeSpec :: Id { .. } => {
1943+ panic ! ( "expected a Ref attribute, got {other:?}" )
1944+ }
19431945 }
19441946 }
19451947}
0 commit comments