Interface warning when using data-dependencies

Hi,

I am testing the interface language feature and considering the following example:

-- | An interface to retrieve some time-dependent quantity
interface A where
  getLabel : Text
  getNumber : Time -> Decimal

then in a separate DAR

-- | A utility function 
f : [ContractId A] -> Update (Text -> Time -> Decimal)
f cids = do 
  values <- M.fromList <$> forA cids \cid -> do
    value <- fetch cid
    pure (getLabel value, value)
  pure \ text t -> case M.lookup text values of
    Some o -> getNumber o t
    None -> error ""

Now, when the two packages are linked via data-dependency, we have the build warning

  daml/B.daml:13:5: warning:
  Pattern match has inaccessible right hand side
  In a case alternative: Some o -> ...

The warning does not appear when using a dependency.

Would you know what triggers the warning?

Thank you,
Matteo

This is a bug but should be harmless I believe. I’ve opened Data-dependencies generate interface types without a constructor · Issue #14217 · digital-asset/daml · GitHub to fix this.

Thank you for investigating and raising the issue.

I can confirm that the code indeed behaves as expected.

Matteo

1 Like