summaryrefslogtreecommitdiff
path: root/testsuite/tests/partial-sigs
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2016-04-28 15:49:24 +0200
committerThomas Miedema <thomasmiedema@gmail.com>2016-04-30 13:07:35 +0200
commit2ae39acd1309c85dbc579976674bcef7172510c2 (patch)
tree8a370a77d2f9aa60e8e86438cfbb7c10fbb2c197 /testsuite/tests/partial-sigs
parentc4259ff3defcac0d8f8075fd99884eef22e5d966 (diff)
downloadhaskell-2ae39acd1309c85dbc579976674bcef7172510c2.tar.gz
Testsuite: accept new output for 2 partial-sigs tests
Test Plan: make TEST='ExtraNumAMROn TidyClash2' Differential Revision: https://phabricator.haskell.org/D2155 GHC Trac Issues: #9478
Diffstat (limited to 'testsuite/tests/partial-sigs')
-rw-r--r--testsuite/tests/partial-sigs/should_compile/ExtraNumAMROn.stderr4
-rw-r--r--testsuite/tests/partial-sigs/should_compile/PatBind2.stderr6
-rw-r--r--testsuite/tests/partial-sigs/should_compile/all.T3
-rw-r--r--testsuite/tests/partial-sigs/should_fail/TidyClash2.hs11
-rw-r--r--testsuite/tests/partial-sigs/should_fail/TidyClash2.stderr103
-rw-r--r--testsuite/tests/partial-sigs/should_fail/all.T3
6 files changed, 71 insertions, 59 deletions
diff --git a/testsuite/tests/partial-sigs/should_compile/ExtraNumAMROn.stderr b/testsuite/tests/partial-sigs/should_compile/ExtraNumAMROn.stderr
index 20c574b544..11e2b1f94c 100644
--- a/testsuite/tests/partial-sigs/should_compile/ExtraNumAMROn.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/ExtraNumAMROn.stderr
@@ -3,5 +3,5 @@ TYPE SIGNATURES
TYPE CONSTRUCTORS
COERCION AXIOMS
Dependent modules: []
-Dependent packages: [base-4.9.0.0, ghc-prim-0.3.1.0,
- integer-gmp-0.5.1.0]
+Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0,
+ integer-gmp-1.0.0.1]
diff --git a/testsuite/tests/partial-sigs/should_compile/PatBind2.stderr b/testsuite/tests/partial-sigs/should_compile/PatBind2.stderr
index 551641c05f..7e31f81e60 100644
--- a/testsuite/tests/partial-sigs/should_compile/PatBind2.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/PatBind2.stderr
@@ -1,7 +1,7 @@
TYPE SIGNATURES
- f :: Bool -> Bool
+ foo :: Bool -> Bool
TYPE CONSTRUCTORS
COERCION AXIOMS
Dependent modules: []
-Dependent packages: [base-4.9.0.0, ghc-prim-0.3.1.0,
- integer-gmp-0.5.1.0] \ No newline at end of file
+Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0,
+ integer-gmp-1.0.0.1]
diff --git a/testsuite/tests/partial-sigs/should_compile/all.T b/testsuite/tests/partial-sigs/should_compile/all.T
index cc8f478e40..f630d8bea3 100644
--- a/testsuite/tests/partial-sigs/should_compile/all.T
+++ b/testsuite/tests/partial-sigs/should_compile/all.T
@@ -20,8 +20,7 @@ test('ExpressionSigNamed', normal, compile, ['-ddump-types -fno-warn-partial-typ
test('ExtraConstraints1', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures'])
test('ExtraConstraints2', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures'])
test('ExtraConstraints3', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures'])
-# Bug
-test('ExtraNumAMROn', expect_broken(9478), compile, ['-ddump-types -fno-warn-partial-type-signatures'])
+test('ExtraNumAMROn', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures'])
test('ExtraNumAMROff', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures'])
test('Forall1', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures'])
test('GenNamed', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures'])
diff --git a/testsuite/tests/partial-sigs/should_fail/TidyClash2.hs b/testsuite/tests/partial-sigs/should_fail/TidyClash2.hs
index 2ca299bf4c..7c40592da4 100644
--- a/testsuite/tests/partial-sigs/should_fail/TidyClash2.hs
+++ b/testsuite/tests/partial-sigs/should_fail/TidyClash2.hs
@@ -1,5 +1,14 @@
{-# LANGUAGE NamedWildCards, ScopedTypeVariables #-}
module TidyClash2 where
-barry :: forall w_. _ -> _ -> w_
+{-
+The bug that TidyClash2 tries to tickle is the following: when GHC generalises
+over wild cards it uses t, t1, t2, ... as type variables. When the user already
+used the t type variable in the same signature, the tidier should respect this
+and use t1, t2, ... for generalised wild cards. So _ -> -> t should result
+in t1 -> t2 -> t. Before the bug fix, the actual output would have been
+something like t -> t1 -> t2.
+-}
+
+barry :: forall t. _ -> _ -> t
barry (x :: _) (y :: _) = undefined :: _
diff --git a/testsuite/tests/partial-sigs/should_fail/TidyClash2.stderr b/testsuite/tests/partial-sigs/should_fail/TidyClash2.stderr
index 1e8a1985d3..ddaf18bdd5 100644
--- a/testsuite/tests/partial-sigs/should_fail/TidyClash2.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/TidyClash2.stderr
@@ -1,54 +1,59 @@
-TidyClash2.hs:4:21:
- Found hole ‘_’ with type: w_1
- Where: ‘w_1’ is a rigid type variable bound by
- the inferred type of barry :: w_1 -> w_2 -> w_ at TidyClash2.hs:5:1
- To use the inferred type, enable PartialTypeSignatures
- In the type signature for ‘barry’: _ -> _ -> w_
+TidyClash2.hs:13:20: error:
+ • Found type wildcard ‘_’ standing for ‘t1’
+ Where: ‘t1’ is a rigid type variable bound by
+ the inferred type of barry :: t1 -> t2 -> t at TidyClash2.hs:14:1
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature:
+ barry :: forall t. _ -> _ -> t
+ • Relevant bindings include
+ barry :: t1 -> t2 -> t (bound at TidyClash2.hs:14:1)
-TidyClash2.hs:4:26:
- Found hole ‘_’ with type: w_2
- Where: ‘w_2’ is a rigid type variable bound by
- the inferred type of barry :: w_1 -> w_2 -> w_ at TidyClash2.hs:5:1
- To use the inferred type, enable PartialTypeSignatures
- In the type signature for ‘barry’: _ -> _ -> w_
+TidyClash2.hs:13:25: error:
+ • Found type wildcard ‘_’ standing for ‘t2’
+ Where: ‘t2’ is a rigid type variable bound by
+ the inferred type of barry :: t1 -> t2 -> t at TidyClash2.hs:14:1
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature:
+ barry :: forall t. _ -> _ -> t
+ • Relevant bindings include
+ barry :: t1 -> t2 -> t (bound at TidyClash2.hs:14:1)
-TidyClash2.hs:5:13:
- Found hole ‘_’ with type: w_1
- Where: ‘w_1’ is a rigid type variable bound by
- the inferred type of barry :: w_1 -> w_2 -> w_ at TidyClash2.hs:5:1
- To use the inferred type, enable PartialTypeSignatures
- Relevant bindings include
- barry :: w_1 -> w_2 -> w_ (bound at TidyClash2.hs:5:1)
- In a pattern type signature: _
- In the pattern: x :: _
- In an equation for ‘barry’:
- barry (x :: _) (y :: _) = undefined :: _
+TidyClash2.hs:14:13: error:
+ • Found type wildcard ‘_’ standing for ‘t1’
+ Where: ‘t1’ is a rigid type variable bound by
+ the inferred type of barry :: t1 -> t2 -> t at TidyClash2.hs:14:1
+ To use the inferred type, enable PartialTypeSignatures
+ • In a pattern type signature: _
+ In the pattern: x :: _
+ In an equation for ‘barry’:
+ barry (x :: _) (y :: _) = undefined :: _
+ • Relevant bindings include
+ barry :: t1 -> t2 -> t (bound at TidyClash2.hs:14:1)
-TidyClash2.hs:5:22:
- Found hole ‘_’ with type: w_2
- Where: ‘w_2’ is a rigid type variable bound by
- the inferred type of barry :: w_1 -> w_2 -> w_ at TidyClash2.hs:5:1
- To use the inferred type, enable PartialTypeSignatures
- Relevant bindings include
- x :: w_1 (bound at TidyClash2.hs:5:8)
- barry :: w_1 -> w_2 -> w_ (bound at TidyClash2.hs:5:1)
- In a pattern type signature: _
- In the pattern: y :: _
- In an equation for ‘barry’:
- barry (x :: _) (y :: _) = undefined :: _
+TidyClash2.hs:14:22: error:
+ • Found type wildcard ‘_’ standing for ‘t2’
+ Where: ‘t2’ is a rigid type variable bound by
+ the inferred type of barry :: t1 -> t2 -> t at TidyClash2.hs:14:1
+ To use the inferred type, enable PartialTypeSignatures
+ • In a pattern type signature: _
+ In the pattern: y :: _
+ In an equation for ‘barry’:
+ barry (x :: _) (y :: _) = undefined :: _
+ • Relevant bindings include
+ x :: t1 (bound at TidyClash2.hs:14:8)
+ barry :: t1 -> t2 -> t (bound at TidyClash2.hs:14:1)
-TidyClash2.hs:5:40:
- Found hole ‘_’ with type: w_
- Where: ‘w_’ is a rigid type variable bound by
- the inferred type of barry :: w_1 -> w_2 -> w_
- at TidyClash2.hs:4:17
- To use the inferred type, enable PartialTypeSignatures
- Relevant bindings include
- y :: w_2 (bound at TidyClash2.hs:5:17)
- x :: w_1 (bound at TidyClash2.hs:5:8)
- barry :: w_1 -> w_2 -> w_ (bound at TidyClash2.hs:5:1)
- In an expression type signature: _
- In the expression: undefined :: _
- In an equation for ‘barry’:
- barry (x :: _) (y :: _) = undefined :: _
+TidyClash2.hs:14:40: error:
+ • Found type wildcard ‘_’ standing for ‘t3’
+ Where: ‘t3’ is a rigid type variable bound by
+ the inferred type of <expression> :: t3 at TidyClash2.hs:14:27
+ To use the inferred type, enable PartialTypeSignatures
+ • In an expression type signature: _
+ In the expression: undefined :: _
+ In an equation for ‘barry’:
+ barry (x :: _) (y :: _) = undefined :: _
+ • Relevant bindings include
+ y :: t2 (bound at TidyClash2.hs:14:17)
+ x :: t1 (bound at TidyClash2.hs:14:8)
+ barry :: t1 -> t2 -> t (bound at TidyClash2.hs:14:1)
diff --git a/testsuite/tests/partial-sigs/should_fail/all.T b/testsuite/tests/partial-sigs/should_fail/all.T
index a676a02b04..2814b13464 100644
--- a/testsuite/tests/partial-sigs/should_fail/all.T
+++ b/testsuite/tests/partial-sigs/should_fail/all.T
@@ -30,8 +30,7 @@ test('PartialClassMethodSignature2', normal, compile_fail, [''])
test('PartialTypeSignaturesDisabled', normal, compile_fail, [''])
test('ScopedNamedWildcardsBad', normal, compile_fail, [''])
test('TidyClash', normal, compile_fail, [''])
-# Bug
-test('TidyClash2', expect_broken(9478), compile_fail, [''])
+test('TidyClash2', normal, compile_fail, [''])
test('UnnamedConstraintWildcard1', normal, compile_fail, [''])
test('UnnamedConstraintWildcard2', normal, compile_fail, [''])
test('WildcardInADT1', normal, compile_fail, [''])