diff options
Diffstat (limited to 'compiler/coreSyn/CoreSyn.hs')
-rw-r--r-- | compiler/coreSyn/CoreSyn.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/coreSyn/CoreSyn.hs b/compiler/coreSyn/CoreSyn.hs index fedf1d73ec..24ce641039 100644 --- a/compiler/coreSyn/CoreSyn.hs +++ b/compiler/coreSyn/CoreSyn.hs @@ -233,6 +233,10 @@ These data types are the heart of the compiler -- The inner case does not need a @Red@ alternative, because @x@ -- can't be @Red@ at that program point. -- +-- 5. Floating-point values must not be scrutinised against literals. +-- See Trac #9238 and Note [Rules for floating-point comparisons] +-- in PrelRules for rationale. +-- -- * Cast an expression to a particular type. -- This is used to implement @newtype@s (a @newtype@ constructor or -- destructor just becomes a 'Cast' in Core) and GADTs. @@ -329,6 +333,9 @@ simplifier calling findAlt with argument (LitAlt 3). No no. Integer literals are an opaque encoding of an algebraic data type, not of an unlifted literal, like all the others. +Also, we do not permit case analysis with literal patterns on floating-point +types. See Trac #9238 and Note [Rules for floating-point comparisons] in +PrelRules for the rationale for this restriction. -------------------------- CoreSyn INVARIANTS --------------------------- |