@@ -50,16 +50,18 @@ toHeader = catMaybes . map go
5050 Nothing
5151 go (CppVariableIntroduction _ _ (Just CppBooleanLiteral {})) =
5252 Nothing
53+ go (CppVariableIntroduction _ _ (Just (CppUnary _ (CppNumericLiteral {})))) =
54+ Nothing
5355 go (CppVariableIntroduction (name, _) _ (Just (CppLambda _ [] rty _))) =
5456 Just $ CppFunction name [] rty [] CppNoOp
5557
5658 -- Generate thunks for top-level values
57− go (CppVariableIntroduction (name, vty) _ (Just cpp)) =
59+ go (CppVariableIntroduction (name, _) _ (Just cpp)) =
5860 case cpp of
5961 CppObjectLiteral CppInstance vals ->
6062 Just $ CppFunction name [("", Just thunkMarkerType)] (Just $ CppAny [CppConst, CppRef]) [] CppNoOp
6163 _ ->
62− Just $ CppVariableIntroduction (name, vty) [CppExtern] Nothing
64+ Just $ CppVariableIntroduction (name, Just $ CppAny [CppConst]) [CppExtern] Nothing
6365 go cpp@(CppStruct {}) =
6466 Just cpp
6567 go (CppComment comms cpp')
@@ -87,6 +89,8 @@ toHeaderFns = catMaybes . map go
8789 Just cpp
8890 go cpp@(CppVariableIntroduction _ _ (Just CppBooleanLiteral {})) =
8991 Just cpp
92+ go cpp@(CppVariableIntroduction _ _ (Just (CppUnary _ (CppNumericLiteral {})))) =
93+ Just cpp
9094 go (CppComment comms cpp') | Just cpp <- go cpp' = Just (CppComment comms cpp)
9195 go _ = Nothing
9296
@@ -118,14 +122,18 @@ toBody = catMaybes . map go
118122 Nothing
119123 go (CppVariableIntroduction _ _ (Just CppBooleanLiteral {})) =
120124 Nothing
125+ go (CppVariableIntroduction _ _ (Just (CppUnary _ (CppNumericLiteral {})))) =
126+ Nothing
121127 go (CppVariableIntroduction (name, _) _ (Just (CppLambda _ [] rty body))) =
122128 Just $ CppFunction name [] rty [] body
123− go (CppVariableIntroduction (name, vty) _ (Just cpp)) =
129+
130+ -- Generate thunks for top-level values
131+ go (CppVariableIntroduction (name, _) _ (Just cpp)) =
124132 case cpp of
125133 CppObjectLiteral CppInstance vals ->
126134 Just $ CppFunction name [("", Just thunkMarkerType)] (Just $ CppAny [CppConst, CppRef]) [] block
127135 _ ->
128− Just $ CppVariableIntroduction (name, vty) [] (Just lambda)
136+ Just $ CppVariableIntroduction (name, Just $ CppAny [CppConst]) [] (Just lambda)
129137 where
130138 val = CppVariableIntroduction ("$value$", Just $ CppAny [CppConst]) [CppStatic] (Just $ addCaptures cpp)
131139 block = CppBlock [val, CppReturn (CppVar "$value$")]