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
29bbb9f5
Commit
29bbb9f5
authored
12 years ago
by
Simon Peyton Jones
Committed by
Ian Lynagh
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
An accidentally-omitted part of commit
8019bc2c
, about promoting data constructors
parent
4b380f19
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
compiler/typecheck/TcHsType.lhs
+6
-8
6 additions, 8 deletions
compiler/typecheck/TcHsType.lhs
with
6 additions
and
8 deletions
compiler/typecheck/TcHsType.lhs
+
6
−
8
View file @
29bbb9f5
...
...
@@ -427,8 +427,8 @@ tc_hs_type hs_ty@(HsExplicitListTy _k tys) exp_kind
; checkExpectedKind hs_ty (mkPromotedListTy kind) exp_kind
; return (foldr (mk_cons kind) (mk_nil kind) taus) }
where
mk_cons k a b = mkTyConApp (
buildP
romote
d
DataCon consDataCon) [k, a, b]
mk_nil k = mkTyConApp (
buildP
romote
d
DataCon nilDataCon) [k]
mk_cons k a b = mkTyConApp (
p
romoteDataCon consDataCon) [k, a, b]
mk_nil k = mkTyConApp (
p
romoteDataCon nilDataCon) [k]
tc_hs_type hs_ty@(HsExplicitTupleTy _ tys) exp_kind
= do { tks <- mapM tc_infer_lhs_type tys
...
...
@@ -603,12 +603,10 @@ tcTyVar name -- Could be a tyvar, a tycon, or a datacon
AGlobal (ATyCon tc) -> inst_tycon (mkTyConApp tc) (tyConKind tc)
AGlobal (ADataCon dc)
| isPromotableType ty -> inst_tycon (mkTyConApp tc) (tyConKind tc)
| Just tc <- promoteDataCon_maybe dc
-> inst_tycon (mkTyConApp tc) (tyConKind tc)
| otherwise -> failWithTc (quotes (ppr dc) <+> ptext (sLit "of type")
<+> quotes (ppr ty) <+> ptext (sLit "is not promotable"))
where
ty = dataConUserType dc
tc = buildPromotedDataCon dc
<+> quotes (ppr (dataConUserType dc)) <+> ptext (sLit "is not promotable"))
APromotionErr err -> promotionErr name err
...
...
@@ -1429,7 +1427,7 @@ tc_kind_var_app name arg_kis
; unless data_kinds $ addErr (dataKindsErr name)
; case isPromotableTyCon tc of
Just n | n == length arg_kis ->
return (mkTyConApp (
buildP
romote
d
TyCon tc) arg_kis)
return (mkTyConApp (
p
romoteTyCon tc) arg_kis)
Just _ -> tycon_err tc "is not fully applied"
Nothing -> tycon_err tc "is not promotable" }
...
...
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