Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Alex D
GHC
Commits
fdf11c90
Commit
fdf11c90
authored
Dec 28, 2018
by
Shayne Fletcher
🥝
Committed by
Ben Gamari
Dec 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rebindable-clash-warning-fix : correct warning logic
parent
07022297
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
1 deletion
+38
-1
compiler/typecheck/TcMatches.hs
compiler/typecheck/TcMatches.hs
+1
-1
testsuite/tests/rebindable/all.T
testsuite/tests/rebindable/all.T
+4
-0
testsuite/tests/rebindable/rebindable11.hs
testsuite/tests/rebindable/rebindable11.hs
+15
-0
testsuite/tests/rebindable/rebindable11.stderr
testsuite/tests/rebindable/rebindable11.stderr
+0
-0
testsuite/tests/rebindable/rebindable12.hs
testsuite/tests/rebindable/rebindable12.hs
+14
-0
testsuite/tests/rebindable/rebindable12.stderr
testsuite/tests/rebindable/rebindable12.stderr
+4
-0
No files found.
compiler/typecheck/TcMatches.hs
View file @
fdf11c90
...
...
@@ -944,7 +944,7 @@ tcMonadFailOp orig pat fail_op res_ty
rebindableSyntax
<-
xoptM
LangExt
.
RebindableSyntax
;
desugarFlag
<-
xoptM
LangExt
.
MonadFailDesugaring
;
missingWarning
<-
woptM
Opt_WarnMissingMonadFailInstances
;
if
|
rebindableSyntax
&&
(
desugarFlag
||
missingWarning
)
;
if
|
rebindableSyntax
&&
desugarFlag
&&
missingWarning
->
warnRebindableClash
pat
|
not
desugarFlag
&&
missingWarning
->
emitMonadFailConstraint
pat
res_ty
...
...
testsuite/tests/rebindable/all.T
View file @
fdf11c90
...
...
@@ -21,6 +21,10 @@ test('rebindable8', normal, compile, [''])
test
('
rebindable9
',
normal
,
compile
,
[''])
test
('
rebindable10
',
normal
,
compile_and_run
,
[''])
# Test rebindable clash warnings
test
('
rebindable11
',
normal
,
compile
,
[''])
test
('
rebindable12
',
normal
,
compile_fail
,
[''])
test
('
T303
',
normal
,
compile
,
[''])
# Tests from Oleg
...
...
testsuite/tests/rebindable/rebindable11.hs
0 → 100644
View file @
fdf11c90
{-# LANGUAGE RebindableSyntax, MonadFailDesugaring #-}
{-# OPTIONS_GHC -Wno-missing-monadfail-instances #-}
-- Test that rebindable clash warnings are not displayed. This program
-- should not generate anything on stderr at compile time.
module
Main
where
import
Prelude
catMaybes
xs
=
do
Just
x
<-
xs
return
x
main
=
return
()
testsuite/tests/rebindable/rebindable11.stderr
0 → 100644
View file @
fdf11c90
testsuite/tests/rebindable/rebindable12.hs
0 → 100644
View file @
fdf11c90
{-# LANGUAGE RebindableSyntax, MonadFailDesugaring #-}
{-# OPTIONS_GHC -Wmissing-monadfail-instances #-}
-- Test that rebindable clash warnings are displayed.
module
Main
where
import
Prelude
catMaybes
xs
=
do
Just
x
<-
xs
return
x
main
=
return
()
testsuite/tests/rebindable/rebindable12.stderr
0 → 100644
View file @
fdf11c90
rebindable12.hs:11:5: error: [-Wmissing-monadfail-instances (in -Wcompat), -Werror=missing-monadfail-instances]
The failable pattern ‘Just x’
is used together with -XRebindableSyntax. If this is intentional,
compile with -Wno-missing-monadfail-instances.
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