Commit 75e2fba5 by Zachary Snow

explicitly size literals in converted default struct patterns

parent da9452bd
...@@ -213,8 +213,8 @@ convertAsgn structs types (lhs, expr) = ...@@ -213,8 +213,8 @@ convertAsgn structs types (lhs, expr) =
where e' = convertExpr (IntegerVector t sg rs) e where e' = convertExpr (IntegerVector t sg rs) e
convertExpr (Struct (Packed sg) fields (_:rs)) (Bit e _) = convertExpr (Struct (Packed sg) fields (_:rs)) (Bit e _) =
convertExpr (Struct (Packed sg) fields rs) e convertExpr (Struct (Packed sg) fields rs) e
convertExpr (Struct (Packed _) fields _) (Pattern [(Just "default", e)]) = convertExpr (t @ (Struct (Packed _) fields _)) (Pattern [(Just "default", e)]) =
Concat $ take (length fields) (repeat e) convertExpr t $ Pattern $ take (length fields) (repeat (Nothing, e))
convertExpr (Struct (Packed sg) fields []) (Pattern itemsOrig) = convertExpr (Struct (Packed sg) fields []) (Pattern itemsOrig) =
if length items /= length fields then if length items /= length fields then
error $ "struct pattern " ++ show items ++ error $ "struct pattern " ++ show items ++
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment