Skip to content

Commit

Permalink
codegen: seal Ext traits
Browse files Browse the repository at this point in the history
  • Loading branch information
jf2048 authored and bilelmoussaoui committed May 30, 2023
1 parent 55b381b commit b0cfba0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/codegen/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,12 @@ fn generate_builder(w: &mut dyn Write, env: &Env, analysis: &analysis::object::I
fn generate_trait(w: &mut dyn Write, env: &Env, analysis: &analysis::object::Info) -> Result<()> {
write!(
w,
"pub trait {}: IsA<{}> + 'static {{",
"mod sealed {{
pub trait Sealed {{}}
impl<T: super::IsA<super::{1}>> Sealed for T {{}}
}}
pub trait {}: IsA<{}> + sealed::Sealed + 'static {{",
analysis.trait_name, analysis.name
)?;

Expand Down

0 comments on commit b0cfba0

Please sign in to comment.