[GHC] #13291: bpk15 and bkp47 fail with -dunique-increment=-1

#13291: bpk15 and bkp47 fail with -dunique-increment=-1
-------------------------------------+-------------------------------------
Reporter: niteria | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.1
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets: #4012
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
This happens on master.
Repro command:
{{{
cd testsuite/; make EXTRA_HC_OPTS='-dunique-increment=-1' TEST="bkp15
bkp47"
}}}
Result:
{{{
Compile failed (exit code 1) errors were:
[1 of 3] Processing p
[1 of 1] Compiling A[sig] ( p/A.hsig, nothing )
[2 of 3] Processing q
[1 of 1] Compiling A[sig] ( q/A.hsig, nothing )
[3 of 3] Processing r
[1 of 2] Compiling A[sig] ( r/A.hsig, nothing )
bkp47.bkp:10:9: error:
• Class ‘C’ has conflicting definitions in the module
and its hsig file
Main module: class C a where
g :: a -> a
f :: a -> a
{-# MINIMAL f | g #-}
Hsig file: class C a where
f :: a -> a
g :: a -> a
{-# MINIMAL f #-}
The methods do not match:
The names ‘f’ and ‘g’ are different
The names ‘g’ and ‘f’ are different
• while merging the signatures from:
• p[A=<A>]:A
• q[A=<A>]:A
• ...and the local signature for A
bkp47.bkp:10:9: error:
• Class ‘C’ has conflicting definitions in the module
and its hsig file
Main module: class C a where
g :: a -> a
f :: a -> a
{-# MINIMAL f | g #-}
Hsig file: class C a where
f :: a -> a
g :: a -> a
{-# MINIMAL g #-}
The methods do not match:
The names ‘f’ and ‘g’ are different
The names ‘g’ and ‘f’ are different
• while merging the signatures from:
• p[A=<A>]:A
• q[A=<A>]:A
• ...and the local signature for A
}}}
{{{
Compile failed (exit code 1) errors were:
bkp15.bkp:1:26: warning:
-XDatatypeContexts is deprecated: It was widely considered a
misfeature, and has been removed from the Haskell language.
[1 of 5] Processing p
[1 of 1] Compiling H[sig] ( p/H.hsig, nothing )
[2 of 5] Processing q
[1 of 1] Compiling H[sig] ( q/H.hsig, nothing )
[3 of 5] Processing r
[1 of 2] Compiling H[sig] ( r/H.hsig, nothing )
bkp15.bkp:36:9: error:
• Class ‘Bloop’ has conflicting definitions in the module
and its hsig file
Main module: class GHC.Classes.Eq a => Bloop a b | a -> b where
data family GMap a (v :: * -> *)
y :: a -> a -> GHC.Types.Ordering
default y :: GHC.Classes.Ord a => a -> a ->
GHC.Types.Ordering
xa :: a -> a -> GHC.Types.Bool
default xa :: a -> a -> GHC.Types.Bool
{-# MINIMAL xa | y | xa | y #-}
Hsig file: class GHC.Classes.Eq a => Bloop a b | a -> b where
data family GMap a (v :: * -> *)
xa :: a -> a -> GHC.Types.Bool
default xa :: a -> a -> GHC.Types.Bool
y :: a -> a -> GHC.Types.Ordering
default y :: GHC.Classes.Ord a => a -> a ->
GHC.Types.Ordering
{-# MINIMAL xa | y #-}
The methods do not match:
The names ‘xa’ and ‘y’ are different
The types of ‘xa’ are different
The default methods associated with ‘xa’ are not compatible
The names ‘y’ and ‘xa’ are different
The types of ‘y’ are different
The default methods associated with ‘y’ are not compatible
• while merging the signatures from:
• p[H=<H>]:H
• q[H=<H>]:H
• ...and the local signature for H
bkp15.bkp:36:9: error:
• Class ‘Bloop’ has conflicting definitions in the module
and its hsig file
Main module: class GHC.Classes.Eq a => Bloop a b | a -> b where
data family GMap a (v :: * -> *)
y :: a -> a -> GHC.Types.Ordering
default y :: GHC.Classes.Ord a => a -> a ->
GHC.Types.Ordering
xa :: a -> a -> GHC.Types.Bool
default xa :: a -> a -> GHC.Types.Bool
{-# MINIMAL xa | y | xa | y #-}
Hsig file: class GHC.Classes.Eq a => Bloop a b | a -> b where
data family GMap a (v :: * -> *)
xa :: a -> a -> GHC.Types.Bool
default xa :: a -> a -> GHC.Types.Bool
y :: a -> a -> GHC.Types.Ordering
default y :: GHC.Classes.Ord a => a -> a ->
GHC.Types.Ordering
{-# MINIMAL xa | y #-}
The methods do not match:
The names ‘xa’ and ‘y’ are different
The types of ‘xa’ are different
The default methods associated with ‘xa’ are not compatible
The names ‘y’ and ‘xa’ are different
The types of ‘y’ are different
The default methods associated with ‘y’ are not compatible
• while merging the signatures from:
• p[H=<H>]:H
• q[H=<H>]:H
• ...and the local signature for H
}}}
This indicates some dependence on Unique ordering.
--
Ticket URL:

#13291: bpk15 and bkp47 fail with -dunique-increment=-1 -------------------------------------+------------------------------------- Reporter: niteria | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #4012 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by ezyang): Drat! Should be an easy fix though. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13291#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13291: bpk15 and bkp47 fail with -dunique-increment=-1 -------------------------------------+------------------------------------- Reporter: niteria | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #4012 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by ezyang): It looks like the old class-matching code for hs-boot files assumes that methods inside a Class are always sorted (a comment suggests that they are), but it doesn't seem to be the case. It kind of looks like I'll just have to rewrite that segment of code. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13291#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC