coerce String type in annotations with OverloadedStrings enabled
Compiling the following snippet fails with the error message for not being able to resolve the constraint IsString for the given annotation (I've chosen some random HLint annotation here):
{-# LANGUAGE OverloadedStrings #-}
module Foo where
{-# ANN module "HLint: ignore Use <$>" #-}
Stating the type explicitly works fine, changing the annotation like this:
{-# ANN module ("HLint: ignore Use <$>" :: String) #-}
Note: this is actually only a minor annoyance which may or may not be confusing to newcomers. However since annotations use the String type, wouldn't it be possible to resolve the constraint in this case / coerce the value when inside an annotation?
Trac metadata
Trac field | Value |
---|---|
Version | 8.2.1 |
Type | FeatureRequest |
TypeOfFailure | OtherFailure |
Priority | low |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |