| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
this Diff contains small, self-contained changes as I work towards
fixing #10613. It is mostly created to let harbormaster do its job, but
feedback is welcome as well.
Please do not merge this via arc; I’d like to push the individual
patches as layed out here. I might push mostly trivial ones even without
review, as long as the build passes.
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2014
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Add "⦇" and "⦈" as unicode alternatives for "(|" and "|)" respectively.
This must be implemented differently than other unicode additions
because ⦇" and "⦈" are interpretted as a $unigraphic rather than
a $unisymbol.
Test Plan: validate
Reviewers: goldfire, bgamari, austin
Reviewed By: bgamari, austin
Subscribers: thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D2012
GHC Trac Issues: #10162
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As the type of a pattern synonym cannot in general be represented by a
value of type Type, we cannot use a value `SigSkol (PatSynCtxt n) (Check
ty)` to represent the signature of a pattern synonym (this causes
incorrect signatures to be printed in error messages). Therefore we now
represent it by a value `PatSynSigSkol n` (instead of incorrect
signatures we simply print no explicit signature).
Furthermore, we rename `PatSynCtxt` to `PatSynBuilderCtxt`, and use
`SigSkol (PatSynBuilderCtxt n) (Check ty)` to represent the type of a
bidirectional pattern synonym when used in an expression context.
Before, this type was represented by a value `SigSkol (PatSynCtxt n)
(Check ty)`, which caused incorrect error messages.
Also, in `mk_dict_err` of `typecheck\TcErrors.hs` we now distinguish
between all enclosing implications and "useful" enclosing implications,
for better error messages concerning pattern synonyms. See `Note [Useful
implications]`.
See the Phabricator page for examples.
Reviewers: mpickering, goldfire, simonpj, austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1967
GHC Trac Issues: #11667
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds timings and allocation figures to the compiler's output when
run with `-v2` in an effort to ease performance analysis.
Todo:
* Documentation
* Where else should we add these?
* Perhaps we should remove some of the now-arguably-redundant
`showPass` occurrences where they are
* Must we force more?
* Perhaps we should place this behind a `-ftimings` instead of `-v2`
Test Plan: `ghc -v2 Test.hs`, look at the output
Reviewers: hvr, goldfire, simonmar, austin
Reviewed By: simonmar
Subscribers: angerman, michalt, niteria, ezyang, thomie
Differential Revision: https://phabricator.haskell.org/D1959
|
|
|
|
|
|
|
|
| |
The desugarer had a fragile case to generate the Unfolding for a
DFun. This patch moves the unfolding generation to TcInstDcls, where
all the pieces are to hand.
Fixes Trac #11742
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
addDataConStupidTheta includes comments that the types list
might be longer than the tvs list. And the check in zipTvSubst
doesn't appear to be terribly recent. I am utterly flummoxed
as to why this worked before. It was clearly just broken.
And now it's fixed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The free vars of `ty2` need to be in scope to satisfy the substitution
invariant.
As far as I can tell we don't have the free vars of `ty2` when
substituting, so unfortunately we have to compute them.
Test Plan: ./validate
Reviewers: austin, bgamari, simonpj, goldfire
Subscribers: thomie, simonmar
Differential Revision: https://phabricator.haskell.org/D2024
GHC Trac Issues: #11371
|
|
|
|
|
|
|
| |
Use `fcmpu 0, ...` rather than `fcmpu cr0, ...` for better
portability since some non-GNU assembler (such as IBM's `as`) tend to not
support the symbolic register name `cr0`. This matches the syntax that
GCC emits for PPC targets.
|
| |
|
| |
|
|
|
|
| |
Test cases: typecheck/should_fail/T1172{3,4}
|
|
|
|
|
|
| |
It was Utterly Wrong before.
Note to self: Never, ever take the free vars of an unzonked type.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In particular, this allows correct tracking of specified/invisible
for variables in Haskell98 data constructors and in pattern synonyms.
GADT-syntax constructors are harder, and are left until #11721.
This was all inspired by Simon's comments to my fix for #11512,
which this subsumes.
Test case: ghci/scripts/TypeAppData
[skip ci] (The test case fails because of an unrelated problem
fixed in the next commit.)
|
| |
|
|
|
|
|
| |
See Note [Prevent unification with type families]
in TcUnify for the details.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of creating a new meta-tyvar and then unifying it with
a known kind in a KindedTyVar in a LHsQTyVars, just use the known kind.
Sadly, this still doesn't make #11719 usable, because while you can
now define a higher-kinded type family, you can't write any equations
for it, which is a larger problem.
test cases: dependent/should_compile/T{11635,11719}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Optimize zonking * to avoid allocation.
- Try to avoid looking at the free variables of a type in the
pure unifier. We need look at the variables only in the case
of a forall.
The performance results updates included in this also include
a regression, but the regression is not due to this patch. When
validating previous patches, the test case failed, but I was
unable to reproduce outside of validation, so I let it go by, thinking
the failure was spurious. Upon closer inspection, the perf number
was right at the line, and the wibble between a valiation environment
and a regular test run was enough to make the difference.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Originally I wanted to only remove substTyWithBindersUnchecked, but
since both of them are unused maybe we don't need them.
Test Plan: ./validate
Reviewers: austin, goldfire, bgamari, simonpj
Reviewed By: simonpj
Subscribers: thomie, simonmar
Differential Revision: https://phabricator.haskell.org/D2025
GHC Trac Issues: #11371
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Ord instance for ConLike uses Unique order which is bad for
determinism. Fortunately it's not used, so we can just delete it.
The is part of the effort to make Unique comparisons explicit.
Test Plan: ./validate
Reviewers: austin, simonmar, bgamari, simonpj
Reviewed By: simonpj
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2018
GHC Trac Issues: #4012
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`Ord` for `TyCon` uses `Uniques` and it's not lexicographic.
I did some archeology and in
rGHC6c381e873e222417d9a67aeec77b9555eca7b7a8 the comment was introduced,
where there was something like `Ord3 Tycon` which *was* lexicographic.
In rGHC9dd6e1c216993624a2cd74b62ca0f0569c02c26b `Ord3 TyCon` was already
not lexicographic and `Ord3` got removed.
Test Plan: make someone take a look
Reviewers: hvr, austin, bgamari
Reviewed By: bgamari
Subscribers: thomie, simonmar
Differential Revision: https://phabricator.haskell.org/D2017
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Desugaring long lists with build trades large static data for large
code, which is likely a poor trade-off. See #11707.
Test Plan: Validate, nofib
Reviewers: simonpj, austin
Reviewed By: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2007
GHC Trac Issues: #11707
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: Look at DWARF output.
Reviewers: scpmw, austin
Reviewed By: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1734
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: Validate with testcase in D2002
Reviewers: austin, simonpj
Reviewed By: simonpj
Subscribers: simonpj, thomie
Differential Revision: https://phabricator.haskell.org/D2004
GHC Trac Issues: #11702
|
|
|
|
| |
Test case: typecheck/should_compile/T11512
|
|
|
|
|
|
|
|
|
|
|
| |
There were several smallish bugs here:
- We had too small an InScopeSet when rejigging GADT return types.
- When adding the extra_tvs with a datatype kind signature, we
were sometimes changing Uniques of an explicitly bound kind var.
- Using coercionKind in the flattener got the wrong visibility
for a binder. Now we just zonk to get what we need.
Test case: dependent/should_compile/RaeJobTalk
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Fixes T11708
Reviewers: austin, bgamari, goldfire, simonpj
Reviewed By: goldfire, simonpj
Subscribers: simonpj, goldfire, thomie
Differential Revision: https://phabricator.haskell.org/D2006
GHC Trac Issues: #11708
|
|
|
|
|
|
|
|
| |
There were two bugs here, both simple: we need to filter out
covars before calling isMetaTyVar in the solver, and TcPat had
a tcSubType the wrong way round.
test case: dependent/should_compile/T11711
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When using Clang as the C compiler, over 100 tests were failing
due to Clang reporting that some command line arguments were not
being used. These warnings only occur when Clang is compiling
assembler files which happens in two places, one of which already
conditionally adding `-Qunused-arguments` to the command line when
the compiler was Clang. This fixes the other.
Test Plan: validate with clang as the C compiler
Reviewers: bgamari, hvr, austin, rwbarton
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1998
GHC Trac Issues: #11684
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It turns out that there were some pretty egregious mistakes
in the code that suggested -fprint-explicit-kinds, which are
fixed. This commit also reorders a bunch of error messages,
which I think is an improvement.
This also adds the test case for #11471, which is what
triggered the cleanup in TcErrors. Now that #11473 is done,
there is nothing more outstanding for #11471.
test case: dependent/should_fail/T11471
|
|
|
|
|
|
|
| |
This is as reported in #11471, though it's not the focus of that
ticket.
test case: polykinds/KindVType
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I've added a check in the zonker for representation polymorphism.
I don't like having this be in the zonker, but I don't know where
else to put it. It can't go in TcValidity, because a clever enough
user could convince the solver to do bogus representation polymorphism
even though there's nothing obviously wrong in what they wrote.
Note that TcValidity doesn't run over *expressions*, which is where
this problem arises.
In any case, the check is simple and it works.
test case: dependent/should_fail/T11473
|
|
|
|
|
|
|
|
|
| |
We were looking at a data instance tycon for visibility info,
which is the wrong place to look. Look at the data family tycon
instead.
Also improved the pretty-printing near there to suppress kind
arguments when appropriate.
|
|
|
|
|
| |
This was necessary in an earlier version of the patch for #11648,
but not in the final version. I forgot to remove it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, checkTauTvUpdate, used in the eager unifier (TcUnify)
right before writing to a metavar, refused to write a metavar to
a type involving type functions. The reason for this was given
in a Note, but the Note didn't make all that much sense and even
admitted that it was a bit confused. The Note, in turn, referred
to another Note, which it was quite sceptical of, as well.
The type-family check was slowing down performance, so I tried
removing it, running the tests referred to in the Note. The tests
all passed without the check. Looking at more test results, I
saw several error messages improve without the check, and some cases
where GHC looped (T7788, in particular) it now doesn't.
So, all in all, quite a win: Two hairy Notes removed, several lines
of code removed, better performance, and improved output.
[skip ci]
|
|
|
|
|
|
|
|
|
|
|
|
| |
We now check that a CUSK is really a CUSK and issue an error if
it isn't. This also involves more solving and zonking in
kcHsTyVarBndrs, which was the outright bug reported in #11648.
Test cases: polykinds/T11648{,b}
This updates the haddock submodule.
[skip ci]
|
|
|
|
|
|
| |
This adapts the text from D1944.
[skip ci]
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This replaces the old HsType and HsTypeOut constructors
with HsAppType and HsAppTypeOut, leading to some simplification.
(This refactoring addresses #11329.)
This also fixes #11456, which stumbled over HsType (which is
not an expression).
test case: ghci/scripts/T11456
[skip ci]
|
|
|
|
|
|
| |
This commit teaches shortCutReduction about Derived constraints.
[skip ci]
|
|
|
|
|
|
|
|
|
| |
Now we fail when trying to default non-*-kinded kind variables
with -XNoPolyKinds.
test case: dependent/should_fail/T11334
[skip ci]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This removes the `defer_me` check that was in checkTauTvUpdate
and uses only a type family check instead. The old defer_me check
repeated work done by fast_check in occurCheckExpand.
There is also some error message improvement, necessitated by
the terrible error message that the test case produced, even when
it didn't consume all of memory.
test case: dependent/should_fail/T11407
[skip ci]
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1999
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 673efccb3b uncovered a bug in LLVM code generation that produced
LLVM code that the LLVM compiler refused to compile:
{
clpH:
br label %clpH
}
This may well be a bug in LLVM itself. The solution is to keep the
existing entry label and rewrite the function as:
{
clpH:
br label %nPV
nPV:
br label %nPV
}
Thanks to Ben Gamari for pointing me in the right direction on this
one.
Test Plan: Build GHC with BuildFlavour=quick-llvm
Reviewers: hvr, austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1996
GHC Trac Issues: #11649
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
makeTrivial is responsible for concocting names during simplification.
Previously, however, it would make no attempt to generate a name that
might be useful to later readers of the resulting Core. Here we add a
bit of state to SimplEnv: a finite depth stack of binders within which
we are currently simplifying. We then derive generated binders from this
context.
See #11676.
Open questions:
* Is there a better way to accomplish this?
* Is `maxContextDepth` too large/small?
Test Plan: Validate, look at Core.
Reviewers: austin, simonpj
Reviewed By: simonpj
Subscribers: thomie, simonpj
Differential Revision: https://phabricator.haskell.org/D1970
GHC Trac Issues: #11676
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The algorithm for ApplicativeDo rearrangement is based on a heuristic
that runs in O(n^2). This patch adds the optimal algorithm, which is
O(n^3), selected by a flag (-foptimal-applicative-do). It finds better
solutions in a small number of cases (about 2% of the cases where
ApplicativeDo makes a difference), but it can be very slow for large do
expressions. I'm mainly adding it for experimental reasons.
ToDo: user guide docs
Test Plan: validate
Reviewers: simonpj, bgamari, austin, niteria, erikd
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1969
|
| |
|