[GHC] #11539: Warn about missing forall when -XScopedTypeVariables is on

#11539: Warn about missing forall when -XScopedTypeVariables is on -------------------------------------+------------------------------------- Reporter: kanetw | Owner: Type: feature | Status: new request | Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 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've ran into a situation where I forgot to put an explicit forall to actually make type variables scoped, resulting in something like {{{ Could not deduce (PacketTypeId s0 t0 a0) arising from a use of ‘fromPacketTypeId’ from the context (PacketTypeId s t n) }}} with code like {{{ getPacketTypeId :: PacketTypeId s t n => KnxPacket d s t -> Integer getPacketTypeId _ = fromPacketTypeId (Proxy :: Proxy s) (Proxy :: Proxy t)) :: Integer }}} It'd be nice if GHC printed an extra suggestion "Did you forget to include an explicit forall?" when something like that arises? Maybe even suggest ScopedTypeVariables if they're not on. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11539 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11539: Warn about missing forall when -XScopedTypeVariables is on -------------------------------------+------------------------------------- Reporter: kanetw | Owner: Type: feature request | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #9244 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * status: new => closed * resolution: => duplicate * related: => #9244 Comment: This is covered by #9244. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11539#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC