summaryrefslogtreecommitdiff
path: root/src/Propellor/Property.hs
diff options
context:
space:
mode:
authorJoey Hess2018-01-24 13:32:04 -0400
committerJoey Hess2018-01-24 13:32:04 -0400
commita730bbda2b91cf2bac9b63be8647ba322691e57f (patch)
tree0e8e7a13dc3741a362577387ac729406df7b7bdb /src/Propellor/Property.hs
parentd79367b4324dec67d929f18239e4159cf8b4d890 (diff)
Add HasCallStack constraint to pickOS and unsupportedOS, so the call stack includes the caller.
This commit was sponsored by Jochen Bartl on Patreon.
Diffstat (limited to 'src/Propellor/Property.hs')
-rw-r--r--src/Propellor/Property.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs
index 884ee683..8c0a5859 100644
--- a/src/Propellor/Property.hs
+++ b/src/Propellor/Property.hs
@@ -55,6 +55,7 @@ import Data.Maybe
import Data.List
import Data.Hashable
import Control.Applicative
+import GHC.Stack
import Prelude
import Propellor.Types
@@ -283,6 +284,7 @@ isNewerThan x y = do
-- fail that way.
pickOS
::
+ HasCallStack =>
( SingKind ('KProxy :: KProxy ka)
, SingKind ('KProxy :: KProxy kb)
, DemoteRep ('KProxy :: KProxy ka) ~ [MetaType]
@@ -344,7 +346,7 @@ unsupportedOS = property "unsupportedOS" unsupportedOS'
-- | Throws an error, for use in `withOS` when a property is lacking
-- support for an OS.
-unsupportedOS' :: Propellor Result
+unsupportedOS' :: HasCallStack => Propellor Result
unsupportedOS' = go =<< getOS
where
go Nothing = error "Unknown host OS is not supported by this property."