diff options
author | Austin Seipp <austin@well-typed.com> | 2015-05-06 08:19:13 -0500 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2015-05-06 08:19:13 -0500 |
commit | f34c072820f617f09c3d1c4e539c41fb2ab645b1 (patch) | |
tree | e359e4a1f103e7a9eed1f28636df3eb01e2300fd /testsuite | |
parent | 81030ede73c4e3783219b2a8d7463524e847cfce (diff) | |
download | haskell-f34c072820f617f09c3d1c4e539c41fb2ab645b1.tar.gz |
Revert "ApiAnnotations : Nested forall loses forall annotation"
This reverts commit 81030ede73c4e3783219b2a8d7463524e847cfce.
Alan is abandoning this approach in favor of D836.
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/ghc-api/annotations/.gitignore | 1 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/annotations/Makefile | 5 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/annotations/T10278.stderr | 16 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/annotations/T10278.stdout | 96 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/annotations/Test10278.hs | 12 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/annotations/all.T | 1 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/annotations/t10278.hs | 107 |
7 files changed, 0 insertions, 238 deletions
diff --git a/testsuite/tests/ghc-api/annotations/.gitignore b/testsuite/tests/ghc-api/annotations/.gitignore index 48df51a844..3c1f510777 100644 --- a/testsuite/tests/ghc-api/annotations/.gitignore +++ b/testsuite/tests/ghc-api/annotations/.gitignore @@ -5,7 +5,6 @@ exampleTest listcomps t10255 t10268 -t10278 *.hi *.o *.run.* diff --git a/testsuite/tests/ghc-api/annotations/Makefile b/testsuite/tests/ghc-api/annotations/Makefile index bf7108a333..d74d3c2aff 100644 --- a/testsuite/tests/ghc-api/annotations/Makefile +++ b/testsuite/tests/ghc-api/annotations/Makefile @@ -43,9 +43,4 @@ T10268: '$(TEST_HC)' $(TEST_HC_OPTS) --make -v0 -package ghc t10268 ./t10268 "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" -T10278: - rm -f t10278.o t10278.hi - '$(TEST_HC)' $(TEST_HC_OPTS) --make -v0 -package ghc t10278 - ./t10278 "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" - .PHONY: clean annotations parseTree comments exampleTest listcomps diff --git a/testsuite/tests/ghc-api/annotations/T10278.stderr b/testsuite/tests/ghc-api/annotations/T10278.stderr deleted file mode 100644 index d3788b752d..0000000000 --- a/testsuite/tests/ghc-api/annotations/T10278.stderr +++ /dev/null @@ -1,16 +0,0 @@ - -Test10278.hs:9:27: error: - Not in scope: type constructor or class ‘Tower’ - -Test10278.hs:9:39: error: - Not in scope: type constructor or class ‘Tower’ - -Test10278.hs:10:34: error: - Not in scope: type constructor or class ‘Tower’ - -Test10278.hs:10:46: error: - Not in scope: type constructor or class ‘Tower’ - -Test10278.hs:12:24: error: Not in scope: ‘zeroNewton’ - -Test10278.hs:12:36: error: Not in scope: ‘diffUU’ diff --git a/testsuite/tests/ghc-api/annotations/T10278.stdout b/testsuite/tests/ghc-api/annotations/T10278.stdout deleted file mode 100644 index a3834c7dfc..0000000000 --- a/testsuite/tests/ghc-api/annotations/T10278.stdout +++ /dev/null @@ -1,96 +0,0 @@ ----Problems--------------------- -[ -(AK Test10278.hs:4:31-61 AnnDot = [Test10278.hs:4:42]) - -(AK Test10278.hs:4:31-61 AnnForall = [Test10278.hs:4:31-36]) - -(AK Test10278.hs:(8,32)-(10,57) AnnDot = [Test10278.hs:8:43]) - -(AK Test10278.hs:(8,32)-(10,57) AnnForall = [Test10278.hs:8:32-37]) -] - --------------------------------- -[ -(AK Test10278.hs:1:1 AnnModule = [Test10278.hs:2:1-6]) - -(AK Test10278.hs:1:1 AnnWhere = [Test10278.hs:2:18-22]) - -(AK Test10278.hs:4:1-61 AnnDcolon = [Test10278.hs:4:16-17]) - -(AK Test10278.hs:4:1-61 AnnSemi = [Test10278.hs:5:1]) - -(AK Test10278.hs:4:19-61 AnnDot = [Test10278.hs:4:29, Test10278.hs:4:42, Test10278.hs:4:29, - Test10278.hs:4:42]) - -(AK Test10278.hs:4:19-61 AnnForall = [Test10278.hs:4:19-24, Test10278.hs:4:31-36, Test10278.hs:4:19-24, - Test10278.hs:4:31-36]) - -(AK Test10278.hs:4:31-61 AnnDot = [Test10278.hs:4:42]) - -(AK Test10278.hs:4:31-61 AnnForall = [Test10278.hs:4:31-36]) - -(AK Test10278.hs:4:44-61 AnnRarrow = [Test10278.hs:4:48-49]) - -(AK Test10278.hs:4:51-61 AnnRarrow = [Test10278.hs:4:56-57]) - -(AK Test10278.hs:5:1-26 AnnEqual = [Test10278.hs:5:16]) - -(AK Test10278.hs:5:1-26 AnnFunId = [Test10278.hs:5:1-14]) - -(AK Test10278.hs:5:1-26 AnnSemi = [Test10278.hs:7:1]) - -(AK Test10278.hs:(7,1)-(11,33) AnnDcolon = [Test10278.hs:7:17-18]) - -(AK Test10278.hs:(7,1)-(11,33) AnnSemi = [Test10278.hs:12:1]) - -(AK Test10278.hs:7:20-39 AnnCloseP = [Test10278.hs:7:39]) - -(AK Test10278.hs:7:20-39 AnnDarrow = [Test10278.hs:7:41-42]) - -(AK Test10278.hs:7:20-39 AnnOpenP = [Test10278.hs:7:20]) - -(AK Test10278.hs:7:21-24 AnnComma = [Test10278.hs:7:25]) - -(AK Test10278.hs:(8,19)-(10,58) AnnCloseP = [Test10278.hs:10:58]) - -(AK Test10278.hs:(8,19)-(10,58) AnnOpenP = [Test10278.hs:8:19]) - -(AK Test10278.hs:(8,19)-(11,33) AnnRarrow = [Test10278.hs:11:23-24]) - -(AK Test10278.hs:(8,20)-(10,57) AnnDot = [Test10278.hs:8:30, Test10278.hs:8:43]) - -(AK Test10278.hs:(8,20)-(10,57) AnnForall = [Test10278.hs:8:20-25, Test10278.hs:8:32-37]) - -(AK Test10278.hs:(8,32)-(10,57) AnnDot = [Test10278.hs:8:43]) - -(AK Test10278.hs:(8,32)-(10,57) AnnForall = [Test10278.hs:8:32-37]) - -(AK Test10278.hs:(9,27)-(10,57) AnnRarrow = [Test10278.hs:10:31-32]) - -(AK Test10278.hs:9:38-50 AnnCloseP = [Test10278.hs:9:50]) - -(AK Test10278.hs:9:38-50 AnnOpenP = [Test10278.hs:9:38]) - -(AK Test10278.hs:10:45-57 AnnCloseP = [Test10278.hs:10:57]) - -(AK Test10278.hs:10:45-57 AnnOpenP = [Test10278.hs:10:45]) - -(AK Test10278.hs:11:26-33 AnnRarrow = [Test10278.hs:11:28-29]) - -(AK Test10278.hs:11:31-33 AnnCloseS = [Test10278.hs:11:33]) - -(AK Test10278.hs:11:31-33 AnnOpenS = [Test10278.hs:11:31]) - -(AK Test10278.hs:12:1-47 AnnEqual = [Test10278.hs:12:22]) - -(AK Test10278.hs:12:1-47 AnnFunId = [Test10278.hs:12:1-15]) - -(AK Test10278.hs:12:1-47 AnnSemi = [Test10278.hs:13:1]) - -(AK Test10278.hs:12:35-44 AnnCloseP = [Test10278.hs:12:44]) - -(AK Test10278.hs:12:35-44 AnnOpenP = [Test10278.hs:12:35]) - -(AK <no location info> AnnEofPos = [Test10278.hs:13:1]) -] - diff --git a/testsuite/tests/ghc-api/annotations/Test10278.hs b/testsuite/tests/ghc-api/annotations/Test10278.hs deleted file mode 100644 index 5586eccba5..0000000000 --- a/testsuite/tests/ghc-api/annotations/Test10278.hs +++ /dev/null @@ -1,12 +0,0 @@ -{-# LANGUAGE ScopedTypeVariables #-} -module Test10278 where - -extremumNewton :: forall tag. forall tag1. tag -> tag1 -> Int -extremumNewton = undefined - -extremumNewton1 :: (Eq a, Fractional a) => - (forall tag. forall tag1. - Tower tag1 (Tower tag a) - -> Tower tag1 (Tower tag a)) - -> a -> [a] -extremumNewton1 f x0 = zeroNewton (diffUU f) x0 diff --git a/testsuite/tests/ghc-api/annotations/all.T b/testsuite/tests/ghc-api/annotations/all.T index 46f788ab13..c8df1c403d 100644 --- a/testsuite/tests/ghc-api/annotations/all.T +++ b/testsuite/tests/ghc-api/annotations/all.T @@ -5,4 +5,3 @@ test('exampleTest', normal, run_command, ['$MAKE -s --no-print-directory example test('listcomps', normal, run_command, ['$MAKE -s --no-print-directory listcomps']) test('T10255', normal, run_command, ['$MAKE -s --no-print-directory t10255']) test('T10268', normal, run_command, ['$MAKE -s --no-print-directory T10268']) -test('T10278', normal, run_command, ['$MAKE -s --no-print-directory T10278']) diff --git a/testsuite/tests/ghc-api/annotations/t10278.hs b/testsuite/tests/ghc-api/annotations/t10278.hs deleted file mode 100644 index a063d91624..0000000000 --- a/testsuite/tests/ghc-api/annotations/t10278.hs +++ /dev/null @@ -1,107 +0,0 @@ -{-# LANGUAGE RankNTypes #-} - --- This program must be called with GHC's libdir as the single command line --- argument. -module Main where - --- import Data.Generics -import Data.Data -import Data.List -import System.IO -import GHC -import BasicTypes -import DynFlags -import MonadUtils -import Outputable -import ApiAnnotation -import Bag (filterBag,isEmptyBag) -import System.Directory (removeFile) -import System.Environment( getArgs ) -import qualified Data.Map as Map -import qualified Data.Set as Set -import Data.Dynamic ( fromDynamic,Dynamic ) - -main::IO() -main = do - [libdir] <- getArgs - testOneFile libdir "Test10278" - -testOneFile libdir fileName = do - ((anns,cs),p) <- runGhc (Just libdir) $ do - dflags <- getSessionDynFlags - setSessionDynFlags dflags - let mn =mkModuleName fileName - addTarget Target { targetId = TargetModule mn - , targetAllowObjCode = True - , targetContents = Nothing } - load LoadAllTargets - modSum <- getModSummary mn - p <- parseModule modSum - return (pm_annotations p,p) - - let spans = Set.fromList $ getAllSrcSpans (pm_parsed_source p) - - -- putStrLn (pp spans) - problems = filter (\(s,a) -> not (Set.member s spans)) - $ getAnnSrcSpans (anns,cs) - putStrLn "---Problems---------------------" - putStrLn (intercalate "\n" [showAnns $ Map.fromList $ map snd problems]) - putStrLn "--------------------------------" - putStrLn (intercalate "\n" [showAnns anns]) - - where - getAnnSrcSpans :: ApiAnns -> [(SrcSpan,(ApiAnnKey,[SrcSpan]))] - getAnnSrcSpans (anns,_) = map (\a@((ss,_),_) -> (ss,a)) $ Map.toList anns - - getAllSrcSpans :: (Data t) => t -> [SrcSpan] - getAllSrcSpans ast = everything (++) ([] `mkQ` getSrcSpan) ast - where - getSrcSpan :: SrcSpan -> [SrcSpan] - getSrcSpan ss = [ss] - - -showAnns anns = "[\n" ++ (intercalate "\n" - $ map (\((s,k),v) - -> ("(AK " ++ pp s ++ " " ++ show k ++" = " ++ pp v ++ ")\n")) - $ Map.toList anns) - ++ "]\n" - -pp a = showPpr unsafeGlobalDynFlags a - - --- --------------------------------------------------------------------- - --- Copied from syb for the test - - --- | Generic queries of type \"r\", --- i.e., take any \"a\" and return an \"r\" --- -type GenericQ r = forall a. Data a => a -> r - - --- | Make a generic query; --- start from a type-specific case; --- return a constant otherwise --- -mkQ :: ( Typeable a - , Typeable b - ) - => r - -> (b -> r) - -> a - -> r -(r `mkQ` br) a = case cast a of - Just b -> br b - Nothing -> r - - - --- | Summarise all nodes in top-down, left-to-right order -everything :: (r -> r -> r) -> GenericQ r -> GenericQ r - --- Apply f to x to summarise top-level node; --- use gmapQ to recurse into immediate subterms; --- use ordinary foldl to reduce list of intermediate results - -everything k f x = foldl k (f x) (gmapQ (everything k f) x) |