Commit Graph

345 Commits

Author SHA1 Message Date
nickchapman-da
587efe4401
[Upgrades POC] softExercise (#16893) 2023-05-31 12:21:39 +00:00
Moisés Ackerman
990308ce53
[Upgrades PoC] softFetch (#16839)
* Refactor PackageMetadata construction

* Package Metadata now can include an upgraded package id

* define PackageInterface#lookupPredecessors

* Add SoftFetch in Daml LF

* Add softFetch function in Daml

* Add USoftFetch LFConversion primitive

* Define SoftFetch in terms of SBPromoteAnyContract

* daml_compile rule now takes upgrades arg

* Add script test for softFetch

* TODOs

* Check LF >= 1.dev when decoding 'upgradedPackageId' and 'softFetch' in DecodeV1.scala

* Check that softFetch is not called on templates with contract keys

* Seq=>List

* ModParser todo

* Extract PackageUpgradesIT from AbstractFuncIT

* Update docstring for SBPromoteAnyContract

* Fix build errors

* Fix build error

* DecodeV1Spec case for softFetch

* DecodeV1Spec case for upgradedPackageId

* EncodeV1 case for upgradedPackageId

* Fix build error

* Disable test due to cyclic dependency with canton

* Add transitive case to PackageUpgradesIT

* Clean up PackageUpgradesIT

* Fix build error

* Error if 'upgrades' field is present before featurePackageUpgrades

* Update doc on compileSoftFetchTemplate

* Reword WronglyTypedContractSoft error
2023-05-16 10:33:47 +02:00
dylant-da
5637a2e509
Test result serializability (#16850)
* define serializeable protobuf for test results

* Redefine serializable datatype, rewrite printTestCoverage to use it

* Fix bug in occurence counting

* Refactor/restructure code

* Implement choice/template printers, amend PackageId datatype

* Protobuf encoding/decoding

* Fix duplicate template choices for Archive

* lint auto-formatting for bazel

* fix lint for haskell

* fix bad paren

* lint

* Document test_results protobuf

* remove commented out nowarn compiler flags
2023-05-11 17:44:46 +00:00
Remy
31bfe9b4c4
[Engine] Implement numeric builtins compatible type nat erasure (#16773)
on the scala side except Speedy.

part of #11679
2023-05-02 12:07:54 +02:00
nickchapman-da
5a7451bdf4
[engine] choice authority: clarify remaining things to do (#16752) 2023-04-27 18:30:32 +00:00
Remy
dc40709efe
[LF] add proper encoder tests for Builtins (#16758)
We test encoder with exhaustive list of builtins for 1.11, 1.12, 1.13,
1.14, 1.15, 1.dev.

This test indirectly allso, LF parser, and LF type checking for
builtins.
2023-04-26 17:09:38 +02:00
Remy
47be2db143
[LF] Kill expirmental optimized text primitives (#16759)
Those have never proved their usefullness.
2023-04-25 15:42:03 +00:00
Remy
bd43e54d7d
Add new Numeric builtin compatible with type erasure in LF proto. (#16757)
part of #11679
2023-04-25 12:45:41 +02:00
Remy
7a17c19bbf
LF: Rename builtins that would need a witness to allow nat type erasure (#16743)
part of #11679
2023-04-24 15:02:11 +00:00
nickchapman-da
ac68bdf416
[engine] kill Daml withAuthority / LF WITH_AUTHORITY (#16548) 2023-04-17 16:50:10 +01:00
Moisés Ackerman
3ea97fa5f8
place 'templateTypeRepToText' behind its own feature flag (#16657)
* place 'templateTypeRepToText' behind its own feature flag

* move down WITH_AUTHORITY in daml_lf_1.proto
2023-04-11 17:46:07 +02:00
nickchapman-da
d4ddc63e81
rename (#16661) 2023-04-05 18:30:22 +00:00
nickchapman-da
046552e1e4
[language] check accuracy of 1.dev markers (#16651)
* Consider and address all 1.dev version markers. Some stay at 1.dev. Some change to 1.15 or earlier.

* TYPEREP_TYCON_NAME stays at 1.dev

* remove stray "x"s in .rst file
2023-04-05 13:12:58 +00:00
nickchapman-da
3abbf2b972
[engine] Push choice authority through compilation pipeline (#16639) 2023-04-03 09:19:24 +00:00
Moisés Ackerman
98dd1a3045
Add dynamicExercise expression and builtin (#16431)
* Add dynamicExercise expression and builtin

* Add DAML_DYNAMIC_EXERCISE feature flag
2023-03-15 10:35:24 +01:00
Marton Nagy
d112eca5e2
Remove critical package private access modifiers (#16512)
To unblock package rename in canton

[CHANGELOG_BEGIN]
[CHANGELOG_END]
2023-03-10 11:09:25 +00:00
Samuel Williams
5c00481ae0
Source location plumbing (#16269)
* 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
2023-02-10 16:26:34 +00:00
nickchapman-da
d406e0a8df
remove clunky of suffix from with-authority internal names (#16214) 2023-02-01 16:19:06 +00:00
Moisés Ackerman
8784ebd9ce
Add choiceController and choiceObserver functions (#16088)
* Add daml test file for choice functions

* Add HasChoice{Controller,Observer} type classes

* Add choice_{controller,observer} in LF

* Update GHC_REV

* Generate HasChoice{Controller,Observer} instances

* Remove manual instances in daml test file for choice functions

* Remove/forbid choice{Controller,Observer} before featureChoiceFuncs

* update *.desugared-daml golden files

* Apply code review suggestion

* Update GHC_REV (da-master-8.8.1)

Co-authored-by: Remy <remy.haemmerle@daml.com>
2023-01-18 14:50:00 +00:00
nickchapman-da
f32419da20
[engine] withAuthorityOf: support from Daml --> Speedy (#16029) 2023-01-16 12:55:34 +00:00
Gary Verhaegen
151e12b81a
bump copyright (#16002)
This is the result of:

- Updating `./COPY` to say `2023`.
- Running `./dev-env/bin/dade-copyright-headers update .`
2023-01-04 18:21:15 +01:00
Moisés Ackerman
f35ebb8dcd
Move stdlib datatypes into stable packages (#15795)
* Move datatype DA.Action.State.State into a stable package

* Move datatype DA.Stack.SrcLoc into a stable package

* Move datatype DA.Random.Minstd into a stable package

* Skip doctest for DA.Action.State.Type

* Don't use magic numbers in CodeGenRunnerTests.scala

* Update comment in StablePackageTest.scala
2022-12-06 15:48:35 +01:00
Remy
462044bd93
[LF] add language version to scala StablePackage list (#15640)
fixes #11371
2022-11-28 10:42:21 +01:00
mziolekda
fd8439144a
fix eta-expansion and nullary method warnings [DPP-1281] (#15689)
* Fix flake jwt leeway test

* fix eta-expansion warnings

* fix nullary method errors

* Revert "Fix flake jwt leeway test"

This reverts commit 5e2fed648b.

* format
2022-11-24 12:28:41 +00:00
Remy
a18fe164ca
[LF] reenable requires for interface (#15561)
Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
2022-11-15 08:59:24 +00:00
dylant-da
bb67fb7f51
Move userWrittenTuple check into own helper in GHC.Tuple.Check (#15445)
* Create tuple size check function in GHC.Tuple.Check

* Update desugar test

* lint

* Fix accidental minus in stable-packages

* Replace GHC.Types with GHC.Tuple.Check in doctest generation

* Fix DarReaderTest

* Fix DamlDocTest for GHC.Tuple.Check import

* Remove unnecessary DamlSyntax pragma

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

* Point to merged GHC changes

* Point to akrmn's merged in changes

* Point back at merged in changes

* restart CI

Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
2022-11-11 15:59:29 +00:00
Remy
72c69fd55c
fix package in archive proto SNAPSHOT (#15550) 2022-11-11 14:15:50 +00:00
Moisés Ackerman
7e6908612b
Fix instance Show Text to produce escaped Text (#15235)
* Fix `instance Show Text` to produce escaped Text (#15177)

This adapts the code used in GHC's 'instance Show Char where { showList }', representing characters as single-character
'Text's using a type synonym. CPP can be used during development to switch to a newtype-based implementation in order
to check type safety.

changelog_begin
- [Daml Standard Library] ``show @Text`` now escapes special characters, producing syntactically correct expressions (#15177)
changelog_end

* Add daml-test-file testing `show @Text`

* Avoid 'explode' in 'showLitChr'

* Cleanup 'showLitChr'

* Update DarReaderTest.scala

* Clean up import of GHC.Base

* Add Note for __DEBUG__SHOW_TEXT_CHR_NEWTYPE macro

* Extract longStringSize from longStringOf in daml-test-file ShowText.daml

* Document differences with GHC implementation

* Remove redundancy between showLitChr and {ascii=>ctrlChrText}

* Add 'exhaustive' test case in daml-test-file ShowText.daml

* Change 'ctrlChrText' default case to throw error
2022-10-17 18:07:56 +02:00
nickchapman-da
0ebe770e59
[engine] stack-safe daml-lf archive decoding (#14964)
Transform our code for the protobuf-decoding phase to be stack-safe, by means of a Work trampoline. The code-style rules are:

runWork is never called in a nested context.
We introduce an explicit Work.Delay to break recursion.
Increase the size of the many-fields test from 120 to 160 fields.

(At 164 fields we run into the protobuf limit)

Part of: #13410
2022-09-20 16:51:50 +01:00
dylant-da
804a0b7b9d
Reenable tests from #14773 #14770 / Add new tests for 1.15 (#14836)
* Squashed commit of the following:

commit fd04d54efffdd182b15ed5350ac190fd7e800f2c
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Mon Aug 29 14:46:19 2022 +0100

    lint

commit 117a3e1253cbede690127b66ee73a7ad7a75fd51
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Mon Aug 29 13:16:00 2022 +0100

    Temporarily disable isCompleted assertions - they appear to be too eager

commit a17e30b045affad557c1282b9c56229f64ab0d51
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Mon Aug 29 12:21:40 2022 +0100

    Remove unnecessary NotExtended tests, fix module names, reenable some

commit 075a62e6f263b86a342e887a0015cf0b812ad4e1
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Mon Aug 29 10:48:24 2022 +0100

    Remove InterfaceConversions - interface exercises are now Interface-only

commit 4b8a7b4a061ea740e5b72c06b99cf6eaced2315d
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Mon Aug 29 10:39:03 2022 +0100

    Update carbon test names for 1.dev suite test

commit 04e735223cc2c06fa3dd014538edcc5e4d5dd191
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Mon Aug 29 10:23:45 2022 +0100

    Point to 1.15 for carbon tests

commit 450e49479fc2daed3bc6a08234a95df8fe80382e
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Mon Aug 29 10:11:23 2022 +0100

    Move InterfaceSubscriptionsIT test to 1.15 folder

commit b1cd99d8074f789927d2e02b46a085fcd7a88319
Merge: 1dfdc2e7c5 f21b165c78
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Mon Aug 29 09:47:09 2022 +0100

    Merge remote-tracking branch 'origin/main' into dylan-lf-15-reenable-tests

commit 1dfdc2e7c503e9d798b60bc1279633295e50bb0c
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Thu Aug 25 16:58:37 2022 +0100

    Add NotExtended versions of all tests which use extended interfaces

commit 6398fa96c5c1d14dda1ff724d3d4b5de6301b97b
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Thu Aug 25 13:01:30 2022 +0100

    Make versions of tests that are NotExtended

commit c2daf05e134ab3d0d27d83a7ef24e07553b15c3e
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Thu Aug 25 12:20:03 2022 +0100

    Reenable disabled tests from #14770 / #14773

commit f390d37941
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Thu Aug 25 11:56:52 2022 +0100

    Remove 1.dev-only references from 1.15 protobuf

commit 87d6b540aa
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Thu Aug 25 11:36:08 2022 +0100

    Temporarily disable failing damlc tests

commit 05ea7bdb75
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Thu Aug 25 09:49:08 2022 +0100

    Update desugared daml for UExerciseInterface[Guarded] generation

commit 14fdd5f725
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Thu Aug 25 09:44:59 2022 +0100

    Run damlc interface tests w/o requires when since DAML_INTERFACE

commit d73c86df3f
Merge: 9a83d0776e 00705af419
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Wed Aug 24 16:35:31 2022 +0100

    Merge remote-tracking branch 'origin/main' into dylan-lf-15-minimal-distinguish-guards

commit 9a83d0776e
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Wed Aug 24 15:22:59 2022 +0100

    Exclude via $cexerciseGuarded check - ClassOpId approach did not work

commit b635dcd7cb
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Wed Aug 24 12:59:57 2022 +0100

    Add check for isId to splitDFunId

commit dcfa1e0ebf
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Wed Aug 24 11:43:19 2022 +0100

    Remove all instances of guarded exercises in versions <= 1.15

commit b0985ccdbd
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Tue Aug 23 13:10:15 2022 +0100

    Remove guarded exercise when Extended Interfaces are not enabled

commit 125280ca60
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Mon Aug 22 15:33:55 2022 +0100

    Clarify purpose of `Maybe Expr` type for exercise guard

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

commit 50cff3004b
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Mon Aug 22 15:32:17 2022 +0100

    Remove unnecessary mention of v1_14 from supportedInputVersions

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

commit 89744ef341
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Mon Aug 22 15:31:04 2022 +0100

    Rename interface features

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

commit c173799c47
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Mon Aug 22 15:23:13 2022 +0100

    Attach correct range to guard support error (if any)

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

commit c41f8480ed
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Thu Aug 18 12:57:28 2022 +0100

    Update to new GHC revision, removes pred argument from `exercise`

commit d9dfe87252
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Tue Aug 16 12:06:04 2022 +0100

    Desugar UExerciseInterface[Guarded] differently, point to updated GHC

commit dd0ac96dcd
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Tue Aug 16 12:05:53 2022 +0100

    Make exercise guards nullable, ignore Nothing in decode/encode

commit 53e23fac26
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Tue Aug 23 13:13:09 2022 +0100

    lint

commit abf5267051
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Tue Aug 23 12:50:04 2022 +0100

    Move InterfaceSubscriptionsIT test back into 1.dev suite

commit c2d1499747
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Tue Aug 23 12:00:17 2022 +0100

    Use dictionary comprehension to generate ledger/test-common test_names

commit 0d5f167fc6
Merge: 0242452662 ec4c86ac2d
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Tue Aug 23 10:27:21 2022 +0100

    Merge remote-tracking branch 'origin/main' into dylan-lf-15-minimal

commit 0242452662
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Tue Aug 23 10:26:29 2022 +0100

    Temporarily disable decode extended interface primitives test

commit b17ca7f03c
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Mon Aug 22 16:26:10 2022 +0100

    lint

commit ceaca2b0f6
Merge: c11eb08083 95d00c4e8a
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Mon Aug 22 16:12:43 2022 +0100

    Merge remote-tracking branch 'origin/main' into dylan-lf-15-minimal

commit c11eb08083
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Mon Aug 22 15:20:50 2022 +0100

    Disable PureConfigReaderWriter tests that assume early-access == stable

commit 03734d2f23
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Mon Aug 22 14:02:55 2022 +0100

    Also disable conformance-test-tls1.2-or-newer-1.15

commit e683ea3d7c
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Mon Aug 22 14:00:45 2022 +0100

    Temporarily disable 1.15 conformance tests - handle in another PR

commit 6fb140b0b6
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Mon Aug 22 13:59:58 2022 +0100

    lint

commit 65531fe577
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Mon Aug 22 11:00:41 2022 +0100

    Run retroactive implements tests only in extended interfaces

commit edf20bf4a7
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Fri Aug 19 17:48:39 2022 +0100

    Fix StableVersions back to 1.14, make EarlyAccessVersions 1.15

commit 12818dc58f
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Thu Aug 18 18:06:36 2022 +0100

    Allow unsafe_from_interface and interface_template_type_rep in 1.15

commit ff7271de1a
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Fri Aug 19 10:55:40 2022 +0100

    Update tests with extended interface features to only run on 1.dev

commit 9558feaec8
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Fri Aug 19 16:47:19 2022 +0100

    satisfy changelog check

    CHANGELOG_BEGIN
    CHANGELOG_END

commit 337cc25b7a
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Wed Aug 17 16:36:45 2022 +0100

    Fix InterfaceNotSupported message to 1.15 or higher

commit 4282ae396b
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Tue Aug 16 17:41:15 2022 +0100

    Move v1_15 ledger-api-tests into own suite

commit ac3d0a9f25
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Fri Aug 19 15:18:41 2022 +0100

    Reinclude 1.15 in COMPILER_LF_VERSIONS to build model-tests-1.15

commit 718879020d
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Fri Aug 19 14:43:35 2022 +0100

    Add 1.15 test suite to testtool

commit a6fd63d3d9
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Fri Aug 19 14:43:23 2022 +0100

    Add 1.15 as preview version

commit f5c48ddc99
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Fri Aug 19 14:43:12 2022 +0100

    Make 1.14 default again

commit b9527c1136
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Wed Aug 17 14:23:16 2022 +0100

    Update Version 1.15 changelog with Call/implements

commit 9cecad5205
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Wed Aug 17 11:24:49 2022 +0100

    Add Tests file for 1.15 in ledger API testtool

commit cde583d08d
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Tue Aug 16 16:41:58 2022 +0100

    Remove references to dev from 1.15 protobufs

commit 904da5679b
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Tue Aug 16 13:04:19 2022 +0100

    Stage 1.15 protobuf

commit 196fa6a3cf
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Tue Aug 16 11:54:20 2022 +0100

    Update Ast/Version & docs for 1.15, split interface into simple/extended

commit 1c58421f2d
Author: Dylan Thinnes <dylan.thinnes@digitalasset.com>
Date:   Mon Aug 15 13:05:37 2022 +0100

    Add version 1.15 - move interfaces into them

* API-test-tool: add InterfaceSubscriptionsIT to LF 1.15 tests

CHANGELOG_BEGIN
CHANGELOG_END

* fix bug

* Add version 1.15 - move interfaces into them

* Update Ast/Version & docs for 1.15, split interface into simple/extended

* Make 1.14 default again

* Update tests with extended interface features to only run on 1.dev

* Fix StableVersions back to 1.14, make EarlyAccessVersions 1.15

* Run retroactive implements tests only in extended interfaces

* Disable PureConfigReaderWriter tests that assume early-access == stable

* lint

* Move InterfaceSubscriptionsIT test back into 1.dev suite

* lint

* Remove unnecessary mention of v1_14 from supportedInputVersions

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

* Run damlc interface tests w/o requires when since DAML_INTERFACE

* Temporarily disable failing damlc tests

* Reenable disabled tests from #14770 / #14773

* Move InterfaceSubscriptionsIT test to 1.15 folder

* Remove InterfaceConversions - interface exercises are now Interface-only

* Re-enable assertEquals

* Modify PureConfigReaderWriterSpec to account for stable != early-access

* Disable conformance tests

* Disable on-canton conformance_test instead

* Remove InterfaceTypeRepCheck - all exercises are on interface now

* Fix UpcastDowncast tests

* Fix DowncastUpcast 1.15 test, convert assets to token in Guarded test

* Move typerep/unsafeFromInterface decode tests to basic interfaces

* Fix desugared daml for damlc test changes

* Reintroduce InterfaceConversions - remove impossible exercise

This reverts commit 075a62e6f263b86a342e887a0015cf0b812ad4e1.

* Reintroduce InterfaceTypeRepCheck - fix test to use T2Choice

This reverts commit d8a0a7f299.

* Run InterfaceTypeRepCheck for LF 1.15

Co-authored-by: Remy Haemmerle <Remy.Haemmerle@daml.com>
Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
2022-08-30 13:58:31 +00:00
Remy
45bfb26ade
LF clean up proto snapshot of LF 1.15 (#14799)
CHANGELOG_BEGIN
CHANGELOG_END
2022-08-29 10:40:19 +00:00
dylant-da
6ece737e46
Desugar guards compatibly with 1.15/1.dev split (#14773)
* 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>
2022-08-25 14:20:03 +01:00
dylant-da
a74c020ddd
Add version 1.15 - move interfaces into them (#14770)
* 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
2022-08-23 13:39:16 +00:00
Moisés Ackerman
c146bee87d
Reduce duplication between implements and co-implements (#14607)
* Reduce duplication between implements and co-implements

This extracts the common part (methods and view) to a new type InterfaceInstanceBody

changelog_begin
changelog_end
2022-08-04 17:01:15 +02:00
Remy
b475d710aa
LF: Create LF 1.15 in scala to park basic interface constructs (#14534)
basic interface constructs contain:
- interface definition
- interface implementation
- retroactive template implemenation
- exerciseInterface and fetchInterface
- basic builin

but do not contain:
- "requires"
- exercise guards

CHANGELOG_BEGIN
CHANGELOG_END
2022-07-29 20:09:57 +02:00
Remy
88d4ff93f2
LF: remove precondition in interface (proto & scala side) (#14511)
CHANGELOG_BEGIN
CHANGELOG_END
2022-07-27 10:52:35 +02:00
Remy
7c89050c60
LF: Utility function to compute the relation interface/implementation (#14409)
in a package.

CHANGELOG_BEGIN
CHANGELOG_END
2022-07-25 11:20:42 +00:00
Remy
df21aad8af
LF: Make ExerciseInterface guard field optional (#14493)
in protobuf

CHANGELOG_BEGIN
CHANGELOG_END
2022-07-25 11:33:02 +02:00
dylant-da
8d93efdd12
Add EViewInterface to LF - stub compilation/interpretation in speedy (#14486)
* Add ViewInterface to LF - stub interpretation in speedy

* Remove templateId and viewtype from EViewInterface

* Fix lint
2022-07-21 15:10:53 +00:00
dylant-da
ab948dd8de
Update LF AST protobuf for interface viewtype and implementation view (#14439)
* 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
2022-07-19 12:00:04 +00:00
Moisés Ackerman
0d1ef10472
Retroactive Implements - Scala side (#14130)
* 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
2022-06-23 17:13:38 +00:00
Moisés Ackerman
ee394702b8
Add CoImplements to DefInterface in protobuf (#14053)
* Update docstring for TemplateImplements.tpiMethods
    * The change happend on https://github.com/digital-asset/daml/pull/13142

* Add CoImplements to DefInterface in protobuf
    * Also adds encoding/decoding logic in the haskell side

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

changelog_begin
changelog_end
2022-06-03 16:05:18 +00:00
Remy
ae8f50dbb8
LF: drop inheretedChoices from Implements (#14068)
part of #13653

CHANGELOG_BEGIN
CHANGELOG_END
2022-06-02 18:48:54 +00:00
Remy
62877ab78b
LF: Cleanup Fetches (#13804)
- Rename fetch to fetch_template
- Rename misnamed fetch_by_interface to fetch_interface
- Drop dead fetch_by_interface

CHANGELOG_BEGIN
CHANGELOG_END
2022-05-30 18:55:41 +02:00
Remy
ea0d101913
Interface: Rename fixedChoice to choice (#13883)
CHANGELOG_BEGIN
CHANGELOG_END
2022-05-17 12:03:53 +02:00
Nicu Reut
a792de39a5
Update scalafmt to 3.5.1. (#13584)
CHANGELOG_BEGIN
CHANGELOG_END
2022-04-28 09:57:04 +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
Moisés Ackerman
b47fa3ba92
interface conversion primitives test cases (#13416)
* Add LF ParsersSpec cases for conversion primitives

* Add LF TypingSpec cases for conversion primitives

* Add LF DecodeV1Spec cases for conversion primitives

* Add LF EncodeV1Spec cases for conversion primitives

* update security-evidence.md

* Add missing cases in daml-lf encoder

* Add missing cases in EncodeV1Spec

* Add InterfaceMod in DamlLfEncoderTest

changelog_begin
changelog_end
2022-03-25 16:08:31 +00: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
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