[GHC] #15498: HPC: do notation marks () as non-covered

#15498: HPC: do notation marks () as non-covered -------------------------------------+------------------------------------- Reporter: tom-bop | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Code Coverage | Version: 8.2.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Incorrect Unknown/Multiple | error/warning at compile-time Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- With this Main.hs, the "()" in "pure ()" is marked by HPC as a non-covered expression: {{{#!hs foo :: IO () foo = do _ <- putStrLn "Unimportant string" pure () main :: IO () main = do foo putStrLn "Unimportant #2" }}} Repro: - `ghc -fhpc Main.hs` - `./Main` - `hpc markup Main.tix` This is an admittedly small issue, but it can be valuable for a project to aspire to 100% code coverage and false negatives prevent us from getting there. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15498 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15498: HPC: do notation marks () as non-covered -------------------------------------+------------------------------------- Reporter: tom-bop | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Code Coverage | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple error/warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by osa1): Do you mean `()` should've marked as evaluated because it's a CAF? Otherwise I think the coverage output is correct, `()` is never evaluated. Replace `()` with `undefined` and you'll see that program output does not change. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15498#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC