Skip to content

Commit 1bcc1bd

Browse files
committed
fix: handle unmatched Key cases in fromKey and fromKeyType functions
1 parent 2a71e12 commit 1bcc1bd

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • ghcide/src/Development/IDE/Types

ghcide/src/Development/IDE/Types/Shake.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ fromKey :: Typeable k => Key -> Maybe (k, NormalizedFilePath)
8282
fromKey (Key k)
8383
| Just (Q (k', f)) <- cast k = Just (k', f)
8484
| otherwise = Nothing
85+
fromKey _ = Nothing
8586

8687
-- | fromKeyType (Q (k,f)) = (typeOf k, f)
8788
fromKeyType :: Key -> Maybe (SomeTypeRep, NormalizedFilePath)
@@ -91,6 +92,7 @@ fromKeyType (Key k)
9192
, Q (_, f) <- k
9293
= Just (SomeTypeRep a, f)
9394
| otherwise = Nothing
95+
fromKeyType _ = Nothing
9496

9597
toNoFileKey :: (Show k, Typeable k, Eq k, Hashable k) => k -> Key
9698
toNoFileKey k = newKey $ Q (k, emptyFilePath)

0 commit comments

Comments
 (0)