* Add version 1.15 - move interfaces into them
* Update Ast/Version & docs for 1.15, split interface into simple/extended
* Stage 1.15 protobuf
* Remove references to dev from 1.15 protobufs
* Add Tests file for 1.15 in ledger API testtool
* Update Version 1.15 changelog with Call/implements
* Make 1.14 default again
* Add 1.15 as preview version
* Add 1.15 test suite to testtool
* Reinclude 1.15 in COMPILER_LF_VERSIONS to build model-tests-1.15
* Move v1_15 ledger-api-tests into own suite
* Fix InterfaceNotSupported message to 1.15 or higher
* satisfy changelog check
CHANGELOG_BEGIN
CHANGELOG_END
* Update tests with extended interface features to only run on 1.dev
* Allow unsafe_from_interface and interface_template_type_rep in 1.15
* Fix StableVersions back to 1.14, make EarlyAccessVersions 1.15
* Run retroactive implements tests only in extended interfaces
* lint
* Temporarily disable 1.15 conformance tests - handle in another PR
* Also disable conformance-test-tls1.2-or-newer-1.15
* Disable PureConfigReaderWriter tests that assume early-access == stable
* lint
* Remove outdated TODO on ValueEnricher
* Rename collectNewPackagesFromTemplateIds for interface use, remove TODO
* Remove outdated TODO on interfaceInstanceBody parser
* Check body view has interface viewtype as type
* Amend type iterator to go over Interface view method, remove TODO
* empty changelog commit
CHANGELOG_BEGIN
CHANGELOG_END
* Fail in Preprocessing when viewing nonimplementing interfaces
* Fix interface instance check in Typing
* Fix lint
* Typecheck view expression with tmplParam in scope
* Remove done TODO in checkInterfaceInstance
* Move AmbiguousInterfaceInstance error into LookupError as a case variant
* lint
* Add unapply to LookupError to default to NotFound
* Refactor (Co)Implements(Method) DefRefs
InterfaceInstanceDefRef replaces ImplementsDefRef and CoImplementsDefRef
InterfaceInstanceMethodDefRef replaces ImplementsMethodDefRef and CoImplementsMethodDefRef
* Define PackageInterface.lookupInterfaceInstance
* Remove lookupTemplateImplements and related functions
* Replace uses of lookupTemplateImplements and similar with lookupInterfaceInstance
* Rename ETemplateDoesNotImplementInterface=>EMissingInterfaceInstance
* Rename EConflictingImplementsCoImplements=>EAmbiguousInterfaceInstance
* Replace checkIface(Co)Implementations with direct use of checkInterfaceInstance
* Remove LookupError.Reference cases for implements/co-implements
* Rename and refactor EMissingRequiredInterface{=>Instance}
* Rename and refactor EMissingInterfaceMethod=>EMissingMethodInInterfaceInstance
* Rename and refactor EUnknownInterfaceMethod=>EUnknownMethodInInterfaceInstance
* Clean up checkInterfaceInstance
* Include interface signature in InterfaceInstanceInfo
changelog_begin
changelog_end
* Reduce duplication between implements and co-implements
This extracts the common part (methods and view) to a new type InterfaceInstanceBody
changelog_begin
changelog_end
* Basic explicit disclosure testing
CHANGELOG_BEGIN
* Engine/speedy-level tests for explicit disclosure (#14227): test that explicit disclosure works for contracts and keys.
CHANGELOG_END
After this change //daml-lf/tests:test-scenario-stable-many-fields
does not seem to stack overflow anymore.
This is a workaround until we make the type checker stack safe, See #13410.
CHANGELOG_BEGIN
CHANGELOG_END
* Update protobuf to include viewtype and implementation view
* Stub interface viewtype and implements view in updated AST
* Set views on Java builders in DecodeV1Spec
CHANGELOG_BEGIN
Update LF AST protobuf for interface viewtype and implementation view -
not currently linked to syntax or engine changes, all stubbed out in
LFConversion.
CHANGELOG_END
* Add view field to CoImplements
* Update iterators & parsers to account for CoImplements view
* Replace uses of TBuiltin(BTUnit) with TUnit
* Remove superfluous "Available in versions >= 1.dev" comment
* Fix missing TUnit imports, missing view param in daml-lf/parser
* Remove unused imports from DecodeV1Spec
* Add stub view in AstSpec
* Extend EncodeV1Spec with interface co-implements
* Add lookupTemplateImplementsOrInterfaceCoImplements to PackageInterface
* Use lookupTemplateImplementsOrInterfaceCoImplements in checkImplements
* Add TypingSpec cases for interface conversion functions via co-implements
* Add TypingSpec cases for interfaces with co-implements
* Apply code review suggestions: result type formatting
changelog_begin
changelog_end
* Add CoImplements to daml-lf AST
* Add AstSpec case for duplicate co-implements in interface
* Add placeholders for CoImplements in daml-lf validation
* Handle CoImplements in daml-lf iterators
* Handle CoImplements in daml-lf scala decoder
* Test DefInterface components in DecodeV1Spec
* Handle CoImplements in daml-lf (testing) parser
* Handle CoImplements in daml-lf (testing) encoder
changelog_begin
changelog_end
* iface: Use ImplementsDefRef instead of pkg iface
For looking up required interface conversions, like we already do in other cases.
Fixes#11345 (updated the ticket for the package interface TODO since it's very different)
changelog_begin
changelog_end
* scalafmt
* errors only a compiler could notice
* scalafmt again :-(
* 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>
* 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
* ifaces: tests: check for interface collisions in ast
We add a test to check for interface name collisions in the daml-lf AST.
CHANGELOG_BEGIN
CHANGELOG_END
* Update daml-lf/language/src/test/scala/com/digitalasset/daml/lf/language/AstSpec.scala
Co-authored-by: Remy <remy.haemmerle@daml.com>
Co-authored-by: Remy <remy.haemmerle@daml.com>
* 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
* 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
* interfaces should not be implicitly serializable
* Add scala serializability check for interface choices
* Add scala serializability check for interface payloads
changelog_begin
changelog_end
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
Following #12338 which merges the two implementations of the
structural record projection introduced by #7740, this PR merges the two
implementations of the structural record introduced by #7742.
However, this PR does not try to cache the field index as it is done
1- unlike what it is suggested by commit message of #7742, the update
has a linear complexity anyway, as it has to copy the whole struct.
2- the compiler does not produce any structural record updates
As result the PR is basically a revert of #7742.
CHANGELOG_BEGIN
CHANGELOG_END
Currently we have two implementations for the projection of structural
record.
1- The first implementation takes as parameter the index of the
projected field and is therefore constant. This implementations is
used when the type checking is enable, as the index cannot be directly
inferred from the AST and must hence be filled in by the DAML-LF type
checker.
2- The second implementation takes as parameter the name of the
projected field and is therefore logarithmic as the field must be
lookup by binary search at each call. This version is used when the
type checking is disable as the index cannot be inferred without type
inference.
In this PR, we modify the second implementation so it cache the index
at the first call, hence avoiding the recomputation during further
calls. In this way we reach an amortized constant complexity. The
first implementation is decommissioned in benefit of the second one.
The advantages of this approach are:
- We have a unique implementation of the projection, so the behavior
of a program is the same whenever the type checking is on or off.
- The AST for structural projection is immutable.
Benchmarks show no performance differences when the type checking is on.
Based on an idea by @sofiafaro-da.
CHANGELOG_BEGIN
CHANGELOG_END
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
* 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
Part of #11978. Adds typechecking for this field on the interface side,
and enforces that any template that implements A must implement B if A requires B.
CHANGELOG_BEGIN
CHANGELOG_END
After staring at a type mismatch between `Nested` and `Nested` this
seemed like a sensible change. We could also include the package
ids. I don’t have strong feelings about this but this seems like a
clear uncontroversial improvement.
changelog_begin
changelog_end
* Drop support for Daml-LF party literals from the Scala side
This PR enforces that forbidPartyLiterals is always `true` and drops
the corresponding literals from the AST. Haskell side is in #11930fixes#11581
changelog_begin
changelog_end
* Update daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/ComparisonSBuiltinTest.scala
Co-authored-by: Remy <remy.haemmerle@daml.com>
* Revert "Update daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/ComparisonSBuiltinTest.scala"
This reverts commit 55e542ce4e3a7fd15544ee703de3277ffc309b17.
Co-authored-by: Remy <remy.haemmerle@daml.com>
* 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