Skip to content

Commit

Permalink
If a field's ambiguous data types does not have an entry on the same …
Browse files Browse the repository at this point in the history
…cluster, and only one global data type, use the global one
  • Loading branch information
hasty committed Sep 19, 2024
1 parent fe1d017 commit bf2504c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion matter/spec/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,18 @@ func disambiguateDataType(entities map[types.Entity]*matter.Cluster, cluster *ma
}
}
}
// Can't disambiguate out this data model

var nakedEntities []types.Entity
for m, c := range entities {
if c == nil {
nakedEntities = append(nakedEntities, m)
}
}
if len(nakedEntities) == 1 {
return nakedEntities[0]
}

// Can't disambiguate out this data model
slog.Warn("ambiguous data type", "cluster", clusterName(cluster), "field", field.Name, log.Path("source", field))
for m, c := range entities {
var clusterName string
Expand Down

0 comments on commit bf2504c

Please sign in to comment.