From 7100850eebb1c1aec0aaabca08915bac8b90e188 Mon Sep 17 00:00:00 2001 From: Adam Gundry Date: Fri, 15 Jun 2018 14:11:22 -0400 Subject: Use data con name instead of parent in lookupRecFieldOcc Test Plan: new tests rename/should_compile/{T14747,T15149} Reviewers: simonpj, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14747, #15149 Differential Revision: https://phabricator.haskell.org/D4821 --- testsuite/tests/rename/should_compile/T14747.hs | 9 +++++++++ testsuite/tests/rename/should_compile/T14747A.hs | 5 +++++ testsuite/tests/rename/should_compile/T15149.hs | 5 +++++ testsuite/tests/rename/should_compile/T15149A.hs | 4 ++++ testsuite/tests/rename/should_compile/T15149B.hs | 4 ++++ testsuite/tests/rename/should_compile/T15149C.hs | 4 ++++ testsuite/tests/rename/should_compile/all.T | 2 ++ 7 files changed, 33 insertions(+) create mode 100644 testsuite/tests/rename/should_compile/T14747.hs create mode 100644 testsuite/tests/rename/should_compile/T14747A.hs create mode 100644 testsuite/tests/rename/should_compile/T15149.hs create mode 100644 testsuite/tests/rename/should_compile/T15149A.hs create mode 100644 testsuite/tests/rename/should_compile/T15149B.hs create mode 100644 testsuite/tests/rename/should_compile/T15149C.hs (limited to 'testsuite/tests/rename/should_compile') diff --git a/testsuite/tests/rename/should_compile/T14747.hs b/testsuite/tests/rename/should_compile/T14747.hs new file mode 100644 index 0000000000..6dde0bdab9 --- /dev/null +++ b/testsuite/tests/rename/should_compile/T14747.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE PatternSynonyms, DisambiguateRecordFields #-} + +module T14747 where + +import T14747A + +pattern T{x} = [x] + +e = S { x = 42 } diff --git a/testsuite/tests/rename/should_compile/T14747A.hs b/testsuite/tests/rename/should_compile/T14747A.hs new file mode 100644 index 0000000000..a3b6e604e4 --- /dev/null +++ b/testsuite/tests/rename/should_compile/T14747A.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE PatternSynonyms #-} + +module T14747A where + +pattern S{x} = [x] diff --git a/testsuite/tests/rename/should_compile/T15149.hs b/testsuite/tests/rename/should_compile/T15149.hs new file mode 100644 index 0000000000..e2e77db9a1 --- /dev/null +++ b/testsuite/tests/rename/should_compile/T15149.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE DisambiguateRecordFields #-} +module Main where +import T15149B +import T15149C +main = do print (AnDouble{an=1}, AnInt{an=1}) diff --git a/testsuite/tests/rename/should_compile/T15149A.hs b/testsuite/tests/rename/should_compile/T15149A.hs new file mode 100644 index 0000000000..09b9beb36f --- /dev/null +++ b/testsuite/tests/rename/should_compile/T15149A.hs @@ -0,0 +1,4 @@ +{-# LANGUAGE TypeFamilies #-} +module T15149A where + +data family An c :: * diff --git a/testsuite/tests/rename/should_compile/T15149B.hs b/testsuite/tests/rename/should_compile/T15149B.hs new file mode 100644 index 0000000000..9a9508da08 --- /dev/null +++ b/testsuite/tests/rename/should_compile/T15149B.hs @@ -0,0 +1,4 @@ +{-# LANGUAGE TypeFamilies #-} +module T15149B where +import T15149A +data instance An Int = AnInt {an :: Int} deriving Show diff --git a/testsuite/tests/rename/should_compile/T15149C.hs b/testsuite/tests/rename/should_compile/T15149C.hs new file mode 100644 index 0000000000..ca1a7f88fb --- /dev/null +++ b/testsuite/tests/rename/should_compile/T15149C.hs @@ -0,0 +1,4 @@ +{-# LANGUAGE TypeFamilies #-} +module T15149C where +import T15149A +data instance An Double = AnDouble {an :: Double} deriving Show diff --git a/testsuite/tests/rename/should_compile/all.T b/testsuite/tests/rename/should_compile/all.T index 1797c28854..7e31400715 100644 --- a/testsuite/tests/rename/should_compile/all.T +++ b/testsuite/tests/rename/should_compile/all.T @@ -154,3 +154,5 @@ test('T13132', normal, compile, ['']) test('T13646', normal, compile, ['']) test('LookupSub', [], multimod_compile, ['LookupSub', '-v0']) test('T14881', [], multimod_compile, ['T14881', '-W']) +test('T14747', [], multimod_compile, ['T14747', '-v0']) +test('T15149', [], multimod_compile, ['T15149', '-v0']) -- cgit v1.2.1