Missing instances if compiling with -fplugin
Using the example from "9.3.3.2. Using Annotations" of the GHC user manual does not work correctly with GHC 7.10. The following fails:
$ ghc -c Bug1.hs -fplugin=SayAnnNames.Plugin
Bug1.hs:5:1:
No instance for (Data SomeAnn) arising from an annotation
In the annotation: {-# ANN foo SomeAnn #-}
It does not seem to matter why the type class is required:
$ ghc -c Bug2.hs -fplugin=SayAnnNames.Plugin
Bug2.hs:10:7:
No instance for (Data SomeAnn) arising from a use of ‘bar’
In the expression: bar SomeAnn
In an equation for ‘baz’: baz = bar SomeAnn
Compiling without -fplugin works fine, though. If SomeAnn is defined in a different module than SayAnnNames.Plugin and reexported from it, the instances are in scope, too.
Trac metadata
Trac field | Value |
---|---|
Version | 7.10.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler (Type checker) |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |