Possible mixup in errors GHC-96665 and GHC-31744
Both these errors are about some declaration being duplicated, but I think there might have been a mixup at some point. (The following examples are using GHC 9.8.1 on the Haskell playground).
Example 1:
{-# INLINE id #-}
{-# INLINE id #-}
id :: a -> a
id x = x
throws error:
Main.hs:2:12: error: [GHC-31744]
Duplicate INLINE pragmas for ‘id’
at Main.hs:1:12-13
Main.hs:2:12-13
|
2 | {-# INLINE id #-}
Example 2:
id :: a -> a
id :: a -> a
id x = x
throws error:
Main.hs:2:1: error: [GHC-31744]
Duplicate type signatures for ‘id’
at Main.hs:1:1-2
Main.hs:2:1-2
|
2 | id :: a -> a
| ^^
What I expect
I think that in example 1 the intention was to use the constructor TcRnMultipleInlinePragmas
with code GHC-96665
instead of TcRnDuplicateSigDecl
. Note that there are currently no tests for GHC-96665
in the codebase, even though the constructor is used in a codepath. I haven't investigated this more deeply yet.