summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Error message wibbles from out-of-scope changesSimon Peyton Jones2015-06-2679-809/+820
| | | | | | The patch "Treat out-of-scope variables as holes" makes lots of error messages change a bit. This patch has all the change.
* Treat out-of-scope variables as holesSimon Peyton Jones2015-06-2613-196/+314
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements the idea in Trac #10569. * An out-of-scope variable is treated as a typed expression hole. * That is, we don't report it in the type checker, not the renamer, and we when we do report it, we give its type. * Moreover, we can defer the error to runtime with -fdefer-typed-holes In implementation terms: * The renamer turns an unbound variable into a HsUnboundVar * The type checker emits a Hole constraint for a HsUnboundVar, and turns it back into a HsVar It was a bit painful to implement because a whole raft of error messages change slightly. But there was absolutely nothing hard in principle. Holes are reported with a bunch of possibly-useful context, notably the "relevant bindings". I found that this was distracting clutter in the very common case of a mis-typed variable that is only accidentally not in scope, so I've arranged to print the context information only for true holes, that is ones starting with an underscore. Unbound data constructors use in patterns, like f (D x) = x are still reportd by the renamer, and abort compilation before type checking.
* Get rid of irrelevant impredicative polymoprhismSimon Peyton Jones2015-06-264-5/+5
| | | | These tests aren't about impredicativity
* Get rid of irrlevant result type signatureSimon Peyton Jones2015-06-261-1/+1
| | | | | Result type-sigs are now illegal, but that's not what this test is about
* Add module header to testSimon Peyton Jones2015-06-261-0/+1
| | | | ..to avoid irrelevant 'main is not defined' error message
* Don't float out alpha[sig] ~ IntSimon Peyton Jones2015-06-261-16/+29
| | | | | This is just a small twiddle to TcSimplify.usefulToFloat See Note [Which equalities to float].
* Fix addDataConStrictnessSimon Peyton Jones2015-06-261-11/+14
| | | | | | | | | | | | See Note [Add demands for strict constructors]. The new bit is the test for isAbsDmd in addDataConStrictness. There was a cryptic note that said that this function should add a seqDmd even for Absent arguments, but that is definitely a bad thing (as the Note now says), causing unused arguments to be passed to the worker. Easy fix!
* Minor fix to free-vars in RnTypesSimon Peyton Jones2015-06-261-2/+6
| | | | | A type wild-card should't appear in the "uses" free-variable set.
* Allow recursive unwrapping of data familiesSimon Peyton Jones2015-06-264-43/+68
| | | | | | | | | | | | | | | | | When doing strictness analysis, we need to look inside products. To avoid unpacking infinitely, we must be careful about infinite types. That in turn is controlled by TyCon.checkRecTc. For data families like data instance T (a,b) = MkT a (T b) we want to unpack the thing recursively for types like T (Int, (Int, (Int, Int))) This patch elaborates the checkRecTc mechanism in TyCon, to maintain a *count* of how many times a TyCon has shown up, rather than just a boolean. A simple change, and a useful one. Fixes Trac #10482.
* Use a Representaional coercion for data familiesSimon Peyton Jones2015-06-2612-40/+69
| | | | | | | | | | | | | | | | When we have data instance T (a,b) = MkT a b we make a represntation type data TPair a b = MkT a b plus an axiom to connect the two ax a b :: T (a,b) ~R TPair a b Previously this was a Nominal equality, and that worked ok but seems illogical since Nominal equalities are between types that the programmer thinks of as being equal. But TPair is not visible to the programmer; indeed we call it the "representation TyCon". So a Representational equality seems more suitable here.
* Improve pretty-printing for CoPatSimon Peyton Jones2015-06-261-3/+12
|
* White space onlySimon Peyton Jones2015-06-261-1/+1
|
* Comments onlyReid Barton2015-06-251-0/+4
|
* Be aware of overlapping global STG registers in CmmSink (#10521)Reid Barton2015-06-2511-27/+118
| | | | | | | | | | | | | | | | | | | Summary: On x86_64, commit e2f6bbd3a27685bc667655fdb093734cb565b4cf assigned the STG registers F1 and D1 the same hardware register (xmm1), and the same for the registers F2 and D2, etc. When mixing calls to functions involving Float#s and Double#s, this can cause wrong Cmm optimizations that assume the F1 and D1 registers are independent. Reviewers: simonpj, austin Reviewed By: austin Subscribers: simonpj, thomie, bgamari Differential Revision: https://phabricator.haskell.org/D993 GHC Trac Issues: #10521
* Test Trac #10562Simon Peyton Jones2015-06-252-0/+15
|
* Improve kind-checking for 'deriving' clausesSimon Peyton Jones2015-06-257-27/+63
| | | | | | | The main payload is in 'mk_functor_like_constraints' in TcDeriv.inferConstraints. This is moving towards a fix for Trac #10561
* driver: pass '-fPIC' option to all CC invocationsSergei Trofimovich2015-06-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by mitchty: When porting ghc to alpine linux (rumors say they build all binaries as Position Independent Executables to leverage global ASLR) linker issued obscure errors: Tiny example: $ echo 'main = print "hello"' > a.hs $ ghc -fforce-recomp a.hs -fPIC -dynamic -optl-pie -o a ld: /tmp/ghc2142_0/ghc2142_5.o: relocation R_X86_64_32 against `ZCMain_main_closure' can not be used when making a shared object; recompile with -fPIC /tmp/ghc2142_0/ghc2142_5.o: error adding symbols: Bad value collect2: error: ld returned 1 exit status There is two entry points in CC driver: 'runPhase' (CC) and 'mkExtraObj' 'mkExtraObj' does not handle most of 'runPhase's complexity. Ideally it should. This patch only adds -fPIC propagation to 'mkExtraObj'. Please merge to stable branch. Signed-off-by: Sergei Trofimovich <siarheit@google.com>
* Clean outdated ext-core references in comments.Sergei Trofimovich2015-06-242-2/+1
| | | | Signed-off-by: Sergei Trofimovich <siarheit@google.com>
* Drop prefix from package keys.Edward Z. Yang2015-06-2410-18/+33
| | | | | | | | | | | | | | | | | | | | | Summary: Contains Cabal submodule update, as Cabal is responsible generating package keys. We also have to update some output. Also comes with a documentation update for ghc-pkg in the user manual for --package-key. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, austin Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1011 GHC Trac Issues: #10550
* Build system: delete unused variables in config.mk.inThomas Miedema2015-06-241-14/+0
| | | | | GhcStage1DefaultNewCodegen, GhcStage2DefaultNewCodegen, GhcStage3DefaultNewCodegen and GhcCompilerWays are not used anywhere.
* Make $1 in $1_$2_$3_FOO actually be directory.Edward Z. Yang2015-06-234-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, we used $1_$2_PACKAGE_KEY to parametrize $1. But the documentation says that $1 should be the directory... and we're now putting the libraries in $1_$2_LIB_NAME. So use /that/. This is just alpha-renaming, so as long as we're consistent, there's no material difference.) I also fixed a bug of a package ID calculation which I missed first time around, which was tickled by this change. BTW, this means DEP_KEYS and TRANSITIVE_DEP_KEYS are unused, so remove them from ghc-cabal. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: austin Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1010
* powerpc: add basic support for PLT relocations (#10402)Sergei Trofimovich2015-06-231-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit a93ab43ab5f40cadbedea2f6342b93c245e91434 enabled support for proper PIC relocations from assembler. Commit adds support for relocations of type: R_PPC_REL16_HI R_PPC_REL16_HA R_PPC_REL16_LO R_PPC_PLTREL24 They are used only when GHC is built in DYNAMIC_GHC_PROGRAMS = NO mode. Verified by running the following test: // cat a.c #include <stdio.h> void ffi_a_hello (int i) { fprintf (stderr, "WEEEEEEEE: i=%d\n", i); } -- cat A.hs {-# LANGUAGE ForeignFunctionInterface #-} module A where import Foreign.C foreign import ccall "ffi_a_hello" a :: CInt -> IO () # ghc -fPIC -c a.c -fforce-recomp # ghc -fPIC -c A.hs -fforce-recomp # ghc --interactive ./a.o A ... *A> a 42 WEEEEEEEE: i=42 See gory details in Trac #10402. Signed-off-by: Colin Watson <cjwatson@debian.org> Signed-off-by: Sergei Trofimovich <siarheit@google.com> Reviewed By: bgamari, austin Differential Revision: https://phabricator.haskell.org/D996 GHC Trac Issues: #10402
* Further elaborate Trac #10403 testSimon Peyton Jones2015-06-232-38/+44
| | | | Adding app1, app2, as requested in the ticket
* Rename $1_$2_$3_LIB_NAME to LIB_FILE.Edward Z. Yang2015-06-223-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: When we introduced user-friendly library names (e.g. unix-2.7.1.0-G4Yo1pNtYrk8nCq1cx8P9d instead of unix_G4Yo1pNtYrk8nCq1cx8P9d) we added a new variable to be written out by ghc-cabal, $1_$2_LIB_NAME. What I didn't realize at the time was that this conflicts with an existing variable in the build system, $1_$2_$3_LIB_NAME, which (confusingly) refers to something like 'libHSunix-2.7.1.0-G4Yo1pNtYrk8nCq1cx8P9d.so'. This is pretty confusing (despite never conflicting), so I renamed this variable to LIB_FILE for enhanced greppability. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: austin Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1002
* Fix #10551 by using LIB_NAMES.Edward Z. Yang2015-06-222-6/+1
| | | | | | | | | | | | | | | | | | Summary: (NB: this code is dead at the moment since Windows is not built dynamically.) Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: none Reviewers: austin Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1001 GHC Trac Issues: #10551
* Use -package-id to specify libraries on command line.Edward Z. Yang2015-06-222-12/+12
| | | | | | | | | | | | | | | | Summary: There's not really any good reason to use -package-key over -package-id, so use the latter as standard practice. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: austin Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1000
* Check KnownSymbol => Typeable deductionGabor Greif2015-06-221-2/+4
| | | | verifying fix for #10348
* Documentation: add section on .haskeline file (#2531)Thomas Miedema2015-06-221-1/+20
|
* Add parsePattern parser entry pointAlan Zimmerman2015-06-211-1/+3
| | | | | | | | | | | | Reviewers: austin, thomie, alanz Reviewed By: thomie, alanz Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1005 GHC Trac Issues: #10556
* Change `Typeable` instance for type-lis to use the Known* classes.Iavor S. Diatchki2015-06-218-31/+72
| | | | This should fix T10348
* Build system: unset HADDOCK when haddock is not foundThomas Miedema2015-06-211-2/+2
| | | | | | | | | | This prevents the following test errors on Windows: perf/haddock haddock.Cabal [[Errno 2] No such file or directory: ... perf/haddock haddock.base [[Errno 2] No such file or directory: ... perf/haddock haddock.compiler [[Errno 2] No such file or directory: ... The tests will now be reported as having missing libraries.
* Remove duplicate test.Edward Z. Yang2015-06-202-8/+0
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Fix all.T for T8131/T8131b.Edward Z. Yang2015-06-201-1/+2
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Filter orphan rules based on imports, fixes #10294 and #10420.Edward Z. Yang2015-06-2032-177/+351
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: If we have an orphan rule in our database, don't apply it unless the defining module is transitively imported by the module we are processing. We do this by defining a new RuleEnv data type which includes both the RuleBase as well as the set of visible orphan modules, and threading this through the relevant environments (CoreReader, RuleCheckEnv and ScEnv). This is analogous to the instances fix we applied in #2182 4c834fdddf4d44d12039da4d6a2c63a660975b95, but done for RULES. An important knock-on effect is that we can remove some buggy code in LoadInterface which tried to avoid loading interfaces that were loaded by plugins (which sometimes caused instances and rules to NEVER become visible). One note about tests: I renamed the old plugins07 test to T10420 and replaced plugins07 with a test to ensure that a plugin import did not cause new rules to be loaded in. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, austin, goldfire Subscribers: bgamari, thomie Differential Revision: https://phabricator.haskell.org/D950 GHC Trac Issues: #10420
* Make GHC install libraries to e.g. xhtml-3000.2.1-0ACfOp3hebWD9jGWE4v4Gh.Edward Z. Yang2015-06-206-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, we'd install them to something like xhtml_0ACfOp3hebWD9jGWE4v4G which was fairly ugly; this commit changes the default install path to contain the full package name and version, as well as the package key. Needs a Cabal submodule update for the commit for install paths support "Add libname install-dirs variable, use it by default. Fixes #2437". It also contains some miscellaneous fixes for Cabal HEAD. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: austin Subscribers: bgamari, thomie Trac Issues: #10479 Differential Revision: https://phabricator.haskell.org/D922
* Updated output for test ghci024Sergei Trofimovich2015-06-201-1/+2
| | | | Signed-off-by: Sergei Trofimovich <siarheit@google.com>
* Recognise 'hardhloat' as a valid vendor in a host tupleSergei Trofimovich2015-06-201-0/+3
| | | | | | | | Observed on a tuple armv7a-hardfloat-linux-gnueabi: > Unknown vendor hardfloat Reported-by: Sergey Alirzaev Signed-off-by: Sergei Trofimovich <siarheit@google.com>
* Fix a couple of tests for GHCi/-O* (Trac #10052)Sergei Trofimovich2015-06-204-3/+7
| | | | | | | Tests use unboxed types (or optimizer gets to them), those can't be handled by ghci. Fixed by using -fobject-code. Signed-off-by: Sergei Trofimovich <siarheit@google.com>
* Amend tcrun037 after Trac #7854 fixSergei Trofimovich2015-06-201-1/+1
| | | | Signed-off-by: Sergei Trofimovich <siarheit@google.com>
* Amend tcrun024, tcrun025 after Trac #7854 fixSergei Trofimovich2015-06-202-2/+2
| | | | Signed-off-by: Sergei Trofimovich <siarheit@google.com>
* should_run/allocLimit4: disable ghci waySergei Trofimovich2015-06-192-2/+5
| | | | | | | Test sets allocation limit for a current main thread, ghci already loaded a bunch of stuff in it. Signed-off-by: Sergei Trofimovich <siarheit@google.com>
* docs: Unbreak the PS/PDF builds for the User's Guide (#10509)Gabor Pali2015-06-191-1/+1
| | | | | | | | | dblatex can only translate the Unicode glyphs introduced in #10509 for LaTeX if the `latex.unicode.use=1` flag is set, otherwise it will just fail. However, note that adding this flag is not going to fully solve the problem as those symbols are not known by LaTeX, so the corresponding character codes will be added instead to the resulting PS/PDF files. Hence it is considered an interim solution only, not a true fix, until a better one is found.
* testsuite: mark T4945 as expect_brokenAustin Seipp2015-06-191-1/+1
| | | | | | | | | | This was working, and then it started failing again; it's a pretty fragile test anyway because it 'grep's the output of the compiler. In the mean time, make the CI system quiet down by marking it appropriately. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Spelling in commentsGabor Greif2015-06-192-2/+2
|
* Elaborate test for Trac #10403Simon Peyton Jones2015-06-182-21/+42
|
* Test Trac #10503Simon Peyton Jones2015-06-183-0/+26
|
* Parser: commas_tup_tail duplicate SrcSpan on "Missing" valueAlan Zimmerman2015-06-183-14/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Parsing {-# LANGUAGE TupleSections #-} baz = (1, "hello", 6.5,,) 'a' (Just ()) Results in the following AST fragment (L tests/examples/Tuple.hs:3:7-25 (ExplicitTuple [ L tests/examples/Tuple.hs:3:8 (Present (L tests/examples/Tuple.hs:3:8 (HsOverLit (OverLit (HsIntegral [ '1' ] 1) PlaceHolder (HsLit (HsString [] {abstract:FastString})) PlaceHolder)))) , L tests/examples/Tuple.hs:3:11-17 (Present (L tests/examples/Tuple.hs:3:11-17 (HsLit (HsString [ '"' , 'h' , 'e' , 'l' , 'l' , 'o' , '"' ] {abstract:FastString})))) , L tests/examples/Tuple.hs:3:20-22 (Present (L tests/examples/Tuple.hs:3:20-22 (HsOverLit (OverLit (HsFractional (FL [ '6' , '.' , '5' ] (:% 13 2))) PlaceHolder (HsLit (HsString [] {abstract:FastString})) PlaceHolder)))) , L tests/examples/Tuple.hs:3:24 (Missing PlaceHolder) , L tests/examples/Tuple.hs:3:24 (Missing PlaceHolder) ] The final `Missing PlaceHolder` has a duplicated `SrcSpan` Test Plan: ./validate Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: thomie, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D995 GHC Trac Issues: #10537
* Trac #4945 is working againSimon Peyton Jones2015-06-181-1/+1
| | | | | | | This test greps in the ouput of -ddump-simpl, so it's fragile. It stopped working for a while, but now works again. I don't know why, but I don't have time to investigate, so I'll just mark it as ok.
* Refactor filterAlts into two partsSimon Peyton Jones2015-06-182-176/+177
| | | | | | | | This splits filterAlts into two: - filterAlts - refineDefaultAlt No change in functionality
* Comments plus tiny refactoringSimon Peyton Jones2015-06-181-2/+6
|