[GHC] #10846: PartialTypeSignatures change implicit CallStack behavior

#10846: PartialTypeSignatures change implicit CallStack behavior -------------------------------------+------------------------------------- Reporter: | Owner: nitromaster101 | Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- I have two functions, f and f2 which are identical expect for the use of PartialTypeSignatures in f2. GHC produces a warning and says that f2's wildcard is filled in by String, which is correct. {{{#!hs {-# LANGUAGE ImplicitParams, PartialTypeSignatures #-} import GHC.Types f :: (?loc :: CallStack) => String f = show $ map (srcLocStartLine . snd) $ getCallStack ?loc f2 :: (?loc :: CallStack) => _ f2 = show $ map (srcLocStartLine . snd) $ getCallStack ?loc f_caller = f f2_caller = f2 }}} {{{ [1 of 1] Compiling Main ( Bug2.hs, interpreted ) Bug2.hs:8:30: warning: Found type wildcard ‘_’ standing for ‘String’ In the type signature for: f2 :: (?loc :: CallStack) => _ Ok, modules loaded: Main. *Main> f_caller "[6,11]" *Main> f2_caller "[9]" }}} f2_caller should have two entries (f2_caller's line and f2's line), just like f_caller. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10846 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10846: PartialTypeSignatures change implicit CallStack behavior -------------------------------------+------------------------------------- Reporter: nitromaster101 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by nitromaster101): * cc: gridaphobe (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10846#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10846: PartialTypeSignatures change implicit CallStack behavior -------------------------------------+------------------------------------- Reporter: nitromaster101 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by nitromaster101): Another version of f2 produces the same incorrect behavior: {{{#!hs f2 :: (?loc :: CallStack, _) => String f2 = show $ map (srcLocStartLine . snd) $ getCallStack ?loc }}} It's the same idea, but now the wildcard is in the constraints, even when it unifies with (). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10846#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10846: PartialTypeSignatures change implicit CallStack behavior -------------------------------------+------------------------------------- Reporter: nitromaster101 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Description changed by nitromaster101: Old description:
I have two functions, f and f2 which are identical expect for the use of PartialTypeSignatures in f2. GHC produces a warning and says that f2's wildcard is filled in by String, which is correct.
{{{#!hs {-# LANGUAGE ImplicitParams, PartialTypeSignatures #-}
import GHC.Types
f :: (?loc :: CallStack) => String f = show $ map (srcLocStartLine . snd) $ getCallStack ?loc
f2 :: (?loc :: CallStack) => _ f2 = show $ map (srcLocStartLine . snd) $ getCallStack ?loc
f_caller = f f2_caller = f2 }}} {{{ [1 of 1] Compiling Main ( Bug2.hs, interpreted )
Bug2.hs:8:30: warning: Found type wildcard ‘_’ standing for ‘String’ In the type signature for: f2 :: (?loc :: CallStack) => _ Ok, modules loaded: Main. *Main> f_caller "[6,11]" *Main> f2_caller "[9]" }}}
f2_caller should have two entries (f2_caller's line and f2's line), just like f_caller.
New description: I'm using GHC head at 062feee4e7408ad5b9d882e5fed2c700e337db72 I have two functions, f and f2 which are identical expect for the use of PartialTypeSignatures in f2. GHC produces a warning and says that f2's wildcard is filled in by String, which is correct. {{{#!hs {-# LANGUAGE ImplicitParams, PartialTypeSignatures #-} import GHC.Types f :: (?loc :: CallStack) => String f = show $ map (srcLocStartLine . snd) $ getCallStack ?loc f2 :: (?loc :: CallStack) => _ f2 = show $ map (srcLocStartLine . snd) $ getCallStack ?loc f_caller = f f2_caller = f2 }}} {{{ [1 of 1] Compiling Main ( Bug2.hs, interpreted ) Bug2.hs:8:30: warning: Found type wildcard ‘_’ standing for ‘String’ In the type signature for: f2 :: (?loc :: CallStack) => _ Ok, modules loaded: Main. *Main> f_caller "[6,11]" *Main> f2_caller "[9]" }}} f2_caller should have two entries (f2_caller's line and f2's line), just like f_caller. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10846#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10846: PartialTypeSignatures change implicit CallStack behavior -------------------------------------+------------------------------------- Reporter: nitromaster101 | Owner: gridaphobe Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by gridaphobe): * owner: => gridaphobe -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10846#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10846: PartialTypeSignatures change implicit CallStack behavior -------------------------------------+------------------------------------- Reporter: nitromaster101 | Owner: gridaphobe Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1422 Wiki Page: | -------------------------------------+------------------------------------- Changes (by gridaphobe): * status: new => patch * differential: => Phab:D1422 Comment: This seems to be fixed by 1e041b7, but I've added a test-case in my patch for the slightly related #10845. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10846#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10846: PartialTypeSignatures change implicit CallStack behavior -------------------------------------+------------------------------------- Reporter: nitromaster101 | Owner: gridaphobe Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1422 Wiki Page: | -------------------------------------+------------------------------------- Changes (by gridaphobe): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10846#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC