Skip to content
Snippets Groups Projects
Commit 294b55dc authored by Eric Wolf's avatar Eric Wolf Committed by Marge Bot
Browse files

Add test for #16575

just use the test to show the defective behaviour, so we can see
the difference, when it gets fixed
parent cef80c0b
No related merge requests found
module Ghost where
data X = A | B
deriving (Show)
instance Eq X where
A == A = True
B == B = True
_ == _ = False
:set +c
:l T16575.hs
:all-types
-- data X = A | B
-- deriving (Show)
-- ^^^^
:type-at T16575.hs 4 15 4 19
-- wrongly outputs:
-- :: [X] -> ShowS
-- instance Eq X where
-- ^^^^
:type-at T16575.hs 6 10 6 14
-- wrongly outputs:
-- :: X -> X -> Bool
-- also note how :all-types is inconsistent with :type-at
Collecting type info for 1 module(s) ...
T16575.hs:(4,15)-(4,18): GHC.Types.Int -> Ghost.X -> GHC.Show.ShowS
T16575.hs:(7,7)-(7,8): Ghost.X -> Ghost.X -> GHC.Types.Bool
T16575.hs:(4,15)-(4,18): GHC.Show.Show Ghost.X
T16575.hs:(4,15)-(4,18): ([Ghost.X] -> GHC.Show.ShowS) -> GHC.Show.Show Ghost.X
T16575.hs:(4,15)-(4,18): (Ghost.X -> GHC.Base.String) -> ([Ghost.X] -> GHC.Show.ShowS) -> GHC.Show.Show Ghost.X
T16575.hs:(4,15)-(4,18): (GHC.Types.Int -> Ghost.X -> GHC.Show.ShowS) -> (Ghost.X -> GHC.Base.String) -> ([Ghost.X] -> GHC.Show.ShowS) -> GHC.Show.Show Ghost.X
T16575.hs:(4,15)-(4,18): GHC.Types.Int -> Ghost.X -> GHC.Show.ShowS
T16575.hs:(4,15)-(4,18): Ghost.X -> GHC.Base.String
T16575.hs:(4,15)-(4,18): [Ghost.X] -> GHC.Show.ShowS
T16575.hs:(6,10)-(6,13): GHC.Classes.Eq Ghost.X
T16575.hs:(6,10)-(6,13): (Ghost.X -> Ghost.X -> GHC.Types.Bool) -> GHC.Classes.Eq Ghost.X
T16575.hs:(6,10)-(6,13): (Ghost.X -> Ghost.X -> GHC.Types.Bool) -> (Ghost.X -> Ghost.X -> GHC.Types.Bool) -> GHC.Classes.Eq Ghost.X
T16575.hs:(6,10)-(6,13): Ghost.X -> Ghost.X -> GHC.Types.Bool
T16575.hs:(6,10)-(6,13): Ghost.X -> Ghost.X -> GHC.Types.Bool
T16575.hs:(7,14)-(7,17): GHC.Types.Bool
T16575.hs:(8,14)-(8,17): GHC.Types.Bool
T16575.hs:(9,14)-(9,18): GHC.Types.Bool
T16575.hs:(7,5)-(7,5): Ghost.X
T16575.hs:(7,10)-(7,10): Ghost.X
T16575.hs:(8,5)-(8,5): Ghost.X
T16575.hs:(8,10)-(8,10): Ghost.X
T16575.hs:(9,5)-(9,5): Ghost.X
T16575.hs:(9,10)-(9,10): Ghost.X
:: [X] -> ShowS
:: X -> X -> Bool
......@@ -300,3 +300,4 @@ test('T16527', normal, ghci_script, ['T16527.script'])
test('T16563', extra_hc_opts("-clear-package-db -global-package-db"), ghci_script, ['T16563.script'])
test('T16569', normal, ghci_script, ['T16569.script'])
test('T16767', normal, ghci_script, ['T16767.script'])
test('T16575', normal, ghci_script, ['T16575.script'])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment