Ignore ROUND/TRUNC when used on a precise conversion (e.g. REAL64 ROUND real64)

This commit is contained in:
Adam Sampson 2007-05-01 14:31:36 +00:00
parent 26a4190d78
commit 287fb8b922

View File

@ -987,13 +987,14 @@ conversion
t <- dataType t <- dataType
(c, o) <- conversionMode (c, o) <- conversionMode
ot <- typeOfExpression o ot <- typeOfExpression o
case (isPreciseConversion ot t, c) of c <- case (isPreciseConversion ot t, c) of
(False, A.DefaultConversion) -> (False, A.DefaultConversion) ->
fail "imprecise conversion must specify ROUND or TRUNC" fail "imprecise conversion must specify ROUND or TRUNC"
(False, _) -> return () (False, _) -> return c
(True, A.DefaultConversion) -> return () (True, A.DefaultConversion) -> return c
(True, _) -> (True, _) ->
fail "precise conversion cannot specify ROUND or TRUNC" do addWarning m "precise conversion specifies ROUND or TRUNC; ignored"
return A.DefaultConversion
return $ A.Conversion m c t o return $ A.Conversion m c t o
<?> "conversion" <?> "conversion"