Commit 56688d70 authored by Edward Z. Yang's avatar Edward Z. Yang Committed by Edward Z. Yang
Browse files

Report an error if you rename a requirement that doesn't exist.


Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent 14f57fdd
......@@ -415,6 +415,13 @@ convertInclude ((uid, ModuleShape provs reqs), pid, incl@(IncludeRenaming prov_r
| k <- map req_rename_fn (Set.toList reqs)
]
-- Report errors if there were unused renamings
let leftover = Map.keysSet req_rename `Set.difference` reqs
unless (Set.null leftover) $
error $ "Attempted to rename the following requirements, which " ++
"were not actually requirements of " ++ display uid ++ ": " ++
intercalate ", " (map display (Set.toList leftover))
-- Provision computation is more complex.
-- For example, if we have:
--
......
name: Fail1
version: 0.1.0.0
license: BSD3
author: Edward Z. Yang
maintainer: ezyang@cs.stanford.edu
build-type: Simple
cabal-version: >=1.25
library sig
signatures: A
build-depends: base
library
build-depends: sig
mixins: sig requires (MissingReq as A)
default-language: Haskell2010
import Test.Cabal.Prelude
main = setupAndCabalTest $ do
skipUnless =<< ghcVersionIs (>= mkVersion [8,1])
r <- fails $ setup' "configure" []
assertOutputContains "MissingReq" r
return ()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment