Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
9e0c1ae5
Commit
9e0c1ae5
authored
Feb 09, 2014
by
eir@cis.upenn.edu
Browse files
Test #6147, which was fixed with the roles commit.
parent
8cc398ff
Changes
3
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/deriving/should_fail/T6147.hs
0 → 100644
View file @
9e0c1ae5
{-# 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 @
9e0c1ae5
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 @
9e0c1ae5
...
...
@@ -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
.
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