summaryrefslogtreecommitdiff
path: root/testsuite
Commit message (Collapse)AuthorAgeFilesLines
* Remove Simon's special number from typecheck/should_fail/all.twip/unexpected-testMatthew Pickering2019-02-161-1/+0
|
* Fix tests which were made to pass by "Make a smart mkAppTyM"Matthew Pickering2019-02-163-3/+3
| | | | | | | | | For some reason gitlab is not reporting these as failures in CI. It's not clear to me why as the junit output looks fine. Fixes #16112 and #16113 They were fixed by 682783828275cca5fd8bf5be5b52054c75e0e22c
* Fix and Reapply "Performance tests: recover a baseline from ancestor commits ↵David Eichmann2019-02-165-65/+277
| | | | and CI results."
* 'forall' always a keyword, plus the dot type operatorVladislav Zavialov2019-02-159-22/+28
|
* Fail fast in solveLocalEqualitiesSimon Peyton Jones2019-02-1422-441/+28
| | | | | | | | | | | | | | | | | | This patch makes us fail fast in TcSimplify.solveLocalEqualities, and in TcHsType.tc_hs_sig_type, if there are insoluble constraints. Previously we ploughed on even if there were insoluble constraints, leading to a cascade of hard-to-understand type errors. Failing eagerly is much better; hence a lot of testsuite error message changes. Eg if we have f :: [Maybe] -> blah f xs = e then trying typecheck 'f x = e' with an utterly bogus type is just asking for trouble. I can't quite remember what provoked me to make this change, but I think the error messages are notably improved, by removing confusing clutter and focusing on the real error.
* Make a smart mkAppTyMSimon Peyton Jones2019-02-141-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch finally delivers on Trac #15952. Specifically * Completely remove Note [The tcType invariant], along with its complicated consequences (IT1-IT6). * Replace Note [The well-kinded type invariant] with: Note [The Purely Kinded Type Invariant (PKTI)] * Instead, establish the (PKTI) in TcHsType.tcInferApps, by using a new function mkAppTyM when building a type application. See Note [mkAppTyM]. * As a result we can remove the delicate mkNakedXX functions entirely. Specifically, mkNakedCastTy retained lots of extremly delicate Refl coercions which just cluttered everything up, and(worse) were very vulnerable to being silently eliminated by (say) substTy. This led to a succession of bug reports. The result is noticeably simpler to explain, simpler to code, and Richard and I are much more confident that it is correct. It does not actually fix any bugs, but it brings us closer. E.g. I hoped it'd fix #15918 and #15799, but it doesn't quite do so. However, it makes it much easier to fix. I also did a raft of other minor refactorings: * Use tcTypeKind consistently in the type checker * Rename tcInstTyBinders to tcInvisibleTyBinders, and refactor it a bit * Refactor tcEqType, pickyEqType, tcEqTypeVis Simpler, probably more efficient. * Make zonkTcType zonk TcTyCons, at least if they have any free unification variables -- see zonk_tc_tycon in TcMType.zonkTcTypeMapper. Not zonking these TcTyCons was actually a bug before. * Simplify try_to_reduce_no_cache in TcFlatten (a lot) * Combine checkExpectedKind and checkExpectedKindX. And then combine the invisible-binder instantation code Much simpler now. * Fix a little bug in TcMType.skolemiseQuantifiedTyVar. I'm not sure how I came across this originally. * Fix a little bug in TyCoRep.isUnliftedRuntimeRep (the ASSERT was over-zealous). Again I'm not certain how I encountered this. * Add a missing solveLocalEqualities in TcHsType.tcHsPartialSigType. I came across this when trying to get level numbers right.
* Implement -Wredundant-record-wildcards and -Wunused-record-wildcardsMatthew Pickering2019-02-147-1/+93
| | | | | | | | | -Wredundant-record-wildcards warns when a .. pattern binds no variables. -Wunused-record-wildcards warns when none of the variables bound by a .. pattern are used. These flags are enabled by `-Wall`.
* Add perf test for #16190Sylvain Henry2019-02-143-0/+30
|
* Add `liftedTyped` to `Lift` classAlec Theriault2019-02-131-0/+7
| | | | | | | | Implements GHC proposal 43, adding a `liftTyped` method to the `Lift` typeclass. This also adds some documentation to `TExp`, describing typed splices and their advantages over their untyped counterparts. Resolves #14671.
* Fix #15849 by checking whether there's a do blocknineonine2019-02-125-4/+8
|
* Fix #16299 by deleting incorrect code from IfaceSynRyan Scott2019-02-121-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | GHCi's `:info` command was pretty-printing Haskell98-style data types with explicit return kinds if the return kind wasn't `Type`. This leads to bizarre output like this: ``` λ> :i (##) data (##) :: TYPE ('GHC.Types.TupleRep '[]) = (##) -- Defined in ‘GHC.Prim’ ``` Or, with unlifted newtypes: ``` λ> newtype T = MkT Int# λ> :i T newtype T :: TYPE 'IntRep = MkT Int# -- Defined at <interactive>:5:1 ``` The solution is simple: just delete one part from `IfaceSyn` where GHC mistakenly pretty-prints the return kinds for non-GADTs.
* Fix #16188Richard Eisenberg2019-02-1210-27/+222
| | | | | | | | | | | | | | There was an awful lot of zipping going on in canDecomposableTyConAppOK, and one of the lists being zipped was too short, causing the result to be too short. Easily fixed. Also fixes #16204 and #16225 test case: typecheck/should_compile/T16188 typecheck/should_compile/T16204[ab] typecheck/should_fail/T16204c typecheck/should_compile/T16225
* Fix #16293 by cleaning up Proxy# infelicitiesRyan Scott2019-02-124-0/+34
| | | | | | | | | | | | | | | | | | | | This bug fixes three problems related to `Proxy#`/`proxy#`: 1. Reifying it with TH claims that the `Proxy#` type constructor has two arguments, but that ought to be one for consistency with TH's treatment for other primitive type constructors like `(->)`. This was fixed by just returning the number of `tyConVisibleTyVars` instead of using `tyConArity` (which includes invisible arguments). 2. The role of `Proxy#`'s visible argument was hard-coded as nominal. Easily fixed by changing it to phantom. 3. The visibility of `proxy#`'s kind argument was specified, which is different from the `Proxy` constructor (which treats it as inferred). Some minor refactoring in `proxyHashId` fixed ths up. Along the way, I had to introduce a `mkSpecForAllTy` function, so I did some related Haddock cleanup in `Type`, where that function lives.
* testsuite: Report unexpected passes in junit outputMatthew Pickering2019-02-111-2/+5
|
* testsuite: Always skip T15897Ben Gamari2019-02-101-2/+2
| | | | See #16193.
* testsuite: Report stdout and stderr in JUnit outputBen Gamari2019-02-104-34/+69
| | | | | | | | | | This patch makes the JUnit output more useful as now we also report the stdout/stderr in the message which can be used to quickly identify why a test is failing without downloading the log. This also introduces TestResult, previously we were simply passing around tuples, making things the implementation rather difficult to follow and harder to extend.
* Capture and simplify constraints arising from running typed splicesMatthew Pickering2019-02-103-0/+29
| | | | | | | | | | | | | | | This fixes a regression caused by #15471 where splicing in a trivial program such as `[|| return () ||]` would fail as the dictionary for `return` would never get bound in the module containing the splice. Arguably this is symptomatic of a major problem affecting TTH where we serialise renamed asts and then retype check them. The reference to the dictionary should be fully determined at the quote site so that splicing doesn't have to solve any implicits at all. It's a coincidence this works due to coherence but see #15863 and #15865 for examples where things do go very wrong. Fixes #16195
* Stack: fix name mangling.Tamar Christina2019-02-093-0/+94
|
* Lexer: Alternate Layout Rule injects actual not virtual bracesAlan Zimmerman2019-02-084-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | When the alternate layout rule is activated via a pragma, it injects tokens for { and } to make sure that the source is parsed properly. But it injects ITocurly and ITccurly, rather than their virtual counterparts ITvocurly and ITvccurly. This causes problems for ghc-exactprint, which tries to print these. Likewise, any injected ITsemi should have a zero-width SrcSpan. Test case (the existing T13087.hs) {-# LANGUAGE AlternativeLayoutRule #-} {-# LANGUAGE LambdaCase #-} isOne :: Int -> Bool isOne = \case 1 -> True _ -> False main = return () Closes #16279
* API Annotations: parens anns discarded for `(*)` operatorAlan Zimmerman2019-02-084-1/+49
| | | | | | | | | | | | | | | The patch from https://phabricator.haskell.org/D4865 introduces go _ (HsParTy _ (dL->L l (HsStarTy _ isUni))) acc ann fix = do { warnStarBndr l ; let name = mkOccName tcClsName (if isUni then "★" else "*") ; return (cL l (Unqual name), acc, fix, ann) } which discards the parens annotations belonging to the HsParTy. Updates haddock submodule Closes #16265
* API Annotations: AnnAt disconnected for TYPEAPPAlan Zimmerman2019-02-086-2/+115
| | | | | | | | | | | | For the code type family F1 (a :: k) (f :: k -> Type) :: Type where F1 @Peano a f = T @Peano f a the API annotation for the first @ is not attached to a SourceSpan in the ParsedSource Closes #16236
* API Annotations: more explicit foralls fixupAlan Zimmerman2019-02-084-1/+95
| | | | | | | The AnnForall annotations introduced via Phab:D4894 are not always attached to the correct SourceSpan. Closes #16230
* Fix test for T16180 on Darwin (fix #16128)Sylvain Henry2019-02-082-12/+11
|
* Fix #14729 by making the normaliser homogeneousRichard Eisenberg2019-02-088-0/+91
| | | | | | | | | | | | | | | | This ports the fix to #12919 to the normaliser. (#12919 was about the flattener.) Because the fix is involved, this is done by moving the critical piece of code to Coercion, and then calling this from both the flattener and the normaliser. The key bit is: simplifying type families in a type is always a *homogeneous* operation. See #12919 for a discussion of why this is the Right Way to simplify type families. Also fixes #15549. test case: dependent/should_compile/T14729{,kind} typecheck/should_compile/T15549[ab]
* testsuite: Mark T5515 as broken with debugged compilerBen Gamari2019-02-071-1/+1
| | | | As noted in #16251.
* testsuite: Mark T14740 and tcfail159 as broken in debugged compilerBen Gamari2019-02-072-2/+2
| | | | As noted in #16113, these trigger an assertion in isUnliftedRuntimeRep.
* testsuite: Mark recomp007 as broken in debugged compilerBen Gamari2019-02-071-3/+4
| | | | As noted in #14759, this triggers a warning in ListSetOps.
* testsuite: Mark T11334b as broken in debugged compilerBen Gamari2019-02-071-1/+1
| | | | As noted in #16112.
* Fix #16287 by checking for more unsaturated synonym argumentsRyan Scott2019-02-063-0/+23
| | | | | | | | | | | | | Trac #16287 shows that we were checking for unsaturated type synonym arguments (in `:kind`) when the argument was to a type synonym, but _not_ when the argument was to some other form of type constructor, such as a data type. The solution is to use the machinery that rejects unsaturated type synonym arguments (previously confined to `check_syn_tc_app`) to `check_arg_type`, which checks these other forms of arguments. While I was in town, I cleaned up `check_syn_tc_app` a bit to only invoke `check_arg_type` so as to minimize the number of different code paths that that function could go down.
* Fix #14579 by defining tyConAppNeedsKindSig, and using itRyan Scott2019-02-055-35/+79
|
* Add `-fplugin-trustworthy` to avoid marking modules as unsafeZejun Wu2019-02-046-0/+34
| | | | | | | | By default, when a module is compiled with plugins, it will be marked as unsafe. With this flag passed, all plugins are treated as trustworthy and the safety inference will no longer be affected. This fixes Trac #16260.
* testsuite: Mark print037 as broken when GHC is built with LLVMBen Gamari2019-02-042-1/+13
| | | | As noted in #16205 this configuration reliably segfaults.
* testsuite: Use makefile_test for T16212Ben Gamari2019-02-041-1/+1
|
* testsuite: Skip T15897 in unregisterised wayBen Gamari2019-02-041-1/+4
| | | | | | | As noted in #16227 this test routinely times out when run in the unregisterised way. See also #15467.
* Report multiple errorsVladislav Zavialov2019-02-033-0/+68
|
* Reject oversaturated VKAs in type family equationsRyan Scott2019-02-016-1/+38
|
* Remove ExnStr and ThrowsExn businessSebastian Graf2019-02-015-6/+23
|
* Fix #16219: TemplateHaskell causes indefinite package build errorEdward Z. Yang2019-01-319-0/+133
| | | | | | | | | | | | | | | | | | | | | | | | It should work to write an indefinite package using TemplateHaskell, so long as all of the actual TH code lives outside of the package. However, cleverness we had to build TH code even when building with -fno-code meant that we attempted to build object code for modules in an indefinite package, even when the signatures were not instantiated. This patch disables said logic in the event that an indefinite package is being typechecked. Signed-off-by: Edward Z. Yang <ezyang@fb.com> Test Plan: validate Reviewers: simonpj, bgamari Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #16219 Differential Revision: https://phabricator.haskell.org/D5475
* Revert "Performance tests: recover a baseline from ancestor commits and CI ↵Ben Gamari2019-01-315-259/+62
| | | | | | | | | results." Unfortunately this has broken all future commits due to spurious(?) performance changes which I have been unable to work around. This reverts commit cc2261d42f6a954d88e355aaad41f001f65c95da.
* testsuite: Add test for #14828Ben Gamari2019-01-312-0/+19
|
* Add -fdefer-diagnostics to defer and group diagnostic messages in make-modeZejun Wu2019-01-317-0/+54
| | | | | | | | | | | | | When loading many modules in parallel there can a lot of warnings and errors get mixed up with regular output. When the compilation fails, the relevant error message can be thousands of lines backward and is hard to find. When the compilation successes, warning message is likely to be ignored as it is not seen. We can address this by deferring the warning and error message after the compilation. We also put errors after warnings so it is more visible. This idea was originally proposed by Bartosz Nitka in https://phabricator.haskell.org/D4219.
* Use ByteString to represent Cmm string literals (#16198)Sylvain Henry2019-01-311-1/+1
| | | | Also used ByteString in some other relevant places
* Allocate bss section within proper range of other sectionsZejun Wu2019-01-305-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This re-applies {D5195} and {D5235}, they were reverted as part of diff stack to unbreak i386. The proper fix is done in {D5289}. Allocate bss section within proper range of other sections: * when `+RTS -xp` is passed, allocate it contiguously as we did for jump islands * when we mmap the code to lower 2Gb, we should allocate bss section there too Test Plan: 1. `./validate` 2. with ``` DYNAMIC_GHC_PROGRAMS = NO DYNAMIC_BY_DEFAULT = NO ``` `TEST="T15729" make test` passed in both linux (both i386 and x86_64) and macos. 3. Also test in a use case where we used to encouter error like: ``` ghc-iserv-prof: R_X86_64_PC32 relocation out of range: (noname) = b90282ba ``` and now, everything works fine. Reviewers: simonmar, bgamari, angerman, erikd Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15729 Differential Revision: https://phabricator.haskell.org/D5290
* API Annotations: Parens not attached correctly for ClassDeclAlan Zimmerman2019-01-304-18/+34
| | | | | | | | | | | The parens around the kinded tyvars should be attached to the class declaration as a whole, they are attached to the tyvar instead, outside the span. An annotation must always be within or after the span it is contained in. Closes #16212
* Performance tests: recover a baseline from ancestor commits and CI results.David Eichmann2019-01-305-62/+259
| | | | gitlab-ci: push performance metrics as git notes to the "GHC Performance Notes" repository.
* testsuite: Use makefile_testBen Gamari2019-01-30152-783/+612
| | | | | This eliminates most uses of run_command in the testsuite in favor of the more structured makefile_test.
* testsuite: Introduce makefile_testBen Gamari2019-01-302-1/+8
|
* Revert "Batch merge"Ben Gamari2019-01-30163-941/+862
| | | | This reverts commit 76c8fd674435a652c75a96c85abbf26f1f221876.
* Batch mergeBen Gamari2019-01-30163-862/+941
|
* Fix #12509: ghci -XSafe fails in an inscrutable wayRoland Senn2019-01-282-0/+1
|