Pass correct dictionary to lengthPA for single-element environments
[ghc-hetmet.git] / compiler / vectorise / Vectorise.hs
index c974c20..50e5923 100644 (file)
@@ -398,8 +398,9 @@ mkClosureMonoFns info arg body
     bind_lenv lenv lbody lc_bndr [lbndr]
       = do
           lengthPA <- builtin lengthPAVar
+          pa_dict  <- paDictOfType vty
           return . Let (NonRec lbndr lenv)
-                 $ Case (mkApps (Var lengthPA) [Type vty, (Var lbndr)])
+                 $ Case (mkApps (Var lengthPA) [Type vty, pa_dict, (Var lbndr)])
                         lc_bndr
                         (exprType lbody)
                         [(DEFAULT, [], lbody)]