Unexpected result from functional dependency typechecking
Summary
The following does not typecheck, despite being fully unambiguous and trivial to manually decide:
{-# LANGUAGE
FunctionalDependencies
#-}
class Inspect a b | a -> b
instance Inspect Int Bool
bad :: Inspect Int b => b
bad = True
=>
…
Couldn’t match expected type `b` with actual `Bool`
…
Expected behaviour
That the given should typecheck.
Environment
- GHC version used: 9.6.2