Commit 627d1e00 authored by Austin Seipp's avatar Austin Seipp

Add TH support for annotations (#8340)

Authored-by: errge's avatarGergely Risko <gergely@risko.hu>
Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
parent 70ccf23f
......@@ -480,6 +480,19 @@ cvtPragmaD (RuleP nm bndrs lhs rhs phases)
rhs' placeHolderNames
}
cvtPragmaD (AnnP target exp)
= do { exp' <- cvtl exp
; target' <- case target of
ModuleAnnotation -> return ModuleAnnProvenance
TypeAnnotation n -> do
n' <- tconName n
return (TypeAnnProvenance n')
ValueAnnotation n -> do
n' <- if isVarName n then vName n else cName n
return (ValueAnnProvenance n')
; returnL $ Hs.AnnD $ HsAnnotation target' exp'
}
dfltActivation :: TH.Inline -> Activation
dfltActivation TH.NoInline = NeverActive
dfltActivation _ = AlwaysActive
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment