diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2018-06-07 13:28:53 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-06-07 18:06:30 -0400 |
commit | 569c16a76ead8f9012fafe7a7e97c72fabe0bb94 (patch) | |
tree | 4b483d838e585ab0d48516ee54d23b2141d33fee /testsuite/tests | |
parent | 5026840fddc86c3bc10693eed676fbf6a74f4227 (diff) | |
download | haskell-569c16a76ead8f9012fafe7a7e97c72fabe0bb94.tar.gz |
Fix #15243 by fixing incorrect uses of NotPromoted
In `Convert`, we were incorrectly using `NotPromoted` to
denote type constructors that were actually intended to be promoted,
resulting in poor `-ddump-splices` output (as seen in #15243).
Easily fixed.
Test Plan: make test TEST=T15243
Reviewers: bgamari, goldfire
Reviewed By: bgamari
Subscribers: rwbarton, thomie, carter
GHC Trac Issues: #15243
Differential Revision: https://phabricator.haskell.org/D4809
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/th/T15243.hs | 15 | ||||
-rw-r--r-- | testsuite/tests/th/T15243.stderr | 12 | ||||
-rw-r--r-- | testsuite/tests/th/TH_PromotedTuple.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/th/TH_TyInstWhere1.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/th/all.T | 1 |
5 files changed, 32 insertions, 4 deletions
diff --git a/testsuite/tests/th/T15243.hs b/testsuite/tests/th/T15243.hs new file mode 100644 index 0000000000..8b366404c8 --- /dev/null +++ b/testsuite/tests/th/T15243.hs @@ -0,0 +1,15 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE TypeFamilies #-} +{-# OPTIONS_GHC -ddump-splices #-} +module T15243 where + +data Unit = Unit + +$([d| type family F (a :: k) :: k where + F 'Unit = 'Unit + F '(,) = '(,) + F '[] = '[] + F '(:) = '(:) + |]) diff --git a/testsuite/tests/th/T15243.stderr b/testsuite/tests/th/T15243.stderr new file mode 100644 index 0000000000..26082a1160 --- /dev/null +++ b/testsuite/tests/th/T15243.stderr @@ -0,0 +1,12 @@ +T15243.hs:(10,3)-(15,6): Splicing declarations + [d| type family F_at5 (a_at7 :: k_at6) :: k_at6 where + F_at5 'Unit = 'Unit + F_at5 '(,) = '(,) + F_at5 '[] = '[] + F_at5 '(:) = '(:) |] + ======> + type family F_a3ZE (a_a3ZG :: k_a3ZF) :: k_a3ZF where + F_a3ZE 'Unit = 'Unit + F_a3ZE '(,) = '(,) + F_a3ZE '[] = '[] + F_a3ZE '(:) = '(:) diff --git a/testsuite/tests/th/TH_PromotedTuple.stderr b/testsuite/tests/th/TH_PromotedTuple.stderr index 9619d52f51..92792a361d 100644 --- a/testsuite/tests/th/TH_PromotedTuple.stderr +++ b/testsuite/tests/th/TH_PromotedTuple.stderr @@ -3,7 +3,7 @@ TH_PromotedTuple.hs:(14,32)-(16,43): Splicing type reportWarning (show ty) return ty ======> - '(Int, False) + '(Int, 'False) -TH_PromotedTuple.hs:14:32: Warning: +TH_PromotedTuple.hs:14:32: warning: AppT (AppT (PromotedTupleT 2) (ConT GHC.Types.Int)) (PromotedT GHC.Types.False) diff --git a/testsuite/tests/th/TH_TyInstWhere1.stderr b/testsuite/tests/th/TH_TyInstWhere1.stderr index 971b7eed24..0d07db83d1 100644 --- a/testsuite/tests/th/TH_TyInstWhere1.stderr +++ b/testsuite/tests/th/TH_TyInstWhere1.stderr @@ -4,5 +4,5 @@ TH_TyInstWhere1.hs:(5,3)-(7,24): Splicing declarations F a b = False |] ======> type family F (a :: k) (b :: k) :: Bool where - F a a = True - F a b = False + F a a = 'True + F a b = 'False diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index e998bd0027..b97ed40353 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -414,3 +414,4 @@ test('T14875', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T14885a', normal, compile, ['']) test('T14885b', normal, compile, ['']) test('T14885c', normal, compile, ['']) +test('T15243', normal, compile, ['']) |