aboutsummaryrefslogtreecommitdiff
path: root/src/HaskellCodeExplorer
diff options
context:
space:
mode:
Diffstat (limited to 'src/HaskellCodeExplorer')
-rw-r--r--src/HaskellCodeExplorer/AST/RenamedSource.hs20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/HaskellCodeExplorer/AST/RenamedSource.hs b/src/HaskellCodeExplorer/AST/RenamedSource.hs
index d3b67d3..52e92e6 100644
--- a/src/HaskellCodeExplorer/AST/RenamedSource.hs
+++ b/src/HaskellCodeExplorer/AST/RenamedSource.hs
@@ -64,6 +64,7 @@ import GHC
#endif
, Type
, RoleAnnotDecl(..)
+ , InjectivityAnn (..)
, unLoc
)
#if MIN_VERSION_GLASGOW_HASKELL(8,4,3,0)
@@ -124,7 +125,8 @@ namesFromRenamedSource =
hsRecAmbFieldExprNames `extQ`
hsRecFieldPatNames `extQ`
foreignDeclNames `extQ`
- roleAnnotationNames)
+ roleAnnotationNames `extQ`
+ injectivityAnnotationNames)
#if MIN_VERSION_GLASGOW_HASKELL(8,4,3,0)
fieldOccName :: Bool -> FieldOcc GhcRn -> NameOccurrence
@@ -647,3 +649,19 @@ roleAnnotationNames (RoleAnnotDecl n _) =
, isBinder = False
}
]
+
+#if MIN_VERSION_GLASGOW_HASKELL(8,4,3,0)
+injectivityAnnotationNames :: InjectivityAnn GhcRn -> [NameOccurrence]
+#else
+injectivityAnnotationNames :: InjectivityAnn Name -> [NameOccurrence]
+#endif
+injectivityAnnotationNames (InjectivityAnn lhsName rhsNames) =
+ injAnnNameOcc lhsName : map injAnnNameOcc rhsNames
+ where
+ injAnnNameOcc :: GenLocated SrcSpan Name -> NameOccurrence
+ injAnnNameOcc n =
+ NameOccurrence
+ { locatedName = Just <$> n
+ , description = "InjectivityAnn"
+ , isBinder = False
+ }