git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Add HasCallStack to internalError (#2608)
6277f69Alex Biehl
CONTRIBUTORS.md+1
@@ -89,6 +89,7 @@ This file lists the contributors to the PureScript compiler project, and the ter
89- [@RyanGlScott](https://github.com/RyanGlScott) (Ryan Scott) My existing contributions and all future contributions until further notice are Copyright Ryan Scott, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
89- [@RyanGlScott](https://github.com/RyanGlScott) (Ryan Scott) My existing contributions and all future contributions until further notice are Copyright Ryan Scott, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
90- [@seungha-kim](https://github.com/seungha-kim) (Seungha Kim) My existing contributions and all future contributions until further notice are Copyright Seungha Kim, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
90- [@seungha-kim](https://github.com/seungha-kim) (Seungha Kim) My existing contributions and all future contributions until further notice are Copyright Seungha Kim, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
91- [@matthewleon](https://github.com/matthewleon) (Matthew Leon) My existing contributions and all future contributions until further notice are Copyright Matthew Leon, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
91- [@matthewleon](https://github.com/matthewleon) (Matthew Leon) My existing contributions and all future contributions until further notice are Copyright Matthew Leon, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
92+- [@alexbiehl](https://github.com/alexbiehl) (Alexander Biehl) My existing contributions and all future contributions until further notice are Copyright Alexander Biehl, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
92
93
93### Companies
94### Companies
94
95
src/Language/PureScript/Crash.hs+27−11
@@ -1,11 +1,27 @@
1+{-# LANGUAGE CPP #-}
2+{-# LANGUAGE ImplicitParams #-}
3+
1−module Language.PureScript.Crash where
4+module Language.PureScript.Crash where
2−
5+
3−import Prelude.Compat
6+import Prelude.Compat
4−
7+
8+import qualified GHC.Stack
9+
10+-- | A compatibility wrapper for the @GHC.Stack.HasCallStack@ constraint.
11+#if __GLASGOW_HASKELL__ >= 800
12+type HasCallStack = GHC.Stack.HasCallStack
13+#elif MIN_VERSION_GLASGOW_HASKELL(7,10,2,0)
14+type HasCallStack = (?callStack :: GHC.Stack.CallStack)
15+#else
16+import GHC.Exts (Constraint)
17+-- CallStack wasn't present in GHC 7.10.1
18+type HasCallStack = (() :: Constraint)
19+#endif
20+
5−-- | Exit with an error message and a crash report link.
21+-- | Exit with an error message and a crash report link.
6−internalError :: String -> a
22+internalError :: HasCallStack => String -> a
7−internalError =
23+internalError =
8− error
24+ error
9− . ("An internal error occurred during compilation: " ++)
25+ . ("An internal error occurred during compilation: " ++)
10− . (++ "\nPlease report this at https://github.com/purescript/purescript/issues")
26+ . (++ "\nPlease report this at https://github.com/purescript/purescript/issues")
11− . show
27+ . show