@@ -39,7 +39,7 @@ toHeader = catMaybes . map go
39 go cpp@(CppUseNamespace{}) = Just cpp
39 go cpp@(CppUseNamespace{}) = Just cpp
40 go (CppFunction _ _ _ qs _)
40 go (CppFunction _ _ _ qs _)
41 | CppInline `elem` qs = Nothing
41 | CppInline `elem` qs = Nothing
42− go (CppFunction _ [(_, atyp)] _ _ (CppBlock [CppReturn (CppApp _ [_])])) | atyp == Just CppAuto
42+ go (CppFunction _ [(_, atyp)] _ _ (CppBlock [CppReturn (CppApp _ [_])])) | atyp == Just (CppAuto [])
44 go (CppFunction name args rtyp qs _) =
44 go (CppFunction name args rtyp qs _) =
45 let args' = (\(_,t) -> ("", t)) <$> args in
45 let args' = (\(_,t) -> ("", t)) <$> args in
@@ -58,7 +58,7 @@ toHeader = catMaybes . map go
58 -- Generate thunks for top-level values
58 -- Generate thunks for top-level values
59 go (CppVariableIntroduction (name, _) _ (Just cpp)) =
59 go (CppVariableIntroduction (name, _) _ (Just cpp)) =
60 case cpp of
60 case cpp of
61− CppObjectLiteral CppInstance vals ->
61+ CppObjectLiteral CppInstance _ ->
62 Just $ CppFunction name [("", Just thunkMarkerType)] (Just $ CppAny [CppConst, CppRef]) [] CppNoOp
62 Just $ CppFunction name [("", Just thunkMarkerType)] (Just $ CppAny [CppConst, CppRef]) [] CppNoOp
64 Just $ CppVariableIntroduction (name, Just $ CppAny [CppConst]) [CppExtern] Nothing
64 Just $ CppVariableIntroduction (name, Just $ CppAny [CppConst]) [CppExtern] Nothing
@@ -81,7 +81,7 @@ toHeaderFns = catMaybes . map go
81 go cpp@(CppFunction _ _ _ qs _)
81 go cpp@(CppFunction _ _ _ qs _)
82 | CppInline `elem` qs = Just cpp
82 | CppInline `elem` qs = Just cpp
83 go (CppFunction name [(_, atyp)] _ _ (CppBlock [CppReturn (CppApp cpp [_])]))
83 go (CppFunction name [(_, atyp)] _ _ (CppBlock [CppReturn (CppApp cpp [_])]))
84− | atyp == Just CppAuto
84+ | Just CppAuto {} <- atyp
85 = Just (CppVariableIntroduction (name, Nothing) [] (Just cpp))
85 = Just (CppVariableIntroduction (name, Nothing) [] (Just cpp))
86 go cpp@(CppVariableIntroduction _ _ (Just CppNumericLiteral {})) =
86 go cpp@(CppVariableIntroduction _ _ (Just CppNumericLiteral {})) =
@@ -130,7 +130,7 @@ toBody = catMaybes . map go
130 -- Generate thunks for top-level values
130 -- Generate thunks for top-level values
131 go (CppVariableIntroduction (name, _) _ (Just cpp)) =
131 go (CppVariableIntroduction (name, _) _ (Just cpp)) =
132 case cpp of
132 case cpp of
133− CppObjectLiteral CppInstance vals ->
133+ CppObjectLiteral CppInstance _ ->
134 Just $ CppFunction name [("", Just thunkMarkerType)] (Just $ CppAny [CppConst, CppRef]) [] block
134 Just $ CppFunction name [("", Just thunkMarkerType)] (Just $ CppAny [CppConst, CppRef]) [] block
136 Just $ CppVariableIntroduction (name, Just $ CppAny [CppConst]) [] (Just lambda)
136 Just $ CppVariableIntroduction (name, Just $ CppAny [CppConst]) [] (Just lambda)