@@ -782,30 +782,36 @@ pub fn step(prim: Prim) -> Step {
782782
783783 Prim :: OptionFold => step ! ( env, [ _, _, on_none, on_some, option] => {
784784 match option. match_prim_spine( ) ? {
785- ( Prim :: OptionSome , [ Elim :: FunApp ( Plicity :: Explicit , value) ] ) => env . fun_app (
786- Plicity :: Explicit ,
787- on_some . clone ( ) , value . clone ( ) ) ,
788- ( Prim :: OptionNone , [ ] ) => on_none. clone( ) ,
785+ ( Prim :: OptionSome , [ _ , Elim :: FunApp ( Plicity :: Explicit , value) ] ) => {
786+ env . fun_app ( Plicity :: Explicit , on_some . clone ( ) , value . clone ( ) )
787+ } ,
788+ ( Prim :: OptionNone , [ _ ] ) => on_none. clone( ) ,
789789 _ => return None ,
790790 }
791791 } ) ,
792792
793793 Prim :: Array8Find | Prim :: Array16Find | Prim :: Array32Find | Prim :: Array64Find => {
794- step ! ( env, [ _, _ , pred, array] => match array. as_ref( ) {
794+ step ! ( env, [ _, elem_type , pred, array] => match array. as_ref( ) {
795795 Value :: ArrayLit ( elems) => {
796796 for elem in elems {
797797 match env. fun_app(
798- Plicity :: Explicit ,
799- pred. clone( ) , elem. clone( ) ) . as_ref( ) {
798+ Plicity :: Explicit ,
799+ pred. clone( ) , elem. clone( ) ) . as_ref( ) {
800800 Value :: ConstLit ( Const :: Bool ( true ) ) => {
801801 // TODO: Is elem.span right here?
802- return Some ( Spanned :: new( elem. span( ) , Arc :: new( Value :: prim( Prim :: OptionSome , [ elem. clone( ) ] ) ) ) )
802+ return Some ( Spanned :: new(
803+ elem. span( ) ,
804+ Arc :: new( Value :: prim( Prim :: OptionSome , [
805+ elem_type. clone( ) ,
806+ elem. clone( ) ,
807+ ] ) ) ,
808+ ) ) ;
803809 } ,
804810 Value :: ConstLit ( Const :: Bool ( false ) ) => { }
805811 _ => return None ,
806812 }
807813 }
808- Spanned :: empty( Arc :: new( Value :: prim( Prim :: OptionNone , [ ] ) ) )
814+ Spanned :: empty( Arc :: new( Value :: prim( Prim :: OptionNone , [ elem_type . clone ( ) ] ) ) )
809815 }
810816 _ => return None ,
811817 } )
0 commit comments