Commit 0eb8fcd9 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺 Committed by Ben Gamari

Enable `Enumeration is empty` warnings for `Integer`

This warning was implemented via
abb3a9fa for addressing #7881. The
bounded H2010 integral types were handled, but the `Integer` type was
missed for the enumeration warning.

Fixes #10929

Test Plan: reused T7881 testcase

Reviewers: thomie, bgamari, austin

Reviewed By: thomie, bgamari, austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1305

GHC Trac Issues: #10929
parent 6cde981a
......@@ -228,6 +228,7 @@ warnAboutEmptyEnumerations dflags fromExpr mThnExpr toExpr
else if tc == word16TyConName then check (undefined :: Word16)
else if tc == word32TyConName then check (undefined :: Word32)
else if tc == word64TyConName then check (undefined :: Word64)
else if tc == integerTyConName then check (undefined :: Integer)
else return ()
| otherwise = return ()
......
module T10929 where
x1 :: [Integer]
x1 = [5 .. 3]
x2 :: [Integer]
x2 = [3 .. 5]
x3 :: [Integer]
x3 = [5, 3 .. 1]
x4 :: [Integer]
x4 = [5, (3+0) .. 1]
x5 :: [Integer]
x5 = [1, 3 .. 5]
x6 :: [Integer]
x6 = [1, (3+0) .. 5]
x7 :: [Integer]
x7 = [5, 7 .. 1]
x8 :: [Integer]
x8 = [5, (7+0) .. 1]
x9 :: [Integer]
x9 = [3, 1 .. 5]
x10 :: [Integer]
x10 = [3, (1+0) .. 5]
T10929.hs:4:6: warning: Enumeration is empty
T10929.hs:22:6: warning: Enumeration is empty
T10929.hs:28:6: warning: Enumeration is empty
......@@ -2,3 +2,4 @@ test('T7116', normal, run_command, ['$MAKE -s --no-print-directory T7116'])
test('T7895', normal, compile, [''])
test('T7881', normal, compile, [''])
test('T8542', normal, compile, [''])
test('T10929', normal, compile, [''])
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