Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,252
Issues
4,252
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
398
Merge Requests
398
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
849547bd
Commit
849547bd
authored
May 08, 2018
by
Ben Gamari
🐢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Normalize the element type of ListPat, fix
#14547
"
This reverts commit
981bf471
.
parent
981bf471
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
20 deletions
+1
-20
compiler/deSugar/Check.hs
compiler/deSugar/Check.hs
+1
-4
testsuite/tests/deSugar/should_compile/T14547.hs
testsuite/tests/deSugar/should_compile/T14547.hs
+0
-15
testsuite/tests/deSugar/should_compile/all.T
testsuite/tests/deSugar/should_compile/all.T
+0
-1
No files found.
compiler/deSugar/Check.hs
View file @
849547bd
...
...
@@ -790,13 +790,10 @@ translatePat fam_insts pat = case pat of
-- overloaded list
ListPat
(
ListPatTc
elem_ty
(
Just
(
pat_ty
,
_to_list
)))
lpats
|
Just
e_ty
<-
splitListTyConApp_maybe
pat_ty
,
(
_
,
norm_e_ty
)
<-
normaliseType
fam_insts
Nominal
e_ty
-- e_ty can be a type family instance, like
-- `It (List a)`, but we prefer `a`, see Trac #14547
,
(
_
,
norm_elem_ty
)
<-
normaliseType
fam_insts
Nominal
elem_ty
-- elem_ty is frequently something like
-- `Item [Int]`, but we prefer `Int`
,
norm_elem_ty
`
eqType
`
norm_
e_ty
->
,
norm_elem_ty
`
eqType
`
e_ty
->
-- We have to ensure that the element types are exactly the same.
-- Otherwise, one may give an instance IsList [Int] (more specific than
-- the default IsList [a]) with a different implementation for `toList'
...
...
testsuite/tests/deSugar/should_compile/T14547.hs
deleted
100644 → 0
View file @
981bf471
{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE TypeFamilies #-}
module
T14547
where
class
Foo
f
where
type
It
f
foo
::
[
It
f
]
->
f
data
List
a
=
Empty
|
a
:!
List
a
deriving
Show
instance
Foo
(
List
a
)
where
type
It
(
List
a
)
=
a
foo
[]
=
Empty
foo
(
x
:
xs
)
=
x
:!
foo
xs
testsuite/tests/deSugar/should_compile/all.T
View file @
849547bd
...
...
@@ -100,7 +100,6 @@ test('T13290', normal, compile, [''])
test
('
T13257
',
normal
,
compile
,
[''])
test
('
T13870
',
normal
,
compile
,
[''])
test
('
T14135
',
normal
,
compile
,
[''])
test
('
T14547
',
normal
,
compile
,
['
-Wincomplete-patterns
'])
test
('
T14773a
',
normal
,
compile
,
['
-Wincomplete-patterns
'])
test
('
T14773b
',
normal
,
compile
,
['
-Wincomplete-patterns
'])
test
('
T14815
',
[]
,
run_command
,
['
$MAKE -s --no-print-directory T14815
'])
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment