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
9cd07fc3
Commit
9cd07fc3
authored
11 years ago
by
Simon Peyton Jones
Committed by
Austin Seipp
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Make sure that polykinded Typeable is defaultable (Trac #8931)
(cherry picked from commit
791f4fa2
)
parent
177b97ad
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/TcSimplify.lhs
+10
-4
10 additions, 4 deletions
compiler/typecheck/TcSimplify.lhs
with
10 additions
and
4 deletions
compiler/typecheck/TcSimplify.lhs
+
10
−
4
View file @
9cd07fc3
...
...
@@ -16,7 +16,7 @@ import TcMType as TcM
import TcType
import TcSMonad as TcS
import TcInteract
import Kind ( defaultKind_maybe )
import Kind (
isKind,
defaultKind_maybe )
import Inst
import FunDeps ( growThetaTyVars )
import Type ( classifyPredType, PredTree(..), getClassPredTys_maybe )
...
...
@@ -1249,16 +1249,22 @@ findDefaultableGroups
-> Cts -- Unsolved (wanted or derived)
-> [[(Ct,Class,TcTyVar)]]
findDefaultableGroups (default_tys, (ovl_strings, extended_defaults)) wanteds
| null default_tys
= []
| otherwise
= filter is_
defaultable_group
(equivClasses cmp_tv unaries)
| null default_tys = []
| otherwise
=
defaultable_group
s
where
defaultable_groups = filter is_defaultable_group groups
groups = equivClasses cmp_tv unaries
unaries :: [(Ct, Class, TcTyVar)] -- (C tv) constraints
non_unaries :: [Ct] -- and *other* constraints
(unaries, non_unaries) = partitionWith find_unary (bagToList wanteds)
-- Finds unary type-class constraints
-- But take account of polykinded classes like Typeable,
-- which may look like (Typeable * (a:*)) (Trac #8931)
find_unary cc
| Just (cls,[ty]) <- getClassPredTys_maybe (ctPred cc)
| Just (cls,tys) <- getClassPredTys_maybe (ctPred cc)
, Just (kinds, ty) <- snocView tys
, all isKind kinds
, Just tv <- tcGetTyVar_maybe ty
, isMetaTyVar tv -- We might have runtime-skolems in GHCi, and
-- we definitely don't want to try to assign to those!
...
...
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