Skip to content

Commit

Permalink
[refactor] Remove never-called OpDef::instantiate_opaque (#584)
Browse files Browse the repository at this point in the history
`Extension::instantiate_extension_op` is the main user-facing entry
point, and already calls ExtensionOp::new(), as it should.
  • Loading branch information
acl-cqc authored Sep 29, 2023
1 parent d45bd4b commit 3e669cf
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/extension/op_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,29 +195,6 @@ impl OpDef {
self.check_concrete_impl(opaque)
}

/// Instantiate a concrete [`OpaqueOp`] by providing type arguments.
///
/// # Errors
///
/// This function will return an error if the provided arguments are not
/// valid instances of the type parameters.
pub fn instantiate_opaque(
&self,
args: impl Into<Vec<TypeArg>>,
) -> Result<OpaqueOp, SignatureError> {
let args = args.into();
self.check_args(&args)?;

Ok(OpaqueOp::new(
self.extension().clone(),
self.name().clone(),
// TODO add description
"".to_string(),
args,
None,
))
}

/// Computes the signature of a node, i.e. an instantiation of this
/// OpDef with statically-provided [TypeArg]s.
pub fn compute_signature(
Expand Down

0 comments on commit 3e669cf

Please sign in to comment.