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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
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
Alex D
GHC
Commits
1395185f
Commit
1395185f
authored
Sep 24, 2015
by
thomie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Testsuite: add test for
#10767
parent
5883b566
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
0 deletions
+49
-0
testsuite/tests/deSugar/should_compile/T10767.hs
testsuite/tests/deSugar/should_compile/T10767.hs
+48
-0
testsuite/tests/deSugar/should_compile/all.T
testsuite/tests/deSugar/should_compile/all.T
+1
-0
No files found.
testsuite/tests/deSugar/should_compile/T10767.hs
0 → 100644
View file @
1395185f
{-# LANGUAGE ScopedTypeVariables, TypeFamilies #-}
module
Main
where
{- ghc-7.8.4 and ghc-7.10.2 showed a confusing warning:
T10767.hs:43:1: Warning:
RULE left-hand side too complicated to desugar
Optimised lhs: case cobox_aWY
of _ [Occ=Dead] { GHC.Types.Eq# cobox ->
genLength @ Int $dSpecList_aWX
}
Orig lhs: case cobox_aWY of cobox_aWY { GHC.Types.Eq# cobox ->
genLength @ Int $dSpecList_aWX
}
-}
import
Data.Proxy
class
SpecList
a
where
type
List
a
::
*
slCase
::
List
a
->
b
->
(
a
->
List
a
->
b
)
->
b
data
IntList
=
ILNil
|
ILCons
{-# UNPACK #-}
!
Int
IntList
deriving
(
Show
)
instance
SpecList
Int
where
type
List
Int
=
IntList
slCase
ILNil
n
_
=
n
slCase
(
ILCons
i
t
)
_
c
=
c
i
t
fromList
::
[
Int
]
->
IntList
fromList
[]
=
ILNil
fromList
(
h
:
t
)
=
ILCons
h
(
fromList
t
)
lst1
::
IntList
lst1
=
fromList
[
1
..
10
]
{-# SPECIALIZE genLength :: Proxy Int -> List Int -> Int #-}
genLength
::
forall
a
.
SpecList
a
=>
Proxy
a
->
List
a
->
Int
genLength
p
lst
=
slCase
lst
0
(
\
(
_
::
a
)
tail
->
1
+
genLength
p
tail
)
main
::
IO
()
main
=
print
(
genLength
(
Proxy
::
Proxy
Int
)
lst1
)
testsuite/tests/deSugar/should_compile/all.T
View file @
1395185f
...
...
@@ -102,3 +102,4 @@ test('T2431', normal, compile, ['-ddump-simpl -dsuppress-uniques'])
test
('
T7669
',
normal
,
compile
,
[''])
test
('
T8470
',
normal
,
compile
,
[''])
test
('
T10251
',
normal
,
compile
,
[''])
test
('
T10767
',
normal
,
compile
,
[''])
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