[GHC] #11366: Control.Exception.assert should perhaps take an implicit call stack

#11366: Control.Exception.assert should perhaps take an implicit call stack -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: task | Status: new Priority: normal | Milestone: 8.0.1 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: -------------------------------------+------------------------------------- It seems to me like our new implicit parameters-based callstack support is a more principled way of accomplishing the ad-hoc rewriting that we current do for `assert`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11366 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11366: Control.Exception.assert should perhaps take an implicit call stack -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: task | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by gridaphobe): We actually do this already, but it's `assertError` that checks the assertion and gets the CallStack. GHC rewrites `assert` to `assertError` unless optimizations are enabled; `assert` is just `const id`. I suppose it would be consistent to give `assert` a CallStack too, but GHC will (rightly) complain that it's unused. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11366#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11366: Control.Exception.assert should perhaps take an implicit call stack -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: task | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by gridaphobe): To clarify, there are two kinds of rewriting that happen with `assert`. 1. Adding the source location. 2. Eliminating the assertion from "production" code. (1) is possible with implicit CallStacks, and is already done that way, (2) is a separate issue for which we don't have a more principled mechanism. But maybe we do, what about a rewrite rule? Those only fire when optimizations are enabled. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11366#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC