
#12716: Suggest ScopedTypeVariables when type variable not in scope -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 (Type checker) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- I recently wrote this: {{{ {-# LANGUAGE ExplicitForAll #-} {-# LANGUAGE TypeApplications #-} module B where f :: forall a. a -> a f x = id @a x }}} And was hornswoggled for the better part of five minutes for why "a" wasn't in scope. Answer: you need `ScopedTypeVariables`. A suggestion would be nice. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12716 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler