summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/generics/GShow/GShow.hs3
-rw-r--r--testsuite/tests/generics/GenDerivOutput.stderr6
-rw-r--r--testsuite/tests/generics/T10604/T10604_deriving.stderr6
-rwxr-xr-xtestsuite/tests/generics/T12220.hs37
-rw-r--r--testsuite/tests/generics/all.T1
-rw-r--r--testsuite/tests/perf/compiler/all.T3
6 files changed, 54 insertions, 2 deletions
diff --git a/testsuite/tests/generics/GShow/GShow.hs b/testsuite/tests/generics/GShow/GShow.hs
index cfe0230411..24c1959ec3 100644
--- a/testsuite/tests/generics/GShow/GShow.hs
+++ b/testsuite/tests/generics/GShow/GShow.hs
@@ -119,7 +119,8 @@ instance GShow Char where gshowsPrec = showsPrec
instance GShow Double where gshowsPrec = showsPrec
instance GShow Int where gshowsPrec = showsPrec
instance GShow Float where gshowsPrec = showsPrec
-instance GShow String where gshowsPrec = showsPrec
+instance {-# OVERLAPPING #-}
+ GShow String where gshowsPrec = showsPrec
instance GShow Word where gshowsPrec = showsPrec
instance GShow Bool where gshowsPrec = showsPrec
diff --git a/testsuite/tests/generics/GenDerivOutput.stderr b/testsuite/tests/generics/GenDerivOutput.stderr
index 2226783029..1b573f26bb 100644
--- a/testsuite/tests/generics/GenDerivOutput.stderr
+++ b/testsuite/tests/generics/GenDerivOutput.stderr
@@ -224,3 +224,9 @@ GHC.Generics representation types:
GenDerivOutput.Rose)))
+
+==================== Filling in method body ====================
+GHC.Base.Functor [GenDerivOutput.List]
+ GHC.Base.<$ = GHC.Base.$dm<$ @GenDerivOutput.List
+
+
diff --git a/testsuite/tests/generics/T10604/T10604_deriving.stderr b/testsuite/tests/generics/T10604/T10604_deriving.stderr
index cbaba8dbbe..04c87ff33d 100644
--- a/testsuite/tests/generics/T10604/T10604_deriving.stderr
+++ b/testsuite/tests/generics/T10604/T10604_deriving.stderr
@@ -541,3 +541,9 @@ GHC.Generics representation types:
* GHC.Types.Int))))
+
+==================== Filling in method body ====================
+GHC.Base.Functor [T10604_deriving.Proxy *]
+ GHC.Base.<$ = GHC.Base.$dm<$ @T10604_deriving.Proxy *
+
+
diff --git a/testsuite/tests/generics/T12220.hs b/testsuite/tests/generics/T12220.hs
new file mode 100755
index 0000000000..70f8b58f84
--- /dev/null
+++ b/testsuite/tests/generics/T12220.hs
@@ -0,0 +1,37 @@
+{-#LANGUAGE TypeApplications#-}
+{-#LANGUAGE MultiParamTypeClasses #-}
+{-#LANGUAGE AllowAmbiguousTypes #-}
+{-#LANGUAGE FlexibleInstances #-}
+{-#LANGUAGE ScopedTypeVariables #-}
+{-#LANGUAGE DefaultSignatures #-}
+module T12220 where
+
+-- | Type a is only used for
+-- type application.
+class ToUse a where
+ toUse :: Int -> Int
+
+-- | The type used for
+-- type application
+data Default
+
+
+-- | The instance using Default as type application.
+-- To call use:
+-- > toUse @Default
+instance ToUse Default where
+ toUse a = 3*a
+
+-- | Typeclass whose methods work
+-- only with type application.
+class Uses a b where
+ uses :: b -> [b]
+ -- | Default Signature, which generates the problem.
+ -- It is the same as the normal one
+ -- Comment it to 'fix' the bug.
+ default uses :: b -> [b]
+ uses v = [v]
+
+-- | But this one doesn't.
+-- Unless you comment the default signature.
+instance (Uses t a, Uses t b, Uses t c) => Uses t (a,b,c)
diff --git a/testsuite/tests/generics/all.T b/testsuite/tests/generics/all.T
index cae975c89e..6bf949fc3b 100644
--- a/testsuite/tests/generics/all.T
+++ b/testsuite/tests/generics/all.T
@@ -45,3 +45,4 @@ test('T10030', normal, compile_and_run, [''])
test('T10361a', normal, compile, [''])
test('T10361b', normal, compile, [''])
test('T11358', normal, compile_and_run, [''])
+test('T12220', normal, compile, [''])
diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T
index 230cff5ac8..386040c00d 100644
--- a/testsuite/tests/perf/compiler/all.T
+++ b/testsuite/tests/perf/compiler/all.T
@@ -91,7 +91,7 @@ test('T1969',
# 2014-06-29 303300692 (x86/Linux)
# 2015-07-11 288699104 (x86/Linux, 64-bit machine) use +RTS -G1
# 2016-04-06 344730660 (x86/Linux, 64-bit machine)
- (wordsize(64), 695430728, 5)]),
+ (wordsize(64), 756138176, 5)]),
# 17/11/2009 434845560 (amd64/Linux)
# 08/12/2009 459776680 (amd64/Linux)
# 17/05/2010 519377728 (amd64/Linux)
@@ -111,6 +111,7 @@ test('T1969',
# 10/09/2014 630299456 (x86_64/Linux) post-AMP-cleanup
# 03/06/2015 581460896 (x86_64/Linux) use +RTS -G1
# 28/10/2015 695430728 (x86_64/Linux) emit Typeable at definition site
+ # 28/10/2015 756138176 (x86_64/Linux) inst-decl defaults go via typechecker (#12220)
only_ways(['normal']),
extra_hc_opts('-dcore-lint -static'),