Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexander Kaznacheev
GHC
Commits
38d95c13
Commit
38d95c13
authored
12 years ago
by
Simon Peyton Jones
Committed by
pcapriotti
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Test FlexibleInstance not UndecidableInstances in the ambiguity check
Fixes Trac #7131 MERGED from commit
f7b096e8
parent
0cb389e5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
compiler/typecheck/TcMType.lhs
+5
-5
5 additions, 5 deletions
compiler/typecheck/TcMType.lhs
with
5 additions
and
5 deletions
compiler/typecheck/TcMType.lhs
+
5
−
5
View file @
38d95c13
...
...
@@ -1305,9 +1305,9 @@ Is every call to 'g' ambiguous? After all, we might have
intance C [a] where ...
at the call site. So maybe that type is ok! Indeed even f's
quintessentially ambiguous type might, just possibly be callable:
with -X
Undecida
bleInstances we could have
with -X
Flexi
bleInstances we could have
instance C a where ...
and now a call could be legal after all! (But only with -X
Undecida
bleInstances!)
and now a call could be legal after all! (But only with -X
Flexi
bleInstances!)
What about things like this:
class D a b | a -> b where ..
...
...
@@ -1333,7 +1333,7 @@ where
* The constraints in 'Cambig' are all of form (C a b c)
where a,b,c are type variables
* 'Cambig' is non-empty
* '-X
Undecida
bleInstances' is not on.
* '-X
Flexi
bleInstances' is not on.
And that is what checkAmbiguity does. See Trac #6134.
...
...
@@ -1375,8 +1375,8 @@ so we can take their type variables into account as part of the
checkAmbiguity :: [TyVar] -> ThetaType -> TyVarSet -> TcM ()
-- Note [The ambiguity check for type signatures]
checkAmbiguity forall_tyvars theta tau_tyvars
= do {
undecida
ble_instances <- xoptM Opt_
Undecida
bleInstances
; unless
undecida
ble_instances $
= do {
flexi
ble_instances <- xoptM Opt_
Flexi
bleInstances
; unless
flexi
ble_instances $
mapM_ ambigErr (filter is_ambig candidates) }
where
-- See Note [Implicit parameters and ambiguity] in TcSimplify
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment