Closed rubik closed 8 years ago
Maybe @alanz can help shed light on this? I see he is very knowledgeable about this topic.
Can you provide the input file that causes the crash?
I'm sorry, I was sure I had included it. Here it is:
{-# LANGUAGE ScopedTypeVariables #-}
module Utility.Exception where
import Control.Monad.Catch as X hiding (Handler)
import qualified Control.Monad.Catch as M
catchNonAsync :: MonadCatch m => m a -> (SomeException -> m a) -> m a
catchNonAsync a onerr = a catches
[ M.Handler ( (e :: SomeException) -> onerr e)
]
It seems it is the EViewPat
with an enclosed ExprWithTySig
that is the problem, it uses mkHsWithBndrs
which initialises with panic values
data HsWithBndrs thing
= HsWB { hswb_cts :: thing -- Main payload (type or list of types)
, hswb_kvs :: [Name] -- Kind vars
, hswb_tvs :: [Name] -- Type vars
}
deriving (Data, Typeable)
mkHsWithBndrs :: thing -> HsWithBndrs thing
mkHsWithBndrs x = HsWB { hswb_cts = x, hswb_kvs = panic "mkHsTyWithBndrs:kvs"
, hswb_tvs = panic "mkHsTyWithBndrs:tvs" }
@rubik Please try install ghc-syb-utils from my repo to see if my attempt does anything for you.
Awesome! Thank you for your quick response and fix. It works perfectly now. Can you push a new version to Hackage?
I will have to put in a pull request, the repo/package belong to @nominolo
On Fri, Oct 30, 2015 at 8:46 PM, Michele Lacchia notifications@github.com wrote:
Closed #13 https://github.com/nominolo/ghc-syb/issues/13.
— Reply to this email directly or view it on GitHub https://github.com/nominolo/ghc-syb/issues/13#event-450718868.
Since you have a test program, how hard would it be to add it as a test case? Right now the acceptance criterion is probably just "doesn't crash", but still.
The GHC API is annoyingly unstable and full of those silly potholes. Would be nice to start catching regressions when GHC 8.0 comes along.
I can add it very easily to Argon tests. But it's only possible if a new version is pushed to Hackage, because Stack pulls packages from there or from Stackage. I already have quite a few tests that cover multiple cases.
@nominolo I am about to update for the Coercion
failure, but I see that
the github version of https://github.com/nominolo/ghc-syb does not have any
tests, although there is a target for it in the makefile.
Please clarify what tests you are requesting to be updated
On Fri, Oct 30, 2015 at 10:36 PM, Thomas Schilling <notifications@github.com
wrote:
Since you have a test program, how hard would it be to add it as a test case? Right now the acceptance criterion is probably just "doesn't crash", but still.
The GHC API is annoyingly unstable and full of those silly potholes. Would be nice to start catching regressions when GHC 8.0 comes along.
— Reply to this email directly or view it on GitHub https://github.com/nominolo/ghc-syb/issues/13#issuecomment-152645340.
I think @nominolo was referring to my program Argon. I already added the relevant test cases and confirmed that your changes solve the issues. Now it's just a matter of publishing a new version of ghc-syb-utils.
While traversing the AST with
everythingStaged Parser
GHC 7.8.4 crashes onmkHsTyWithBndrs
:As far as I understand, this shouldn't happen, as
everythingStaged
is supposed to avoid known potholes.Here is how
everythingStaged
is being used: https://github.com/rubik/argon/blob/master/src/Argon/Visitor.hs