@@ -243,7 +243,7 @@ lintImportDecl env mni qualifierName names declType allowImplicit =
243243 didWarn' <- forM (mapMaybe getTypeRef declrefs) $ \(tn, c) -> do
244244 let allCtors = dctorsForType mni tn
245245 -- If we've not already warned a type is unused, check its data constructors
246− unless' (runProperName tn `notElem` usedNames) $
246+ unless' (TyName tn `notElem` usedNames) $
247247 case (c, dctors `intersect` allCtors) of
248248 (_, []) | c /= Just [] -> warn (UnusedDctorImport mni tn qualifierName allRefs)
249249 (Just ctors, dctors') ->
@@ -335,18 +335,18 @@ findUsedRefs env mni qn names =
335335matchName
336336 :: (ProperName 'ConstructorName -> Maybe (ProperName 'TypeName))
337337 -> Name
338− -> Maybe String
339−matchName _ (IdentName x) = Just $ showIdent x
340−matchName _ (TyName x) = Just $ runProperName x
341−matchName _ (TyClassName x) = Just $ runProperName x
342−matchName lookupDc (DctorName x) = runProperName <$> lookupDc x
343−matchName _ _ = Nothing
344−
345−runDeclRef :: DeclarationRef -> Maybe String
338+ -> Maybe Name
339+matchName lookupDc (DctorName x) = TyName <$> lookupDc x
340+matchName _ ModName{} = Nothing
341+matchName _ name = Just name
342+
343+runDeclRef :: DeclarationRef -> Maybe Name
346344runDeclRef (PositionedDeclarationRef _ _ ref) = runDeclRef ref
347−runDeclRef (ValueRef ident) = Just $ showIdent ident
348−runDeclRef (TypeRef pn _) = Just $ runProperName pn
349−runDeclRef (TypeClassRef pn) = Just $ runProperName pn
345+runDeclRef (ValueRef ident) = Just $ IdentName ident
346+runDeclRef (ValueOpRef op) = Just $ ValOpName op
347+runDeclRef (TypeRef pn _) = Just $ TyName pn
348+runDeclRef (TypeOpRef op) = Just $ TyOpName op
349+runDeclRef (TypeClassRef pn) = Just $ TyClassName pn
350350runDeclRef _ = Nothing
351351
352352checkDuplicateImports