Skip to content

Commit

Permalink
Export tuple type correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
zrho committed Jan 28, 2025
1 parent 0c37a93 commit 510e008
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions hugr-core/src/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ use hugr_model::v0::{self as model};
use petgraph::unionfind::UnionFind;
use std::fmt::Write;

const TERM_PARAM_TUPLE: &str = "param.tuple";

/// Export a [`Hugr`] graph to its representation in the model.
pub fn export_hugr<'a>(hugr: &'a Hugr, bump: &'a Bump) -> model::Module<'a> {
let mut ctx = Context::new(hugr, bump);
Expand Down Expand Up @@ -948,11 +946,7 @@ impl<'a> Context<'a> {
.map(|param| model::ListPart::Item(self.export_type_param(param, None))),
);
let types = self.make_term(model::Term::List(parts));
let symbol = self.resolve_symbol(TERM_PARAM_TUPLE);
self.make_term(model::Term::Apply(
symbol,
self.bump.alloc_slice_copy(&[types]),
))
self.make_term_apply(model::CORE_TUPLE_TYPE, &[types])
}
TypeParam::Extensions => self.make_term_apply(model::CORE_EXT_SET, &[]),
}
Expand Down

0 comments on commit 510e008

Please sign in to comment.