Skip to content

Commit

Permalink
Remove redundant parameter from match.matchEnum
Browse files Browse the repository at this point in the history
  • Loading branch information
matil019 committed Oct 31, 2019
1 parent 8ec97a2 commit 1952d83
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions frege/compiler/gen/java/Match.fr
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ match assert (pat@PCon {pos,qname,pats}) bind cont binds = do
-- g <- getST
symd <- U.findD qname -- forall a.a -> List a -> List a
symt <- U.findT symd.name.tynm -- forall a.List a
if symt.enum then matchEnum (SymbolT.D symd) (SymbolT.T symt)
if symt.enum then matchEnum symd
else if symt.product
then if symt.newt
then matchNew symd symt
Expand All @@ -178,15 +178,13 @@ match assert (pat@PCon {pos,qname,pats}) bind cont binds = do
other kbnd
comment g = sComment ("match " ++ nice pat g
++ " with " ++ show bind)
-- matchNewt :: Symbol -> Symbol -> StG (Binding, [JStmt])
-- matchNewt symd symt = match (head pats) bind cont binds
matchEnum :: Symbol -> Symbol -> StG (Binding, [JStmt])
matchEnum symd symt = do
matchEnum :: SymD Global -> StG (Binding, [JStmt])
matchEnum symd = do
g <- getST
let sbnd = unKindedStrict g bind
-- (bind, code1) <- realize "$" sbnd
body <- cont binds
let comp = JBin sbnd.jex "==" (JX.staticMember (symJavaName g symd))
let comp = JBin sbnd.jex "==" (JX.staticMember (symJavaName g $ SymbolT.D symd))
ifc = if assert then JAssert comp : body else [JCond "if" comp body]
stio (sbnd, comment g : ifc)

Expand Down

0 comments on commit 1952d83

Please sign in to comment.