summaryrefslogtreecommitdiff
path: root/testsuite/tests/module
Commit message (Collapse)AuthorAgeFilesLines
* testsuite: Fix -Wcompat-unqualified-imports issuesBen Gamari2020-02-084-0/+5
|
* Fix typos, using Wikipedia list of common typosBrian Wignall2019-11-281-1/+1
|
* Whitespace-sensitive bang patterns (#1087, #17162)wip/whitespace-and-lookaheadVladislav Zavialov2019-11-272-3/+5
| | | | | | | | | | | | | | | | | | This patch implements a part of GHC Proposal #229 that covers five operators: * the bang operator (!) * the tilde operator (~) * the at operator (@) * the dollar operator ($) * the double dollar operator ($$) Based on surrounding whitespace, these operators are disambiguated into bang patterns, lazy patterns, strictness annotations, type applications, splices, and typed splices. This patch doesn't cover the (-) operator or the -Woperator-whitespace warning, which are left as future work.
* Whitespace forward compatibility for proposal #229Vladislav Zavialov2019-10-302-2/+2
| | | | | | | | GHC Proposal #229 changes the lexical rules of Haskell, which may require slight whitespace adjustments in certain cases. This patch changes formatting in a few places in GHC and its testsuite in a way that enables it to compile under the proposed rules.
* Implement the -XUnliftedNewtypes extension.Andrew Martin2019-06-142-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | GHC Proposal: 0013-unlifted-newtypes.rst Discussion: https://github.com/ghc-proposals/ghc-proposals/pull/98 Issues: #15219, #1311, #13595, #15883 Implementation Details: Note [Implementation of UnliftedNewtypes] Note [Unifying data family kinds] Note [Compulsory newtype unfolding] This patch introduces the -XUnliftedNewtypes extension. When this extension is enabled, GHC drops the restriction that the field in a newtype must be of kind (TYPE 'LiftedRep). This allows types like Int# and ByteArray# to be used in a newtype. Additionally, coerce is made levity-polymorphic so that it can be used with newtypes over unlifted types. The bulk of the changes are in TcTyClsDecls.hs. With -XUnliftedNewtypes, getInitialKind is more liberal, introducing a unification variable to return the kind (TYPE r0) rather than just returning (TYPE 'LiftedRep). When kind-checking a data constructor with kcConDecl, we attempt to unify the kind of a newtype with the kind of its field's type. When typechecking a data declaration with tcTyClDecl, we again perform a unification. See the implementation note for more on this. Co-authored-by: Richard Eisenberg <rae@richarde.dev>
* Implement ImportQualifiedPostShayne Fletcher2019-05-088-0/+43
|
* Update Trac ticket URLs to point to GitLabRyan Scott2019-03-151-1/+1
| | | | | This moves all URL references to Trac tickets to their corresponding GitLab counterparts.
* testsuite: Use makefile_testBen Gamari2019-01-303-12/+12
| | | | | This eliminates most uses of run_command in the testsuite in favor of the more structured makefile_test.
* Revert "Batch merge"Ben Gamari2019-01-303-12/+12
| | | | This reverts commit 76c8fd674435a652c75a96c85abbf26f1f221876.
* Batch mergeBen Gamari2019-01-303-12/+12
|
* Fix unused-import warningsDavid Eichmann2018-11-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes a fairly long-standing bug (dating back to 2015) in RdrName.bestImport, namely commit 9376249b6b78610db055a10d05f6592d6bbbea2f Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Wed Oct 28 17:16:55 2015 +0000 Fix unused-import stuff in a better way In that patch got the sense of the comparison back to front, and thereby failed to implement the unused-import rules described in Note [Choosing the best import declaration] in RdrName This led to Trac #13064 and #15393 Fixing this bug revealed a bunch of unused imports in libraries; the ones in the GHC repo are part of this commit. The two important changes are * Fix the bug in bestImport * Modified the rules by adding (a) in Note [Choosing the best import declaration] in RdrName Reason: the previosu rules made Trac #5211 go bad again. And the new rule (a) makes sense to me. In unravalling this I also ended up doing a few other things * Refactor RnNames.ImportDeclUsage to use a [GlobalRdrElt] for the things that are used, rather than [AvailInfo]. This is simpler and more direct. * Rename greParentName to greParent_maybe, to follow GHC naming conventions * Delete dead code RdrName.greUsedRdrName Bumps a few submodules. Reviewers: hvr, goldfire, bgamari, simonmar, jrtc27 Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5312
* Fix trac #15702, as a followon to fix for #13704.Chris Smith2018-11-174-1/+13
| | | | | | | | | | | | | | | | | | Summary: The effect of this change is that -main-is changes the default export list for the main module, but does not apply the same change to non-main modules. This fixes some cases where -main-is was used to wrap a module that expected that default behavior (exporting `main`, even when that wasn't the main entry point name). Reviewers: mpickering, monoidal, bgamari Subscribers: rwbarton, carter GHC Trac Issues: #13704, #15702 Differential Revision: https://phabricator.haskell.org/D5322
* Fix for Trac #15611: Scope errors lie about what modules are imported.roland2018-11-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: For the error message: Not in scope X.Y Module X does not export Y No module named ‘X’ is imported: there are 2 cases, where we don't show the last "no module named is imported" line: 1. If the module X has been imported. 2. If the module X is the current module. There are 2 subcases: 2.1 If the unknown module name is in a input source file, then we can use the getModule function to get the current module name. 2.2 If the unknown module name has been entered by the user in GHCi, then the getModule function returns something like "interactive:Ghci1", and we have to check the current module in the last added entry of the HomePackageTable. Test Plan: make test TESTS="T15611a T15611b" Reviewers: monoidal, hvr, thomie, dfeuer, bgamari, DavidEichmann Reviewed By: monoidal, DavidEichmann Subscribers: rwbarton, carter GHC Trac Issues: #15611 Differential Revision: https://phabricator.haskell.org/D5284
* resolve T13704chessai2018-10-022-1/+4
| | | | | | | | | | | | | | | | | Summary: allow -main-is to change export list for default module header, allowing one to change the entry point to one's program. Test Plan: ./validate Reviewers: bgamari, nomeata, mpickering Reviewed By: mpickering Subscribers: mpickering, rwbarton, carter GHC Trac Issues: #13704 Differential Revision: https://phabricator.haskell.org/D5189
* Fix for #13862: Optional "-v" not allowed with :load in GHCiroland2018-09-162-2/+2
| | | | | | | | | | | | | | | Replace the error message `Use -v to see a list of the files searched for.` with `Use -v (or :set -v` in ghci) to see a list of the files searched for.` Reviewers: bgamari, monoidal, thomie, osa1 Subscribers: rwbarton, carter GHC Trac Issues: #13862 Differential Revision: https://phabricator.haskell.org/D5122
* Improve error message on un-satisfied importSimon Peyton Jones2018-07-252-4/+3
| | | | | | | | | | | | | | | | | | Consider import M( C( a,b,c ) ) where class C is defined as module M where class C x where a :: blah c :: blah Tnen (Trac #15413) we'd like to get an error message only about failing to import C( b ), not C( a,b,c ). This was fairly easy (and local) to do. Turned out that the existing tests mod81 and mod91 are adequate tests for the feature.
* Improved Valid Hole FitsMatthías Páll Gissurarson2018-05-301-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've changed the name from `Valid substitutions` to `Valid hole fits`, since "substitution" already has a well defined meaning within the theory. As part of this change, the flags and output is reanamed, with substitution turning into hole-fit in most cases. "hole fit" was already used internally in the code, it's clear and shouldn't cause any confusion. In this update, I've also reworked how we manage side-effects in the hole we are considering. This allows us to consider local bindings such as where clauses and arguments to functions, suggesting e.g. `a` for `head (x:xs) where head :: [a] -> a`. It also allows us to find suggestions such as `maximum` for holes of type `Ord a => a -> [a]`, and `max` when looking for a match for the hole in `g = foldl1 _`, where `g :: Ord a => [a] -> a`. We also show much improved output for refinement hole fits, and fixes #14990. We now show the correct type of the function, but we also now show what the arguments to the function should be e.g. `foldl1 (_ :: Integer -> Integer -> Integer)` when looking for `[Integer] -> Integer`. I've moved the bulk of the code from `TcErrors.hs` to a new file, `TcHoleErrors.hs`, since it was getting too big to not live on it's own. This addresses the considerations raised in #14969, and takes proper care to set the `tcLevel` of the variables to the right level before passing it to the simplifier. We now also zonk the suggestions properly, which improves the output of the refinement hole fits considerably. This also filters out suggestions from the `GHC.Err` module, since even though `error` and `undefined` are indeed valid hole fits, they are "trivial", and almost never useful to the user. We now find the hole fits using the proper manner, namely by solving nested implications. This entails that the givens are passed along using the implications the hole was nested in, which in turn should mean that there will be fewer weird bugs in the typed holes. I've also added a new sorting method (as suggested by SPJ) and sort by the size of the types needed to turn the hole fits into the type of the hole. This gives a reasonable approximation to relevance, and is much faster than the subsumption check. I've also added a flag to toggle whether to use this new sorting algorithm (as is done by default) or the subsumption algorithm. This fixes #14969 I've also added documentation for these new flags and update the documentation according to the new output. Reviewers: bgamari, goldfire Reviewed By: bgamari Subscribers: simonpj, rwbarton, thomie, carter GHC Trac Issues: #14969, #14990, #10946 Differential Revision: https://phabricator.haskell.org/D4444
* Track type variable scope more carefully.Richard Eisenberg2018-03-311-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main job of this commit is to track more accurately the scope of tyvars introduced by user-written foralls. For example, it would be to have something like this: forall a. Int -> (forall k (b :: k). Proxy '[a, b]) -> Bool In that type, a's kind must be k, but k isn't in scope. We had a terrible way of doing this before (not worth repeating or describing here, but see the old tcImplicitTKBndrs and friends), but now we have a principled approach: make an Implication when kind-checking a forall. Doing so then hooks into the existing machinery for preventing skolem-escape, performing floating, etc. This also means that we bump the TcLevel whenever going into a forall. The new behavior is done in TcHsType.scopeTyVars, but see also TcHsType.tc{Im,Ex}plicitTKBndrs, which have undergone significant rewriting. There are several Notes near there to guide you. Of particular interest there is that Implication constraints can now have skolems that are out of order; this situation is reported in TcErrors. A major consequence of this is a slightly tweaked process for type- checking type declarations. The new Note [Use SigTvs in kind-checking pass] in TcTyClsDecls lays it out. The error message for dependent/should_fail/TypeSkolEscape has become noticeably worse. However, this is because the code in TcErrors goes to some length to preserve pre-8.0 error messages for kind errors. It's time to rip off that plaster and get rid of much of the kind-error-specific error messages. I tried this, and doing so led to a lovely error message for TypeSkolEscape. So: I'm accepting the error message quality regression for now, but will open up a new ticket to fix it, along with a larger error-message improvement I've been pondering. This applies also to dependent/should_fail/{BadTelescope2,T14066,T14066e}, polykinds/T11142. Other minor changes: - isUnliftedTypeKind didn't look for tuples and sums. It does now. - check_type used check_arg_type on both sides of an AppTy. But the left side of an AppTy isn't an arg, and this was causing a bad error message. I've changed it to use check_type on the left-hand side. - Some refactoring around when we print (TYPE blah) in error messages. The changes decrease the times when we do so, to good effect. Of course, this is still all controlled by -fprint-explicit-runtime-reps Fixes #14066 #14749 Test cases: dependent/should_compile/{T14066a,T14749}, dependent/should_fail/T14066{,c,d,e,f,g,h}
* typecheck: Consistently use pretty quotes in error messagesBen Gamari2017-11-272-2/+3
| | | | | | Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4241
* typecheck: Clarify errors mentioned in #14385Ben Gamari2017-10-251-1/+1
|
* Also show types that subsume a hole as valid substitutions for that hole.Matthías Páll Gissurarson2017-09-211-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This builds on the previous "Valid substitutions include..." functionality, but add subsumption checking as well, so that the suggested valid substitutions show not only exact matches, but also identifiers that fit the hole by virtue of subsuming the type of the hole (i.e. being more general than the type of the hole). Building on the previous example, in the given program ``` ps :: String -> IO () ps = putStrLn ps2 :: a -> IO () ps2 _ = putStrLn "hello, world" main :: IO () main = _ "hello, world" ``` The results would be something like ``` • Found hole: _ :: [Char] -> IO () • In the expression: _ In the expression: _ "hello, world" In an equation for ‘main’: main = _ "hello, world" • Relevant bindings include main :: IO () (bound at t1.hs:8:1) Valid substitutions include ps :: String -> IO () (defined at t1.hs:2:1) ps2 :: forall a. a -> IO () (defined at t1.hs:5:1) putStrLn :: String -> IO () (imported from ‘Prelude’ at t1.hs:1:1 (and originally defined in ‘System.IO’)) fail :: forall (m :: * -> *). Monad m => forall a. String -> m a (imported from ‘Prelude’ at t1.hs:1:1 (and originally defined in ‘GHC.Base’)) mempty :: forall a. Monoid a => a (imported from ‘Prelude’ at t1.hs:1:1 (and originally defined in ‘GHC.Base’)) print :: forall a. Show a => a -> IO () (imported from ‘Prelude’ at t1.hs:1:1 (and originally defined in ‘System.IO’)) (Some substitutions suppressed; use -fmax-valid-substitutions=N or -fno-max-valid-substitutions) ``` Signed-off-by: Matthías Páll Gissurarson <mpg@mpg.is> Modified according to suggestions from Simon PJ Accept tests that match the expectations, still a few to look better at Swithced to using tcLookup, after sit down with SPJ at ICFP. Implications are WIP. Now works with polymorphism and constraints! We still need to merge the latest master, before we can make a patch. Wrap the type of the hole, instead of implication shenanigans, As per SPJs suggestion, this is simpler and feels closer to what we actually want to do. Updated tests with the new implementation Remove debugging trace and update documentation Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: RyanGlScott, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3930
* Remove unneeded reqlibs for mtl and parsec in the GHC testsuiteRyan Scott2017-08-171-2/+2
| | | | | | | | | | | | | | | | Now that `mtl` and `parsec` are boot libraries, there's no need to qualify various tests in the testsuite with `reqlib('mtl')` or `reqlib('parsec')`. Test Plan: make test TEST="T4809 tcfail126 T4355 tc232 tc223 tc220 tc217 tc183 T5303 DoParamM qq005 qq006 galois_raytrace T1074 mod133 T3787 T4316 prog011 drvfail006 drvfail008" Reviewers: bgamari, austin Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3855
* Fix #13948 by being pickier about when to suggest DataKindsRyan Scott2017-07-116-12/+3
| | | | | | | | | | | | | | | | | | | | | | | Commit 343cb32d0983f576d344a2d04a35c3fd6eecf2c5 (#13568) made GHC a bit too cavalier in suggesting when data constructors are in scope (and suggesting the use of `DataKinds`). This tones down the suggestions so that `DataKinds` is only suggested if a data constructor of that name is actually in scope (previously, it would always suggest, even if it was out of scope). Fixes #13948. Test Plan: ./validate Reviewers: mpickering, austin, bgamari Reviewed By: mpickering Subscribers: rwbarton, thomie GHC Trac Issues: #13948 Differential Revision: https://phabricator.haskell.org/D3719
* Fix incorrect ambiguity error on identically-named data constructorsSoham Chowdhury2017-05-116-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | Given multiple in-scope constructors with the same name, say `A`, and a function of type `A -> Int`, say, the compiler reports both a "type `A` is not in scope" and (incorrectly) an ambiguity error. The latter shouldn't be there if `DataKinds` isn't enabled. This issue was recommended to me by @mpickering as a suitable first task, and the fix was also outlined in the original Trac ticket. It involved a simple reordering of the steps taken in `lookup_demoted` in `RnEnv.hs`. The fix is to make the `DataKinds` check happen earlier, ensuring that the ambiguity check doesn't happen at all if we know the constructors couldn't have been promoted. Signed-off-by: Soham Chowdhury <chow.soham@gmail.com> Reviewers: mpickering, austin, bgamari Reviewed By: mpickering, bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #13568 Differential Revision: https://phabricator.haskell.org/D3547
* Implement sequential name lookup properlyMatthew Pickering2017-05-042-0/+6
| | | | | | | | | | | | | | | | | | | Previously we would run all the monadic actions and then combine their results. This caused problems if later actions raised errors but earlier lookups suceeded. We only want to run later lookups if the earlier ones fail. Fixes #13622 Reviewers: RyanGlScott, austin, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, thomie GHC Trac Issues: #13622 Differential Revision: https://phabricator.haskell.org/D3515
* Allow qualified names to be children in export listsMatthew Pickering2017-04-122-0/+15
| | | | | | | | | | | | | | | | When doing this I noticed a horrible amount of duplication between lookupSubBndrOcc and lookupExportChild (which I am responsible for). I opened #13545 to keep track of this. Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #13528 Differential Revision: https://phabricator.haskell.org/D3434
* Fix TcSimplify.decideQuantification for kind variablesSimon Peyton Jones2017-03-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TcSimplify.decideQuantification was doing the Wrong Thing when "growing" the type variables to quantify over. We were trying to do this on a tyvar set where we'd split off the dependent type varaibles; and we just got it wrong. A kind variable wasn't being generalised properly, with confusing knock on consequences. All this led to Trac #13371 and Trac #13393. This commit tidies it all up: * The type TcDepVars is renamed as CandidateQTvs; and splitDepVarsOfType to candidateQTyVarsOfType * The code in TcSimplify.decideQuantification is simpler. It no longer does the tricky "grow" stuff over TcDepVars. Instead it use ordinary VarSets (thereby eliminating the nasty growThetaTyVarsDSet) and uses that to filter the result of candidateQTyVarsOfType. * I documented that candidateQTyVarsOfType returns the type variables in a good order in which to quantify, and rewrote it to use an accumulator pattern, so that we would predicatably get left-to-right ordering. In doing all this I also made UniqDFM behave a little more nicely: * When inserting an element that is there already, keep the old tag, while still overwriting with the new value. * This means that when doing udfmToList we get back elements in the order they were originally inserted, rather than in reverse order. It's not a big deal, but in a subsequent commit I use it to improve the order of type variables in inferred types. All this led to a lot of error message wibbles: - changing the order of quantified variables - changing the order in which instances are listed in GHCi - changing the tidying of variables in typechecker erors There's a submodule update for 'array' because one of its tests has an error-message change. I may not have associated all of them with the correct commit.
* tests: remove extra_files.py (#12223)Reid Barton2017-02-263-49/+50
| | | | | | | | | | | | The script I used is included as testsuite/driver/kill_extra_files.py, though at this point it is for mostly historical interest. Some of the tests in libraries/hpc relied on extra_files.py, so this commit includes an update to that submodule. One test in libraries/process also relies on extra_files.py, but we cannot update that submodule so easily, so for now we special-case it in the test driver.
* Remove clean_cmd and extra_clean usage from .T filesThomas Miedema2017-01-223-135/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | The `clean_cmd` and `extra_clean` setup functions don't do anything. Remove them from .T files. Created using https://github.com/thomie/refactor-ghc-testsuite. This diff is a test for the .T-file parser/processor/pretty-printer in that repository. find . -name '*.T' -exec ~/refactor-ghc-testsuite/Main "{}" \; Tests containing inline comments or multiline strings are not modified. Preparation for #12223. Test Plan: Harbormaster Reviewers: austin, hvr, simonmar, mpickering, bgamari Reviewed By: mpickering Subscribers: mpickering Differential Revision: https://phabricator.haskell.org/D3000 GHC Trac Issues: #12223
* Unquote ‘import’ in bad import error messagePhil Ruffwind2017-01-171-3/+3
| | | | | | | | | | | | | | | | | | | In module ‘Prelude’: ‘True’ is a data constructor of ‘Bool’ To import it use ‘import’ Prelude( Bool( True ) ) The quotes around `import` don't make any sense. Test Plan: manual Reviewers: austin, mpickering, bgamari Reviewed By: mpickering, bgamari Subscribers: dfeuer, thomie Differential Revision: https://phabricator.haskell.org/D2935
* Replace -fshow-source-paths with -fhide-source-pathsSylvain Henry2016-11-292-3/+3
| | | | | | | | | | | | | | | | | | | | | This patch reverts the change introduced with 587dcccfdfa7a319e27300a4f3885071060b1f8e and restores the previous default output of GHC (i.e., show source path and object path for each compiled module). The -fhide-source-paths flag can be used to hide these paths and reduce the line noise. Reviewers: gracjan, nomeata, austin, bgamari, simonmar, hvr Reviewed By: hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2728 GHC Trac Issues: #12851
* Test for type synonym loops on TyCon.Edward Z. Yang2016-11-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, we tested for type synonym loops by doing a syntactic test on the literal type synonym declarations. However, in some cases, loops could go through hs-boot files, leading to an infinite loop (#12042); a similar situation can occur when signature merging. This commit replaces the syntactic test with a test on TyCon, simply by walking down all type synonyms until we bottom out, or find we've looped back. It's a lot simpler. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, austin, bgamari Subscribers: goldfire, thomie Differential Revision: https://phabricator.haskell.org/D2656 GHC Trac Issues: #12042
* Make default output less verbose (source/object paths)Sylvain HENRY2016-11-112-3/+3
| | | | | | | | | | | | Reviewers: simonmar, mpickering, austin, bgamari Reviewed By: bgamari Subscribers: mpickering, nomeata, thomie Differential Revision: https://phabricator.haskell.org/D2679 GHC Trac Issues: #12807
* Rework renaming of children in export lists.Matthew Pickering2016-10-0814-10/+82
| | | | | | | | | | | | | | | | | | | | | | | | | The target of this patch is exports such as: ``` module Foo ( T(A, B, C) ) where ``` Essentially this patch makes sure that we use the correct lookup functions in order to lookup the names in parent-children export lists. This change highlighted the complexity of this small part of GHC which accounts for the scale. This change was motivated by wanting to remove the `PatternSynonym` constructor from `Parent`. As with all these things, it quickly spiraled out of control into a much larger refactor. Reviewers: simonpj, goldfire, bgamari, austin Subscribers: adamgundry, thomie Differential Revision: https://phabricator.haskell.org/D2179 GHC Trac Issues: #11970
* Distinguish between UnitId and InstalledUnitId.Edward Z. Yang2016-10-082-4/+4
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Implement deriving strategiesRyan Scott2016-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Allows users to explicitly request which approach to `deriving` to use via keywords, e.g., ``` newtype Foo = Foo Bar deriving Eq deriving stock Ord deriving newtype Show ``` Fixes #10598. Updates haddock submodule. Test Plan: ./validate Reviewers: hvr, kosmikus, goldfire, alanz, bgamari, simonpj, austin, erikd, simonmar Reviewed By: alanz, bgamari, simonpj Subscribers: thomie, mpickering, oerjan Differential Revision: https://phabricator.haskell.org/D2280 GHC Trac Issues: #10598
* Testsuite: remove `-Wno-warn-tabs` from default flagsThomas Miedema2016-06-201-1/+1
| | | | This allows the removal of the override_flags stuff in testlib.py.
* Testsuite: remove `-fforce-recomp` from default flags (#11980)Thomas Miedema2016-06-201-2/+2
| | | | | | | | | | | | | | There is no need for this flag anymore, since each test runs in a newly created directory. Removing it cleans up testlib.py a bit. There is a small risk that this renders some tests useless. It's hard to know. Those tests should have specified -fforce-recomp` explicitly anyway, so I'm not going to worry about it. I've fixed the ones that failed without -fforce-recomp. Reviewed by: bgamari Differential Revision: https://phabricator.haskell.org/D2346
* Testsuite: tabs -> spaces [skip ci]Thomas Miedema2016-06-204-11/+11
|
* Testsuite: remove Windows CR [skip ci]Thomas Miedema2016-06-201-12/+12
|
* Improve typechecking of let-bindingsSimon Peyton Jones2016-06-131-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This major commit was initially triggered by #11339, but it spiraled into a major review of the way in which type signatures for bindings are handled, especially partial type signatures. On the way I fixed a number of other bugs, namely #12069 #12033 #11700 #11339 #11670 The main change is that I completely reorganised the way in which type signatures in bindings are handled. The new story is in TcSigs Note [Overview of type signatures]. Some specific: * Changes in the data types for signatures in TcRnTypes: TcIdSigInfo and new TcIdSigInst * New module TcSigs deals with typechecking type signatures and pragmas. It contains code mostly moved from TcBinds, which is already too big * HsTypes: I swapped the nesting of HsWildCardBndrs and HsImplicitBndsrs, so that the wildcards are on the oustide not the insidde in a LHsSigWcType. This is just a matter of convenient, nothing deep. There are a host of other changes as knock-on effects, and it all took FAR longer than I anticipated :-). But it is a significant improvement, I think. Lots of error messages changed slightly, some just variants but some modest improvements. New tests * typecheck/should_compile * SigTyVars: a scoped-tyvar test * ExPat, ExPatFail: existential pattern bindings * T12069 * T11700 * T11339 * partial-sigs/should_compile * T12033 * T11339a * T11670 One thing to check: * Small change to output from ghc-api/landmines. Need to check with Alan Zimmerman
* RdrHsSyn: Only suggest `type` qualification when appropriateBen Gamari2016-05-104-7/+5
| | | | This suggestion only applies to operators.
* Forbid variables to be parents in import lists.Matthew Pickering2016-05-107-19/+31
| | | | | | | | | | | | | | | | | | | | | | In the long discussion on #11432, it was decided that when a type constructor is parsed as a variable ((--.->) is one example) then in order to export the type constructor then the user should be required to use the ExplicitNamespaces keyword. This was implemented in quite an indirect manner in the renamer. It is much more direct to enforce this in the parser at the expense of slighty worse error messages. Further to this, the check in the renamer was actually slightly wrong. If the variable was in scope then no error was raised, this was causing panics, see #12026 for an example. Reviewers: austin, bgamari Subscribers: davean, skvadrik, thomie Differential Revision: https://phabricator.haskell.org/D2181 GHC Trac Issues: #12026
* Remove trailing whitespace from 'testsuite/tests/module/all.T'Matthew Pickering2016-05-061-11/+11
| | | | [skip ci]
* Kill varSetElemsWellScoped in quantifyTyVarsBartosz Nitka2016-04-262-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | varSetElemsWellScoped introduces unnecessary non-determinism in inferred type signatures. Removing this instance required changing the representation of TcDepVars to use deterministic sets. This is the last occurence of varSetElemsWellScoped, allowing me to finally remove it. Test Plan: ./validate I will update the expected outputs when commiting, some reordering of type variables in types is expected. Reviewers: goldfire, simonpj, austin, bgamari Reviewed By: simonpj Subscribers: thomie, simonmar Differential Revision: https://phabricator.haskell.org/D2135 GHC Trac Issues: #4012
* Testsuite: fixup lots of testsThomas Miedema2016-04-263-6/+15
| | | | | | | | | These aren't run very often, because they require external libraries. https://ghc.haskell.org/trac/ghc/wiki/Building/RunningTests/Running#AdditionalPackages maessen-hashtab still doesn't compile, QuickCheck api changed. Update submodule hpc.
* Print which warning-flag controls an emitted warningMichael Walker2016-02-256-7/+8
| | | | | | | | | | | | | | | | | Both gcc and clang tell which warning flag a reported warning can be controlled with, this patch makes ghc do the same. More generally, this allows for annotated compiler output, where an optional annotation is displayed in brackets after the severity. This also adds a new flag `-f(no-)show-warning-groups` to control whether to show which warning-group (such as `-Wall` or `-Wcompat`) a warning belongs to. This flag is on by default. This implements #10752 Reviewed By: quchen, bgamari, hvr Differential Revision: https://phabricator.haskell.org/D1943
* Testsuite: delete empty files [skip ci]Thomas Miedema2016-02-252-0/+0
|
* Improve accuracy of suggestion to use TypeApplicationsMatthew Pickering2016-02-251-3/+1
| | | | | | | | | | | | | | | | The suggestion only makes sense when we try to use an as pattern in an expression context. It is misleading in the case of a lazy pattern and view pattern. Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1948
* Testsuite: delete Windows line endings [skip ci] (#11631)Thomas Miedema2016-02-239-43/+43
|