Change History (19)

Annotations are pragmas, which we haven't historically had extensions for. Some options:

Do nothing.

Ignore (but warn about) ANN pragmas if TemplateHaskell is off (I infer from the docs that they rely on TH). If they are a well-behaved pragma then ignoring them won't affect the correctness of the code.

Can you please reconsider option two? On Debian, we have several arches where ghci does not work. It is already a pitty that we cannot build any TH-using library there, but now we also have to remove anything using annotation, e.g. haskell-vector.

Summary
changed from Annotation extension needs a flag to Warning for ANN pragmas when GHCi is not supported

We don't want a flag for the ANN pragma, because pragmas don't normally have flags to enable them, they are unconditionally enabled. However, ANN might not be supported if GHC is built without GHCi support (say on a platform that doesn't have GHCi support), so in those cases we want to emit a warning.

Therefore this ticket is now for adding a warning when an ANN pragma is being ignored.

According to #8312, Annotations will require a -X flag in the future, and in a non-GHCi-compiler, we still get an error (not a warning), requiring distributions to patch annotations out of the code. In light of #8312, do you still think that it should be a warning, and not an error?

Warn if you use ANN annotations with a stage-1 compiler (Trac #4268)
This makes us give a civilised warning when we hit an
{-# ANN f foo #-}
pragma in a stage-1 compiler.
We decided that, since it's a pragma, it does not need a language
extension flag to enable it.