Skip to content

Casts get in the way of calculating unfolding discount

The dictionary argument discount was not being applied for code such as rec_sel (dict_arg 'cast' cobox).

For example, adding lots of type equality constraints increases the size of foo so that it will no longer be inlined into foo1 (if specialisation is turned off).

{-# LANGUAGE GADTs #-}
module Small where

foo :: (Num a, a ~ b, a ~ b, a ~ b, a ~ b, a ~ b)  => a -> b
foo x = x + x

foo1 :: Int -> Int
foo1 x = foo x
Trac metadata
Trac field Value
Version 8.2.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information