From a730bbda2b91cf2bac9b63be8647ba322691e57f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 24 Jan 2018 13:32:04 -0400 Subject: Add HasCallStack constraint to pickOS and unsupportedOS, so the call stack includes the caller. This commit was sponsored by Jochen Bartl on Patreon. --- src/Propellor/Property.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Propellor/Property.hs') 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." -- cgit v1.2.3