Fixed the type of a list for the empty list
This commit is contained in:
parent
0e3465afc0
commit
d4991461a5
|
@ -94,9 +94,10 @@ annotateListLiteralTypes = everywhereASTM doExpression
|
||||||
doExpression :: A.Expression -> PassM A.Expression
|
doExpression :: A.Expression -> PassM A.Expression
|
||||||
doExpression (A.Literal m _ (A.ListLiteral m' es))
|
doExpression (A.Literal m _ (A.ListLiteral m' es))
|
||||||
= do ts <- mapM typeOfExpression es
|
= do ts <- mapM typeOfExpression es
|
||||||
sharedT <- case leastGeneralSharedTypeRain ts of
|
sharedT <- case (ts, leastGeneralSharedTypeRain ts) of
|
||||||
Just t -> return t
|
(_, Just t) -> return t
|
||||||
Nothing -> diePC m'
|
([], Nothing) -> return A.Any
|
||||||
|
(_, Nothing) -> diePC m'
|
||||||
$ formatCode
|
$ formatCode
|
||||||
"Can't determine a common type for the list literal from: %"
|
"Can't determine a common type for the list literal from: %"
|
||||||
ts
|
ts
|
||||||
|
|
Loading…
Reference in New Issue
Block a user