Commit Graph

2036 Commits

Author SHA1 Message Date
nickchapman-da
fd75c5ece1
[engine] construct ResultNeedAuthority (#16390) 2023-02-27 15:13:30 +00:00
Samuel Williams
f52cd077d6
Remove breaking expected file (#16389) 2023-02-27 14:00:04 +01:00
dylant-da
014b0ccc36
Fix formatting of GHC type errors (#16368)
* Point to updated revision

* Fix test failures due to expectations for unformatted errors

* Fix pretty printer for EForbiddenNameCollision, amend test
2023-02-23 20:18:18 +00:00
Samuel Williams
370a468524
Add Daml.Script to daml-docs tests (#16366)
* Bring back script integration, this time tested for different SDK versions

* Create failing test that covers behaviour

* Add Daml.Script to daml-docs tests

* Shift dependency installation to start of suite for performance

* Only pipe scriptPackageData to golden tests
2023-02-23 11:51:34 +00:00
Samuel Williams
d6bc75fcc0
Bring back script integration, this time tested for different SDK versions (#16361) 2023-02-23 09:20:12 +00:00
dylant-da
adb01a7b68
Table and transaction view in daml test (#16353)
* Initial outputTables work

* refactor outputTables

* Fix duplicate ShowCoverage opt

* Export TableOutputPath & TransactionsOutputPath constructors

* Implement outputTransactions

* Fix redundant imports, unused fields

* Embed extension's CSS style into generated tables / traces

* lint

* Extract webview css without locateResource

* Check stylesheet exists before reading it, emit warning if necessary

* Refactor tryWithPath
2023-02-22 17:56:50 +00:00
Samuel Williams
1d8c361dc1
Revert integration test support until fixed (#16360)
* Revert integration test support until fixed

* Remove some missing changes
2023-02-21 14:19:37 +00:00
dylant-da
a90865d370
Show time elapsed on running scenarios in IDE (#16324)
* PoC: Add live script runner with intermediate live messages

* Unify live and non-live scenario service script runners

* Add live scenarios

* Clean up runLiveScenario

* dedupe runLiveScenario/runLiveScript

* return to onComplete mode

* Send status update every second

* Send progress events with milliseconds passed instead

* Fix runLiveScript -> runLiveScenario

* Show milliseconds passed in scenarios

* Sleep a random amount 300;600 ms

* Try to prevent older status updates from overwriting newer ones

* lint

* wrap errors appropriately

* Remove wrong secondary webview update

* Define variants inside companion object

* use abstract class instead of trait

* lint
2023-02-20 17:19:42 +00:00
Moisés Ackerman
dd9c07177f
Timeouts are now reported correctly for daml-script Scripts (#16344)
Co-authored-by: Remy Haemmerle <Remy.Haemmerle@daml.com>
2023-02-20 11:03:21 +01:00
Remy
12c240e06e
[Speedy] do not need disclosed contract at Machine creation time (#16302)
This PR make several (small) changes on how the disclosed contract are
handle by the speedy machine.

(1) disclosed contract at not anymore pass a builtin time. They were
any pass latter using `SBCacheDisclosedContract`.

(2) disclosed contracts are first keep in their own cache,
disclosedContracts: Map[V.ContractId, CachedContract]. They are moved
to the cached for used contract only if used.  In fact we need to be
sure the used disclosed contracts pass through the
Speedy#addGlobalContract to verify the transaction limits are not
overpassed.
2023-02-17 22:59:41 +00:00
Samuel Williams
d3feb57b39
Support Script tests in integration suite (#16323)
* WIP Implement integration script test support

* Add ghc_pkg

* Get scripts to run in integration tests!
Add expected error to new test

* Slight refactor
2023-02-17 11:21:29 +00:00
Samuel Williams
fb55f4c1bb
Add signatory labels to create and fetch in tree view (#16291)
* Add signatory labels to create and fetch in tree view

* Switch node printing in scala and expected ledger files

* Update docs/images

* Update party formatting to use `x, y and z` and correct verb tense

* Update scala to match haskell, update tests and docs (except images)

* Cleanup code from suggestions

* Fix misformatting, refactor
2023-02-16 15:57:01 +00:00
Samuel Williams
0516143831
Fix warning about unused this in exception messages (#16313)
* Fix warning about unused `this` in exception messages

* Fix desugar tests

* Update ghc version

* Update test to include context
2023-02-16 15:32:30 +00:00
mziolekda
1a3980bf89
Separate test-common from the rest of the ledger code (#16307)
* move files

* format

* wrong file

* fix conformance tests

* add readme

* fix compatibility tests

* fix haskell tests
2023-02-14 15:29:13 +00:00
Samuel Williams
0c9ba9e691
Allow name shadowing in choices (#16306)
* Add bypassReduceLambda to allow shadowing

* Fix integration test

* Update ghc, update desugared cases

* Update ghc version
2023-02-14 11:39:42 +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
Samuel Williams
9fdeaf2ed4
Fix list pattern match warnings to use :: (#16278)
* Fix list pattern match warnings to use ::

* Add test case

* Update ghc version
2023-02-10 16:24:46 +00:00
Remy
a75db47275
[LF] factorize GlobalKeyWithMaintainers and KeyWithMaintainers (#16251) 2023-02-08 13:58:43 +01:00
Samuel Williams
90a0f13829
Implement name synonyms in error prints (#16242)
* Implement interface name synonyms in error prints
* Add View type synonym test
2023-02-08 10:33:57 +00:00
Remy
2851401df6
[ScenarioService] add evaluation timeout (#16204)
Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
2023-02-06 08:59:12 +01:00
Remy
aad8725ea7
[damlc] change default output to 1.15 (#16157) 2023-02-06 08:58:47 +01:00
Remy
68a718ef58
Revert "Revert "Reactive requires in surface language (#15570)" (#16222)" (#16231)
This reverts commit db6e87589a.
2023-02-03 13:05:48 +01:00
Remy
db6e87589a
Revert "Reactive requires in surface language (#15570)" (#16222)
This reverts commit e94f1a74a9.
2023-02-02 19:20:17 +00:00
dylant-da
c7ae5f1c93
Allow run tests manually (#16211)
* Add rules for running single scenarios, redefine RunScenario using them

* Turn runScenario into an action, not IO

* Add FormattingStarted custom message type

* Redefine OfInterest rule in terms of RunSingleScript

* lint

* fix broken renamed var

* Use getFilesOfInterest for diagnostics & uncompilable check

* explicitly run tests that need to be run

* Amend test

* Remove commented out code

* Remove vr formatting message
2023-02-02 17:59:11 +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
e9963e88df
Unhide DA.Internal.LF.coerceContractId (#16180) 2023-01-27 15:24:11 +01:00
Remy
3603ba870b
[Speedy] add cooperative interuptions (#16129)
Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
2023-01-26 16:05:33 +01:00
nickchapman-da
4aa5b7d768
add new tx node type: Node.Authority (#16070) 2023-01-25 11:09:56 +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
41fa30cfd4
add daml feature: DAML_WITH_AUTHORITY (#16075) 2023-01-16 15:18:22 +00:00
nickchapman-da
f32419da20
[engine] withAuthorityOf: support from Daml --> Speedy (#16029) 2023-01-16 12:55:34 +00:00
Carl Pulley
980464a866
Disable visibility checks for local contract keys (#15131)
Main part of  #14199

Co-authored-by: Remy Haemmerle <Remy.Haemmerle@daml.com>
2023-01-13 15:16:33 +00:00
dylant-da
03a76f4a61
Turn Daml-specific errors into suggestions on the original error (#16017) 2023-01-11 15:44:45 +00:00
Moisés Ackerman
4feeed6598
Use daml.yaml args in 'daml repl' (#15958) 2023-01-09 12:45:22 +01:00
dylant-da
0701488c40
Fix return type error for methods (#15999)
* Add tests for method result mismatches & for interface synonyms

* point to updated ghc
2023-01-06 12:54: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
Remy
e94f1a74a9
Reactive requires in surface language (#15570) 2022-12-19 09:28:43 +01:00
Bernhard Elsner
1f30da1f23
Remove "Module" from daml-doc H1 headers (#15862)
* Remove "Module" from daml-doc H1 headers

CHANGELOG_BEING
- Remove the word "Module" from the H1 page header of
- module pages and stop overriding the ToC headers to make
- the generated pages easier to use.
CHANGELOG_END

* Reinstate links in daml-docs rst TOC

* Update render tests

* Update golden tests

Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
2022-12-16 10:19:08 +00:00
Remy
f1aca5e11c
[Speedy] create Scenario Machine (#15588) 2022-12-16 08:20:42 +00:00
dylant-da
445104a41b
Custom error / fix error for wrong expected return type of a choice. (#15855)
* Point to updated GHC

* add test for choice result mismatch

* add test for interface

* point to updated ghc

* point to merged ghc
2022-12-13 18:08:32 +00:00
dylant-da
f9d7301024
Fix erroneous code action/lens suggestions in Daml Studio (#15731)
* point to updated ghc

* point to updated GHC

* point to updated GHCIDE

* point to updated ghc

* Make _requires_ non-writable by inserting dollar - amend detectors

* Make _choice_ declarations non-writable (add dollar)

* Add checks for dollar-gen'd code require/view/interface_instance/method

* point to updated GHC

* point to updated ghc

* satisfy changelog

CHANGELOG_BEGIN
CHANGELOG_END

* point to updated GHC

* Point to updated ghcide

* update desugar tests

* point to revised daml-ghcide

* point to updated ghc

* point to updated ghc

* replace with isDamlGenerated

* point to merged ghc and merged ghcide
2022-12-13 12:06:40 +00:00
Stephen Compall
1ac4199538
update qs, express for security (#15874)
- fixes for CVE-2022-24999

* upgrade qs, express in root

* upgrade qs in daml-extension

* upgrade qs, express in navigator
2022-12-12 15:52:19 -05:00
Stefano Baghino
18ed316827
Accept uppercase English alphabet letters in user IDs (#15832)
* Accept uppercase English alphabet letters in user IDs

changelog_begin
Accept uppercase English alphabet letters in user IDs
changelog_end

* Fix title case in docs change

Co-authored-by: Sergey Kisel <98825453+skisel-da@users.noreply.github.com>

Co-authored-by: Sergey Kisel <98825453+skisel-da@users.noreply.github.com>
2022-12-08 16:44:54 +00:00
dylant-da
caf6d1d22a
Fix internal interface instance count (#15806) 2022-12-07 13:37:47 +00: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
Stephen Compall
c24c17d595
Javascript library security updates (#15798)
Incorporates fixes for

- CVE-2022-3517
- CVE-2022-37599
- CVE-2022-37601

* update minimatch in root
* update minimatch in daml-extension
* update minimatch in typescript libraries
* update minimatch and loader-utils in navigator
2022-12-05 12:40:46 -05:00
Moisés Ackerman
6bafad6b20
Fix dlint hints for DA.{Action=>Functor}.void (#15746) 2022-12-01 16:06:33 +01:00
Moisés Ackerman
ccb1df08a7
Use daml-base-anchors.json when '--input-anchor' unspecified (#15715)
* Use default anchors for daml-prim and daml-stdlib when building docs

This PR introduces two flags for subcommand 'daml docs':

* '--default-input-anchor' to use the default anchors defined by //compiler/damlc:daml-base-anchors.json. This is the default if neither '--input-anchor=PATH' nor '--no-input-anchor' are passed.
* '--no-input-anchor' to use an empty anchor map. This is used to build //compiler/damlc:daml-base-anchors.json, since it cannot depend on itself.

* break cyclic dependency
2022-12-01 10:08:07 +01:00
Moisés Ackerman
badfb9dcea
Improve error message for attempted use of '..' in record update (#15712)
* Update GHC_REV

* Add test case
2022-12-01 10:07:29 +01:00
dylant-da
05d9ee89f3
Improve interpretation error consistency (#15680)
* 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
2022-11-29 13:02:46 +00:00
Gary Verhaegen
46a4804672
bump nix (#15628)
Partly because the current version is from February (of this year,
fortunately), and partly because I need a more recent one to bump node
to 18 and fix the GSG for that.
2022-11-24 14:29:09 +00:00
dylant-da
ff6e776da0
Improve type error for Numeric types with precision > 37 and mistyped/missing field access (#15626)
* point to GHC with improved error

* Point to new GHC

* Fix error in RelTimeDetailsHidden1

* Point to updated ghc

* Point to new GHC

* Satisfy changelog check

CHANGELOG_BEGIN
CHANGELOG_END

* Fix assertion in RelTimeDetailsHidden1

* Amend tests with out-of-bounds NumericScale, point to updated GHC

* Drop quotes around type error

* Add tests for field access errors

* point to merged GHC
2022-11-22 15:44:25 +00:00
dylant-da
ccde982df5
Error for implementing non-interfaces (#15435)
* point to updated GHC

* satisfy changelog

CHANGELOG_BEGIN
CHANGELOG_END

* Point to updated GHC

* Expect new interface view error message in ImplementsNonInterface

* Add test for trying to implement a non-interface

* Point to GHC with better error suppression, fix tests

* Remove unused TryImplementNonInterface

* point to rebased ghc

* point to forwarded GHC changes

* point to updated GHC

* Fix expected error in ImplementsNonInterface

* Point to merged commit
2022-11-22 11:07:21 +00:00
Jonas De Vuyst
514a757e57
Add DA.List.chunksOf function in Daml stdlib (#15618) 2022-11-21 16:09:34 +00:00
dylant-da
1f998f95e8
Add interfaces & interface choices to coverage report (#15563)
* extract interface info for coverage

* Remove commented out Summary monoid code

* DRY up identifier creator

* remove unused summarize usage

* Disambiguate template/interface identifiers & choices via Variety

* Redesign extractors & start printing reports

* Reformat, begin proper counting of implementation choices

* Fix filter for interface archives choices to exclude, not include

* Remove commented code in printTestCoverage

* Fix lint

* Add external report

* Add percentages to coverage report

* Complete `External interface choices` report section

* Forgot to extract sizes from implementationChoices

* Remove unused allExercisedImplementationChoices

* Improve pctage reporter

* Report uncovered templates/choices when getShowCoverage is True

* Flip getShowCoverage check

* Fix width of percentages in coverage report

* Update damlc tests for coverage report

* Fix filter & text for external interface implementations

* Remove unused / misused Variant, Report, and interfaceChoices extractor

* add section header to never created/exercised summaries
2022-11-21 13:27:39 +00:00
Moisés Ackerman
c15617e87d
Fix view in view method definition (#15595)
* Update GHC_REV

* Update *.EXPECTED.desugared-daml

* Add regression test for #15459

* Method-in-method test now checks runtime behavior
2022-11-21 09:34:51 +00:00
Remy
7cac969756
[Speedy] Inline LedgerMode in the Machine (#15514) 2022-11-15 14:47:22 +00:00
Remy
d071e5e505
Remove TemplateOrInterface type class (#15347) 2022-11-15 09:44:51 +01:00
dylant-da
c6d10b6246
Remove GHC.Tuple.Check module (#15549)
* Prevent unused import warnings

* Remove all explicit occurences of GHC.Tuple.Check

* Update desugar tests

* Remove magic from GHC.Tuple.Check

* Add GHC.Tuple.Check back to DarReaderTest

* Point to merged changes
2022-11-14 18:29:35 +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
nickchapman-da
7abbb694b9
[script] rename: queryView --> queryInterface (#15541) 2022-11-11 11:50:02 +00:00
Moisés Ackerman
06892a4ae9
Clean up uses of locateRunfiles (#15446)
* Define DA.Bazel.Runfiles.locateResource as an alternative to locateRunfiles

* Use locateResource to get default dlint rules file

Fixes #15443

* Use locateResource to get scenario-service.jar

* Use locateResource to get ghc-pkg executable

* Use locateResource to get stable-packages directory

* Use locateResource to get ghcversion.h

* Use locateResource to get hpp executable

* Use locateResource to get builtin package dbs

* Drop unused function DA.Daml.Options.Types.getBaseDir

* Use locateResource to get d3{,plus}.min.js

* Use locateResource to get repl-service.jar

* data Resource now takes a runfilesPathPrefix instead of a runfilesPath

* Add hlint warning 'locateRunfiles/package_app'

* Let locateRunfiles crash when used outside of bazel target

* typo
2022-11-10 13:20:43 +01:00
Remy
49f4d2979e
[LF] strengthen compilation flags (#15481) 2022-11-09 14:12:04 +01:00
dylant-da
27f0f2b014
Catch mistyped view implementations via better Daml-specific type error detection (#15426)
* point to updated GHC

* satisfy changelog

CHANGELOG_BEGIN
CHANGELOG_END

* Point to updated GHC

* Expect new interface view error message in ImplementsNonInterface

* Add test for trying to implement a non-interface

* Point to GHC with better error suppression, fix tests

* Remove unused TryImplementNonInterface

* Point to merged GHC
2022-11-08 17:57:06 +00:00
dylant-da
1f2c728113
Fix overeager tuple warning (#15418)
* Success!

* Remove dead / unnecessary code from debugging

* Remove unused `userWrittenTuple` helper

* Import `GHC.Types.magic` where necessary

* Test for example in issue #15338

* satisfy changelog check

CHANGELOG_BEGIN
CHANGELOG_END

* Remove fst/snd lint tests, which weren't correct/useful anyways

* Update DocTest to import GHC.Types where necessary

* Update desugar tests

* Fix daml repl to include GHC.Types import

* Add GHC.Types to the doctest

* style improvement: if cond then action else pure () -> when cond action

* Point to merged GHC
2022-11-04 17:16:34 +00:00
Moisés Ackerman
a33127599e
Add coerceInterfaceContractId : (...) => ContractId i -> ContractId j (#15405)
* Replace '1.dev only'=>'Daml-LF >= 1.15' in docs for interface functions

* Define coerceInterfaceContractId

* Test coerceInterfaceContractId in InterfaceContractDoesNotImplementInterface

* Test coerceInterfaceContractId in InterfaceConversions

* Add entry for coerceInterfaceContractId in interface reference docs

* update *.EXPECTED.desugared-daml files

changelog_begin
- [Daml Standard Library] Added function ``coerceInterfaceContractId``
changelog_end
2022-11-02 10:48:12 +00:00
Moisés Ackerman
ae4d7c681b
Move regression test for #14291 into compatibility tests (#15390)
* Extract helper _validate_dar in data_dependencies.bzl

* Generalize daml_script_test from daml_script.bzl

* Move regression test for #14291 into compatibility tests

changelog_begin
changelog_end

run-full-compat: true
2022-11-01 10:39:16 +01:00
nickchapman-da
a20ac183aa
handle view computations which fail in daml-script (#15384)
changelog_begin
changelog_end
2022-10-28 17:05:18 +01:00
nickchapman-da
d14e68dc53
[daml-script] queryView (#15286) 2022-10-27 14:06:25 +01:00
Moisés Ackerman
d2f824fcc2
Fix DD test case 'Cross Daml-LF version with double data-dependency' (#15371)
The problem is that `damlcForTarget tools depLfVer` could return an older damlc
than needed for `targetLfVer`.

The reason this didn't fail before is that the legacy damlc supports up to
LF=1.14, and `lfVersionTestPairs` never had `depLfVer < 1.14 && targetLfVer > 1.14`

changelog_begin
changelog_end
2022-10-27 14:03:03 +02:00
Moisés Ackerman
484c40acb5
Update "Reference: Daml Packages" (#15324)
* Remove mention of FunctionalDependencies as data-dependencies caveat

FunctionalDependencies in data-dependencies have been supported since #7698

changelog_begin
changelog_end

* Remove mention of advanced type system features as data-dependencies caveat

module DA.Generics and language extension DeriveGeneric have long been removed
from the language, and I couldn't think of other similar "advanced type
system features" that work for plain dependencies but not for data-dependencies.

* Extend list of data dependable extensions
2022-10-26 11:56:29 +02:00
Moisés Ackerman
0dbc0424b8
Clean dlint flags (#15290)
* Clean `dlint` flags

changelog_begin
changelog_end
2022-10-25 16:12:38 +02:00
dylant-da
da8064de64
Add AnyView with HasFromAnyView instances (#15280)
* Implement AnyView as a stable package / primitive

* Point to updated GHC

* Export AnyView datatype, move typeclasses, fix convertPrim

* Adjust AnyView w/ InterfaceTypeRep, implement {to,from}AnyView

* fix lint, satisfy changelog

CHANGELOG_BEGIN
CHANGELOG_END

* fix daml-desugar

* Has{From,To}AnyView instances in daml-docs

* Add DA.Internal.Interface.AnyView to LibraryModules for stdlib

* Fix hash for DA.Internal.Interface.AnyView

* Prefix AnyView with CurrentSdk, add to golden for daml-script test

* Remove HasToAnyView

* Split AnyView into AnyView and AnyView.Types

* fix hash

* Remove unused StandaloneDeriving

* Add HasField instances (requires relevant workers)

* Accept desugaring test changes for removal of HasToAnyView

* Update daml-doc for removal/modification of HasToAnyView/HasFromAnyView

* Update StablePackage hash for DA.Internal.Interface.AnyView.Types
2022-10-25 11:49:32 +00:00
Remy
b0d840019b
[Script] Do not use type constructor in AnyInterfaceChoice anymore (#15188)
companion PR of digital-asset/ghc#137

CHANGELOG_BEGIN
CHANGELOG_END
2022-10-20 10:30:20 +00:00
dylant-da
0efadf61eb
GHC - Extract more info about templates (#15170)
* Point to fixed GHC

* Fix daml-test-files for improved GHC errors

* Fix error message to match critical parts of improved GHC errors

* satisfy changelog

CHANGELOG_BEGIN
CHANGELOG_END

* point to updated GHC

* Point to updated GHC

* Fix damlc tests for new GHC error messages

* Point to updated GHC
2022-10-19 15:47:45 +00:00
nickchapman-da
d654321432
daml-script: support query by interface-id (#15234) 2022-10-18 09:32:46 +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
Rex Ng
e724982a9e
Generalize the <?> operator to support a generic error type (#15244)
The original implementation forces the caller to always use Text as the error type. This is unnecessarily restrictive as the types can be polymorphic on the caller's side.

CHANGELOG_BEGIN
* [Stdlib] Generalize the (<?>) operator to support a generic type for Validation
CHANGELOG_END
2022-10-17 14:41:00 +02:00
dylant-da
cedb09825a
Only report coverage for package-local choices/templates (#15150)
* Only report coverage for package-local choices/templates, add extra info

* Unify information for printTestCoverage

* Extract modules from all packages & local modules, not just tested ones

* Create reports about local/external choices/templates

* Remove unnecessary reporting

* Report local package coverage, external package coverage, all coverage

* Refactor printReport

* fix test, satisfy changelog check

CHANGELOG_BEGIN
CHANGELOG_END

* Fix another test

* Fix wording to `defined in local/external package`

* Check coverage against all modules in scope, not just tested modules

* Fix wording again, back to local/external modules - more accurate

* Replace TemplateInfo with Qualified Template
2022-10-11 15:57:36 +00:00
fayi-da
69f11311df
npm resolutions for daml extension (#15203)
* npm resolutions for daml extension

* Remove unnecessary dependencies

* No changelog

CHANGELOG_BEGIN
CHANGELOG_END
2022-10-11 11:42:36 +00:00
Moisés Ackerman
7f19bf258a
Check package name of preprocessor-excepted modules (#15184)
* Ensure daml preprocessor is only skipped when building 'daml-{prim,stdlib}'

changelog_begin
changelog_end

* Test that the daml preprocessor can't be skipped simply by changing the module name
2022-10-11 12:11:36 +02:00
nickchapman-da
ef959deeac
[engine] improve stacktrace for daml-script InterpretationError (#15178)
* improve stacktrace for daml-script InterpretationError

changelog_begin
changelog_end

* adapt expected regexp
2022-10-06 15:54:50 +00:00
Moisés Ackerman
ccb7ef7167
Add HasField instances for DA.Stack.SrcLoc (#15163)
* Add HasField instances for DA.Stack.SrcLoc (#15142)

changelog_begin
[DA.Stack] The SrcLoc datatype now supports dot syntax for field access (#15142)
changelog_end

* Add daml-test-file SrcLocFields to test dot syntax on DA.Stack.SrcLoc

* Define 'HasField f SrcLoc t' instances using record syntax
2022-10-06 11:53:22 +02:00
dylant-da
485eb2b8dd
Archive choices for interfaces (#15085)
* Point to latest GHC with archive choices on interfaces

* Update Desugared daml for interfaces Archives

* satisfy changelog check

CHANGELOG_BEGIN
CHANGELOG_END

* Update daml-doc test files

* Add relevant identifiers to SignatureReaderSpec for iface Archive choice

* lint

* Point to GHC with generated HasArchive instance

* Add test for archive on interface

* Test that second archive doesn't work

* Update desugar tests

* Point to GHC merge
2022-09-29 10:57:07 +01:00
nickchapman-da
68b323635d
[engine] prefer lastLocation to stackTrace (#15111)
TLDR: Remove broken code which constructs stackTrace().
Happy never to have to read those NOTE(MH) comments in the pushLocation code again!

(1) This code was fundamentally broken for various reasons:
- It doesn't make sense to track location info on the continuation stack. The continuation stack is a record of the evaluation still to come; not a context for the current evaluation.
- Stack traces can't sensibly be provided in a language such as Daml which promises that tail-recursion is evaluated in constant stack-space.
- Attempting to keep location info on the continuation stack does not play well when exceptions are thrown and the stack is unwound.

(2) The stack-trace management code was also very hacky:
- The pushLocation code contained special cases when the continuation stack was headed by a KArg/SToken continuation. This is an internal implementation detail. The KArg doesn't even exist when we stop using the deprecated SEAppGeneral expression constructor.
- The pushLocation code also contained special support for copying stack-traces into SEVal and SDefinition caches, and then later back on to the continuation stack. Yuck!

(3) The stackTrace() code was barely used:
- Some time ago an alternative/simpler location tracking system (lastLocation) was implemented.
- Only ScenarioRunner makes use of the stackTrace()
- Only a single test changes behaviour when we drop use of stackTrace() in favour of getLastLocation
2022-09-28 13:15:08 +01:00
Moisés Ackerman
8411a960b1
Daml Studio: Suggested type signatures no longer qualify HasField typeclass (#15106)
* Add test for typesignature.add codelens with HasField

* Reexport class HasField from DA.Internal.RebindableSyntax

* Update expected signature in test for typesignature.add codelens with HasField

changelog_begin
- [Daml Studio] Suggested type signatures no longer qualify HasField typeclass
  See `#13790 <https://github.com/digital-asset/daml/issues/13790>`__.
changelog_end

* Update expected error in RelTimeDetailsHidden1 daml-test-file
2022-09-28 10:38:32 +00:00
Rex Ng
b204aa5fbe
Add Semigroup, Foldable, and Traversable instances for Validation (#15080)
CHANGELOG_BEGIN
* [Stdlib] Add Semigroup, Foldable, and Traversable instances for Validation
CHANGELOG_END
2022-09-26 18:25:31 +02:00
dylant-da
db652ef270
Improve EExpectedViewType (#15048)
* Add dylant-da as a codeowner on compiler-related directories

CHANGELOG_BEGIN
CHANGELOG_END

* SPlit EExpectedViewType into three variants with non-Text bodies

* Duplicate Haskell viewtype typechecking behaviour onto Scala side

* Split TypingSpec tests for different viewtype failures

* lint & changelog

CHANGELOG_BEGIN
CHANGELOG_END

* Fix lint
2022-09-26 14:38:12 +00:00
nickchapman-da
3180094987
[engine] avoid construction of unrestricted speedy expression applications (#15079)
Avoid construction of unrestricted speedy expression applications.SEApp (alias for SEAppGeneral)

- Replace occurrences of SEApp(General) to use SEAppAtomic, with SELet1 as required
- Add new helper SEApp for many cases where arguments are simple values.
- Rename the most general unrestricted constructor as SEAppGeneral_DEPRECATED. The only remaining use is by fromUpdateSExpr and fromScenarioSExpr, due to our unprincipled approach to stack-trace. See TODO in pushLocation. I hope to fix this in a future PR.
- Rename the slightly less unrestricted constructor as SEAppOnlyFunIsAtomic_DEPRECATED. The only call site being in Anf.scala (for the case when ANF is not performed). Maybe one day we can perform ANF in all cases, and hence remove this one remaining usage.
2022-09-26 14:33:51 +01:00
Carl Pulley
aa062cde42
Final step of explicit disclosure cached contract refactor
* Fixes #13897

CHANGELOG_BEGIN
CHANGELOG_END
2022-09-21 18:12:55 +01:00
dylant-da
89e2f4db9b
Add warnings to conversion, Warn for tuples size > 5 (#15018)
* Add warnings to conversion

* Fix warning code, add warning for tuples larger than 5 in convertType

* Add flag AllowLargeTuples to ignore when tuples of size > 5 are used

* Predicate tuple warning on AllowLargeTuples flag

* Compile stdlib / prim packages with --allow-large-tuples

* satisfy changelog

CHANGELOG_BEGIN
CHANGELOG_END

* Fix type error in LFConversion test due to runConvertM signature change

* Move warning to convertDataCon, so un-type-annotated uses are detected

* Add TODO

* Add codeGenAllowLargeTuples internal function to DA.Internal.Desugar

* Unsplit convertDataCon and convertDataCon' via envAllowLargeTuples check

* Desugar codeGenAllowLargeTuples call to allow large tuples on subexprs

* Point to GHC with auto-inserted codeGenAllowLargeTuples calls

* Reorder codeGenAllowLargeTuples replacement to be before internals check

* Export codeGenAllowLargeTuples from DA.Internal.Desugar

* Reverse warnings at end of ConvertM run

* Comment role of Either and tuple in ConvertM

* Rename --allow-large-tuples=yes to --disable-warn-large-tuples=yes

* Make disable_warn_large_tuples an option, false by default

* Add tests for tuple size warning

* Use minimum tuple size to trigger large tuple warning

* Disable large tuple warning during stdlib compilation

* Use a pattern synonym for tuple detection

* lint
2022-09-21 14:16:39 +01:00
dylant-da
5a3cb468f8
Make damlc options fail if used more than once (#15021)
* Make damlc options fail if used more than once

* Fix import issues with optparse-applicative

* Undo `optionOnce` conversion for arguments that should occur many times

* satisfy changelog check

CHANGELOG_BEGIN
CHANGELOG_END

* Improve comments

* Add tests for optionOnce behaviour

* lint
2022-09-21 09:26:59 +00:00
dylant-da
931734d59c
PoC: Custom errors, for Interfaces (#14950)
* Point to GHC version with custom typecheck interface error messages

* Fix tests for new messages

* satisfy changelog check

CHANGELOG_BEGIN
CHANGELOG_END

* Point to GHC revision with TcDaml module & minor fixes

* Add TcDaml to ghc-lib.cabal

* Point to GHC: better HasMethod msg, uses PrelNames

* Point at non-PrelNames approach - turns out that didn't work

* Point to GHC with multiple module checks

* Point to GHC with tentative PrelNames work fully removed

* Add tests for new "non existent method" and "view" error messages

* Point to merged GHC changes
2022-09-15 12:53:30 +00:00
Moisés Ackerman
a97f83e19d
Fix unstable package ids in the presence of data-dependencies (#14936)
* Add test case

* Restart UniqSupply on every call of setupDamlGHC

changelog_begin
- [data-dependencies] Fixed an issue where packages with data-dependencies would get non-deterministic package ids (`#14936 <https://github.com/digital-asset/daml/issues/14936>`__).
changelog_end
2022-09-06 17:53:10 +02:00
dylant-da
a2ea3ce685
Better errors for non-record non-monomorphic viewtypes (#14932)
* 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
2022-09-05 15:50:00 +00:00
Moisés Ackerman
1f2b709781
Data.NameMap: remove runtime check on HOF name changes (#14907)
* Add 'damlc validate-dar' test case for interface definition

* Add failing 'damlc validate-dar' test cases for interface instances

* Remove instance MonoTraversable e (NameMap a) from Data.NameMap

* Add (orphan) instance MonoTraversable ModuleRef (NameMap a) in DA.Daml.LF.Ast.Optics

* Data.NameMap: remove runtime check on HOF name changes

changelog_begin
changelog_end
2022-09-02 14:36:29 +00:00
Moisés Ackerman
b305f4111d
daml-doc improvements (#14867)
* Show "(no fields)" for fieldless records in daml-doc .rst output

* Update daml-test-files *.EXPECTED.rst

* Extract compareRendered from renderTest

* Add daml-doc test cases for renderFolder

* Add operator (DA.Daml.Doc.Render.Util.<->)

* Avoid trailing whitespace in daml-doc.{md,rst} output

* Update daml-test-files *.EXPECTED.{md,rst} and DA.Daml.Doc.Render.Tests

* Drop unused code

* Update comments

changelog_begin
changelog_end
2022-09-02 16:24:59 +02:00
dylant-da
69296455f3
Better errors when trying to use guards in LF 15 (#14884)
* Make InterfaceGuardedNotExtended error out with guard message

* Move ConvertM into own module, make convertPrim failable

* Error out when exerciseGuarded is called

* Remove _exerciseDefault, now unused

* Error at runtime if _exerciseInterfaceGuard called in <= LF 1.15

* Add InterfaceChoiceGuardFailedNotExtended - test guarded exercises error

* lint

* Satisfy changelog

CHANGELOG_BEGIN
CHANGELOG_END

* Only error on exerciseGuarded if extended interfaces are NOT supported

* Make convertPrim impure - handle strict errors by inserting runtime errs

* Use ifdef/else/endif instead of ifdef/endif/ifndef/endif

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-09-01 15:39:03 +01:00
Moisés Ackerman
91dabdee69
Fix LF conversion and typechecker #12051 TODOs (#14890)
* 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
2022-09-01 12:43:04 +02:00
Moisés Ackerman
4b574ac393
Add damlc internal command debug-ide-span-info (#14792)
* update ghcide rev

* Add getSpanInfo action in daml-ide-core

* Add internal damlc command 'debug-ide-span-info'

changelog_begin
changelog_end
2022-09-01 09:53:19 +02: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
Moisés Ackerman
e1b46f4384
Cleanup daml-doc (#14857)
* Add newtype for interface viewtype docs

* Change type of InterfaceDoc field if_viewtype to Maybe InterfaceViewtypeDoc

* Extract interface viewtype in distributeInstanceDocs

changelog_begin
changelog_end
2022-08-30 09:20:53 +02:00
Moisés Ackerman
3ac7d87498
Monomorphize interface methods and choices (#14853)
* Update ghc rev

* Update daml-test-file InterfaceGuarded

* Add daml-test-files for interface method and choice monomorphicity

* Update daml-test-files *.EXPECTED.desugared-daml

* Update daml-test-files *.EXPECTED.{md,rst}

* Fix data-dependencies tests

* Fix ide test

* Update code-snippets-dev/Interfaces.daml

* Update interface reference docs to reflect monomorphic methods and choices

* Apply suggestions from code review

changelog_begin
changelog_end

Co-authored-by: carrielaben-da <91496516+carrielaben-da@users.noreply.github.com>
2022-08-29 16:24:35 +02: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
Remy
0f662a66a9
LF: simplify error about unserializability of view (#14803)
CHANGELOG_BEGIN
CHANGELOG_END
2022-08-25 09:53:03 +00:00
Moisés Ackerman
1a90e9c117
Extend daml-doc to support retroactive interface instances and viewtypes (#14774)
* Add daml-doc EXPECTED.{md,rst} files for QualifiedInterface.daml

* Add daml-doc EXPECTED.{md,rst} files for {,Qualified}RetroactiveInterfaceInstance.daml

* 'implements' in templates are now rendered as 'interface instance's

* Update daml-test-files {,Qualified}Interface.daml EXPECTED daml-doc output

* daml-doc now includes interface instances in interfaces

* Update daml-test-files {,Qualified}RetroactiveInterfaceInstance.daml EXPECTED daml-doc

* Add daml-doc test case for interface instance in interface

* Generalize runDamldoc to runDamldocMany

* Generalize damldocExpect to damldocExpectMany

* Add daml-doc test cases for qualified interface instance anchors

* Extract interface viewtypes in daml-doc

* Render interface viewtypes in daml-doc

* Update EXPECTED daml-doc for daml-test-files with interface viewtypes

* Add comment for use of partial function (Data.Map.Strict.!)

changelog_begin
changelog_end
2022-08-25 09:30:44 +00:00
Remy
5a07b6596f
LF: check viewtype is a monomorphic record (#14802)
CHANGELOG_BEGIN
CHANGELOG_END
2022-08-25 10:02:13 +02:00
Moisés Ackerman
d1c0cff106
Fix for interface instance of interface from data-dependency (#14813)
* Add failing test cases

* fix unhandled string in convertTemplateTyCon

* data-dependencies: Add DamlTemplate context on template data declarations

changelog_begin
changelog_end
2022-08-25 09:50:24 +02: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
0d364f5547
update interface keywords in daml studio syntax file (#14759)
changelog_begin
changelog_end
2022-08-19 11:02:15 +02:00
Matteo Limberto
04c7f04da4
daml-doc generates valid rst for interface methods (#14752)
changelog_begin
changelog_end
2022-08-18 18:25:12 +02:00
Moisés Ackerman
ed046a11b5
Pretty print interfaces (#14742)
* Pretty print interface instances in templates

* Pretty print interface definitions, including nested interface instances

changelog_begin
changelog_end
2022-08-18 10:42:01 +02:00
Moisés Ackerman
009c3c306b
Add interface instance syntax, including retroactive interface instances (#14715)
* Extract qualifyLocally in LFConversion

* Update ghc rev

* Add parent type argument to interface instance desugaring types

* Check interface instance parent in LFConversion

* Convert interface instances in interface declarations

* Update daml-test-files to use 'interface instance' syntax

* Update other tests to use 'interface instance' syntax

* Update interface reference docs to use 'interface instance' syntax

* Update other files to use 'interface instance' syntax

* Add todo in DA.Daml.LF.Ast.Pretty

* Add daml-test-files for retroactive interface instances

changelog_begin
changelog_end
2022-08-17 12:06:59 +00:00
Moisés Ackerman
14c6f82ba2
DA.Internal.Interface.view now works directly on interface values (#14726)
changelog_begin
changelog_end
2022-08-17 11:05:44 +02:00
Moisés Ackerman
ad2740498b
Interface instance typechecking (haskell) (#14683)
* 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
2022-08-11 10:53:41 +00:00
Moritz Kiefer
f03615657a
Add insertWith to DA.Map (#14691)
changelog_begin

- [Daml Stdlib] Add `insertWith` to `DA.Map` which allows combining
  the newly inserted value with the existing value (if any).

changelog_end
2022-08-11 10:07:51 +00:00
dylant-da
0d37134bc2
Change placeholder unit viewtypes to empty records (#14656)
* Update views in integration-v1dev to be EmptyInterfaceView instead of ()

* Update expected desugared daml for `EmptyInterfaceView`

* Update compiler Shake / DataDependencies viewtypes to EmptyInterfaceView

* Add record viewtypes to docs, update docs

* Add empty records to daml-lf, language-support, ledger, trigger tests

* Qualify EmptyInterfaceView in ledger semantic Interface tests

* Fix imports for EmptyInterfaceView in IIou / CIou / Transferrable

* empty changelog commit

CHANGELOG_BEGIN
CHANGELOG_END

* Qualify EmptyInterfaceView import

* Fix imports of EmptyInterfaceView in TypeScript codegen tests

* Accept Interface doc changes

* Add EmptyInterfaceView to DataDependencies tests

* Remove missing interface viewtype test - all interfaces must have views

* Replace all EmptyInterfaceView with EmptyInterfaceView {}
2022-08-10 16:45:23 +00:00
dylant-da
b73e852604
Better errors related to Interface Views (#14648)
* Point to new GHC with errors for missing views

* Add placeholder view to ImplementsNonInterface

* Fix doc comment in InterfaceViewNotSpecified

* Add test for error when method named `view` is declared

* Add placeholder unit viewtype to doc tests

* Update err message in ImplementsNonInterface - error now detected in LF

* empty changelog commit

CHANGELOG_BEGIN
CHANGELOG_END
2022-08-10 13:45:25 +00:00
Moisés Ackerman
24e04076da
Refactor interface LF conversion (#14671)
* Extract interface views from binds instead of 'md_insts'

* Extract interface binds together

* Define and use pattern 'HasMethodDFunId' to extract 'HasMethod' instances

* Extract interface methods in 'scrapeInterfaceBinds'

* Extract interface requirements in 'scrapeInterfaceBinds'

* Include locations in InterfaceBinds.ibMethods

* Introduce 'InterfaceInstanceGroup' newtype

* Extract interface instance binds together in 'scrapeInterfaceInstanceBinds'

* Extract 'convertInterfaceInstance' from 'convertImplements'

* Update expected error in daml-test-file ImplementsNonInterface

changelog_begin
changelog_end
2022-08-10 11:46:21 +02:00
Carl Pulley
19a2b986bc
Disclosure testing invalid contract type
* Test that invalidly typed contracts are rejected

CHANGLELOG_BEGIN

* Engine/speedy-level tests for explicit disclosure (#14227): test that invalidly typed contracts are rejected.

CHANGELOG_END
2022-08-09 18:45:44 +01:00
dylant-da
a4e29299be
Implement Interface views in speedy (#14565)
* 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
2022-08-09 12:49:14 +01: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
Carl Pulley
d0f40d89ca
Disclosure error reporting fix
Add key hash to scenario service error reporting

CHANGELOG_BEGIN

  * Engine/speedy-level tests for explicit disclosure (#14227): Add key hash to scenario service error reporting.

CHANGELOG_END
2022-08-04 11:09:33 +01:00
Moisés Ackerman
aa01362dca
data-dependencies: empty class instances (#14600)
* data-dependencies: accept Unit as a valid dfun body

changelog_begin
* data-dependencies: fixed a bug in the handling of instances of typeclasses without methods (#14585)
changelog_end
2022-08-04 10:03:14 +02:00
dylant-da
8e8e0dabdf
Convert viewtype and view methods to LF (#14456)
* 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
2022-08-03 16:23:38 +01:00
Moisés Ackerman
0c8f2ed43e
LF conversion: split Env (#14566)
* LF conversion: split Env type into Env+ModuleContents

Env is now limited to information _about_ the module and the compilation environment, as well as compiler state such as local aliases and a fresh tyvar name supply
ModuleContents has the fields from old Env which are extracted from type, class and function declarations in the module being converted

* rename x=>coreModule

* Extract convertBinds function

* Extract convertTypeDefs function

* move binds into ModuleContents

* Move typeDefs into ModuleContents

* Move depOrphanModules into ModuleContents

* Move exports into ModuleContents

* Move fixities into ModuleContents

* Extract mkEnv function

* Extract convertModuleContents function

* Remove unused fields {Env,DamlEnv}.envIsGenerated

* Remove unused field ModuleContents.mcInterfaceChoiceData

* Remove unused field ModuleContents.mcInterfaceBinds

changelog_begin
changelog_end
2022-07-29 09:15:26 +02:00
Remy
b163638d19
Damlc: Remove precondition for interface (#14548)
* 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
2022-07-28 16:34:12 +00:00
Carl Pulley
c87732c438
Disclosure testing of contracts and keys
* 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
2022-07-28 16:00:55 +01:00
Remy
88d4ff93f2
LF: remove precondition in interface (proto & scala side) (#14511)
CHANGELOG_BEGIN
CHANGELOG_END
2022-07-27 10:52:35 +02:00
dylant-da
87938faaf7
DAML Views - Syntax Only (#14435)
* Point to new GHC version with viewtype and view syntax

* Make minimum modifications to erase newly generated view code

CHANGELOG_BEGIN
CHANGELOG_END

* Point to updated GHC - no longer requires viewtype/view at syntax level

* Add DA_Internal_Interface to convertTypeDef exclusion check

* Move desugared types/values for interface views into DA.Internal.Desugar

* Disable unused TypeFamilies extension in DA.Internal.Interface

* Point to updated GHC, "Remove shortViewName"

* Update to latest GHc view syntax changes

* Update GHC to merged view syntax changes
2022-07-26 16:57:51 +00:00
Johan Sjödin
3968bcf216
Fix DA.Logic.isBool comment (#14532)
CHANGELOG_BEGIN
CHANGELOG_END
2022-07-26 15:20:40 +00:00
Remy
8a02a050b1
LF: Remove interface methods from collision check (#14513)
CHANGELOG_BEGIN
CHANGELOG_END
2022-07-26 13:31:55 +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
2393b5071f
Reject class method overlapping with record field (#14391)
* Update GHC patch

* Add daml-test-files for overlapping methods and fields

* changelog

changelog_begin
* [daml] Programs where a class method overlaps with a record field are no longer accepted (#14390)
changelog_end
2022-07-11 12:58:20 +00:00
dylant-da
3c7ab41bc3
Check interface view exists and is serializable, in compiler and in engine (#14112) (#14322)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
2022-07-05 13:43:28 +00:00
Remy
abd47e972b
[Speedy] Do not crash when encountering an inconsistent contract key (#14276)
but rather return a proper interpretation error.

CHANGELOG_BEGIN
CHANGELOG_END
2022-07-05 10:28:38 +00:00
Moisés Ackerman
ba9abf3c5f
Use the appropriate daml-script for each Script (#14321)
* Add failing test

* Overload daml-script 'Runner.run' to work directly with 'PureCompiledPackages'

* Use new daml-script 'Runner.run' in scenario-service

changelog_begin
* data-dependencies: fixed an issue with the handling of multiple versions of the daml-script package (#14291)
changelog_end

Co-authored-by: Remy <remy.haemmerle@daml.com>
2022-07-04 08:26:12 +00:00
Remy
d0058dcff3
[Interface] make all ContractIds serializable (#14307)
CHANGELOG_BEGIN
CHANGELOG_END
2022-07-01 11:07:12 +02:00
Robin Krom
36b39aca7b
Move disclosed contract logic to speedy (#14288)
* Move disclosed contract logic to speedy

This moves the disclosed contract logic from the engine to speedy.

Fixes #14090.

* back to versioned contract instances

CHANGELOG_BEGIN
CHANGELOG_END
2022-07-01 08:40:10 +00:00
Remy
54af1c0ecd
[stdlib] fix DA.Foldable (#14235)
fixes #14230

CHANGELOG_BEGIN

- [Bug Fix] fix DA.Foldable Standard library. Both DA.Foldable.foldl
  and DA.Foldable.toList were recuring in the wrong direction.

CHANGELOG_END
2022-06-30 21:56:10 +02:00
Carl Pulley
5c026163a9
Remove redundant fields from LedgerNodeInfo
CHANGELOG_BEGIN

[DAML Studio] as the `parent` and `rolledbackBy` fields of `LedgerNodeInfo` are not used within the code base, they have been removed.

CHANGELOG_END
2022-06-29 16:35:42 +02:00
Moisés Ackerman
583a97d02e
data-dependencies: qualify HasMethod interface (#14280)
* Add failing test

* Use qualified interface type for HasMethod instances

changelog_begin
changelog_end
2022-06-28 14:12:39 +02:00
Carl Pulley
6ed88105bb
Refactor and simplification of Transaction#processNodes
* fixes #14183

CHANGELOG_BEGIN

- [DAML Studio] Refactor and simplification of Transaction#processNodes to avoid need for custom state during processing. Refactor of Transaction#processTransaction to make processing workflow more transparent and easier to unit test. See https://github.com/digital-asset/daml/issues/14183 for details.

CHANGELOG_END
2022-06-28 13:49:41 +02:00
dylant-da
32d6a4a2dc
Improve error message when implementing non-interface (Issue #13823) (#14249)
* Improve error for `implements` on non-interface using GHC source-map

* Pass source location for implements directly

* Update GHC revision to pick up updated implements location

* Change revision to point to merged GHC source location changes

CHANGELOG_BEGIN
CHANGELOG_END

* Handlers output strings in convertInterfaceTyCon

* Improve error for requires on non-interface

* Use prettyPrint instead of GHC.showSDocUnsafe . ppr

* Test error messages for implement/require noninterface

* Fix error line numbers, point to merged GHC changes instead of branch

* Enable interfaces in new tests, Fix copyright year

* Add trailing newline to interface tests

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

Co-authored-by: Remy <remy.haemmerle@daml.com>
2022-06-28 10:14:53 +01:00
Moisés Ackerman
f4211b709f
data-dependencies: generate opaque constructor for interfaces (#14228)
* Add simpleImportTestOptions helper

* Add failing test

* data-dependencies: Generate opaque constructor for interfaces

changelog_begin
changelog_end

* Add comment in test case
2022-06-20 17:49:12 +02:00
Sergey Kisel
b1d8c14c55
Removal of Sandbox Classic in Haskell code [DPP-1073]. (#14127)
* Removal of Sandbox Classic in Haskell code.

CHANGELOG_BEGIN
CHANGELOG_END

* Further sandbox-classic removals

* Upload dar files when withSandbox is used.

* fix formatting

* Moved upload of dars in createSandbox.

* Fixed test by passing the token before the token file is created.

* Added implicit party allocation argument for haskell tests.

* DPP-1073 Infer sandbox token from the shared secret.

* Different slicing of runLedgerUploadDar

Co-authored-by: Andreas Triantafyllos <andreas.triantafyllos@digitalasset.com>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2022-06-16 14:14:39 +02:00
Remy
2d5094160e
[Engine] clean key uniqueness mode (#14194)
This is a follow up of #14175 and #14176.  

Basically
-  we kill the `On` mode which is not used anymore.
- we factorize the visibility check.
- we rename `LocalContractNotVisible` into `ContractNotVisible`

CHANGELOG_BEGIN
CHANGELOG_END
2022-06-16 12:04:45 +00:00
dylant-da
90f0bf8ba0
Display key used by exerciseByKey and fetchByKey in transaction log (#14035) (#14162)
* Show key in transaction log when exercising by key

* Only show key if key was actually used

* Show key if used by a fetch in transaction view

* Add test for key showing up in log on fetch/exercise

* CHANGELOG_BEGIN
Display key used by exerciseByKey and fetchByKey in transaction log
CHANGELOG_END

* Dummy commit for CHANGELOG

changelog_begin
changelog_end

* Use "by key" instead of "using key", to better match function names

* Test that key is only reported when ByKey is used
2022-06-15 16:50:35 +00:00
Carl Pulley
7d76460ee8
DAML Studio Activeness checks
* fixes #13835

CHANGELOG_BEGIN
  - [Daml Studio] Fix a bug where some contracts were considered inactive even though their consumption was under a rollback. See https://github.com/digital-asset/daml/issues/13835 for details
CHANGELOG_END
2022-06-15 11:35:18 +01:00
Moritz Kiefer
d233bfa4b4
Add missing activeness check when reading from globalKeyInputs (#14080)
* Add missing activeness check when reading from globalKeyInputs

changelog_begin

- Engine. Fix lookup by key. See issue Lookup archived contracts may succeed when combined with rollback exceptions #14107 for more details.

changelog_end
2022-06-13 19:27:08 +00:00
Moisés Ackerman
3255dccfc9
Qualify interface name in _requires_ markers (#14054)
* Add failing test
* update ghc patch
* Update *.EXPECTED.desugared-daml daml-test-files
2022-06-07 10:00:36 +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
09034a265d
ScenarioRunner: move the building of the speedy machine (#14024)
CHANGELOG_BEGIN
CHANGELOG_END
2022-06-02 16:40:48 +02:00
Remy
7638e086ae
Script: infer the typeId of Choice in daml (#13971)
part of #13653

goes with digital-asset/ghc#122

CHANGELOG_BEGIN
CHANGELOG_END
2022-06-02 14:02:12 +00:00
Moisés Ackerman
25b342240e
Fix data-dependencies leaking dependency internals (#13981)
* Add failing test

* Do not overwrite existing dalfs when installing a dar dependency

changelog_begin
* data-dependencies: fixed an issue with the handling of transitive dependencies through a data-dependency (#13981)
changelog_end
2022-05-30 13:19:59 +00:00
Moisés Ackerman
cc41d0ce3a
Replace 'fetchByKey' with 'lookupByKey' in 'LookupKeyed' choice in KeyNotVisibleStakeholders (#14011)
changelog_begin
changelog_end

Co-authored-by: Danilo Faria <danilo@digitalasset.com>
2022-05-30 08:39:47 +00:00
Moisés Ackerman
789d9a44b1
Integration test fixes (#13982)
* Add integration test for runtime check of contract id in contract key

* Replace 'LookupKeyed' with 'FetchKeyed' in 'blindFetch' scenario

changelog_begin
changelog_end

* Replace 'FetchKeyed' with 'LookupKeyed' in 'divulgeeLookup' scenario
2022-05-25 14:48:09 +02:00
Remy
d3264236ba
Interface: drop collision check between inherited choice name (#13939)
CHANGELOG_BEGIN
CHANGELOG_END
2022-05-24 17:53:18 +02:00
Remy
a3cccbc6eb
Update GHC (#13917)
with digital-asset/ghc#120

fixes #13915

CHANGELOG_BEGIN
CHANGELOG_END
2022-05-19 12:52:46 +00:00
Moisés Ackerman
fedfd5ad4a
data-dependencies: Constraint synonym context on class (#13916)
* Add failing test case

* Use convTypeLiftingConstraintTuples for superclasses

changelog_begin
* data-dependencies: fixed an issue with the handling of constraint synonyms in superclasses (#13916)"
changelog_end
2022-05-18 18:04:37 +02:00
Moritz Kiefer
13b69b3004
Fix locations for LF errors (#13895)
* Fix locations for LF errors

fixes #13837

changelog_begin

- [Daml Compiler] Fix locations of certain types of error messages, e.g., missing interface methods.

changelog_end
2022-05-17 13:45:58 +02:00
Remy
ea0d101913
Interface: Rename fixedChoice to choice (#13883)
CHANGELOG_BEGIN
CHANGELOG_END
2022-05-17 12:03:53 +02:00
Moisés Ackerman
ad123f9b22
Add da-hls helper (#13853)
* Add haskell-language-server executable

* Add da-hls alias

* strip prefixes in da_haskell_libraries

* Remove dev-env-provided ghcide

* Update mentions of 'ghcide' to 'hls'

changelog_begin
changelog_end
2022-05-12 10:53:10 +02:00
Moisés Ackerman
05960c6edf
Preserve fixity information in data-dependencies (#13774) 2022-05-05 18:50:51 +02:00
Moisés Ackerman
61cb257225
Make disclosure explicit in Daml Studio tree view (#13735)
changelog_begin
* Daml Studio: transaction tree view now differentiates between disclosed and divulged contracts
changelog_end
2022-05-02 09:18:46 +02:00
Moisés Ackerman
9fb7f11316
Replace more instances of 'scenario' with 'script' (#13651)
* Replace more instances of 'scenario' with 'script'

changelog_begin
* Remove Daml Studio 'scenario' snippet
* Add Daml Studio 'script' snippet
* Update documentation for 'daml test' command
changelog_end

* remove 'test' snippet

changelog_begin
* Remove Daml Studio 'test' snippet
changelog_end
2022-04-27 17:49:32 +02:00
Moisés Ackerman
9af86bcc2c
Update reference and docstrings for fromInterfaceContractId and fetchFromInterface (#13712)
changelog_begin
changelog_end
2022-04-27 14:10:17 +02:00
Remy
3e2edfe5e2
Drop wrong comment in GHC.Err (#13664)
CHANGELOG_BEGIN
CHANGELOG_END
2022-04-22 13:28:25 +00:00
Robin Krom
c15c5a42a4
daml test: print test summary at end of test suite. (#13648)
This changes the output of `daml test`, such that at the end of the test
suite a summary is printed, indicating which tests failed and which
passed.

Fixes #13535.

CHANGELOG_BEGIN
CHANGELOG_END
2022-04-22 12:30:30 +02:00
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