Don't assume an empty array literal can be a string literal.

This commit is contained in:
Adam Sampson 2008-04-06 15:33:18 +00:00
parent 1640b9ce63
commit 28f329dd07

View File

@ -517,6 +517,7 @@ cgenLiteral lr t
-- | Does a LiteralRepr represent something that can be a plain string literal? -- | Does a LiteralRepr represent something that can be a plain string literal?
isStringLiteral :: A.LiteralRepr -> Bool isStringLiteral :: A.LiteralRepr -> Bool
isStringLiteral (A.ArrayLiteral _ []) = False
isStringLiteral (A.ArrayLiteral _ aes) isStringLiteral (A.ArrayLiteral _ aes)
= and [case ae of = and [case ae of
A.ArrayElemExpr (A.Literal _ _ (A.ByteLiteral _ _)) -> True A.ArrayElemExpr (A.Literal _ _ (A.ByteLiteral _ _)) -> True