RebindableSyntax does not imply NoImplicitPrelude
According to the documentation for RebindableSyntax
: "-XRebindableSyntax
implies -XNoImplicitPrelude.
"
I would expect using GHC with both -XRebindableSyntax
and -NoImplicitPrelude
to be equivalent to just using -XRebindableSyntax
.
However NoImplicitPrelude
does not appear to be applied if RebindableSyntax
is used. Furthermore, NoImplicitPrelude
does not appear to have an effect if placed before RebindableSyntax
.
I would expect the Test.hs program to fail to compile with:
[1 of 1] Compiling Main ( Test.hs, Test.o )
Test.hs:4:8: Not in scope: `undefined'
Test.hs:7:5: Not in scope: `>>'
Test.hs:8:5: Not in scope: `return'
However the failure is actually:
[coconnor@toast Scratch]$ ghc --make Test
[1 of 1] Compiling Main ( Test.hs, Test.o )
Test.hs:6:5:
Ambiguous occurrence `fail'
It could refer to either `Main.fail', defined at Test.hs:3:1
or `Prelude.fail', imported from Prelude
Placing an NoImplicitPrelude
LANGUAGE pragma after the RebindableSyntax
one produces the expected results.
RebindableSyntax documentation
Trac metadata
Trac field | Value |
---|---|
Version | 7.0.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |