| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Consider the type
forall k. b -> k
where
b :: k -> Type
Here the 'k' in b's kind must be a different 'k' to the forall k,
because 'b' is free in the expression. So we must return 'k'
among the free vars returned from tyCoVarsOfType applied that
type. But we weren't.
This is an outright bug, although we don't have a program that
fails because of it.
It's easy to fix, too: see TyCoRep
Note [Closing over free variable kinds]
This fix has been in the pipeline for ages because it fell into
the Trac #14880 swamp. But this patch nails it.
|
|
|
|
|
|
|
|
|
| |
Fixing the way that we close-over-kinds when taking the
free vars of a type revealed that the way we generalise
type constructors was a bit wrong.
This fixes it. See TcTyClDecls
Note [Generalisation for type constructors]
|
|
|
|
|
|
|
|
|
|
|
| |
As Trac #15765 says, Once upon a time, the extract functions
at the bottom of RnTypes were pure. Then, along came -XTypeInType,
which needed to do a check in these functions for users mixing
type variables with kind variables.
Now, however, with -XTypeInType gone again, we no longer
do this check. Thus, there is no reason to keep these
functions monadic.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Update details for `ForAllTy` and `ForAllCo` in core-spec, as they
can now quantify over coercion variables.
Test Plan: Please read core-spec.pdf
Reviewers: goldfire, simonpj, bgamari
Reviewed By: goldfire
Subscribers: rwbarton, carter
GHC Trac Issues: #15497, #15589
Differential Revision: https://phabricator.haskell.org/D5247
|
| |
|
| |
|
|
|
|
| |
An attempt to help with Trac #15800
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes Trac #15778 by removing a zonkTcTyVarToTyVar
from tcHsSigType.
Nww that a pattern-bound type variable can refer to a type, it's
obvoiusly wrong to expect it to be a TyVar! Moreover, that zonk
is entirely unnecessary.
I added a new Note [Type variables in the type environment]
in TcRnTypes
|
|
|
|
| |
This just improves docmentation for the fix to Trac #15300
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change some URLs from hackage.haskell.org/trac to ghc.haskell.org/trac
Test Plan: manually verify links work
Reviewers: bgamari, simonmar, mpickering
Reviewed By: bgamari, mpickering
Subscribers: mpickering, rwbarton, carter
GHC Trac Issues: #15733
Differential Revision: https://phabricator.haskell.org/D5257
|
|
|
|
|
|
|
| |
In TcSimplify.neededEvVars, in add_implic_seeds we were
deleting the 'givens'; but they are already deleted, so
this is a no-op. This patch just remove the redundant
delete.
|
| |
|
|
|
|
| |
This is a debug-only change
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We suppress some Given errors; see Note [Given errors]
in TcErrors. But we must be careful not to suppress
Wanted errors because of the presence of these Given
errors -- else we might allow compilation to bogusly
proceed
The rubber hits the road in TcRnTypes.insolubleCt,
where we don't want to treat Givens as insoluble,
nor (and this is the new bit) Deriveds that arise
from Givens. See Note [Given insolubles] in TcRnTypes.
This fixes #15767.
|
|
|
|
|
|
|
|
|
|
| |
A debug-print was trying to print the coercion returned
by the flattener. But that coercion can be undefined
in the case of Derived constraints. Because we might
rewrite it with [D] a ~ ty, and there is no evidence
for that.
Solution: don't attempt to print the coercion.
|
|
|
|
|
|
|
|
| |
Trac #15694 showed that we were forgetting to solve
the equalities of a pattern signature until too late.
Result: WARNINGs and a panic:
"Type-correct unfilled coercion hole"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Trac #15648 showed that GHC was a bit confused about the
difference between the types for
* Predicates
* Coercions
* Evidence (in the typechecker constraint solver)
This patch cleans it up. See especially Type.hs
Note [Types for coercions, predicates, and evidence]
Particular changes
* Coercion types (a ~# b) and (a ~#R b) are not predicate types
(so isPredTy reports False for them) and are not implicitly
instantiated by the type checker. This is a real change, but
it consistently reflects that fact that (~#) and (~R#) really
are different from predicates.
* isCoercionType is renamed to isCoVarType
* During type inference, simplifyInfer, we do /not/ want to infer
a constraint (a ~# b), because that is no longer a predicate type.
So we 'lift' it to (a ~ b). See TcType
Note [Lift equality constaints when quantifying]
* During type inference for pattern synonyms, we need to 'lift'
provided constraints of type (a ~# b) to (a ~ b). See
Note [Equality evidence in pattern synonyms] in PatSyn
* But what about (forall a. Eq a => a ~# b)? Is that a
predicate type? No -- it does not have kind Constraint.
Is it an evidence type? Perhaps, but awkwardly so.
In the end I decided NOT to make it an evidence type,
and to ensure the the type inference engine never
meets it. This made me /simplify/ the code in
TcCanonical.makeSuperClasses; see TcCanonical
Note [Equality superclasses in quantified constraints]
Instead I moved the special treatment for primitive
equality to TcInteract.doTopReactOther. See TcInteract
Note [Looking up primitive equalities in quantified constraints]
Also see Note [Evidence for quantified constraints] in Type.
All this means I can have
isEvVarType ty = isCoVarType ty || isPredTy ty
which is nice.
All in all, rather a lot of work for a small refactoring,
but I think it's a real improvement.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch makes a number of improvements to the output
generated by -ddump-types
* Prints data constructor separately
* Omits empty chunks of output
I was driven initially by the unhelpful existing output for
data constructors, but ended up doing some refactoring.
Lots of error message wibbles, but nothing significant.
Certainly no change in user behaviour.
(NB: It is just possible that I have failed to cleanly
separate this patch from the next one, about
isPredTy and friends.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The `reifyType` function in `TcSplice` is carefully designed
to avoid reifying visible arguments to `TyConApp`s. However, the same
care was not given towards the `AppTy` case, which lead to #15792.
This patch changes to the `AppTy` case of `reifyType` so that it
consults the kind of the function type to determine which of the
argument types are invisible (and therefore should be dropped) during
reification. This required crafting a variant of `tyConArgFlags`,
which I dubbed `appTyArgFlags`, that accept an arbitrary function
`Type` instead of a `TyCon`.
Test Plan: make test TEST=T15792
Reviewers: goldfire, bgamari, simonpj
Reviewed By: simonpj
Subscribers: simonpj, rwbarton, carter
GHC Trac Issues: #15792
Differential Revision: https://phabricator.haskell.org/D5252
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
When renaming untyped TH quotes, some care is taken to
ensure that uses of top-level names in quotes do not have their
bindings discarded during desugaring. The same care was not applied
to typed TH quotes, so this patch brings the two into sync.
Test Plan: make test TEST=T15783
Reviewers: bgamari, mpickering
Reviewed By: mpickering
Subscribers: mpickering, rwbarton, carter
GHC Trac Issues: #15783
Differential Revision: https://phabricator.haskell.org/D5248
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This is a follow-up to D5173, which permitted
unparenthesized kind signatures in certain places. One place that
appeared to be overlooked was the right-hand sides of type synonyms,
which this patch addresses by introducing a `ktypedoc` parser
production (which is to `ctypdoc` as `ktype` is to `ctype`) and
using it in the right place.
Test Plan: make test TEST="KindSigs T15781"
Reviewers: harpocrates, bgamari
Reviewed By: harpocrates
Subscribers: rwbarton, mpickering, carter
GHC Trac Issues: #15781
Differential Revision: https://phabricator.haskell.org/D5245
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
In ALR, 'ITlcase' should expect an opening curly. This is probably a forgotten
edge case in ALR, since `maybe_layout` (which handles the non-ALR layout)
already deals with the 'ITlcase' token properly.
Test Plan: make TEST=T10453 && make TEST=T13087
Reviewers: bgamari, RyanGlScott
Reviewed By: RyanGlScott
Subscribers: RyanGlScott, rwbarton, carter
GHC Trac Issues: #10453, #13087
Differential Revision: https://phabricator.haskell.org/D5236
|
| |
|
|\
| |
| |
| |
| |
| | |
git-subtree-dir: hadrian
git-subtree-mainline: 575b35f4cdc18045bccd42d341d6f25d95c0696c
git-subtree-split: 45f3bff7016a2a0cd9a5455a882ced984655e90b
|
| | |
|
| | |
|
| |\
| | |
| | | |
update GHC versions used on travis
|
| |/
| |
| | |
I saw that (nightly) travis builds are failing because we now only support 8.4 or higher to boot a GHC HEAD build. I don't know how to achieve this for the OS X section though.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* honour the flavours advertised by our flavours.md document
In particular, this patches focuses on enabling back the dynamic-enabled ways
for the runtime system, which required to fix a bug in libsuf.
* address some feedback
* make dynamicGhcPrograms :: Action Bool to implement the default logic faithfully
* remove redundant windows check
|
| | |
|
| |
| |
| |
| | |
As discussed in #550, we can remove some unnecessary occurrences of `newCache`.
|
| |
| |
| |
| |
| | |
The current implementation of parsing Cabal data is a big mess, which affects performance as described in #671 and #550. In this PR we simplify the implementation and avoid unnecessary reparsing.
As a result, the zero build time is reduced from 30 seconds to 5 seconds on my machine. The full build time seems to have been improved as well, since now all CI bots complete within the time limit. On the other hand, the speed up of the full build with `-j` on my machine does not appear to be significant.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* unlit: build only in stage0, copy that binary for later stages (fixes #595)
* add missing condition
We only want this "optimisation" for unlit.
* compare 'Package's instead of strings
* same optimisation for touchy
|
| | |
|
| | |
|
| |
| |
| |
| | |
ways (#687)
|
| |
| |
| |
| |
| |
| | |
* set integer-gmp flag when appropriate, when building the compiler lib
* address Andrey's feedback
|
| |
| |
| | |
See #681
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
* .travis.yml: update OS X script to test a GHC patch for #614
* circle.yml: update script to test GHC patch for #614
|
| |
| |
| |
| |
| | |
(#677)
This fixes all the failing ghc-compact tests (quite likely all of them, since they presumably all need the library), and also removes some leftover from the previous PR #676.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(#676)
* Work around the "can't use natural in base" problem on a per-flavour basis
The only flavours that need the workaround are the ones that build
GHC/{Natural, Num}.hs with -O0, namely 'quick', 'quickest' and 'prof'.
This patches defines the necessary arguments in one place and uses them
in all the aforementionned flavour definitions.
This will allow us to have both quick/quickest/prof builds that come through
as well as an efficient compiler when we want it (with e.g perf), which wasn't
the case before my series of patches for this problem.
* address @snowleopard's feedback
|
| | |
|
| | |
|
| |
| |
| |
| | |
The driver was invoked with invalid syntax for some arguments, we were not
making sure hsc2hs is built before we run the tests (it's needed by many), etc.
|