Skip to content

Commit

Permalink
Allow imported types to be declared more than once
Browse files Browse the repository at this point in the history
  • Loading branch information
eggyal committed Aug 27, 2019
1 parent 8b9ac19 commit dc0dacd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/cli-support/src/webidl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,12 @@ impl<'a> Context<'a> {
) -> Result<(), Error> {
let import = self.determine_import(import, &type_.name)?;
log::debug!("inserting import id {:x?}: {}", type_.id, type_.name);
assert!(self.aux.internal_refs.insert(type_.id, Referenceable::Import(import.clone())).is_none());
let parent = Referenceable::Import(import.clone());
match self.aux.internal_refs.insert(type_.id, parent) {
Some(Referenceable::Struct(_)) => unreachable!(),
Some(Referenceable::Import(previous)) => assert_eq!(previous, import),
None => (),
}

let (import_id, _id) = match self.function_imports.get(type_.instanceof_shim) {
Some(pair) => *pair,
Expand Down

0 comments on commit dc0dacd

Please sign in to comment.