strengthen unused * testing (#6467)

changelog_begin
changelog_end
This commit is contained in:
Shayne Fletcher 2020-06-23 12:44:11 -04:00 committed by GitHub
parent 6ad3279bbd
commit 4f68cfc480
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 8 deletions

View File

@ -284,9 +284,21 @@ xFlagsSet options =
wOptsSet :: [ WarningFlag ]
wOptsSet =
[ Opt_WarnUnusedImports
-- Can enable when we are on GHC >= 8.10 (we should, after all we
-- upstreamed it :) ).
-- , Opt_WarnPrepositiveQualifiedModule
, Opt_WarnOverlappingPatterns
, Opt_WarnIncompletePatterns
-- Confirmed that nothing in template desugaring prevents us from
-- enabling these.
-- , Opt_WarnUnusedMatches
-- , Opt_WarnUnusedForalls
-- , Opt_WarnUnusedPatternBinds
-- , Opt_WarnUnusedTopBinds
-- , Opt_WarnUnusedTypePatterns
-- Template desugaring in the presence of local binds will currently
-- trigger this.
-- , Opt_WarnUnusedLocalBinds
]
-- | Warning options set for DAML compilation, which become errors.

View File

@ -202,7 +202,7 @@ exerciseByKey k c = do
exercise cid c
-- | Create a contract and exercise the choice on the newly created contract.
createAndExercise : forall t k c r. (HasCreate t, HasExercise t c r) => t -> c -> Update r
createAndExercise : forall t c r. (HasCreate t, HasExercise t c r) => t -> c -> Update r
createAndExercise t c = do
cid <- create t
exercise cid c

View File

@ -78,7 +78,7 @@ divulgeeLookup = scenario do
blindLookup = scenario do
sig <- getParty "s" -- Signatory
blind <- getParty "b" -- Blind
keyedCid <- submit sig do create Keyed with ..
_ <- submit sig do create Keyed with ..
-- Blind party can't do positive lookup with maintainer authority.
submit blind do
mcid <- createAndExercise (Delegation sig blind) LookupKeyed

View File

@ -1,4 +1,5 @@
-- Copyright (c) 2020, Digital Asset (Switzerland) GmbH and/or its
-- affiliates. All rights reserved.
module ExportList
( function1
, Data1

View File

@ -1,5 +1,6 @@
module TyConAppCoercion () where
-- Copyright (c) 2020, Digital Asset (Switzerland) GmbH and/or its
-- affiliates. All rights reserved.
module TyConAppCoercion (X(..)) where
class MyClass a where
f1 : Optional a -> a

View File

@ -1,13 +1,20 @@
-- Copyright (c) 2020, Digital Asset (Switzerland) GmbH and/or its
-- affiliates. All rights reserved.
-- @WARN range=12:2-12:3; Defined but not used
-- @WARN range=19:2-19:3; Defined but not used
{-# OPTIONS_GHC -Wunused-matches #-}
{-# OPTIONS_GHC -Wunused-foralls #-}
{-# OPTIONS_GHC -Wunused-imports #-}
{-# OPTIONS_GHC -Wunused-pattern-binds #-}
{-# OPTIONS_GHC -Wunused-top-binds #-}
{-# OPTIONS_GHC -Wunused-type-patterns #-}
-- We know this will fail and why.
-- {-# OPTIONS_GHC -Wunused-local-binds #-}
module UnusedMatchTests where
-- It should be OK to enable -Wunused-matches and not get warnings
-- from template desugared code.
-- It should be OK to enable -Wunused-* and not get warnings from
-- template desugared code.
f x = 12 -- Defined but not used 'x'; prove unsed match detection.