Skip to content

Commit

Permalink
Harden detection of missing nested types (#3099)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr authored Jun 14, 2024
1 parent a2a4e1e commit 7f1a7ff
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/libs/metadata/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,11 @@ impl Reader {
// TODO: this needs to be deferred via a TypeName's optional nested type name?
if let Some(outer) = enclosing {
if full_name.namespace().is_empty() {
let nested = &self.nested[&outer];
let Some(inner) = nested.get(full_name.name()) else {
let Some(inner) = self
.nested
.get(&outer)
.and_then(|nested| nested.get(full_name.name()))
else {
panic!(
"Nested type not found: {}.{}",
outer.type_name(),
Expand Down

0 comments on commit 7f1a7ff

Please sign in to comment.