Allow specialization of NOINLINE functions.
See also
- #23584 (refactor INLINE; probably necessary if we proceed with this ticket)
- #22758 (closed), especially this comment
I understand that there are currently ghc internal reasons why we can't specialise NOINLINE functions.
But it seems sensible to allow specialise on NOINLINE bindings if we can get a hold of an unfolding.
Either because it's in the same module or maybe one day because it has been marked both as INLINEABLE and NOINLINE. #18557
{-# SPECIALISE foo :: [Int] -> Int #-}
{-# NOINLINE foo #-}
foo :: (Foldable t, Num a) => t a -> a
foo = sum