File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -307,7 +307,7 @@ toC toCMode (Binder meta root) = emitterSrc (execState (visit startingIndent roo
307307 appendToSrc (addIndent indent ++ " {\n " )
308308 let innerIndent = indent + indentAmount
309309 ret <- visit innerIndent expr
310- appendToSrc (addIndent innerIndent ++ pathToC path ++ " = " ++ ret ++ " ;\n " )
310+ when (ret /= " " ) $ appendToSrc (addIndent innerIndent ++ pathToC path ++ " = " ++ ret ++ " ;\n " )
311311 delete innerIndent info
312312 appendToSrc (addIndent indent ++ " }\n " )
313313 pure " "
@@ -895,7 +895,9 @@ toDeclaration (Binder meta xobj@(XObj (Lst xobjs) _ ty)) =
895895 in defnToDeclaration meta path argList retTy ++ " ;\n "
896896 [XObj Def _ _, XObj (Sym path _) _ _, _] ->
897897 let Just t = ty
898- in " " ++ tyToCLambdaFix t ++ " " ++ pathToC path ++ " ;\n "
898+ in if (isUnit t)
899+ then " "
900+ else tyToCLambdaFix t ++ " " ++ pathToC path ++ " ;\n "
899901 XObj (Deftype t) _ _ : XObj (Sym path _) _ _ : rest ->
900902 defStructToDeclaration t path rest
901903 XObj (DefSumtype t) _ _ : XObj (Sym _ _) _ _ : rest ->
Original file line number Diff line number Diff line change 22(load "Test.carp")
33(load "Vector.carp")
44
5+ ; void definitions should get elided (issue #1296)
6+ (def is-void ())
7+
58; this is a test-only module to test module resolution (see #288)
69(defmodule Foo
710 (register init (Fn [] Int) "fooInit")
You can’t perform that action at this time.
0 commit comments