on master help sign in
Add a catchall to inner toDefs function

I think it would be more appropriate to reorder this code as to only case-match over defs once, but I'm not sure of how to approach this (yet).

commit12a58167a9be0b55b84aa98450a9ec6b204dc293 authorMichael Sondergaard <msond@cs.au.dk> dateMon 4 Nov 2013, 21:22 (13 years ago) parentb3d5357
1 file changed+3
compiler/Transform/SortDefinitions.hs+3
compiler/Transform/SortDefinitions.hs+3
@@ -124,6 +124,9 @@ reorder lexpr@(L s expr) =
124124 toDefs (pattern, expr, Nothing) = [ Def pattern expr ]
125125 toDefs (PVar name, expr, Just tipe) =
126126 [ TypeAnnotation name tipe, Def (PVar name) expr ]
127+ -- This case won't happen since we've removed everything
128+ -- but Def's and PVars above.
129+ toDefs (_,_,_) = error "Internal compiler error"
127130
128131 L _ let' = foldr addDefs body' defss
129132