Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
d99fcc16
Commit
d99fcc16
authored
Feb 09, 2014
by
eir@cis.upenn.edu
Committed by
thoughtpolice
Feb 17, 2014
Browse files
Test
#6147
, which was fixed with the roles commit.
(cherry picked from commit
9e0c1ae5
)
parent
c0329679
Changes
3
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/deriving/should_fail/T6147.hs
0 → 100644
View file @
d99fcc16
{-# LANGUAGE GeneralizedNewtypeDeriving, TypeFamilies #-}
module
T6147
where
data
family
T
a
data
instance
T
Int
=
T_Int
Int
class
C
a
where
foo
::
a
->
T
a
instance
C
Int
where
foo
=
T_Int
newtype
Foo
=
Foo
Int
deriving
(
C
)
testsuite/tests/deriving/should_fail/T6147.stderr
0 → 100644
View file @
d99fcc16
T6147.hs:13:32:
Could not coerce from ‛T Int’ to ‛T Foo’
because the first type argument of ‛T’ has role Nominal,
but the arguments ‛Int’ and ‛Foo’ differ
arising from the coercion of the method ‛foo’ from type
‛Int -> T Int’ to type ‛Foo -> T Foo’
Possible fix:
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (C Foo)
testsuite/tests/deriving/should_fail/all.T
View file @
d99fcc16
...
...
@@ -48,3 +48,4 @@ test('T7148', normal, compile_fail, [''])
test
('
T7148a
',
normal
,
compile_fail
,
[''])
test
('
T7800
',
normal
,
multimod_compile_fail
,
['
T7800
',''])
test
('
T5498
',
normal
,
compile_fail
,
[''])
test
('
T6147
',
normal
,
compile_fail
,
[''])
\ No newline at end of file
Write
Preview
Supports
Markdown
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