| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
This is needed to give meaningful error messages (instead of internal
panics) when a program tries to lift a pattern synonym into a kind.
(fixes T9161)
|
|
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
|
|
|
|
|
|
|
| |
Fixes Trac #9196. Thanks to archblob for an initial stab at this.
In the end I fixed it in the kind checker rather than the subsequent
validity check, (a) so that the error messages look more uniform,
and (b) so that I did not need to meddle with isPredTy.
|
| |
|
|
|
|
|
|
|
| |
The issue here is avoiding a GHC crash when a program uses
unsafeCoerce is a dangerous (or even outright-wrong) way.
See Trac #9208
|
|
|
|
|
|
|
|
|
|
| |
This covers things like
Eq a => blah and (?x::Int) => blah
where there is just one predicate. Previously we used an ad-hoc
test to decide whether to parenthesise it, but acutally there is
a much simpler solution: just use the existing precedence mechamism.
This applies both to Type and HsType.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was pretty obscure. elemLocalRdrEnv was utterly wrong (replied
False when it should reply True) when given an Exact Name. That
doesn't happen often, but it does happen in the result of a TH splice.
The result was that an associated type didn't get a type variable that
lined up with its parent class (elemLocalRdrEnv is used in
RnTypes.bindHsTyVars), and that messed up the singletons package.
I've made a completely different test case to show up the bug:
indexed_types/should_fail/T9160
I also refactored RdrName.LocalRdrEnv to be a record with named
fields, which makes the code more robust and easy to understand.
|
|
|
|
| |
This bug was causing Trac #9199
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch has three main bits:
* The most substantial change is that IfaceConDecl no longer
records its universal type variables, because they are
always the same as those of the parent TyCon. A bit less
fuss and clutter.
* Add a synonym for IfTopBndr = OccName, and explain why it's an
OccName not a FastString
* Make the ifMinDef field be a (BooleanFormula IfLclName) rather
than (BooleanFormula OccName). These really are occurrences (not
binders), and should be treated like other occurences.
The first and third change the format of interface files, so
you'll need to recompile.
|
|
|
|
|
|
|
|
|
| |
In a special case for trivial RHSs (see DmdAnal.unpackTrivial),
I'd forgotten to include a demand for the RHS itself.
See Note [Remember to demand the function itself].
Thanks to David Terei for guiding me to the bug,
at PLDI in Edinburgh.
|
|
|
|
|
|
|
|
|
|
|
| |
Now that we are very consistent about tidying when converting
to IfaceSyn, we don't need to worry about accidental capture
of the "extra" type variables in tcDataKindSig. (Previously
we gave them weird names like $a.)
However, it is nicer for the user if we don't gratuitously
re-use an in-scope name, so we take care not to do that
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are three bugs here, one serious
* We were failing to tidy the type arguments in an IfTyConParent
This is what was causing Trac #9190.
* toIfaceTcArgs is careful to suppress kind arguments, but there
was a clone, tidyToIfaceTcArgs in IfaceSyn which didn't.
Now the latter goes via the former.
* When pretty-printing a IfaceDecl for an algebraic data type, and
doing so in Haskell-98 syntax, we were silently assuming that the
universal type variables of the TyCon and the DataCon were the
same. But that has not been true for some time. Result: a very
confusing display.
Solution: during the conversion to IfaceSyn, take the opportunity
to make the universal type variables line up exactly. This is very
easy to do, makes the pretty-printing easy, and leaves open the future
possiblity of not serialising the universal type variables of the
data constructor.
|
| |
|
|
|
|
|
| |
The improvement is to report the inferred type in the error message,
as suggested in email on ghc-deves (10 Jun 14).
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Removed (pprEqPred (coercionKind co)) in favor of
(pprType (coercionType co)).
Also had to make "~R#" a *symbolic* identifier and BuiltInSyntax
to squelch prefix notation and module prefixes in output. These
changes are both sensible independent of #9062.
|
|
|
|
|
| |
Inaccessible equations in a closed type family now leads to a
warning, not an error. This echoes what happens at the term level.
|
|
|
|
| |
`Any` is now an abstract (that is, no equations) closed type family.
|
| |
|
|
|
|
|
| |
This change also updates castFunPtr to make it free at runtime.
This fixes #9163.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We now emit
movq %rdi,16(%r14,%rsi,8)
instead of
leaq 16(%r14),%rax
movq %rdi,(%rax,%rsi,8)
This helps e.g. byte array indexing.
|
|
|
|
|
|
| |
Say how it differs from Array in terms of size and performance.
These are primitives so it's also ok to talk a bit about implementation
details like card tables.
|
|
|
|
| |
Including a test case.
|
|
|
|
|
| |
This was triggered by looking at Trac #9171. See
Note [Suggest -fprint-explicit-kinds] in TcErrors
|
|
|
|
| |
Fixes Trac #9167
|
| |
|
| |
|
|
|
|
| |
See Note [RTLD_LOCAL] for a summary of the problem and solution, and
|
|
|
|
| |
This closes #9181.
|
|
|
|
| |
fixes #9127
|
|
|
|
|
|
|
| |
A previous fix to this was wrong: f5879acd018494b84233f26fba828ce376d0f81d
and left some unreachable code behind. So rather than try to be clever and
do this at the same time as the strongly-connected-component analysis, I'm
doing a separate reachability pass first.
|
|
|
|
| |
using the same check as for unicode quotes.
|
|
|
|
|
| |
When printing Haskell source, and UnicodeSyntax is enabled, use the
unicode sytax characters (#8959).
|
|
|
|
| |
Implements #9069
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was a serious bug, exposed by Trac #9175. The matcher and wrapper
must be LocalIds, like record selectors and dictionary functions, for
the reasons now documented in Note [Exported LocalIds] in Id.lhs
In fixing this I found
- PatSyn should have an Id inside it (apart from the wrapper and matcher)
It should be a Name. Hence psId --> psName, with knock-on consequences
- Tidying of PatSyns in TidyPgm was wrong
- The keep-alive set in Desugar.deSugar (now) doesn't need pattern synonyms
in it
I also cleaned up the interface to PatSyn a little, so there's a tiny knock-on
effect in Haddock; hence the haddock submodule update.
It's very hard to make a test for this bug, so I haven't.
|
|
|
|
|
| |
instead of just one matching directly. This is an alternative way to fix
ticket #9177.
|
|
|
|
| |
and the other way around. This fixes #9177.
|
| |
|
| |
|
| |
|
|
|
|
| |
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We simply weren't giving anything like the right instantiating types
to patSynInstArgTys in matchOneConLike.
To get these instantiating types would have involved matching the
result type of the pattern synonym with the pattern type, which is
tiresome. So instead I changed ConPatOut so that instead of recording
the type of the *whole* pattern (in old field pat_ty), it not records
the *instantiating* types (in new field pat_arg_tys). Then we canuse
TcHsSyn.conLikeResTy to get the pattern type when needed.
There are lots of knock-on incidental effects, but they mostly made
the code simpler, so I'm happy.
|
|
|
|
| |
MPTC now also handles the nullary case
|
| |
|
|
|
|
|
|
| |
The type variables in the IfaceEqSpec of a data constructor are really
ordinarly *occurrences*, so they should be IfLclNames just like any
other type variable occurence.
|