| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: It works, I promise.
Reviewers: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1956
GHC Trac Issues: #11370
|
|
|
|
|
|
|
|
| |
Reviewers: austin, thomie, bgamari
Reviewed By: thomie, bgamari
Differential Revision: https://phabricator.haskell.org/D1955
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As `-fno-show-warning-groups` shows associated warning groups regardless
of whether the respective warning group flag as been passed on the CLI,
the warning-group information may be confusing to users.
At this point, `-fshow-warning-groups` is useful mostly to GHC
developers and possibly GHC users who want to see which warning groups
an emitted warning is part of. (Btw, this is particularly interesting in
combination with `-Weverything` which enables *every* warning flag known
to GHC.)
Consequently, starting with this commit, one has to opt-in via
`-fshow-warning-groups` for GHC to show warning groups.
In order to reduce the testsuite delta in this commit, the
`-fshow-warning-groups` flag has been added to TEST_HC_OPTS.
|
|
|
|
| |
This was missed in bb5afd3c274011c5ea302210b4c290ec1f83209c
|
|
|
|
|
|
|
| |
This is extends bb5afd3c274011c5ea302210b4c290ec1f83209c to cover
SafeHaskell warnings.
This implements yet another part of #10752
|
|
|
|
| |
This was missed in bb5afd3c274011c5ea302210b4c290ec1f83209c
|
|
|
|
|
|
|
| |
This is extends bb5afd3c274011c5ea302210b4c290ec1f83209c to cover
warnings emitted during lexing.
This implements another part of #10752
|
|
|
|
|
|
|
|
|
|
|
| |
This is extends bb5afd3c274011c5ea302210b4c290ec1f83209c to cover
warnings emitted during the desugaring phase.
This implements another part of #10752
Reviewed-by: quchen, bgamari
Differential Revision: https://phabricator.haskell.org/D1954
|
|
|
|
| |
Fixes Trac #11651. Merge to 8.0.
|
|
|
|
|
|
|
|
| |
We were failing to zonk, after quantifyTyVars, and that left
un-zonked type variables in the final PatSyn.
This fixes the patsyn/ problems in Trac #11648, but not
the polykinds/ ones.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is a general invariant that the constraint solver doesn't see
TyVars, only TcTyVars. But when checking the generic-default
signature of a class, we called checkValidType on the generic-default
type, which had the class TyVar free. That in turn meant that it wasn't
considered during flattening, which led to the error reported in
Trac #11608.
The fix is simple: call checkValidType on the /closed/ type. Easy.
While I was at it, I added a bunch of ASSERTs about the TcTyVar
invariant.
|
|
|
|
| |
This fixes Trac #11600
|
|
|
|
|
|
|
|
| |
When AbsBinds has no tyvars and no dicts, a rather simpler
desugaring is possible. This patch implements it.
I don't think the optimised code changes, but there is
less clutter generated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch was triggered by Trac #11601, where I discovered that
-XStrict was really not doing the right thing. In particular,
f y = let !(Just x) = blah[y] in body[y,x]
This was evaluating 'blah' but not pattern matching it
against Just until x was demanded. This is wrong.
The patch implements a new semantics which ensures that strict
patterns (i.e. ones with an explicit bang, or with -XStrict)
are evaluated fully when bound.
* There are extensive notes in DsUtils:
Note [mkSelectorBinds]
* To do this I found I need one-tuples;
see Note [One-tuples] in TysWiredIn
I updated the user manual to give the new semantics
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we didn't add Template Haskell key names to the list
of known uniques when building a stage 1 compiler. But with
f16ddcee0c64a92ab911a7841a8cf64e3ac671fd we may refer to TH
names even in stage 1, and this was causing uniques to not
be setup properly.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate and run stage1 test suite
Reviewers: osa1, austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1520
GHC Trac Issues: #10382
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Both gcc and clang tell which warning flag a reported warning can be
controlled with, this patch makes ghc do the same. More generally, this
allows for annotated compiler output, where an optional annotation is
displayed in brackets after the severity.
This also adds a new flag `-f(no-)show-warning-groups` to control
whether to show which warning-group (such as `-Wall` or `-Wcompat`)
a warning belongs to. This flag is on by default.
This implements #10752
Reviewed By: quchen, bgamari, hvr
Differential Revision: https://phabricator.haskell.org/D1943
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds a new data constructor `PatSynOrigin Bool Name` to the `CtOrigin`
data type. This allows for better error messages when the origin of a
wanted constraint is a pattern synonym declaration.
Fixes T10873.
Reviewers: mpickering, simonpj, austin, thomie, bgamari
Reviewed By: simonpj, thomie, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1866
GHC Trac Issues: #10873
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The suggestion only makes sense when we try
to use an as pattern in an expression context.
It is misleading in the case of a lazy pattern and
view pattern.
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1948
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #10398 in a different way, thereby also fixing #11579.
I inverted the logic of the Bool argument to "worker", to hopefully make
it more self-explanatory.
Reviewers: austin, hvr, bgamari
Reviewed By: bgamari
Differential Revision: https://phabricator.haskell.org/D1935
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Issue a separate warning per redundant (or inaccessible) clause.
This way each warning can have more precice location information
(the location of the clause under consideration and not the whole
match).
I thought that this could be too much but actually the number of
such warnings is bound by the number of cases matched against (in
contrast to the non-exhaustive warnings which may be exponentially
more).
Test Plan: validate
Reviewers: simonpj, austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1920
GHC Trac Issues: #8710
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This comparison is only necessary when the types being compared contain
casts. Otherwise the structural equality of the types implies that their
kinds are equal.
Test Plan: Validate
Reviewers: goldfire, austin, simonpj
Reviewed By: simonpj
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1944
GHC Trac Issues: #11597
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: austin, rdragon, bgamari
Reviewed By: bgamari
Subscribers: rdragon, thomie
Differential Revision: https://phabricator.haskell.org/D1949
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Replace "Sigs" with "Signatures" in WarningFlag data constructors.
- Replace "PatSyn" with "PatternSynonym" in WarningFlag data
constructors.
- Deprecate "missing-local-sigs" in favor of "missing-local-signatures".
- Deprecate "missing-exported-sigs" in favor of
"missing-exported-signatures".
- Deprecate "missing-pat-syn-signatures" in favor of
"missing-pattern-synonym-signatures".
- Replace "ddump-strsigs" with "ddump-str-signatures"
These complete the tasks that were explicitly mentioned in #11583
Test Plan:
Executed `ghc --show-options` and verified that the flags were changed
as expected.
Reviewers: svenpanne, austin, bgamari
Reviewed By: austin, bgamari
Subscribers: mpickering, thomie
Differential Revision: https://phabricator.haskell.org/D1939
GHC Trac Issues: #11583
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: bgamari, austin
Reviewed By: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1936
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ApplicativeDo handled terminal `return` statements properly, but not
`pure`.
Test Plan: Validate with included testcase
Reviewers: austin, simonmar
Reviewed By: austin, simonmar
Subscribers: simonpj, thomie
Differential Revision: https://phabricator.haskell.org/D1931
GHC Trac Issues: #11607
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Static pointers are rarely used naked: most often they are defined at
the base of a Closure, as defined in e.g. the distributed-closure and
distributed-static packages. So a typical usage pattern is:
distributeMap (closure (static (\x -> x * 2)))
which is more verbose than it needs to be. Ideally we'd just have to
write
distributeMap (static (\x -> x * 2))
and let the static pointer be lifted to a Closure implicitly. i.e.
what we want is to overload static literals, just like we already
overload list literals and string literals.
This is achieved by introducing the IsStatic type class and changing
the typing rule for static forms slightly:
static (e :: t) :: IsStatic p => p t
Test Plan: ./validate
Reviewers: austin, hvr, bgamari
Reviewed By: bgamari
Subscribers: simonpj, mboes, thomie
Differential Revision: https://phabricator.haskell.org/D1923
GHC Trac Issues: #11585
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: austin, bgamari, simonpj
Reviewed By: simonpj
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1933
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See Note [TYPE] in TysPrim. There are still some outstanding
pieces in #11471 though, so this doesn't actually nail the bug.
This commit also contains a few performance improvements:
* Short-cut equality checking of nullary type syns
* Compare types before kinds in eqType
* INLINE coreViewOneStarKind
* Store tycon binders separately from kinds.
This resulted in a ~10% performance improvement in compiling
the Cabal package. No change in functionality other than
performance. (This affects the interface file format, though.)
This commit updates the haddock submodule.
|
|
|
|
| |
...forgot to stage/add this alpha renaming to the previous commit
|
|
|
|
|
|
|
|
|
|
|
| |
The original implementation for #11429 covers only `-W*` flags. However,
old packages will continue to use `-f(no-)warn-*` flags, so it seems
desirable to have `-Wunrecognised-warning-flag` apply to those legacy aliases
as well.
Reviewed By: bgamari
Differential Revision: https://phabricator.haskell.org/D1942
|
|
|
|
|
|
| |
Reviewed by: austin, rwbarton
Differential Revision: https://phabricator.haskell.org/D1938
|
|
|
|
|
| |
In some cases ApplicativeDo would miss some opportunities, due to a
wrong calculation of free variables in RnExpr.segments.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Refactoring only. Cleanup some loose ends from #10196.
Initially the idea was to only allow modifier letters at the end of
identifiers. Since we later decided to allow modifier letters also in
the middle of identifiers (because not doing so would not fix the
regression completely), the names `suffix` and `okIdSuffixChar` don't
seem appropriate anymore.
Remove TODO. Move test from should_fail to should_compile.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A long time ago, you could use `"-- # <haddock options>"` to mean that
`<haddock options.` should be passed to `haddock`. Since 2007
(03d8585e0940e28e024548654fe3505685aca94f), using `OPTIONS_HADDOCK` is
the preferred way to do this.
Why is ok to remove support for "-- # .."?
* It is not mentioned in the Haddock user's guide, nor are there any
tests that use it.
* Ever since 2011 (b3e30449aa6d6eaa978eb3c7447ca85985d9d251), it doesn't
actually work anymore. The function `getOptionsFromFile` uses
`gopt_unset dflags Opt_Haddock` for other reasons, so even when
running ghc with `--haddock`, the following rule always fires when the
lexer sees "-- # ..", and it gets treated as a normal comment:
```
-- Next, match Haddock comments if no -haddock flag
"-- " [$docsym \#] .* / { ifExtension (not . haddockEnabled) } { lineCommentToken }
```
Reviewed by: bgamari
Differential Revision: https://phabricator.haskell.org/D1932
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to make this work I needed to shuffle around typechecking a bit
such that `TyCon` and friends are available during compilation of
GHC.Types. I also did a bit of refactoring of `TcTypeable`.
Test Plan: Validate
Reviewers: simonpj, austin
Subscribers: simonpj, thomie
Differential Revision: https://phabricator.haskell.org/D1906
GHC Trac Issues: #11120
|
|
|
|
|
|
|
|
|
|
| |
...when computing the size of a call on the RHS of a type
instance declaration.
This came up in Trac #11581. The change is in
TcType.tcTyFamInsts
which now trims the type arguments in a call. See the
comments with that function definition.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Several things here:
* Re-implement piResultTys so that its substitution has
the correct in-scope set
That means paying close attention to performance, since as we
discovered in Trac #11371, it's a heavily used function and
is often used on ordinary function types, with no foralls to
worry about substituting.
* Kill off applyTys, which was just the same as piResultTys.
* Re-engineer MkCore.mkCoreApps so that it calls piResultTys,
rather than repeatedly calling piResultTy.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
No change in functionality here, but greater clarity:
* In FamInstEnv.FlattenEnv, kill off the fi_in_scope field
We are already maintaining an in-scope set in the fe_subst field,
so it's silly do to it twice.
(This isn't strictly connected to the rest of this patch, but
the nomenclature changes below affect the same code, so I put
them together.)
* TyCoRep.extendTCVSubst used to take a TyVar or a CoVar and work
out what to do, but in fact we almost always know which of the
two we are doing. So:
- define extendTvSubst, extendCvSubst
- and use them
* Similar renamings in TyCoRep:
- extendTCvSubstList --> extendTvSubstList
- extendTCvSubstBinder --> extendTvSubstBinder
- extendTCvSubstAndInScope --> extendTvSubstAndInScope
* Add Type.extendTvSubstWithClone, extendCvSubstWithClone
* Similar nomenclature changes in Subst, SimplEnv, Specialise
* Kill off TyCoRep.substTelescope (never used)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When implementing Strict Haskell, the patch 46a03fbe didn't faithfully
implement the semantics given in the manual. In particular there was
an ad-hoc case in mkSelectorBinds for "strict and no binders" that
didn't work.
This patch fixes it, curing Trac #11572.
Howver it forced me to think about banged let-bindings, and I rather
think we do not have quite the right semantics yet, so I've opened
Trac #11601.
|
|
|
|
| |
RyanGlScott updated the Diff only after I had merged it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, `-XDeriveFoldable` and `-XDeriveTraversable` generate
unnecessary `mempty` and `pure` expressions when it traverses of an
argument of a constructor whose type does not mention the last type
parameter. Not only is this inefficient, but it prevents `Traversable`
from being derivable for datatypes with unlifted arguments (see
Trac #11174).
The solution to this problem is to adopt a slight change to the
algorithms for `-XDeriveFoldable` and `-XDeriveTraversable`, which is
described in [this wiki
page](https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/DeriveFu
nctor#Proposal:alternativestrategyforderivingFoldableandTraversable).
The wiki page also describes why we don't apply the same changes to the
algorithm for `-XDeriveFunctor`.
This is techincally a breaking change for users of `-XDeriveFoldable`
and `-XDeriveTraversable`, since if someone was using a law-breaking
`Monoid` instance with a derived `Foldable` instance (i.e., one where `x
<> mempty` does not equal `x`) or a law-breaking `Applicative` instance
with a derived `Traversable` instance, then the new generated code could
result in different behavior. I suspect the number of scenarios like
this is very small, and the onus really should be on those users to fix
up their `Monoid`/`Applicative` instances.
Fixes #11174.
Test Plan: ./validate
Reviewers: hvr, simonpj, austin, bgamari
Reviewed By: simonpj, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1908
GHC Trac Issues: #11174
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Eq and Ord instance were previously hand-written and this change
updates them to be automatically derived by the compiler. The derived
behavior should be equivalent to the original.
Reviewers: hvr, austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1913
|
|
|
|
|
| |
Previously, we looked through synonyms when counting arguments,
but that's a bit silly.
|