Skip to content

Commit

Permalink
former : experimenting
Browse files Browse the repository at this point in the history
  • Loading branch information
Wandalen committed Mar 29, 2024
1 parent 10fbde3 commit 68bd732
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 9 additions & 2 deletions module/core/former/tests/inc/former_tests/a_primitives_manual.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ impl Struct1
pub struct Struct1FormerDefinition< Context = (), Formed = Struct1, End = former::ReturnPreformed >
// xxx : use?
// where
// End : FormingEnd< Struct1FormerDefinition< Context, Formed, NoEnd > >,
// End : former::FormingEnd< Struct1FormerDefinition< Context, Formed, NoEnd > >,
// where
// End : former::FormingEnd< Self >,
{
_phantom : core::marker::PhantomData< ( Context, Formed, End ) >,
}
Expand All @@ -53,6 +55,10 @@ for Struct1FormerDefinition< Context, Formed, End >

impl< Context, Formed > former::FormerDefinitionTypes
for Struct1FormerDefinition< Context, Formed, former::NoEnd >
// impl< Context, Formed, End > former::FormerDefinitionTypes
// for Struct1FormerDefinition< Context, Formed, End >
// where
// End : former::FormingEnd< Self >,
{
type Storage = Struct1FormerStorage;
type Formed = Formed;
Expand All @@ -63,9 +69,10 @@ impl< Context, Formed, End > former::FormerDefinition
for Struct1FormerDefinition< Context, Formed, End >
where
End : former::FormingEnd< Struct1FormerDefinition< Context, Formed, former::NoEnd > >,
// End : former::FormingEnd< Self >,
{
// type Types = Struct1FormerDefinition;
type Types = Struct1FormerDefinition< Context, Formed, former::NoEnd >;
// type Types = Self;
type End = End;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,9 @@ tests_impls!
let _default = Struct1FormerDefinition::< () >::default();
// let _default = Struct1FormerDefinition::default(); // why does not work?

// impl< Context, Formed, End > Default

// definition types exists and has Formed
let got = < Struct1FormerDefinition< (), Struct1, former::NoEnd > as the_module::FormerDefinitionTypes >::Formed::former().form();
// let got = < Struct1FormerDefinition as the_module::FormerDefinitionTypes >::Formed::former().form(); // xxx : make it working
// let got = < Struct1FormerDefinition<> as the_module::FormerDefinitionTypes >::Formed::former().form();
let exp = Struct1::former().form();
a_id!( got, exp );
// xxx : uncomment
Expand Down

0 comments on commit 68bd732

Please sign in to comment.