* Point to updated revision
* Fix test failures due to expectations for unformatted errors
* Fix pretty printer for EForbiddenNameCollision, amend test
* Update protobuf to include sourceloc for implements and coimplements
Relevant haskell changes
* Update error ranges in tests
* Extract source locations from various template/interface parts
* Improve ExprSource extraction
* Move location from instance head to template/interface parts
Add location to instance print
* Add custom viewtype mismatch error
* Modify error message on EViewTypeMismatch to be like GHC error
* Make EUnknownMethodInInterfaceInstance error consistent w/ GHC
* Add MethodTypeMismatch error, sync with GHC error
* Prefix fields in new errors
* Intercept type mismatch in method to throw EMethodTypeMismatch
* Synchronize EUnknownField with GHC-side message
* Complete synchronizing EUnknownField with GHC-side error message
* satisfy lint and changelog check
CHANGELOG_BEGIN
CHANGELOG_END
* lint
* Fix TypingSpec for new EMethodTypeMismatch
* lint
* lint again
* EFieldTypeMismatch error for ERecUpd/ERecProj mismatch, like in GHC
* lint
* Improve error for wrong viewtypes
* Add tests for new viewtype errors
* satisfy changelog check
CHANGELOG_BEGIN
CHANGELOG_END
* Use strict foldl
* Update tests to be non-hyphenated
* Allow EExpectedViewType to define own article
* Use _TApps instead of _TypeSplitApp
* Remove hyphen from "type-constructor" in EExpectedViewType
* Add article to EExpectedViewType messages
* Improve EExpectedViewType errors for unexpected Type, add particle
* Fix tests for improved viewtype errors
* Add per interface choice context in serializability checks
* Update expected errors in daml-test-files
* Drop done todo
* Keep TyCon in InterfaceBinds
* Move convertInterface to top level
* convertInterface now returns a list of definitions
* Refactor convertInterface
* Create interface data type def in convertInterface
* Check for featureSimpleInterfaces in convertInterface
* Check for featureSimpleInterfaces in convertInterfaceInstance
* cleanup convertRequires
* Validate that an interface type constructor has no parameters
changelog_begin
changelog_end
* 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
* Temporarily disable decode extended interface primitives test
* Use dictionary comprehension to generate ledger/test-common test_names
* Move InterfaceSubscriptionsIT test back into 1.dev suite
* lint
* Make exercise guards nullable, ignore Nothing in decode/encode
* Desugar UExerciseInterface[Guarded] differently, point to updated GHC
* Update to new GHC revision, removes pred argument from `exercise`
* Attach correct range to guard support error (if any)
Co-Authored-By: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
* Rename interface features
Co-Authored-By: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
* Remove unnecessary mention of v1_14 from supportedInputVersions
Co-Authored-By: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
* Clarify purpose of `Maybe Expr` type for exercise guard
Co-Authored-By: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
* Remove guarded exercise when Extended Interfaces are not enabled
* Remove all instances of guarded exercises in versions <= 1.15
* Add check for isId to splitDFunId
* Exclude via $cexerciseGuarded check - ClassOpId approach did not work
* Run damlc interface tests w/o requires when since DAML_INTERFACE
* Update desugared daml for UExerciseInterface[Guarded] generation
* Temporarily disable failing damlc tests
* Remove 1.dev-only references from 1.15 protobuf
Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
* 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 -XRankNTypes in DA.Daml.LF.TypeChecker.Check
* Add TemplateOrInterface type in Haskell
* Define type InterfaceInstanceHead in daml-lf-ast
* Define 'lookupInterfaceInstance'
* Use lookupInterfaceInstance for checking implemented interfaces
* Use lookupInterfaceInstance for checking required interfaces
* Extract checkInterfaceInstance from checkIfaceImplementation
* Reword 'implements' errors in terms of interface instances
* Introduce tmplParam in checkInterfaceInstance
* Check interface instances in interface
* Add InterfacePart argument to ContextDefInterface
changelog_begin
changelog_end
* Add DA_Internal_Interface to convertTypeDef exclusion check
* Move desugared types/values for interface views into DA.Internal.Desugar
* Convert viewtype and view method declarations
* Typecheck view types and view declarations
* Add unit viewtypes to InterfaceChoiceCollision tests
* Add unit viewtypes to more compiler/damlc tests
* Modify empty interfaces/implements to have viewtypes/views
* Add unit viewtypes to remaining Interface tests
* Test for error thrown when viewtype not specified
* Fix daml-lf/ interface tests to use new syntax / unit views
* Add placeholder view of type Unit to TestInterfaces
CHANGELOG_BEGIN
CHANGELOG_END
* Fix typescript interface tests with unit viewtype
* Add unit viewtype to Java & Scala codegen
* Add unit viewtype to triggers tests interface
* Add unit viewtypes to ledger/test-common
* Add unit viewtypes to ledger-service/http-json
* Fix some damlc tests
* Use viewtype syntax in InterfaceViewNonSerializable test
* Remove HasInferfaceView instances in convertBind
* Add unit view to QualifiedInterface.daml test
* Generate HasInterfaceView instances in DataDependencies
* Add unit viewtypes and views to compiler/damlc/tests
* Document reconstruction of HasInterfaceView
* Move desugared types/values for interface views into DA.Internal.Desugar
* Add desugarable function view w/ EViewInterface desugaring
* Remove templateName and viewtype from generated EViewInterface
* Update desugared-daml
* Proof of concept: use _view -> EViewInterface prim via HasInterfaceView
* Move view, HasInterfaceView to DA.Internal.Interface
* Update desugared-daml tests
* Stop removing and re-generating HasInterfaceView instances
* Do not generate docs for generated "_view_" methods
* Report errors with interface TypeConNames prettily
* Fix InterfaceViewNotSpecified @ERROR to reflect new error text
* Don't import magic `view` method from Prelude to avoid name clash
* Update shake interface goto definition test locations
* Temp disable view spec tests, will re-implement views in speedy
* Add unit viewtype to Java code snippet docs
* Update Interface syntax docs for views
* Add unit viewtype to Transferrable.daml
* Add back "empty" interface implementation to interfaces.rst
* Re-enable view tests by having _view methods on InterfaceViews.daml file
* Remove deprecated commented-out view desugaring code
* Remove templateId and viewtype from EViewInterface
* Fix lint
* Compile DefRefs for views, return them in SBViewInterface
* Stop looking for `_view` method, remove ENoViewFound in TypeChecker.hs
* Remove ENoViewFound / remove view method lookup, use view param instead
* Fix use of viewMethod.returnType / import of MethodName
* Replace uses of `_view` in Scala, update parser w/ viewtype/view clauses
* Fix lint
* Update Interface LF encoding test for views
* Stop using unit views in ParsersSpec
* Fix tests to have new Scala test parser viewtype/view syntax
* Fix Interface_extended_1.dev_.lf to have viewtypes/views
* Change all spec/lf viewtypes/views to Unit
* Remove accidental use of requires
* Fix ParsersSpec to have record viewtypes/views
* Fix ValueEnricherSpec for switch to unit views
* Remove no view test from Scala - lack of view is caught at compile-time
* Remove unused _view method in InterfaceViews.daml test
* Return control expression via Control.Expression
* Retrieve compiled views via implementation body
* Reduce duplication between implements and co-implements
This extracts the common part (methods and view) to a new type InterfaceInstanceBody
changelog_begin
changelog_end
* Add DA_Internal_Interface to convertTypeDef exclusion check
* Move desugared types/values for interface views into DA.Internal.Desugar
* Convert viewtype and view method declarations
* Typecheck view types and view declarations
* Add unit viewtypes to InterfaceChoiceCollision tests
* Add unit viewtypes to more compiler/damlc tests
* Modify empty interfaces/implements to have viewtypes/views
* Add unit viewtypes to remaining Interface tests
* Test for error thrown when viewtype not specified
* Fix daml-lf/ interface tests to use new syntax / unit views
* Add placeholder view of type Unit to TestInterfaces
CHANGELOG_BEGIN
CHANGELOG_END
* Fix typescript interface tests with unit viewtype
* Add unit viewtype to Java & Scala codegen
* Add unit viewtype to triggers tests interface
* Add unit viewtypes to ledger/test-common
* Add unit viewtypes to ledger-service/http-json
* Fix some damlc tests
* Use viewtype syntax in InterfaceViewNonSerializable test
* Remove HasInferfaceView instances in convertBind
* Add unit view to QualifiedInterface.daml test
* Generate HasInterfaceView instances in DataDependencies
* Add unit viewtypes and views to compiler/damlc/tests
* Document reconstruction of HasInterfaceView
* Move desugared types/values for interface views into DA.Internal.Desugar
* Add desugarable function view w/ EViewInterface desugaring
* Remove templateName and viewtype from generated EViewInterface
* Update desugared-daml
* Proof of concept: use _view -> EViewInterface prim via HasInterfaceView
* Move view, HasInterfaceView to DA.Internal.Interface
* Update desugared-daml tests
* Stop removing and re-generating HasInterfaceView instances
* Do not generate docs for generated "_view_" methods
* Report errors with interface TypeConNames prettily
* Fix InterfaceViewNotSpecified @ERROR to reflect new error text
* Don't import magic `view` method from Prelude to avoid name clash
* Update shake interface goto definition test locations
* Temp disable view spec tests, will re-implement views in speedy
* Add unit viewtype to Java code snippet docs
* Update Interface syntax docs for views
* Add unit viewtype to Transferrable.daml
* Add back "empty" interface implementation to interfaces.rst
* Re-enable view tests by having _view methods on InterfaceViews.daml file
* Remove deprecated commented-out view desugaring code
* Damlc: Remove precondition for interfaces
follow up of #14511, goes together with digital-asset/ghc#129
* Address Ackerman's review
* Update ghc rev
CHANGELOG_BEGIN
CHANGELOG_END
* 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>
* 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
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
* 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
* 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
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
* 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
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
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
* 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
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
* 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
* 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>
* 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
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