@@ -25,7 +25,11 @@ import Language.PureScript.Sugar.Names.Imports
2525import qualified Language.PureScript.Constants as C
2626
2727-- | Imported name used in some type or expression.
28−data Name = IdentName (Qualified Ident) | IsProperName (Qualified ProperName) | DctorName (Qualified ProperName)
28+data Name
29+ = IdentName (Qualified Ident)
30+ | TypeName (Qualified ProperName)
31+ | DctorName (Qualified ProperName)
32+ | ClassName (Qualified ProperName)
2933
3034-- | Map of module name to list of imported names from that module which have been used.
3135type UsedImports = M.Map ModuleName [Name]
@@ -63,6 +67,7 @@ findUnusedImports (Module _ _ _ mdecls mexports) env usedImps = do
6367 let ddiff = ctors \\ usedDctors
6468 in unless (null ddiff) $ tell $ errorMessage $ UnusedDctorExplicitImport tn ddiff
6569 _ -> return ()
70+
6671 return ()
6772
6873 _ -> return ()
@@ -102,7 +107,8 @@ findUnusedImports (Module _ _ _ mdecls mexports) env usedImps = do
102107
103108matchName :: (ProperName -> Maybe ProperName) -> Maybe ModuleName -> Name -> Maybe String
104109matchName _ qual (IdentName (Qualified q x)) | q == qual = Just $ showIdent x
105−matchName _ qual (IsProperName (Qualified q x)) | q == qual = Just $ runProperName x
110+matchName _ qual (TypeName (Qualified q x)) | q == qual = Just $ runProperName x
111+matchName _ qual (ClassName (Qualified q x)) | q == qual = Just $ runProperName x
106112matchName lookupDc qual (DctorName (Qualified q x)) | q == qual = runProperName <$> lookupDc x
107113matchName _ _ _ = Nothing
108114
@@ -114,6 +120,7 @@ runDeclRef :: DeclarationRef -> Maybe String
114120runDeclRef (PositionedDeclarationRef _ _ ref) = runDeclRef ref
115121runDeclRef (ValueRef ident) = Just $ showIdent ident
116122runDeclRef (TypeRef pn _) = Just $ runProperName pn
123+runDeclRef (TypeClassRef pn) = Just $ runProperName pn
117124runDeclRef _ = Nothing
118125
119126getTypeRef :: DeclarationRef -> Maybe (ProperName, Maybe [ProperName])