Commit Graph

1915 Commits

Author SHA1 Message Date
Moisés Ackerman
611cce8c8c
Add parens in desugared code (#13603)
* Add parens around 'fromAnyException' view pattern in '_tryCatch' desugaring

* Add parens around desugared 'setField' calls and around its first argument.

* Update desugaring golden files

* Add golden test for parens around 'setField' in renamed daml

changelog_begin
changelog_end
2022-04-20 17:05:16 +00:00
Robin Krom
e0ddfef89c
damlc: add option to filter which scenarios to run (#13600)
This adds an option to specify a pattern such that only tests containing
the given pattern in their name will be executed.

Fixes #13534.

CHANGELOG_BEGIN
CHANGELOG_END
2022-04-20 14:43:14 +02:00
Moisés Ackerman
2e22929cd0
Desugared Daml golden tests (#13591)
* Add daml-desugar library

* Add desugar command to damlc

* Add daml-desugar golden tests

* Add EXPECTED.desugared-daml files for Interface tests

* Add EXPECTED.desugared-daml files for Exception tests

* drop manually generated {Exception,Interface}Desugared files

changelog_begin
changelog_end
2022-04-14 13:14:37 +00:00
Stefano Baghino
d105db2ece
Mention that we do not publish docs for snapshots in the release guide (#13587)
changelog_begin
changelog_end
2022-04-14 10:37:49 +02:00
Robin Krom
fcd3b6622b
ifaces:support exercising by required interface (#13554)
* ifaces:support exercising by required interface

This adds support to exercise an interface choice on a contract ID,
where the interface is required by one of the implemented interfaces of
the contract template.

Fixes #13434.

CHANGELOG_BEGIN
CHANGELOG_END

* some improvements based on review

* added a test plus a bugfix

* Update daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/PhaseOne.scala

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>

* 2 more interface tests for the command preprocessor

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2022-04-12 18:15:29 +00:00
Moisés Ackerman
d85ced7b79
Cross-module interface tests (#13560)
* Add test case 'require interface from data-dependency'

* Add test case 'data-dependency interface hierarchy'

changelog_begin
changelog_end
2022-04-12 10:23:31 +02:00
Moisés Ackerman
606896e17f
Add partial ContractId-in-template-key check (#13541)
* Add Keyability check in DA.Daml.LF.TypeChecker

* Update expected errors in daml-test-files/ContractIdInContractKey.daml

* Update no-contract-ids-in-keys daml-lf scenario test to circumvent new check

changelog_begin
[Daml Compiler] Implemented compile-time check disallowing ContractId types in contract key types. This check looks for potential problems with the contract key type only within the template's module.
changelog_end

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2022-04-11 18:05:49 +02:00
Robin Krom
8c046c7776
ghc-lib:remove unused let bindings (#13525)
* ghc-lib:remove unused let bindings

This updates ghc-lib, such that no unused let bindings are created in
Archive choices.

Fixes #13431.

CHANGELOG_BEGIN
CHANGELOG_END

* update ghc-lib hash

* Update of InterfaceDesugared.daml
2022-04-11 12:34:17 +00:00
Moritz Kiefer
7da8d54613
Add unionWith to DA.Map (#13532)
changelog_begin

- [Daml Stdlib] Add `unionWith` function. `unionWith` is a more
  flexible version of `union` that accepts a function to combine
  values found in both maps.

changelog_end
2022-04-08 09:51:47 +00:00
Remy
d94aa137f1
Remove by_interface from scenario transaction Nodes (#13509)
part of #13491

CHANGELOG_BEGIN
CHANGELOG_END
2022-04-06 11:09:52 +00:00
Moisés Ackerman
b08fcfada3
Property test buildLfPackageGraph (#13481)
* Generalize buildLfPackageGraph to arbitrary payload type

* Reinstate 'data-dependencies + exposed-modules' test without quickcheck

* Add property-based test on the graph resulting from buildLfPackageGraph'

changelog_begin
changelog_end
2022-04-06 10:00:58 +02:00
Moisés Ackerman
6402b2e95c
Handle scenario service errors (#13479)
* Add ChoiceGuardFailed and ContractDoesNotImplementInterface errors to scenario-service protocol

* Update daml-test-file InterfaceErrors.daml 

* Add daml-test-files for ChoiceGuardFailed and ContractDoesNotImplementInterface errors

changelog_begin
changelog_end

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2022-04-05 09:26:08 +00:00
Moisés Ackerman
f59d1cd0b4
Convert experimental primitive TYPEREP_TYCON_NAME into proper LF builtin (#13465)
* Convert experimental primitive TYPEREP_TYCON_NAME into proper LF builtin

* Add entry for TYPEREP_TYCON_NAME in daml-lf spec

* disable quickcheck test in DA.Test.Packaging

changelog_begin
changelog_end
2022-03-31 14:35:46 +02:00
Sofia Faro
7000875e62
interfaces: Make fromInterfaceContractId pure, add fetchFromInterface (#13453)
* interfaces: Make fromInterfaceContractId pure.

This PR changes `fromInterfaceContractId` to make it pure. This means
it cannot verify the contract id coercion, and should only be used
with care. To balance this, this PR also adds `fetchFromInterface` which
combines a `fetch` with a `fromInterface` and `fromInterfaceContractId`,
to serve as a safer alternative to `fromInterfaceContractId`, and is more
useful than the old `fromInterfaceContractId` since it also returns the
fetched & converted contract payload.

changelog_begin
changelog_end

* fix integration tests

* add submitMustFail tests for fromInterfaceContractId
2022-03-30 16:42:03 +00:00
Moisés Ackerman
da812e4c8b
Drop duplicate packages in dependency graph (#13442)
* Drop duplicate packages in dependency graph

* Add double data-dependency test

changelog_begin
changelog_end
2022-03-30 14:54:26 +02:00
Moisés Ackerman
f9f1611d46
Unsafe interface conversion primitives (#13391)
* Add unsafeFromInterface method to HasFromInterface class

* Use unsafeFromInterface instead of fromInterface + experimental primitive

* Drop THROW_WRONGLY_TYPED_CONTRACT experimental primitive

* Add UnsafeFrom{,Required}Interface LF primitives

* Add convertPrim cases for UnsafeFrom{,Required}Interface

* Add InterfaceGuarded tests for WronglyTypedContract cases

changelog_begin
changelog_end

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2022-03-25 10:07:14 +00:00
Moisés Ackerman
1185eb32bc
Preserve inherited choice info in daml test coverage report (#13354)
* Preserve inherited choice info in 'daml test' coverage report

changelog_begin
changelog_end
2022-03-23 12:28:04 +01:00
Stefano Baghino
50fd93c250
Address remaining issues about CVE-2021-44906 (#13382)
Addresses https://github.com/digital-asset/daml/security/dependabot/28
Addresses https://github.com/digital-asset/daml/security/dependabot/24

changelog_begin
changelog_end
2022-03-23 11:06:31 +00:00
Robin Krom
d10f678518
ifaces: tests for by_interface in transactions (#13365)
We add tests to check that by_interface fields are set for interface
transactions. We also extend the scenario service to show the
by_interface fields in the pretty printed transactions.

Fixes #13333

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-22 19:53:49 +00:00
Moisés Ackerman
b800fdc99a
expand buildLfPackageGraph docstring (#13343)
changelog_begin
changelog_end
2022-03-21 13:29:59 +01:00
Moisés Ackerman
2971949913
Allow dependencies that depend on data-deps (#13205)
Previously, all dependencies were installed first in a single step, and then
the data-dependencies were installed according to the dependency graph. 
This failed for dependencies with data-dependencies since those are processed later.

This was achieved by installing _all_ dependencies and data-dependencies according to the
dependency graph. Additionally, to ensure that the instance-rewriting behavior is preserved, 
the dependency graph is extended with edges from each data-dependency to the subset of 
dependencies without data-dependencies.

[instance rewriting behaviour: the class instances from data-dependencies are rewritten 
to refer to a matching class definition from a dependency when such a class definition exists.
]

* Add edges from each data-dependency to all dependencies without data-dependencies

* Generate stub sources inside for loop

* Update PackageMap manually

* Make PackageNode a sum type

* Add TODO for replacing recachePkgDb

* Tests

    * Generalize 'data-dependencies + exposed-modules' test with QuickCheck

    * Add test for building a project where a dependency has a data-dependency

    * Add test for building a project where a dependency has a data-dependency which is a plain dependency of the main project

    * Add test for building a project where a dependency has a data-dependency which is not a dependency of any kind of the main project

changelog_begin
changelog_end
2022-03-18 16:10:29 +01:00
Sofia Faro
79715ad32d
interfaces: Drop the typerep, raise WronglyTypedContract (#13314)
* Drop the typerep in interface desugaring.

GHC PR: https://github.com/digital-asset/ghc/pull/110

Fixes https://github.com/digital-asset/daml/issues/13275 and https://github.com/digital-asset/daml/issues/13283

changelog_begin
changelog_end

* compile ghc-lib

* update bazel-haskell-deps

* update InterfaceTypeRepCheck test

* scalafmt

* update compile.yml

* update bazel-haskell-deps last time
2022-03-17 16:12:46 +00:00
Sofia Faro
1feb4d25eb
Drop typerep argument from ExerciseInterface. (#13284)
* ifaces: Remove typerep arg from UExerciseInterface

changelog_begin
changelog_end

* Drop typerep argument in protobuf and haskell ast

changelog_begin
changelog_end

* scalafmt

* fix ExprParser

* fix PhaseOneTest

* fix validation test

* update evidencing security
2022-03-15 13:53:06 +00:00
Sofia Faro
83bdd983da
interfaces: Mark interface functions as 1.dev only in docs (#13268)
* iface: Mark functions as 1.dev only in docs

changelog_begin
changelog_end

* Update compiler/damlc/daml-stdlib-src/DA/Internal/Interface.daml

Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>

Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
2022-03-14 11:47:14 +00:00
Moritz Kiefer
a8057a5741
Handle absence of table view in Daml Studio (#13245)
We encounter that when there are no transactions which can happen
legitimately if you’re testing pure functions.

fixes #11244

changelog_begin

- [Daml Studio] Fix an issue where script views failed to display if
  there were no transactions. Now you can see trace messages even in
  those cases.

changelog_end
2022-03-10 11:56:06 +01:00
Remy
851fb53083
add milli/micro-seconds to RelTime and fix doc (#13217)
CHANGELOG_BEGIN
CHANGELOG_END
2022-03-09 19:09:10 +00:00
Moritz Kiefer
4e004e0a88
Replace scenario messages with script (#13207)
* Replace scenario messages with script

In theory we could try to be clever and print the "right" thing. In
practice, scenarios are almost dead so the complexity for that doesn’t
seem worth it.

fixes #13178

changelog_begin
changelog_end

* .
2022-03-09 11:35:37 +01:00
Moritz Kiefer
af855e5675
Speed up Daml repl startup (#13172)
* Speed up Daml repl startup

Daml repl startup is stupidly slow to the point where starting up and
executing 1+1 takes ~7s (piped to stdin so no typing included).

This PR speeds this up to ~4.5s. In addition to that, we also display
the repl process sooner and complete the last bit of setup while the
user is typing.

Specifically, we do the following:

1. Startup the JVM process in parallel with initializing our package
   db and only block on it once it’s started (and remove a stupid 1s
   sleep which doesn’t actually matter).
2. Load all packages in one go instead of one by one. This (roughly)
   matches how the script service works.
3. Only block on packages being loaded once we start running the
   script. Users can type before and we even typecheck their stuff
   before.

We could take this further and do even more in parallel with users
typing but this seems to strike a good balance between implementation
complexity, UX (if startup actually fails you get somewhat sensible
errors) & performance.

changelog_begin
changelog_end

* handle tls logs

changelog_begin
changelog_end

* Update compiler/damlc/daml-compiler/src/DA/Daml/Compiler/Repl.hs

Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>

* s/terminateBarrier/exitBarrier/

changelog_begin
changelog_end

Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
2022-03-09 08:22:42 +00:00
Gary Verhaegen
dfa648f585
hunt down DAML better (#13195)
Process:

- `git ls-files -z | xargs -0 -n 100 sed -i --follow-symlinks 's/DAML/Daml/g'`
- `git add -p`
- `git restore -p`
- Check there is no unstaged change left.

To review:

- Check for false positives by carefully reviewing the diff in this PR.
- Check for false negatives with `git grep DAML`.
- Quicker check for fals positives:

```
git grep DAML | grep -v migration | grep -v DAML_
```

Fixes #13190

Note: This is the "second half" of #13191, which failed to cover all the
remaining DAMLs because of:

```
$ git ls-files | grep "'"
compiler/damlc/tests/daml-test-files/MangledScenario'.daml
```

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-08 17:04:58 +01:00
Gary Verhaegen
961ca80b77
hunt down DAML (#13191)
Process:

- `git ls-files | xargs sed -i 's/DAML/Daml/g'`
- `git add -p`

To review:

- Check for false positives by carefully reviewing the diff in this PR.
- Check for false negatives with `git grep DAML`.

CHANGELOG_BEGIN
- Removed all traces of DAML. This may affect error messages and debug
  outputs.
CHANGELOG_END
2022-03-08 14:25:25 +01:00
Sofia Faro
b2d6f8014c
LF: Use template parameter (this) in method bodies. (#13142)
* Use `this` param in method bodies in LF.

Instead of having method bodies be functions from the template, have them reuse the existing template parameter (usually `this`).

Fixes #13123

changelog_begin
changelog_end

* fix validation-test
2022-03-03 13:50:59 +00:00
Moisés Ackerman
7ca26b01ce
make interface declaration where optional (#13129)
* Extend InterfaceSyntax test file with interfaces declared without 'where'

changelog_begin
changelog_end
2022-03-03 11:09:56 +00:00
Moisés Ackerman
2dbd91aab9
Interface methods can use plain function declaration syntax (#13102)
* Update 'implements' blocks to use new syntax

* Add InterfaceSyntax test case

* Add InterfaceMultipleMethodDeclsError test case

* Add InterfaceDifferentNumArgsError test case

changelog_begin
changelog_end
2022-03-02 15:59:01 +00:00
Moritz Kiefer
7acc6a9009
Pipe hpp through package_app (#13128)
This is needed so shared libraries are properly resolved and this
actually works outside of our build. Same issue that broke
damlc_legacy originally and we had someone trying to use cpp on their
own project (whether they should is another question but having it
half working is even worse).

I don’t know how to write a test for this unfortunately. It would only
fail if our nix store is not available which is pretty hard to
simulate. I could spin up a docker image or something but that doesn’t
seem worth the trouble.

fixes #13100

changelog_begin
changelog_end
2022-03-02 16:04:12 +01:00
Sofia Faro
db100c131a
Prevent iface choice & method name collisions. (#13075)
* Prevent iface choice & method name collisions.

This PR adds interface choices and methods to the name collision checker.

changelog_begin
changelog_end

* check the names from interfaces

* add error

* implement name collision check in scala side

* scalafmt
2022-02-28 13:21:41 +00:00
Moisés Ackerman
7af4215261
Interfaces accept at most a single ensure clause (#13093)
* Add test for multiple ensure declarations in interface

* update ghc patch

* Update expected result for daml-doc interface test

changelog_begin
changelog_end
2022-02-28 14:12:40 +01:00
Robin Krom
3692a4a565
interfaces:ensure that implementations are ordered (#13071)
* interfaces:ensure that implementations are ordered

We make sure that the implementations are ordered by insertion in the
Scala AST. This is important to guarantee an evaluation order of the
interface preconditions that is determined by the order of interface
implementations of a template.

CHANGELOG_BEGIN
CHANGELOG_END

* use VectorMap instead of ListMap
2022-02-25 15:14:50 +00:00
Moritz Kiefer
0ea4866adc
Fix activeness display in script service (#13059)
The previous way of tracking this only worked for direct children of
rollback nodes but lost the information when there was an exercise
node in between.

Reported in https://discuss.daml.com/t/exception-rollback/4000

changelog_begin

- [Daml Studio] Fix a bug where contracts that have been rolled back
  would still show up as active in the table view and in the list of
  active contracts at the end of the transaction view. This only
  affected display. Fetching those contracts failed and `query` also
  did not return those contracts.

changelog_end
2022-02-24 16:20:00 +01:00
Moisés Ackerman
58132cf71c
Fix data-deps orphan imports without explicit packageRefs (#13055)
* Include orphan instance imports in buildLfPackageGraph

* Add failing test for cross-DAML-LF version data-deps with stdlib orphan instances

* Add failing test for cross-DAML-LF version data-deps with custom orphan instance

changelog_begin
changelog_end
2022-02-24 15:03:10 +01:00
Moisés Ackerman
91ddbe9cf0
Include interface choices in 'damlc test' coverage stats (#13012)
changelog_begin
changelog_end
2022-02-23 13:44:36 +01:00
Remy
e834a7b85c
Triggers: Connect Logging context from Triggers to the Speedy. (#13009)
Follow up of #12976.
fixes #12208

CHANGELOG_BEGIN
CHANGELOG_END
2022-02-22 18:28:49 +01:00
Moisés Ackerman
2532cf8991
Derive Eq for interfaces (#12988)
changelog_begin
changelog_end
2022-02-22 16:33:48 +01:00
Moritz Kiefer
8a966bfaf3
Upgrade sphinx (#12968)
* Upgrade sphinx

Don’t want to be stuck on 1.8.3 forever. The current version is
4.4.0 (this upgrades to 4.3.1 which is the latest in nixpkgs).

I did had to drop footnotebackref. This runs into the same issue as
https://tex.stackexchange.com/questions/137594/hyperref-footnotebackref-in-longtable
but just copying the fix doesn’t work and I don’t understand enough
about the details here to fix this myself.

We have 7 footnotes in the Daml docs + some in the Canton docs. That
does not seem worth sticking on a sphinx version from 2018 for just to
get backreferences from footnotes to the link on the same page.

changelog_begin
changelog_end

* turns out you need fonts maybe

* .

changelog_begin
changelog_end

* suppport :force: in daml-docs

changelog_begin
changelog_end
2022-02-22 14:30:15 +00:00
Sofia Faro
b842b53ff4
Delete vestigial InterfaceChoice from AST (#13017)
* Delete vestigial InterfaceChoice from AST

This is a leftover from when interfaces had virtual choices.

changelog_begin
changelog_end

* delete more
2022-02-22 13:59:04 +00:00
Sofia Faro
b626aeb632
Add experimental builtin to show template typerep (#13004)
Part of #12792, this is the builtin we need to be able to effectively
store a TemplateTypeRep inside a template (i.e. you store a string
containing the template id, not a typerep).

changelog_begin
changelog_end
2022-02-21 18:24:56 +00:00
Remy
ac3d9a4647
LF: Add LoggingContext to Speedy Machine (#12976)
This advances the state of #12208

CHANGELOG_BEGIN
CHANGELOG_END
2022-02-21 13:34:46 +01:00
Moritz Kiefer
04eff2722c
Drop daml-lf-verify (#12942)
This is completely unmaintained, unused and partially broken so delete
it for now. Worst case, we recover it from Git history.

closes #6550 because it now refers to deleted code.

changelog_begin
changelog_end
2022-02-15 12:31:32 +01:00
Moisés Ackerman
4848519fc6
Enable go-to-definition for interface methods and choices (#12903)
* Extend interface go to def test to cover methods and choices

changelog_begin
changelog_end
2022-02-15 08:30:30 +00:00
Moritz Kiefer
d6e6c568fe
Fold daml test-script under daml script --all (#12895)
I tried to keep the changes somewhat minimal and reuse what is already
there. I think there is a fair amount of cleanup we can do afterwards
but hopefully this way it’s easier to review.

fixes #12837

changelog_begin

- [Daml Script] `daml test-script` has been replaced by `daml script
  --all`. The option to spin up a ledger automatically has been
  removed and you always have to specify one.

changelog_end
2022-02-14 14:23:21 +01:00
Victor Peter Rouven Müller
c0c40bd10f
Add autoformatting to ts bindings & navigator frontend (#12693)
* Add autoformatting for the ts&tsx files (typescript effectively)

changelog_begin
changelog_end

* Format ts files

* Fix ts linter warnings
2022-02-11 11:44:52 +00:00
Moisés Ackerman
a179f03197
Enable go-to-definition for interfaces (#12865)
* Add goto definition test cases for exceptions and interfaces

changelog_begin
changelog_end
2022-02-11 11:01:30 +00:00
Moisés Ackerman
a59156084f
Generate Eq instances for interfaces (#12850)
changelog_begin
changelog_end
2022-02-10 15:13:20 +00:00
Moritz Kiefer
0fb0bf2f52
Disable implicit party allocation in Daml Studio (#12839)
* Disable implicit party allocation in Daml Studio

fixes #12058

This matches what sandbox does in 2.0 so it reduces a source of
inconsistency and potential confusion.

changelog_begin
changelog_end

* Update compiler/scenario-service/protos/scenario_service.proto

Co-authored-by: Remy <remy.haemmerle@daml.com>

Co-authored-by: Remy <remy.haemmerle@daml.com>
2022-02-09 17:47:40 +00:00
Sofia Faro
55cada7c47
Make interfaceTypeRep return a TemplateTypeRep (#12838)
* Make interfaceTypeRep return a TemplateTypeRep

Part of https://github.com/digital-asset/daml/issues/12788

* Update bazel-haskell-deps and code

changelog_begin
changelog_end

* Add missing import

* update ghc-lib sha

* update bazel-haskell-deps
2022-02-09 15:39:08 +00:00
Moritz Kiefer
22165730bf
Migrate Haskell tests to Sandbox on X (#12761)
* Migrate Haskell tests to Sandbox on X

The diff here looks extremely confusing. sandbox-classic is now
sandbox on x not sandbox classic so this isn’t a typo. It is really
moving to sandbox on x.

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2022-02-07 21:18:16 +01:00
Moritz Kiefer
486c869986
Replace most scenario references in the docs by Daml script (#12741)
* Replace most scenario references in the docs by Daml script

There are still some left in the Daml studio docs (should be updated)
and in quickstart-java (should be updated but probably not by us
🤷) but I’ll leave those for separate PRs.

changelog_begin
changelog_end

* delete unused code

changelog_begin
changelog_end
2022-02-03 15:55:55 +00:00
Moisés Ackerman
3ce272b9f0
Replace experimental interface primitives with proper LF primitives (#12678)
* Add new primitives to proto spec

* implement E{Signatory,Observer}Interface in terms of EResolveVirtual{Signatory,Observer}

* define EToTypeRep primitive in terms of EToTypeRep Expr

* Remove experimental primitives TO_TYPE_REP and RESOLVE_VIRTUAL_{SIGNATORY,OBSERVER} 

changelog_begin
changelog_end
2022-02-03 13:36:45 +00:00
nickchapman-da
cd16eb740e
Rename: listUsers --> listAllUsers (within daml-script) (#12734)
* Rename: listUsers --> listAllUsers (within daml-script)

changelog_begin
changelog_end

* fix/rename in newly add def: clearUsers

* improve comment doc
2022-02-03 13:07:09 +00:00
Remy
ed1bf2469a
LF: Check activeness of cached contracts inside FetchInterface (#12698)
Missed in #12527.

CHANGELOG_BEGIN
CHANGELOG_END
2022-02-01 19:06:40 +00:00
Moisés Ackerman
e4764cc426
Upgrade to GHC 9.0.2 (#12300)
changelog_begin
changelog_end

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2022-02-01 11:27:11 +01:00
Stephen Compall
1fa095a327
match Foldable.foldl1's argument order to DA.List.foldl1's order (#12685)
List.foldl1 uses the first argument as the accumulator, whereas
Foldable.foldl1 uses the second argument.  I believe the latter is an
oversight (though the documentation doesn't suggest one way or the
other), so swap them here.

As discovered and reported by @gyorgybalazsi on the Daml Forum:
https://discuss.daml.com/t/in-daml-foldl1-works-differently-from-haskell-is-this-intentional/3819

CHANGELOG_BEGIN
- [Daml Standard Library] An argument order in the default
  implementation of ``Foldable.foldl1`` was reversed from that of
  ``DA.List.foldl1``; this incompatibly changes the former to match the
  latter.
CHANGELOG_END
2022-02-01 08:05:30 +00:00
Sofia Faro
dcbb398cae
Typecheck experimental primitives in damlc (#12650)
Adds a check that experimental primitive is defined in damlc, before you can use it.

This is only for the Haskell side, and only intended so we can catch bugs in the compiler more easily. (It would have caught the bug where `observer` wasn't defined correctly in LFConversion.)

I also removed RESOLVE_VIRTUAL_CREATE since we're not using it anywhere, it has been superseded by UCreateInterface.

changelog_begin
changelog_end
2022-01-31 09:33:34 +00:00
Moritz Kiefer
0d5443f8de
Drop direct dependencies on system-filepath (#12658)
That package has been deprecated for years and we don’t even use
it. The deps are just redundant.

changelog_begin
changelog_end
2022-01-31 10:04:07 +01:00
Moisés Ackerman
f1560ce646
Support implements qualified interfaces (#12644)
changelog_begin
changelog_end
2022-01-31 09:55:57 +01:00
Stefano Baghino
20836b1622
Address CVE-2022-0355 alert, resolve simple-get to 4.0.1 (#12655)
changelog_begin
changelog_end
2022-01-30 23:17:04 +01:00
Sofia Faro
49e664606c
Clean up unstable-types test (#12648)
LF 1.6 isn't one of our compiler outputs anymore, so we don't need to special case it in the test.

changelog_begin
changelog_end
2022-01-28 16:15:21 +00:00
Remy
35eae895e4
Compiler: expose LF builtin ExerciseByKey (#12615)
With this change, Daml exerciseByKey use the LF primitive
ExerciseByKey instead of the combinason of FetchByKey + Exercise.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-28 16:29:16 +01:00
Sofia Faro
dfdb7cef40
Remove DA.Generics (#12634)
* Remove DA.Generics

changelog_begin
- [Daml Standard Library] The DA.Generics module has been removed.
changelog_end

* update unstable-types test
2022-01-28 14:55:25 +00:00
Sofia Faro
60a0f0370d
Hide primitiveInterface from docs (#12635)
changelog_begin
changelog_end
2022-01-27 17:19:53 +00:00
Moritz Kiefer
d5ede55066
Turn name collision warnings for virtual modules into errors (#12627)
fixes https://github.com/digital-asset/daml/issues/11321

changelog_begin
changelog_end
2022-01-27 17:58:02 +01:00
Sofia Faro
f5c9a6767e
Remove DA.Experimental.Interfaces (#12619)
The functions are available through typeclasses / typeclass instances
generated during desugaring. Moved the test over to use these, and
discovered a bug in our implementation of `observer`.

changelog_begin
changelog_end
2022-01-27 12:15:09 +00:00
Moritz Kiefer
4038d0a7e3
Fix VSCode extension (#12611)
The upgrade to node-fetch 3.x broke our vscode extension because it
can only be loaded from proper ES modules. I tried changing our
tsconfig to emit that but I couldn’t figure out how to make vscode be
happy with an es module extension. So in the end I gave up and stuck
with commonjs and downgraded to node-fetch 2.x which is still in
maintenance mode and gets bugfixes for now.

However that resulted in me finding a bunch of other issues: The
upgrade to new LSP versions resulted in our LSP server crashing on
messages sent by the vscode extension. So I had to upgrade the client
libraries as well to fix that which required upgrading typescript
as well as @types/vscode which forces a bump of the minimum vscode
version. 1.52.0 is from November 2020 so not that concerned but I’ll
let product know in case theyre worried.

With this change things now work correctly and the extension is
backwards compatible with SDK 1.18.0 which matches our usual approach
of trying to get users to install the latest version of the extension.

changelog_begin

- [Daml Studio] The minimum supported vscode version is now 1.52.0.

changelog_end
2022-01-27 08:48:36 +01:00
Moisés Ackerman
403efa70ba
Add support for interfaces through data-dependencies (#12516)
* reconstruct HasMethod instances from interface definitions

* reconstruct DamlInterface context

changelog_begin
changelog_end
2022-01-26 16:34:39 +00:00
Moritz Kiefer
ea62021eaf
Upgrade ghcide (#12579)
* Upgrade ghcide

Spun out from the GHC 9 upgrade to make it easier to review. All
credit goes to Moisés.

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
2022-01-26 16:00:20 +01:00
Sofia Faro
cb77c84cc7
damlc: Don't rely on worker for zero argument polymorphic type constructors (#12581)
* damlc: Don't rely on polymorphic constant worker

Fixes https://github.com/digital-asset/daml/issues/12166 which was
caused by assuming that GHC would create a "worker function" for
all constructors. GHC doesn't create one if the constructor takes
no arguments. This only caused a problem with partially applied
constructors, so, it only applies to zero argument constructors of
polymorphic types in situations where the type argument is eta-reduced.

changelog_begin
changelog_end

* rename the test file

* Update compiler/damlc/daml-lf-conversion/src/DA/Daml/LFConversion.hs

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2022-01-25 18:26:14 +00:00
Remy
ebf7908007
LF: check contracts are consumed when found them in the cache (#12527)
fixes #11874

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-25 13:33:54 +00:00
Moritz Kiefer
ce06eb00fb
Add serializability check for interface payloads in Haskell (#12560)
* Add serializability check for interface payloads in Haskell

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* cleanup

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2022-01-25 14:20:25 +01:00
Moritz Kiefer
42aadec073
Cleanup Haskell serializability check (#12565)
I got unreasonably confused why we sometimes pass `Nothing` here and
why the templates are sometimes unused so this PR attempts to clarify
this a bit.

changelog_begin
changelog_end
2022-01-25 10:03:30 +00:00
Moisés Ackerman
dcd721da99
Drop scenarios (#12484)
* Remove scenarios from user examples

* Remove scenarios from tests

* implicitly enable scenario service for doctests

changelog_begin
changelog_end
2022-01-24 18:42:42 +01:00
Stefano Baghino
aec3390904
Replace silencer plugin with built-in warning configuration (#12543)
Since Scala 2.13.2, Scala introduced built-in support to
manage warnings in a more granular fashion, thus making
the silencer plugin we are currently using no longer
strictly useful. Removing compiler plugins also removes
friction from migrating to Scala 3 in the future. As a
cherry on top, the built-in warning configuration also
allows to check whether a `@nowarn` actually does
anything, allowing us to proactively remove unused
warnings should the need arise.

[Here][1] is s a blog post by the Scala team about it.

Warnings have been either solved or preserved if useful,
trying to minimize the scope (keeping it at the single
expression scope if possible). In particular, all
remaining usages of the Scala Collection API compatibility
module have been removed.

Using the silencer plugin also apparently hid a few
remaining usages of compatibility libraries that were used
as part of the transition from Scala 2.12 to Scala 2.13
that are no longer needed. Removing those warnings
highlighted those.

changelog_begin
changelog_end

[1]: https://www.scala-lang.org/2021/01/12/configuring-and-suppressing-warnings.html
2022-01-24 15:01:35 +00:00
Moritz Kiefer
24b2325d19
Bump node-fetch to address dependabot alerts (#12553)
changelog_begin
changelog_end
2022-01-24 13:23:52 +00:00
nickchapman-da
ebd3827c4a
Make UserId properly opaque by defining it as a variant (#12476)
* Make UserId properly opaque by defining it as a variant instead of as a record.

changelog_begin
changelog_end

* hand coded Show instance for UserId

* rename: userName --> userIdToText
2022-01-19 17:53:44 +00:00
Moritz Kiefer
681f8fca6b
Add missing serializability checks for interfaces (#12483)
* Add missing serializability checks for interfaces

The checks for argument & result type were missing before. I openey
https://github.com/digital-asset/daml/issues/12482 to do the same fix
on the Scala side.

fixes #12475 

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2022-01-19 17:24:46 +01:00
nickchapman-da
6fbaac467f
Remove user-management error cases from scenario-service proto. (#12460)
* Remove user-management error cases from scenario-service proto.

changelog_begin
changelog_end

* remove Error.UserManagement

* remove UserManagememtError

* simp

* meh... done over by scala's poor excuse for a type system
2022-01-19 10:44:04 +00:00
nickchapman-da
0c13a4f1fd
Error handling for User Management exposed via daml-script (#12416)
* Error handling for User Management exposed via daml-script

changelog_begin
changelog_end

adapt ScriptTest.daml to new user-management interface

adapt create-daml-app Setup.daml to new user-management interface

* Add deriving Ord for UserId

* change example of invalid user-id char to "%" from "." (which is no longer illegal)

* recover/reify ALREADY_EXISTS from GrpcLedgerClient.createuser

* fix testcase expected order of users from daml-script listUsers

* adapt create-saml-app Setup.daml to changed interface of user-management

* reinstate sort lost in merge

* sort user in ScriptService user-management test

* improve comment for error foobar hack

* improve doc comment for validateUserId

* use upper case as test example for invalid user-id
2022-01-18 12:58:51 +00:00
Moritz Kiefer
bf39f4890c
Upgrade vsce and markdown-it (#12431)
This upgrades vsce to the latest version and also markdown-it which is
unfortunately still pinned to an older version with a vulnerability.

There are some minor changes required to our invocations of vsce. I
tried to test this locally up to the point where it fails due to me
not having a token. We’ll only fully see it working after the next
stable release unfortunately.

changelog_begin
changelog_end
2022-01-17 13:40:42 +00:00
Moritz Kiefer
e9e673c393
Drop scenario compat helpers (#12389)
They are in Prelude so they steal identifiers and we’re killing
scenarios so keeping these around makes little sense.

changelog_begin
changelog_end
2022-01-13 11:35:27 +00:00
Sofia Faro
09013eb501
Add eager timeouts to the polling functions used in daml start and assistant integration tests. (#12361)
* Add timeouts to polling funcs in daml start.

This PR adds timeouts to some polling functions used in daml start and
the assistant integration tests, and also early exits based on a process
exit status. E.g. waitForHttpServer will make sure some process is
still running, instead of waiting to timeout.

The effect of this is that now whenever there is some error in a
subprocess, daml start and the integration tests will finish early
instead of running forever (or timing out in bazel).

changelog_begin
changelog_end

* missing a readPortFile instance
2022-01-12 10:01:56 +00:00
Moritz Kiefer
8bc5ff06a7
Clarify unhandled exception error message (#12353)
* Clarify unhandled exception error message

The previous error doesn’t make it clear that this is an exception in
user code rather than a Scala exception in our code.

Daml-lf exception would technically be more correct but I don’t think
it’s helpful here so I went with Daml exception.

changelog_begin
changelog_end

* adjust ledger api test tool

changelog_begin
changelog_end

* Update test assertions

changelog_begin
changelog_end

* fix another assertion

changelog_begin
changelog_end
2022-01-11 17:57:07 +00:00
nickchapman-da
6bf24fce93
Proxy user management errors via the scenario service proto (#12267)
* Proxy user management errors via the scenario service proto and display them

changelog_begin
changelog_end

* address comment
2022-01-05 13:41:49 +00:00
Moisés Ackerman
ceb83a6ddb
Interface method sigs (#12258)
* Skip _method_ markers during docs generation

* Remove r argument from Method desugar type

* Update HasMethod/mkMethod docs

* define `mkMethod` as compiler "magic"

changelog_begin
changelog_end

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2022-01-05 13:09:36 +00:00
Gary Verhaegen
ea55ea2d14
Further copyright updates (#12249)
Somewhat error-prone, so please review carefully.

Reasons we need this:

- Some file types are not properly handled by the script.
- The only exclusion mechanism we currently have (`NO_AUTO_COPYRIGHT`)
  is overly coarse.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-04 16:32:17 +01:00
Gary Verhaegen
d2e2c21684
update copyright headers (#12240)
New year, new copyright, new expected unknown issues with various files
that won't be covered by the script and/or will be but shouldn't change.

I'll do the details on Jan 1, but would appreciate this being
preapproved so I can actually get it merged by then.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-03 16:36:51 +00:00
Moisés Ackerman
ba0c6c9841
Set --enable-scenarios to False by default (#12156)
* Set --enable-scenarios to False by default

changelog_begin
changelog_end

* Enable scenarios for shake test

* Add --enable-scenarios=yes for //compiler/lsp-tests

* Add enable_scenarios arg to rules_daml/daml.bzl helpers

* daml_compile
* daml_build_test
* daml_test

* Add enable_scenarios to ledger/test-common helper da_scala_dar_resources_library

* Add --enable-scenarios=yes for //ledger/test-common

* Remove unused scenario in //ledger/test-common PingPong test

* Add --enable-scenarios=yes for //daml-lf/tests

* Add --enable-scenarios=yes for //language-support/java tests

* Add --enable-scenarios=yes for group-chat example

* Add --enable-scenarios for //ledger/sandbox-perf LargeTransaction test

* Add --enable-scenarios=yes for //docs tests

* Add --enable-scenarios=yes for //daml-lf/scenario-interpreter tests

* format bazel

* Add --enable-scenario=yes for 'daml_doc_test's

* Add --enable-scenarios=yes for DamlDocTestIntegration

* Add --enable-scenarios=yes for DamlcTest

* Add --enable-scenarios=yes for Test/DataDependencies

* Add --enable-scenarios=yes for daml-ghc-deterministic.sh

* Add --enable-scenarios=yes for Test.IncrementalBuilds

* Add --enable-scenarios=yes for tests:memory-bond-trading and tests:memory-examples

* Add --enable-scenarios=yes for daml-assistant/integratio-tests
2021-12-20 19:31:06 +01:00
Moritz Kiefer
0142c6a34e
Add forM_ compat definition (#12209)
I keep confusing myself because of this and I expect I’m not the only
one. We have this for forM already so this only seems natural.

The definition is in DA.Foldable rather than DA.Internal.Compatible
since it doesn’t make sense to have it imported when you don’t import forA_.

changelog_begin
changelog_end
2021-12-20 13:45:28 +00:00
Sofia Faro
e52469c1dc
Add a test that mkMethod call causes a type error. (#12175)
Relevant discussion: https://github.com/digital-asset/daml/pull/12171#discussion_r770553009

changelog_begin
changelog_end
2021-12-16 15:52:44 +00:00
Robin Krom
1ed02369eb
interfaces: fix mkMethod erasure (#12171)
We erase the call to `mkMethod` in `convertExpr` instead of pattern
matching against the binding. This fixes a bug when the method body
contained statements using typeclass dictionaries such as
`do [2] === [2]`.

CHANGELOG_BEGIN
CHANGELOG_END
2021-12-16 15:22:46 +01:00
Robin Krom
5af58a1652
interfaces: doc generation for interface methods (#12096)
This adds documentation generation for interface choices and methods.

CHANGELOG_BEGIN
CHANGELOG_END
2021-12-15 13:57:09 +00:00
Moritz Kiefer
506eee16f5
Extend VSCode extension troubleshooting section (#12154)
I’ve had to look this up for the second time today so documenting it
seems very sensible.

changelog_begin
changelog_end
2021-12-15 13:56:30 +00:00
Moisés Ackerman
149474f3cb
Drop scenarios from the user-facing SDK (#12128)
* Add --enable-scenarios hidden flag
* Fail LFConversion when a scenario is defined and --enable-scenarios=no
* Remove unused optIsGenerated=True test cases
* Refactor getIntegrationTests
* Add no-scenarios-enabled tests
* Add enable-scenarios flag to scenario-service server
* Add test ensuring that scenario-returning functions are still allowed
* Remove 'enable scripts' option (--daml-script)
* Add --scripts synonym to --scenarios
* Rephrase scenarios flags descriptions

changelog_begin
changelog_end
2021-12-15 13:39:14 +01:00
Moritz Kiefer
ffe05aab3d
Apply grpc-max-message-size in both directions in the script service (#12149)
Previously, it was only applied for messages towards the script
service but not for messages towards the Haskell client. Now we
increase the max size in both directions.

See
https://discuss.daml.com/t/increase-max-message-size-in-daml-studio/3573/9
for the forum thread that raised this.

changelog_begin

- [Daml Studio/Daml Test] The `grpc-max-message-size` field in
  `daml.yaml` now also applies to the message that contains the result
  of a script.

changelog_end
2021-12-15 09:33:55 +00:00
Sofia Faro
798137964b
Add requires keyword for syntax highlighting (#12113)
Part of #11978

changelog_begin
changelog_end
2021-12-14 12:20:41 +00:00
Sofia Faro
d1fb5e442c
interfaces: Implement 'requires' syntax (#12105)
* interfaces: Implement 'requires' syntax

part of: https://github.com/digital-asset/daml/issues/11978

ghc counterpart: https://github.com/digital-asset/ghc/pull/92

changelog_begin
changelog_end

* .

* ...

* ...

* ....

* ....

* update bazel-haskell-deps

* use requires syntax in tests

* .......

* .......

* update bazel-haskell-deps

* update InterfaceDesugared

* .........

* update bazel-haskell-deps

* ...........

* update bazel-haskell-depos

* update compile.yml

* update bazel-haskell-deps
2021-12-14 12:19:52 +00:00
Moritz Kiefer
77a37cf213
Drop damlc code for LF <= 1.11 (#12121)
* Drop damlc code for LF <= 1.11

Still a tiny bit left for pre 1.14 but this covers most of it.

changelog_begin
changelog_end

* delete numeric equal prmitives

changelog_begin
changelog_end
2021-12-13 14:19:48 +00:00
Moisés Ackerman
caa8072d91
Drop unused primitives for interface contract id conversion (#12114)
changelog_begin
changelog_end
2021-12-13 14:43:16 +01:00
Moritz Kiefer
82465e2e85
Drop Decimal completely from damlc (#12120)
no need to keep it if we can neither read nor write it.

changelog_begin
changelog_end
2021-12-13 12:30:53 +00:00
Moritz Kiefer
36106c39de
Drop featureNumeric (#12119)
Also unused now that we only support LF >= 1.14.

changelog_begin
changelog_end
2021-12-13 11:20:04 +00:00
Moritz Kiefer
7f76cf1bdf
Drop featureAnyType and featureTypeRep (#12112)
and ofc drop the codepaths that use it.

All pre LF < 1.14 so unused and untested.

changelog_begin
changelog_end
2021-12-13 10:25:20 +01:00
Moisés Ackerman
937849b101
Define asciiToLower and asciiToUpper in DA.Text (#12109)
changelog_begin
changelog_end
2021-12-10 18:14:34 +01:00
Sofia Faro
124f8854f0
daml-docs: Refactor context type (#12111)
* daml-docs: Refactor context type.

Also remove context and args from templates, since that was
only needed with generic templates v1.

changelog_begin
changelog_end

* fix tests
2021-12-10 16:33:53 +00:00
Moritz Kiefer
778def6f48
Drop non-type synonym code from LF conversion (#12110)
* Drop non-type synonym code from LF conversion

We stopped emitting LF < 1.8, this is unused and untested at this
point.

changelog_begin
changelog_end

* drop parameter from mkDictProj

changelog_begin
changelog_end

* Update compiler/damlc/daml-lf-conversion/src/DA/Daml/LFConversion.hs

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2021-12-10 16:32:46 +00:00
Moisés Ackerman
0298ed3a21
Exercise interface (#12066)
* Define HasExerciseGuarded class

* Pass predicate to UExerciseInterface primitive

* Update InterfaceDesugared test file

* Add InterfaceGuarded test file

changelog_begin
changelog_end
2021-12-10 12:10:15 +00:00
Sofia Faro
178411d0c5
Refactor Env construction in LFConversion. (#12092)
Use RecordWildCards to avoid repetition, and enforce consistent naming.

changelog_begin
changelog_end
2021-12-10 11:04:08 +00:00
Sofia Faro
b99952407c
Update TODOs to outdated issues. (#12090)
* Update TODOs to outdated issues.

In particular update a lot of defunct interface TODOs to the LF 1.15
issue (or add the LF 1.15 issue if it's also relevant).

changelog_begin
changelog_end

* typo

* remove numeric/bignumeric todo

* scalafmt!!

* drop choice observer TODO
2021-12-09 21:01:27 +00:00
Sofia Faro
0aacbac678
interfaces: Support EToRequiredInterface and EFromRequiredInterface in LFConversion (#12086)
* interfaces: Support up/downcast in LFConversion

Part of https://github.com/digital-asset/daml/issues/11978

changelog_begin
changelog_end

* update TODO
2021-12-09 19:50:18 +00:00
Sofia Faro
cbeab4b672
interfaces: Prevent circular and non-closed requirements. (#12073)
* interfaces: Prevent circular and non-closed reqs

Updates the haskell side to be more strict about requirements:
- requirements must be transitively closed, so if A requires B, and B requires C,
  then A requires C.
- no circular requirements allowed

The logic for circular requirements is a bit duplicated to get a better
error message.

Part of https://github.com/digital-asset/daml/issues/11978

changelog_begin
changelog_end

* Update compiler/daml-lf-tools/src/DA/Daml/LF/TypeChecker/Check.hs

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* take a list in NotClosed error

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-12-09 14:27:15 +00:00
Moritz Kiefer
f3acd8d852
Wire up user management to ScriptLedgerClient (#11889)
part of #11997

changelog_begin
changelog_end
2021-12-09 08:52:48 +01:00
Sofia Faro
15020c977c
interfaces: LFConversion support for requires (#12055)
Part of #11978.
Adds a test that "requires" is enforced.

changelog_begin
changelog_end
2021-12-08 18:49:32 +00:00
Sofia Faro
c65fd0d79d
interfaces: Remove envEmptyInterfaces in LFConv (#12065)
The problem with envEmptyInterfaces is that it can only detect
interfaces in the current module. When you try to implement an
interface across a module boundary, LFConversion has very little
information about the interface.

This PR removes envEmptyInterfaces and simplifies the code
that used it, so it works uniformly for all interfaces
regardless of how many methods it has. The alternative would be
to pass more information into LFConversion, but this seems simpler.

changelog_begin
changelog_end
2021-12-08 17:32:15 +00:00
Sofia Faro
199642f5f0
interfaces: Improve error when targeting LF 1.14 (#12060)
This PR improves the error message you get when targeting
an LF version that doesn't support interfaces.

changelog_begin
changelog_end
2021-12-08 16:40:35 +00:00
Robin Krom
beff0049ba
interface docs: testing for doc extraction. (#11996)
This adds a couple of doc strings to interfaces to test that they are
properly extracted and shown in the generated documentation.

CHANGELOG_BEGIN
CHANGELOG_END
2021-12-08 16:27:50 +00:00
Moritz Kiefer
e036e2c00a
Implement user management in Daml script service (#12050)
* Implement user management in Daml script service

changelog_begin
changelog_end

* Update compiler/scenario-service/server/src/main/scala/com/digitalasset/daml/lf/scenario/Conversions.scala

Co-authored-by: Remy <remy.haemmerle@daml.com>

* move assertion into replaceInfo

changelog_begin
changelog_end

Co-authored-by: Remy <remy.haemmerle@daml.com>
2021-12-08 16:11:09 +00:00
Robin Krom
4ddd0f4911
iface docs: add method docs (#12043)
This generates documentation for methods present in interface
definitions.

CHANGELOG_BEGIN
CHANGELOG_END
2021-12-08 15:44:19 +00:00
Sofia Faro
04dd386dcc
interfaces: Add up/downcast in haskell AST (#12048)
Adds EToRequiredInterface and EFromRequiredInterface in
the Haskell AST, and the typechecker.

Part of #11978

changelog_begin
changelog_end
2021-12-08 13:22:08 +00:00
Sofia Faro
51cb552b79
Add typerep argument in UExerciseInterface call from daml (#11959)
changelog_begin
changelog_end
2021-12-08 13:25:45 +01:00
Sofia Faro
43c8641215
interfaces: add up/downcast expressions in proto (#12030)
Part of https://github.com/digital-asset/daml/issues/11978

changelog_begin
changelog_end
2021-12-07 18:44:24 +00:00
Sofia Faro
1dd813170d
interfaces: Add "requires" field in Haskell AST. (#12016)
* interfaces: Add "requires" field in Haskell AST.

Part of #11978. Adds typechecking for this on the interface and
implementation side.

changelog_begin
changelog_end

* Fix all the errors
2021-12-07 17:01:45 +00:00
Moisés Ackerman
8df9a42f29
Interface desugaring cont. (#11964)
* Move toInterfaceContractId and fromInterfaceContractId out of Implements class

* Split Implements class into single-method classes

* Define toInterface outside its class to swap type arguments

This allows users to call 'toInterface @Interface', since the type of the template can usually be inferred

* Move interface classes and functions to DA.Internal.Interface

changelog_begin
changelog_end
2021-12-07 13:56:57 +01:00
Robin Krom
299027b4b9
interfaces: doc generation for interfaces (#11971)
* interfaces: doc generation for interfaces

This adds generated documentation for interface choices.

CHANGELOG_BEGIN
CHANGELOG_END

* added issue to todo

* refactor getTemplateDocs/getInterfaceDocs

* refactor template/interface doc extraction
2021-12-07 06:49:42 +01:00
Sofia Faro
9430ee3131
interfaces: Add requires in DefInterface protobuf (#11986)
Part of #11978

changelog_begin
changelog_end
2021-12-07 00:38:59 +00:00
Moisés Ackerman
ad77eed798
Move method interfaceTypeRep to its own class (#11940)
changelog_begin
changelog_end
2021-12-04 15:33:58 +00:00
Moritz Kiefer
cde80df2c4
Mark lsp tests as flaky (#11958)
* Mark lsp tests as flaky

Not quite sure what is going wrong and doesn’t seem worth prioritizing
right now so marking them flaky again (they were marked flaky until a
few weeks ago).

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2021-12-03 07:42:52 +01:00
Remy
b02ed7765a
LF: Introduce configurable limits on produced transactions (#11948)
This is part of #11691

This PR allows to limits:
- the number of signatories,
- the number of observers,
- the number of controllers,
- the number of inputContracts,

CHANGELOG_BEGIN
CHANGELOG_END
2021-12-02 16:31:09 +01:00
Robin Krom
20d1b95fe2
docs: support for interface implementations (#11643)
* docs: support for interface implementations

This produces documentation for interface implementations of templates.

CHANGELOG_BEGIN
CHANGELOG_END

* Update compiler/damlc/daml-doc/src/DA/Daml/Doc/Render/Output.hs

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>

* add check for modulename for implementations

CHANGELOG_BEGIN
CHANGELOG_END

* added golden tests to daml-test-files

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2021-12-02 09:51:41 +00:00
Sofia Faro
81e27a9442
Add some predicates in DA.Set (#11947)
I noticed we didn't have a "subset" function in DA.Set when Oliver
showed me some daml test code that had to define it manually. So I
decided to add it, and a couple more predicates.

changelog_begin
changelog_end
2021-12-01 17:22:52 +00:00
Moisés Ackerman
0b79d8ae7c
Deprecate 'controller ... can' syntax (#11363)
Closes #11317

* Add warning for uses of 'controller ... can' syntax

* Remove uses of 'controller ... can' syntax

* Add test cases for -W{,no-}controller-can

* Update docs to reflect 'controller ... can' syntax deprecation

changelog_begin
* Deprecate 'controller ... can' syntax.
  * It will be removed in a future version of Daml.
  * Instead, use 'choice ... with ... controller' syntax. Note that this does not implictly add the controller as an observer, so it must be added explictly as one (or as a signatory).
changelog_end
2021-12-01 13:36:04 +01:00
Moritz Kiefer
cf172619e5
Drop support for Daml-LF party literals-LF from the Haskell side (#11930)
This PR enforces that forbidPartyLiterals is always `true` and drops
the corresponding literals from the AST in our Haskell code. Scala
code will follow separately.

part of #11581

changelog_begin
changelog_end
2021-12-01 11:00:09 +01:00
Moritz Kiefer
1d0ff3cc71
Fix package version validation in damlc (#11937)
Currently the validation only allows for 3-component version
names. However even our own releases don’t respect that for snapshots
so instead we relax the validation to allow an arbitrary number of
numeric components which matches what ghc-pkg allows.

changelog_begin
changelog_end
2021-12-01 08:17:48 +00:00
Moritz Kiefer
16135e6f7c
Limit supported input versions in damlc to >= LF 1.8 (#11905)
* Limit supported input versions in damlc to >= LF 1.8

1.8 was the version that introduced type synonyms, we really don’t
gain much by dropping more since data-dependencies mainly depends on
that. and this provides for a very natural upgrade path for users
where pretty much everyone should be able to upgrade directly to SDK
2.0 without having to go through intermediate versions.

changelog_begin

- [Daml Compiler] The supported input LF versions for
  data-dependencies are now limited to LF 1.8 and newer.

changelog_end

* fix some tests

changelog_begin
changelog_end

* Drop export 1.6 tests

changelog_begin
changelog_end

* Drop daml2js support for LF < 1.8

changelog_begin

- [Daml2js] DARs with LF version < 1.8 are no longer supported.

changelog_end

* .

changelog_begin
changelog_end

* bash is bad, stop using it

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2021-11-30 17:24:08 +01:00
Sofia Faro
1d7bca801e
Add optional typerep argument in UExerciseInterface. (#11910)
* Add type rep argument for interface exercises.

(Still WIP.)

Part of #11703. Fixes the order in which errors are raised ("wrong type"
takes priority over "does not implement interface"). This PR also simplifies
ExerciseInterface by making the guard mandatory, otherwise there's too
many variations. We can revisit that later if we want.

changelog_begin
changelog_end

* haskell side

* dont throw exception in checkTemplateId

* scalafmt

* evidence security

* fix TypingSpec test
2021-11-30 15:10:33 +00:00
Sofia Faro
0b9d57b95e
Add ContractDoesntImplementInterface error. (#11884)
* Add a ContractDoesntImplementInterface error

Part of #10810 and #11703

changelog_begin
changelog_end

* use inside

* rename error
2021-11-29 15:54:31 +00:00
Moritz Kiefer
dbbb05fe2e
Split daml-lf encode/decode Haskell libraries (#11906)
* Split daml-lf encode/decode Haskell libraries

I was working on limiting the supported input versions in damlc. This
requires the list of stable package ids so we can allow those to be
decoded even if they are older.

However that leads to a cyclical dependency:
To get the package ids of the stable packages, I need to encode
them. The version check is in the decoder. If those live in the same
package, I now end up with a cyclical dependency and
Bazel (understandably) gets very sad.

This PR splits decoding/encoding into two libraries with the
generation of stable packages only depending on encoding.

changelog_begin
changelog_end

* Fix dependants

changelog_begin
changelog_end
2021-11-29 12:49:02 +00:00
Moritz Kiefer
31cc540cf9
Turn package name & version warnings into an error (#11859)
* Turn package name & version warnings into an error

fixes #11321

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2021-11-26 18:46:33 +00:00
Moritz Kiefer
cb758e8d91
Fix call to experimental interface signatory builtin (#11882)
Turns out if you mistype the name it doesn’t work, who would have
thought.

changelog_begin
changelog_end
2021-11-25 16:33:18 +00:00
Sofia Faro
0852c8f6fa
Make DA.List.Total return Optional instead (#11878)
* Make DA.List.Total return Optional instead.

Instead of using ActionFail or CanAbort, return an Optional. The library
user can then convert this into the appropriate error if they wish.

This PR also removes DA.Optional.Total (and the deprecated DA.Maybe.Total)
for having questionable utility.

changelog_begin

- [Daml Standard Library] DA.List.Total functions now return Optional
  instead of being polymorphic in the return type. DA.Optional.Total
  has been removed.

changelog_end

* update Examples.daml
2021-11-25 14:33:48 +00:00
Sofia Faro
2f8f69e7cb
Drop DA.Next.Set and DA.Next.Map (#11864)
* Drop DA.Next.Set and DA.Next.Map

Fixes #11527. Also removed a bunch of unnecessary CPP, though there's
still a lot more CPP to remove.

changelog_begin

- [Daml Standard Library] DA.Next.Map and DA.Next.Set have been removed
  after being deprecated since Daml-LF 1.11

changelog_end

* Drop a deriving MapKey

* update unstable-types test
2021-11-25 13:02:08 +00:00
Sofia Faro
5c12d757f4
Add a guard when exercising by interface. (#11836)
* Add a guard when exercising by interface.

This fixes part of #11703, when exercising an inherited choice by
interface and you know the template id, via the command preprocessor.

It does this by inserting a "guard" in between the interface fetch and
the exercise body. The guard is a function Interface -> Bool, which
is general enough to check the template id, without complicating too
much in speedy. And can be generalized in the future to check more,
like signatories, etc.

I added the guard as an optional argument to UExerciseByInterface.
This isn't hooked up to the protobuf AST yet (or Haskell side for
that matter) -- but I'll do it in the next PR! For now you can invoke
the guarded exercise via the command preprocessor, so I can enable the
approprate engine tests. (There's still some failing fetch tests left,
but I decided to leave this for later. Fetch can be a lot simpler than
guarded choices, since you always add a fetch node. No need for fancy
continuations.)

changelog_begin
changelog_end

* scalafmt

* Feedback and fix matches

* Update comments, we are always going to abort the transaction

* Raise WronglyTypedContract in SBGuardTemplateId.

* rebase and fix parser

* restore ANF

* scalafmt
2021-11-24 14:22:40 +00:00
Moritz Kiefer
5785bbfcfd
Drop LF < 1.14 from supported damlc output versions (#11701)
* Drop LF < 1.14 from supported damlc output versions

fixes #11319

We keep test coverage by depending on the most recent snapshot which
still has 1.14 support.

changelog_begin

- [Daml Compiler] Damlc can only produce Daml-LF 1.14 or
  newer. Passing aynthing older to `--target` is an error. If you
  need to produce older versions, use an older SDK.

changelog_end

* Switch around legacy_compiler_lf_versions

changelog_begin
changelog_end

* drop since-lf

changelog_begin
changelog_end
2021-11-22 16:20:17 +00:00
tudor-da
8e31e8e6a8
[Self-service error codes] Enabled by default [DPP-691] (#11685)
* [Self-service error codes] Enabled by default
* Flag changed to `use-pre-1.18-error-codes` (disabled by default)

CHANGELOG_BEGIN
[Ledger API Specification] The Ledger API returns enriched error codes (see https://docs.daml.com/error-codes/self-service/index.html)
For backwards-compatibility, a new API flag `--use-pre-1.18-error-codes` is introduced for preserving the legacy behavior for
clients that want to migrate incrementally to the changed gRPC status code responses and error details format.
CHANGELOG_END

* Adapted HttpServiceIntegrationTest

* Renamed `Feature Flag` to `Configuration` in docs

* Fix Daml Script tests

changelog_begin
changelog_end

* Fix Repl functests

changelog_begin
changelog_end

* Fix haskell binding tests

changelog_begin
changelog_end

* Fix CommandClientIT test

* Fixed Sandbox and CommandServiceBackpressureIT tests
 Please enter the commit message for your changes. Lines starting

* Adapt //compiler/damlc/tests:repl-functests again

* Fix more tests and address Miklos' comments
* Flag name changed to `grpc-status-codes-compatibility-mode`

* Remove useless flags sandbox-classic

* Sandbox-classic tests fix for ContractKeysIT and ExceptionsIT
* Created 2 deprecated test suites that have the more generic assertions as returned
by the deprecated in-memory backend

* More fixes for CommandServiceIT
* Fixes compilation issue with the deprecated exceptionsIT class for Sandbox-classic in-memory

* Compatibility mode for old test tools

* Change flag name to `use-pre-1.18-error-codes`

* Apply suggestions from code review

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
2021-11-22 12:26:48 +00:00
Remy
cbe9c922ba
LF: Clean up Ast (#11786)
- rename non-default builders `apply` to `build`
  * avoid confusing both
  * make explicit the build can crash

- make interfaceId and templateId fields consitent

- use when possible named arguments

- check for non-repetition of inherited choices

CHANGELOG_BEGIN
CHANGELOG_END
2021-11-19 15:40:28 +01:00
Moisés Ackerman
d23d113667
Restructure interface desugaring (#11555)
* Update ghc patch

* Replace Implements proxy datatype with a class

* Expose 'Implements' class in Prelude

* Add DA.Internal.Desugar.HasMethod class

This allows us to get the type of a method of an interface through the functional dependency

* Convert interfaces from new desugaring

* Update Interface daml-test-file to use Interface class functions

* Update InterfaceDesugared daml-test-file

* Replace remaining uses of Is<Interface> methods with Implements

* Document HasMethod, Method and mkMethod

* Ignore _method_ bindings in convertBind

* Ignore interface desugaring types/classes/instances/functions in LF conversion

* update snapshot after pin on windows

changelog_begin
changelog_end
2021-11-19 10:06:49 +01:00
Moritz Kiefer
4a8e1104ca
Add missing export of deleteBy from DA.NonEmpty (#11716)
changelog_begin
changelog_end
2021-11-18 18:15:35 +00:00
Moritz Kiefer
3b5f8a73e1
Remove precondition field from TemplateImplements (#11763)
* Remove precondition field from TemplateImplements

fixes #11635

changelog_begin
changelog_end

* Update daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/Compiler.scala

Co-authored-by: Remy <remy.haemmerle@daml.com>

Co-authored-by: Remy <remy.haemmerle@daml.com>
2021-11-18 17:10:40 +01:00
Andreas Herrmann
39a38d3a37
Update to Java 11 (#11512)
* Update to Java 11

changelog_begin
changelog_end

* Fix RoundingMode deprecation warnings

* Fix dep-ann warning

* Integer constructor

* JavaX annotation dependency

* javax.xml.bind was removed in Java 11

Using Guava as a replacement, since it is already a project dependency.

* JDK 11 no longer has a separate JRE tree

* Remove unused jdk_nix import

* remove now redundant jdk11_nix

* Java 8 --> 9 increased Instant.now() precision

See https://bugs.openjdk.java.net/browse/JDK-8068730

The precision of `Instant.now()` increased between Java 8 and Java 9.
On Linux and MacOS this doesn't seem to be a problem, as the precision
still seems to be at micro seconds. However, on Windows this now causes
errors of the following form:
```
java.lang.IllegalArgumentException: Conversion of Instant
2021-11-05T13:58:56.726875100Z to microsecond granularity would result
in loss of precision.
```
Suggesting that it now offers sub-microsecond precision.

`TimestampConversion.instantToMicros` had a check to fail if the
conversion lead to a loss of precision. In the specific failing test
case this is not a concern, so this adds a `roundInstantToMicros`
variant that avoids this kind of error.

* TMP round timestamps

* Revert "TMP round timestamps"

This reverts commit af8e261278.

* Skip versions before 1.6.0 in migration tests

changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-11-18 14:48:37 +00:00
Moritz Kiefer
fa7663148a
Drop 2.12 versioned_scala_deps (#11748)
I’ve kept the infrastructure for versioned_scala_deps around because
I’m optimistic and hope that eventually we’ll do another Scala upgrade.

changelog_begin
changelog_end
2021-11-17 22:13:08 +00:00
Moritz Kiefer
c109552a6e
Disable ofInterestRule by default (#11637)
This seems like a more sensible default. There are really only very
few places where it makes sense to do things automagically (mainly the
IDE). For everything else we might just end up wasting time by
compiling stuff we don’t need.

changelog_begin
changelog_end
2021-11-12 11:01:58 +01:00
Sofia Faro
87f282c7f3
interfaces: Preserve/provide by_interface data for create actions. (#11639)
* interfaces: Preserve by_interface data for create.

Part of #10915

This was a lot more involved than fetch or exercise. The first issue is
that we need to preserve the interface id into speedy, so it needs a
separate primitive ("experimental" won't cut it). Second, because
speedy's create requires the template definition, and now the interface
id as well, we basically need to compile a separate version of "create"
for each interface that a template implements, hence the separate
`CreateByInterfaceDefRef(templateId, ifaceId)`.

changelog_begin
changelog_end

* scalafmt and refactoring

* fixx merge conflict

* fix silly mistakes
2021-11-11 12:57:55 +00:00
nickchapman-da
2dd5289a35
different types for different speedy phases (#11605)
* Refactor speedy to distinuish SExpr types before/after ANF compilation phase

CHANGELOG_BEGIN
CHANGELOG_END

* remove commment/marker left in error

* make SExpr0 private to speedy

* reinstate (non-pp) print of original expression in AnfTest faiure

* avoid use of s./t. prefixes for expressions in SBuiltin; add 3 TODO markers

* inline "runtime" apply methods of SDefinitionRef into sole caller: SBCallInterface

* avoid use of t. prefix in SExpr0

* change s./t. prefix to source./target.

* add comment to summarize differences between SExpr0 and SExpr
2021-11-11 08:21:12 +00:00
Moritz Kiefer
93c07f41fa
Extend synonym expansion caching in data-dependencies (#11629)
Turns out we can cache even more. No need to reexpand the same synonym
as the argument to isDuplicate.

changelog_begin
changelog_end
2021-11-10 13:28:10 +00:00
Remy
b8f384e193
LF: Drop typeparameter from KeyWithMaintainers (#11625)
Following up #10827 and #10921, we drop type parameter to
KeyWithMaintainers, and use the `Versioned` wrapper introduced in

CHANGELOG_BEGIN
CHANGELOG_END
2021-11-10 13:21:13 +01:00
Moritz Kiefer
d0c313d801
Share dependencyInfo in data-dependencies (#11620)
No need to recompute this everytime given that the dependencies do not change.

changelog_begin
changelog_end
2021-11-10 13:15:54 +01:00
Remy
92181161cc
LF: Abstract VersionedValue and VersionedContractInstance (#11533)
* LF: Abstract VersionedValue and VersionedContractInstance

CHANGELOG_BEGIN
CHANGELOG_END

* formatting
2021-11-09 23:22:38 +00:00
Moritz Kiefer
ef3fc0ef4b
Cache type synonym expansion in safeToReexport (#11612)
Not really significant but seems better to be on the safe side and
keep this consistent with isDuplicate than try to do something
different here.

changelog_begin
changelog_end
2021-11-09 18:05:56 +01:00
Moritz Kiefer
7c92cabff7
Cache type synonym expansion in isDuplicate (#11611)
This speeds up data-deps generation from ~30s to < 10s. It’s not quite
where we could be (9s vs 6-7s) but given that this is much simpler
than trying to make alpha equivalence expand lazy and we have more
options for speeding this up so this seems good enough.

changelog_begin
changelog_end
2021-11-09 15:34:47 +00:00
Robin Krom
af1bee7b82
precondition lf conversion (#11538)
* interfaces: lf conversion of preconditions

This adds the LF conversion of preconditions from the desugared GHC code
to Daml LF for preconditions. This depends on the corresponding patch of
the GHC fork.

CHANGELOG_BEGIN
CHANGELOG_END

* pin linux stackage snapshot

* added a test

CHANGELOG_BEGIN
CHANGELOG_END

* pinned linux stackage snapshot

CHANGELOG_BEGIN
CHANGELOG_END

* additional InterfacePrecondition test

this checks that that conjunction of all preconditions of intererfaces
and templates is checked.

CHANGELOG_BEGIN
CHANGELOG_END

* pin stackage snapshot

* pin windows stackage snapshot

* update compile.yml (again)

* pin linux stack snapshot

* fix InterfacePrecondition test

* pin windows stackage
2021-11-09 11:43:46 +00:00
Moritz Kiefer
3bed7a9b4f
Drop unused defaultFeatureFlags (#11580)
I believe this is still from Daml 1.1, it’s definitely not the default
right now so this is at best confusing.

changelog_begin
changelog_end
2021-11-08 17:54:48 +01:00
Moisés Ackerman
7d68e05f7f
Remove virtual choices (#11482)
* Remove virtual choices

* Remove choices without a body in 'interface' definition
* Remove choices in 'template ... implements' section

part of #11372

changelog_begin
changelog_end

* Remove virtual choices cont.

Switch uses of virtual choices to fixed choice with method implementation

* update snapshot after pin on windows

* Disable failing interface tests with TODO #10810
2021-11-08 17:05:23 +01:00
Moritz Kiefer
60dc2869e7
Avoid unnecessarily decoding DALFs during dependency installation (#11541)
We only need the package id which only requires decoding the header
which is exactly what decodearchivePackageId exists for.

On a large project this seems like a 10-20s improvement which is
pretty significant.

changelog_begin
changelog_end
2021-11-04 11:36:39 +01:00
Moritz Kiefer
afd79b6729
Improve logging for dependency installation (#11540)
Also drops the weird Base module and the always empty tags (yet
another reason why I want to burn our own logging lib with fire).

changelog_begin
changelog_end
2021-11-04 11:36:03 +01:00
Moritz Kiefer
b83af37077
Fix recache log statement (#11536)
turns out I cannot type

changelog_begin
changelog_end
2021-11-03 17:09:10 +00:00
Moritz Kiefer
c098d75621
Add a --log-level flag to damlc (#11514)
This also allows us to quite down our builds a bit which is nice.

changelog_begin
changelog_end
2021-11-03 14:22:57 +01:00
Moisés Ackerman
ac49d69e13
Ensure that -Werror converts parser warnings into errors (#11511)
closes #11399

changelog_begin
changelog_end
2021-11-03 11:28:52 +01:00
Robin Krom
da76e2825b
iface: check for interface implementations precond (#11494)
* iface: check for interface implementations precond

We change speedy to also check all preconditions defined in interface
implementations upon a create.

CHANGELOG_BEGIN
CHANGELOG_END

* Update daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/Compiler.scala

Co-authored-by: Remy <remy.haemmerle@daml.com>

* format

* interfaces: lfconversion for iface preconditions

This adds interface preconditions to the interface implementations
during completion phase in the LF conversion.

CHANGELOG_BEGIN
CHANGELOG_END

* format

* rebase

Co-authored-by: Remy <remy.haemmerle@daml.com>
2021-11-02 17:27:49 +00:00
Remy
a8ae4d6f9c
LF: Rename GenNode to Node (#11469)
Following up #10827 and #10921 that drop type parameters from GenNode,
we rename GenNode into Node.

CHANGELOG_BEGIN
CHANGELOG_END
2021-11-02 16:42:16 +00:00
Moritz Kiefer
92495b0662
Upgrade nixpkgs (#11490)
* Upgrade nixpkgs

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2021-11-02 15:52:55 +01:00
Moritz Kiefer
63d855f202
Pass damlc build logs through daml logger (#11485)
* Pass `damlc build` logs through daml logger

This gives us some timings which can be useful in some
circumstances (I want timings around data-dependencies next).

I also changed the default log level to INFO. The `damlc build` output
doesn’t get any noisier from that.

Example output:

```
2021-11-01 15:25:17.16 [INFO]  [build]  []
Compiling foobar to a DAR.

2021-11-01 15:25:17.80 [INFO]  [build]  []
Created .daml/dist/foobar-0.0.1.dar
```

changelog_begin
changelog_end

* Adjust scenario service log level

changelog_begin
changelog_end

* Adjust tests

changelog_begin
changelog_end

* delete comment

changelog_begin
changelog_end
2021-11-02 12:10:09 +00:00
Moritz Kiefer
505a7f59f3
Extend debug logging around dependencies/data-dependencies (#11488)
* Extend debug logging around dependencies/data-dependencies

changelog_begin
changelog_end

* stop stealing by $s hlint

changelog_begin
changelog_end
2021-11-02 09:34:45 +01:00
Sofia Faro
d8898b8c80
Check fixed choices in name collision checker (#11481)
* Check fixed choices in name collision checker

This is a follow up to #11364. This PR checks that the list of inherited
choice names is correct in the type checker, and moves the "fixed choice name
collision" check into the name collision checker using this data.

Haskell side only for now. Part of #11137.

changelog_begin
changelog_end

* Update compiler/daml-lf-tools/src/DA/Daml/LF/TypeChecker/Check.hs

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-11-01 14:52:44 +00:00
Sofia Faro
741a6e75a7
interfaces: Add list of fixed choices in TemplateImplements structure. (#11364)
* interfaces: Add fixed choices in TemplateImplements

To make template choice collision checks local.

changelog_begin
changelog_end

* LF completer

* lint

* scary non-shadowing

* improve comment

* change field name
2021-11-01 11:51:51 +00:00
Robin Krom
45beaf7aac
interfaces: typecheck for precond, haskell side. (#11468)
This adds the typecheck for the interface precondition on the Haskell
side.

CHANGELOG_BEGIN
CHANGELOG_END
2021-10-29 14:36:32 +00:00
Moisés Ackerman
05312f1ca0
Lift out constraint tuples to synonyms in dfun contexts (#11467)
This is because otherwise GHC expands them out as regular constraints.

Closes #11455
Similar to #9663

changelog_begin
changelog_end
2021-10-29 15:52:46 +02:00
Robin Krom
b98a3ade29
interfaces: precondition, scala ast, decoder/encoder (#11452)
* interfaces: precondition, scala ast, decoder/encoder

This adds the interface precondition to the scala Daml LF AST, plus
decoder/encoder and the typechecker.

CHANGELOG_BEGIN
CHANGELOG_END

* Update daml-lf/archive/src/main/scala/com/digitalasset/daml/lf/archive/DecodeV1.scala

Co-authored-by: Remy <remy.haemmerle@daml.com>

* format

Co-authored-by: Remy <remy.haemmerle@daml.com>
2021-10-29 10:10:55 +00:00
Moisés Ackerman
bad50a51e9
Type reexports explicitly use 'type' namespace (#11451)
This ensures that type operators are reexported correctly.

Closes #11447

changelog_begin
changelog_end
2021-10-28 15:50:58 +02:00
Robin Krom
d3b9c84908
ifaces: preconditions, proto changes (#11448)
This adds a precondition expression to the protobuf and the
encoders/decoders on the haskell side.

CHANGELOG_BEGIN
CHANGELOG_END
2021-10-28 13:15:22 +00:00
Moritz Kiefer
d8b92b7c99
Drop flaky marker from lsp-tests (#11442)
I can’t reproduce flakiness anymore. I suspect #11395 fixed it.

fixes #4904

changelog_begin
changelog_end
2021-10-28 12:21:01 +02:00
Robin Krom
12e782b1ea
ifaces: update ghc-parser (#11383)
* ifaces: update ghc-parser

This updates the ghc-parser, including the `ifaceTypeRep` method
generation for interfaces.

CHANGELOG_BEGIN
CHANGELOG_END

* pin stack snapshot on unix

* add tests

* update ghc-lib hash

* pin stackage dependencies on unix

* pinned stackage windows
2021-10-27 11:29:22 +00:00
Moritz Kiefer
b1fed31ca4
Fix missing script results (#11395)
fixes #11007

changelog_begin

- [Daml Studio] Fix a bug where script results in Daml Studio
  sometimes do not show up.

changelog_end
2021-10-26 15:00:55 +02:00
Moisés Ackerman
613aac3e47
Add support for non-star-kinded type synonyms in data-dependencies (#11293)
* Add DA.Internal.NatSyn as a stable package

This module exposes a type NatSyn, to be used for encoding
type synonyms of Nat-kinded types

* Add generalized roundtrip test helpers in LFConversion tests

roundtripTestsBy and roundtripTestsPartialBy are like their
non-By versions, except they take an explicit equality predicate
instead of relying on the Eq instance. This allows the source
and target types to differ.

* Define encoder/decoder for type synonyms

This works by saturating the RHS of the declaration with artificial
variable names and adding the corresponding parameters on the LHS
In the case of Nat type synonyms, the Proxy-like
DA.Internal.NatSyn.NatSyn type is used to wrap the value into
something of kind star.

* Use type synonym encoder/decoder when generating/consuming DALF

This closes #11226

changelog_begin
changelog_end

* Extend type synonyms over data-dependencies test

* Add test cases for multi-param type class synonyms
2021-10-25 17:10:05 +02:00
Robin Krom
f89ecc6b95
interfaces: add an experimental toTypeRep builtin. (#11378)
This adds an experimental `toTypeRep: forall t. t -> TypeRep` builtin.
It will only work on interface payloads and crash horribly otherwise.

CHANGELOG_BEGIN
CHANGELOG_END
2021-10-25 14:09:23 +00:00
Remy
8d5cab5f16
LF: Simplify seeds generation in scenario runnner (#11353)
We just need the new seeds to be:
- fresh during a run,
- deterministic across two runs.

CHANGELOG_BEGIN
CHANGELOG_END
2021-10-25 08:54:42 +02:00
Moritz Kiefer
9e5b78804e
Speedup daml repl integration tests (#11335)
We’ve seen the tests time out despite already having a 900s test
timeout so this PR speeds up the tests using the following approaches:

1. Drop redundant test. We don’t need a test to test that daml repl
starts without a ledger if other tests also use that. Admittedly that
could make debugging slightly worse but I’m happy to accept that here.
2. Stop using a Ledger where we don’t need one. The import tests are
about testing the client side not the server side.
3. Share ledgers where we can. The inbound messages size tests and the
static time tests can reuse the ledger.
4. Stop using packages where we don’t need them. This speeds up both
ledger startup as well as Daml Repl startup.

changelog_begin
changelog_end
2021-10-25 08:52:38 +02:00
Sofia Faro
ed9dbed100
interfaces: Add fixed choice collision check in typechecker (Haskell) (#11337)
* interfaces: Add fixed choice name collision check

Add a check that a template cannot have two choices with the same name,
even taking into account all of its "inherited" interface fixed choices.

Part of #11137

changelog_begin
changelog_end

* "Me want" -> "We want"
2021-10-21 12:29:05 +01:00
Sofia Faro
76eb1657d2
Interface fixed choices: ghc parser (#11275)
* Interface fixed choices: ghc parser

(WIP)

changelog_begin
changelog_end

* .

* ..

* ...

* stackage unpin unix

* ...

* fold create/observer/signatory into fake lfconversion primitives

* stackage unpin

* .....

* ......

* ........

* .........

* . . . . .

* unpin stackage on unix

* ...... ......

* ...

* . . . . .

* unpin stackage on unix

* . . . . . . . . .

* unpin stackage on unix

* Loosen restriction on ETo/FromAnyChoice fake primitives

* uncomment exercise in Interface.daml

* remove comments

* !!!

* the final re-pinning, part 1

* the final re-pinning: part 2
2021-10-20 17:45:13 +00:00
Moisés Ackerman
62558374a7
Data dependencies support for reexports (#11147)
* Add 'fsFromText' helper function in UtilGHC

* Define exports encoding/decoding

* Test exports encoding/decoding

* Tweak convertQualified to take a function on Name

* Generate $exports value

This includes all the values exposed by the module.

* Add norm_exports jq filter for QUERY-LF tests

* Test $exports value generation

* DataDeps reconstructs exports from $exports value

* Test data-dependencies preserves cross-package exports

* Only emit $exports entries for values defined in other modules

* Only emit $exports entries for Daml-LF versions that support type synonyms

* Do not emit $exports entries for internal DAML modules

* Use one $export<i> value per exported entity

changelog_begin
changelog_end
2021-10-18 14:51:11 +00:00
Moritz Kiefer
a940016f46
Add debugRaw corresponding to traceM in Haskell (#11259)
changelog_begin

- [Daml Stdlib] Add `debugRaw` as a convenience wrapper around
  `traceRaw` when used inside a do-block. `debugRaw` compares to
  `debug` like `traceRaw` compares to `trace` meaning it expects a
  `Text` instead of calling `show` on an expression.

changelog_end
2021-10-18 10:55:46 +02:00
Moisés Ackerman
e4808f620e
Extract UtilLF module from daml-lf-conversion to its own library (#11263)
changelog_begin
changelog_end
2021-10-15 17:52:09 +00:00
Moisés Ackerman
82fa229385
Add daml-util-ghc lib (#11260)
* Extract UtilGHC module from daml-lf-conversion to its own library

* Drop daml-preprocessor dependency on daml-lf-conversion

changelog_begin
changelog_end
2021-10-15 15:52:29 +00:00
Remy
3c26852226
LF: Use template Id in exercise node of fixed choice. (#11229)
* LF: Put template Id in exercise node of fixed choice.

instead of interface id and fix ValueEnricher.

CHANGELOG_BEGIN
CHANGELOG_END
2021-10-13 15:24:00 +02:00
Sofia Faro
ce64cb2a13
interfaces: Do some TODOs (#11231)
* interfaces: Do some TODOs

- Add uniqueness check between fixed choices and virtual choices in
  haskell decoder.
- Encode interface methods and fixed choices in scala encoder.
- ExprIterable for interfaces.

changelog_begin
changelog_end

* scalafmt
2021-10-13 13:36:53 +01:00
Sofia Faro
7a02e7c440
interface fixed choices: LFConversion support (#11206)
* interface fixed choices: LFConversion support

Part of #11137

changelog_begin
changelog_end

* Update experimental primitives name, invoke UExerciseInterface
2021-10-12 17:06:52 +00:00
Remy
b2988bc79a
LF: type and compile Interface fixed choices (#11175)
* LF: type and compile Interface fixed choices

CHANGELOG_BEGIN
CHANGELOG_END

* cleanup

* fix some token

* cleanup

* Address sophia's review

* add comment

* cosmetic

* fix
2021-10-12 15:48:36 +01:00
Robin Krom
3115d104aa
daml script interfaces (#11124)
* interfaces: introduce TemplateOrInterface class in stdlib

The template typeclass is to strong for many applications. The new
constraint `TemplateOrInterface` only contains the methods to convert
contract IDs and choices.

CHANGELOG_BEGIN
CHANGELOG_END

* ghc-lib update, interface script tests

* pinned stackage on unix

* added missing implementation in preprocessor

* added test

* fixing tests

* remove Iface type

* pinned stackage windows

* make sure createAndExercise is not called on interfaces
2021-10-11 18:22:40 +02:00
Sofia Faro
174e23a6f8
interfaces: Sync InterfaceDesugared with Interface (#11191)
I think it's helpful for us to keep these two in sync.

changelog_begin
changelog_end
2021-10-11 12:22:02 +01:00
Sofia Faro
7e2edbdfaf
interface fixed choices: Haskell Typechecker (#11177)
Part of #11137

changelog_begin
changelog_end
2021-10-08 15:42:29 +01:00
Sofia Faro
c876bd82a8
interfaces: Add a test for runtime errors (#11179)
changelog_begin
changelog_end
2021-10-08 15:27:24 +01:00
Sofia Faro
53c76d47c3
interface fixed choices: Haskell AST (#11160)
* interface fixed choices: Haskell AST

Part of #11137

changelog_begin
changelog_end

* Make intParam strict
2021-10-07 10:46:50 +00:00
Sofia Faro
7f6c8608bd
Interface fixed choices: protobuf (#11139)
Adds protobuf for fixed choices. ASTs left for later.

changelog_begin
changelog_end
2021-10-06 16:01:41 +01:00
Andreas Herrmann
51873ff344
Support empty party display name in scenario service (#11131)
* Add regression test for #11099

https://github.com/digital-asset/daml/issues/11099

* Support empty party display name in scenario service

changelog_begin
- [Daml Studio] Scripts no longer fail when allocating a party with an
  empty display name. See https://github.com/digital-asset/daml/issues/11099.
changelog_end

* fmt

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-10-06 10:28:11 +00:00
Remy
11bc22d085
LF: builtins to create, signatory, and obersver on interface payload. (#11120)
CHANGELOG_BEGIN
CHANGELOG_END
2021-10-05 11:59:07 +00:00
Moisés Ackerman
ffc8d6894f
Data dependencies deserialize imports (#11037)
* Extend ModRef type to include ImpSpec

* Extract 'importOriginFromPackageRef' from 'genModule'

* emitModRef with EmptyImpSpec for all items in the metadata value 'imports'

* Generalize simpleImportTest into dataDependenciesTest, for tests with a multiple-module library and app

* Test that orphan instances are propagated in data-dependencies

changelog_begin
changelog_end
2021-09-30 16:27:12 +00:00
Robin Krom
9fd6326ae7
interfaces: consuming/non-consuming iface choices (#11009)
* interfaces: consuming/non-consuming iface choices

We add the consumption behaviour to the interface choice definition and
typecheck accordingly.

CHANGELOG_BEGIN
CHANGELOG_END

update to new ghc-lib, conversion implementation

* update ghc-lib

* pinning stackage on unix

* pin stackage on windows
2021-09-30 15:56:28 +00:00
Moisés Ackerman
229ce4776f
Data dependencies serialize imports (#11038)
* Extract 'convertQualifiedModuleName' from 'convertQualified'

* Generate stub definition with orphan module imports

* Test that generated $$imports value has the right contents

* Update InternedTypes test to expect $$imports-related types

changelog_begin
changelog_end
2021-09-30 15:25:26 +00:00
Moritz Kiefer
26d10b267d
Drop NodeId type parameter (#10921)
changelog_begin
changelog_end
2021-09-30 09:13:54 +00:00
Leonid Rozenberg
3cbd9229aa
More NonEmpty functions (#10930)
* Add NonEmpty cons.

* Add NonEmpty find.

* Add NonEmpty delete, deleteBy.

CHANGELOG_BEGIN
Add cons, find, delete and deleteBy functions to NonEmpty module.
CHANGELOG_END

* Simplify type signator of delete result.
2021-09-30 09:13:20 +00:00
Sofia Faro
bcd468625c
interface methods: Speedy (#11076)
* interface methods: Scala AST

Part of #11006
This PR takes care of the Scala AST and decoder.
It leaves the encoder, type checker, and speedy for later.

changelog_begin
changelog_end

* scalafmt

* AstRewriter

* interface methods: Speedy

Part of #11006

changelog_begin
changelog_end

* scalafmt

* Remove InterfaceMethods test

* Update daml-lf/archive/src/main/scala/com/digitalasset/daml/lf/archive/DecodeV1.scala

Co-authored-by: Remy <remy.haemmerle@daml.com>

Co-authored-by: Remy <remy.haemmerle@daml.com>
2021-09-30 08:38:08 +00:00
Moritz Kiefer
6d8cf7089c
Handle interface methods in LF conversion (#11054)
changelog_begin
changelog_end
2021-09-29 12:23:44 +02:00
Moritz Kiefer
b7daa5f7d8
Address remaining dependabot alerts (#11045)
* Address remaining dependabot alerts

changelog_begin
changelog_end

* downgrade string-width

5.0.0 is too new for our setup

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2021-09-28 11:12:14 +02:00
Moisés Ackerman
03203b7360
Define encoding/decoding for module imports (#11036)
* Define encoding/decoding for module imports

First step towards closing #10773

changelog_begin
changelog_end

* Update compiler/damlc/daml-lf-conversion/src/DA/Daml/LFConversion/MetadataEncoding.hs

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2021-09-28 08:48:48 +00:00
Sofia Faro
0d3ae6e14c
interface methods: Haskell Typechecker (#11028)
part of #11006

changelog_begin
changelog_end
2021-09-27 12:32:05 +01:00
Sofia Faro
4075624cfc
interface methods: Haskell AST (#11018)
* interface methods: Haskell AST for methods

Part of #11006. This leaves typechecker and LF conversion for later, on
the haskell side.

changelog_begin
changelog_end

* Forgot ECallInterface in DecodeV1

* fix a test
2021-09-27 10:10:21 +01:00
Sofia Faro
bf8b75dab5
interface methods: Add protobuf definitions. (#11005)
* interface methods: Add protobuf

Adds protobuf definitions for interface methods and calling them.
Encoders/decoders just ignore the extra stuff or error out.

Part of #10810 (maybe)

changelog_begin
changelog_end

* Update issue numbers where appropriate

* update stable protos
2021-09-23 14:55:19 +01:00
Moisés Ackerman
35666caae8
Add MINIMAL pragma for Additive type class (#11001)
* Add MINIMAL pragma for Additive type class

This ensures that the compiler gives an error if both (-) and negate are missing in an instance

Fixes #11000

changelog_begin
changelog_end

* Add test case to ensure incomplete Additive instance declaration triggers error message
2021-09-23 11:01:53 +00:00
Remy
58c82b6e41
LF: reduce usage of NodeCreate.coinst (#10988)
Access directly templateId, argument, and agreementText.

CHANGELOG_BEGIN
CHANGELOG_END
2021-09-22 18:52:23 +00:00
Sofia Faro
3f4dbf6f8e
interfaces: Syntax highlighting for interfaces (#10987)
* interfaces: Syntax highlighting for 'interface'

To make daml studio look pretty.

changelog_begin
changelog_end

* Add 'implements' as well
2021-09-22 16:40:14 +00:00
Sofia Faro
d52a2857da
interface: Add test for conversion functions (#10991)
Test conversions of both payloads and contract ids

changelog_begin
changelog_end
2021-09-22 16:39:58 +00:00
Sofia Faro
34390f7062
interfaces: Implemented conversions, added test. (#10982)
Part of #10810

- Implemented ToInterface, FromInterface in speedy
- Added a test that exercises and fetches an interface
- Fixed a bug in SBUChoiceInterface

Hey, interfaces work now!

changelog_begin
changelog_end
2021-09-22 15:50:54 +01:00
Moritz Kiefer
99836d2610
Handle fetchByKey callback correctly in scenario runner (#10980)
fixes #10977

Turns out assertions are good unless they’re wrong …

This only affects scenarios, the engine never looks at the callback.

changelog_begin
changelog_end
2021-09-22 13:19:57 +02:00
Moritz Kiefer
4acf34b5fc
Add conversions from/to interfaces in Daml parser (#10954)
* Add conversions from/to interfaces in Daml parser

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2021-09-21 18:24:12 +00:00
Sofia Faro
cebe6ed482
Refactor safetyStep in the simplifier. (#10948)
changelog_begin
changelog_end
2021-09-21 15:49:48 +01:00
Sofia Faro
ac192fc6db
interfaces: Add to/from interface in Haskell typechecker (#10951)
* interfaces: Add to/from interface in hs typecheck

changelog_begin
changelog_end

* questionable lint
2021-09-21 15:29:33 +01:00
Sofia Faro
724e50d739
interfaces: Add to/from interface in Haskell AST (#10945)
Part of #10810

changelog_begin
changelog_end
2021-09-21 10:24:10 +01:00
Robin Krom
2edfc062a0
ifaces: name collision, typecheck fetch/exercise (#10896)
* ifaces: name collision, typecheck fetch/exercise

This adds name collision detection and adds typechecking for
fetch/exercising of interface instances.

CHANGELOG_BEGIN
CHANGELOG_END

* turn on exercises in InterfaceDesugared test case

* Update compiler/daml-lf-tools/src/DA/Daml/LF/TypeChecker/NameCollision.hs

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2021-09-20 21:40:26 +00:00
Remy
5dc15c6911
LF: rename language Interface to PackageInterface (#10938)
To avoid confusion with the new Daml concept of Interface.

CHANGELOG_BEGIN
CHANGELOG_END
2021-09-20 19:04:14 +00:00
Sofia Faro
409c0b4f60
interfaces: Add to/from_interface in proto (#10937)
* interfaces: Add to/from_interface in proto

Part of #10810

changelog_begin
changelog_end

* fix typo
2021-09-20 13:44:00 +00:00
Robin Krom
50291ed61b
interfaces: scala typechecker implementation (#10867)
* interfaces: scala typechecker implementation

This is the scala side of the lf typechecker for interfaces.

CHANGELOG_BEGIN
CHANGELOG_END

* added collision check

* added exercise/fetch typechecking

* review suggestions

* added todos for collision/typing scala tests
2021-09-16 20:37:33 +00:00
Moritz Kiefer
cac8391d4c
Bump ghc-lib to include daml interfaces parser (#10747)
changelog_begin
changelog_end
2021-09-16 17:52:16 +00:00
Moritz Kiefer
9b0fa29aec
Separate exercise & fetch for interfaces from templates (#10908)
* Separate exercise & fetch for interfaces from templates

part of #10810

changelog_begin
changelog_end

* Update compiler/daml-lf-ast/src/DA/Daml/LF/Ast/Base.hs

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>

* Update compiler/daml-lf-ast/src/DA/Daml/LF/Ast/Base.hs

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2021-09-16 12:05:11 +00:00
Moritz Kiefer
8e22bb6b2d
Drop ContractId typeparameter from Value (#10827)
99% of our usecases use Value[ContractId] so this PR just fixes it.

The few other usescases are:

1. Value[Nothing] which we use for keys. This is technically more
precise but we benefit very little from it.
2. Value[String] mostly because in a few places we are lazy.

We don’t have any code which benefits from being polymorphic in the
contract id type.

changelog_begin
changelog_end
2021-09-16 08:46:57 +00:00
Moritz Kiefer
f08ac5f65c
Desugar interface implements declarations (#10895)
* Desugar interface implements declarations

This PR adds desugaring for tplImplements. This consists of the
corresponding typeclass instance (which we just ignore in LF for now,
we probably need it once we have pure functions) and a _implements_
top-level value.

changelog_begin
changelog_end

* Address review feedback

changelog_begin
changelog_end
2021-09-15 19:48:59 +00:00
pbatko-da
6dcdaa411c
[DPP-589] Add CLI flag to select minimum enabled TLS version (#10854)
- Add support for specifying either 1.2 or 1.3 as minimum TLS versions for ledger api server.
- Log enabled protocols (~TLS versions) and cipher suites at server and client startup.
- Add integration tests against Sandbox-classic and Sandbox

CHANGELOG_BEGIN
Sandbox: Add CLI flag to select minimum enabled TLS version for ledger API server.
CHANGELOG_END
2021-09-14 12:37:38 +02:00
Robin Krom
8f5b4fa84c
interfaces: protobuf encoder haskell side (#10850)
* interfaces: protobuf encoder haskell side

This is the implementation of the protobuf encoder on the haskell side.

CHANGELOG_BEGIN
CHANGELOG_END

* missing decoder cases for added interface data constructor
2021-09-13 14:36:14 +00:00
Moritz Kiefer
9a4c9df06a
Implement LF desugaring of interface definitions (#10834)
This only handles the interface definition, not the implementation in
the template. There are also a few rough edges:

1. It maks all choices as consuming.
2. it ignores locations

But for a poc that doesn’t seem too bad.

The tests don’t do anything super useful since the typechecker falls
over but I checked tha tthe generated LF looks more or less reasonable.

changelog_begin
changelog_end
2021-09-13 15:15:31 +02:00
Robin Krom
2aaf601912
interfaces: protobuf decoder haskell side (#10849)
CHANGELOG_BEGIN
CHANGELOG_END
2021-09-13 14:58:48 +02:00
Robin Krom
6dc769b7ad
interfaces: lf typechecker implementation (#10843)
* interfaces: lf typechecker implementation

CHANGELOG_BEGIN
CHANGELOG_END

* review suggestions
2021-09-13 14:58:33 +02:00
Moritz Kiefer
6d347d4e88
Add daml interfaces to the Haskell LF AST (#10811)
* Add daml interfaces to the Haskell LF AST

Just copied from Sofia’s PR with no changes and stubbed all usages of
it that aren’t trivial.

changelog_begin
changelog_end
2021-09-08 15:48:02 +00:00
Moritz Kiefer
8830eaa2ec
Drop controller can syntax from compiler tests (#10807)
You definitely want to review this with whitespace disabled.

changelog_begin
changelog_end
2021-09-08 15:28:09 +02:00
Robin Krom
b8bd5e6399
interface PoC: protobuf definitions (#10796)
* interface PoC: protobuf definitions

The protobuf changes for the Daml interface PoC.

CHANGELOG_BEGIN
CHANGELOG_END

* dummy interface decoder/encoder
2021-09-07 16:58:49 +02:00
Remy
c4e0a755d4
LF: drop ad-hoc ImmArray builders (#10763)
Since we switch to scala 2.13, ImmArray companion object extends
`Factory`. Hence:

- the `apply` methods of `ImmArray` override the one from `Factory`

- we can use the notation `.to(ImmArray)` to convert an `Iterable` to
  `ImmArray`

This PR drops those `apply` ImmArray. Conversion from Iterable to
`ImmArray` should use the `.to(ImmArray)`.

CHANGELOG_BEGIN
CHANGELOG_END
2021-09-04 16:10:07 +02:00
Moritz Kiefer
e9c8af5024
Bump ghc-lib to include dropped parsing code for generic templates (#10735)
* Bump ghc-lib to include dropped parsing code for generic templates

changelog_begin
changelog_end

* bump snapshot

changelog_begin
changelog_end

* drop old generics file

changelog_begin
changelog_end

* drop other broken file

changelog_begin
changelog_end

* Bump again

changelog_begin
changelog_end

* bump to merged commit

changelog_begin
changelog_end

* and bump snapshots

changelog_begin
changelog_end
2021-09-01 15:35:40 +02:00
Remy
9ef3377864
LF: Update specification with Contract ID Comparability check (#10703)
This is part of #10504.

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-31 13:01:25 +02:00