fixes#10570
I’m increasingly convniced, that the future failures here are a
maintenance nightmare and we should switch to Either completely but
not in this PR
changelog_begin
changelog_end
Requested in #10509. Should we also add `minimumBy` and `maximumBy` for
consistency with `sortBy`?
CHANGELOG_BEGIN
- The DA.List and DA.List.Total modules now export minimumBy, maximumBy,
minimumOn and maximumOn, respectively behaving similarly to sortBy and
sortOn.
CHANGELOG_END
* Add dlint rule to suggest ===
This rule doesn’t quite work in all cases since you can have types
that have Eq instances but not Show instances. However, I think the
benefits of people learning about this are much larger than the
downsides here of getting a hint that doesn’t apply in edge cases.
changelog_begin
changelog_end
* fix all the tests, why are there so many :(
changelog_begin
changelog_end
* Allow imports of internal modules
changelog_begin
- [Daml Compiler] Imports of internal modules from stable packages are
no longer illegal. Previously, the compiler raised an error when it
encountered imports of internal modules such as
`DA.Internal.Template`. Such imports are now accepted by the compiler.
Note, however, that internal modules are still not part of the stable
API. Fixes https://github.com/digital-asset/daml/issues/10379
changelog_end
* ~unstable~
https://github.com/digital-asset/daml/pull/10397#discussion_r676485891
Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
* Pass commitLocation along in engine warning log.
changelog_begin
changelog_end
* Use commitLocation in diagnostics.
* scalafmt
* update divulgence test
* Fix commitLocation and expected diagnostic locations
* Register divulgence warnings as diagnostics
The divulgence warnings for a scenario are registered as a diagnostic,
when there isn't a scenario error. (Rationale: Scenario errors already
include the warnings in their text, after trace log entries.)
Part of #9947, follow up from #10253
changelog_begin
changelog_end
* Rewrite case expression to make it more readable
* Fix a couple integration tests
* Separate traces from warnings in engine.
I decided to separate the engine warnings from the tracelog after all,
because I think it will make testing and maintenance easier in the
long run.
Part of #9947, follow up from #10179
changelog_begin
changelog_end
* scalafmt
* Apply suggestions from code review
Co-authored-by: Remy <remy.haemmerle@daml.com>
* dont use case class for WarningLog
* revert TraceLog changes from last PR
* Scala 2.12 doesnt have ArrayBuffer.addOne :(
* remove isWarnEnabled check
Co-authored-by: Remy <remy.haemmerle@daml.com>
* Warn on DA.Exception import
We had a few confused users that imported that module and got weird
errors. The warning should hopefully make things a bit clearer. We
could do this for other modules as well but I’ll leave that for
separate PRs.
changelog_begin
- [Daml Compiler] Importing DA.Exception on LF < 1.14 now produces a
warning that exceptions require Daml-LF >= 1.14.
changelog_end
* Add a test for exception imports
changelog_begin
changelog_end
* Add divulgence warning and test in script service.
Part of #9947, building on the key visibility checks from #10136
This PR adds a divulgence warning inside the traceLog.
I wasn't sure whether:
1. these warnings should be kept in a separate structure from the
traceLog, and therefore transmitted separately, or
2. these warnings should be kept together with traces, but the severity
should be tracked and also transmitted over grpc, and warnings should
be logged as warnings instead of as debug messages, or
3. these warnings should be kept together with traces, but
logged as warnings instead of debug messages,
4. these warnings should be treated exactly like traces
I'm leaning toward #2, but this PR implements #3.
This PR tests the warning via the script service tests.
changelog_begin
changelog_end
* scalafmt
* Address Moritz's review
* Rename traceLog.add to traceLog.addDebug
* fix test
* Add test using exercise
* add single transaction test
changelog_begin
changelog_end
- DAML -> daml
- Assistant -> assistant
The capitalization of the latter fixed one occurrence of a capitalized 'A'
which was inconsistent with the vast majority of uncapitalized 'a's.
* Refactor error reporting in Daml Repl
fixes#10098
As mentioned in that issue, the current behavior is a mess which
silently drops errors in certain cases. This PR switches things around
so that errors are reported to the client and we print them there
making sure that no error should ever get lost.
changelog_begin
changelog_end
* Bump timeout
changelog_begin
changelog_end
* Use ScenarioRunner.submit in Daml Script
changelog_begin
changelog_end
* privatize ledger variable
changelog_begin
changelog_end
* drop space
changelog_begin
changelog_end
* Add proper error handling for missing contract keys
These are clearly not internal errors so we should not be calling
`crash` here. Canton in fact already started string matching on the
crash message which is definitely not what we want.
changelog_begin
changelog_end
* backwards compat
changelog_begin
changelog_end
* fix tests
changelog_begin
changelog_end
* Make data-deps exception tests version-aware.
This PR changes the exception data-dependencies tests to test cross-version imports of exceptions (once we release exceptions in preview).
It also removes the last exceptions TODO from the Haskell side, other than changing `featureMinVersion` for once we start releasing excepions.
Part of #8020
changelog_begin
changelog_end
* qualify everything
* typo
* Special case _tryCatch @Update in LFConversion.
This is in line with the special cases for (>>=), pure, etc
changelog_begin
changelog_end
* , args
* EUpdate
* Fix typeclass detection in data-dependencies
Fixes#9689 which was actually caused by misinterpreting a constraint
synonym as an empty typeclass.
This PR fixes and deduplicates the logic for detecting typeclass
definitions in data-dependencies. It also tries to avoid lifting
constraint tuples unnecessarily (since constraint synonym
definitions are already lifted). And for any constraint tuples
that are lifted, it picks a more unique name.
The PR adds a regression test, and a test for nested constraint tuples.
changelog_begin
changelog_end
* Preserve nice comment.
* Make succ/pred throw an ArithmeticError on overflow.
Part of #8020.
This is the only remaining case in daml-prim & daml-stdlib where it seems correct to me to throw a different exception type rather than `GeneralError`.
changelog_begin
changelog_end
* Fix Enum
* Make DA.Assert throw AssertionFailed instead of GeneralError
changelog_begin
- [Daml Standard Library] `assert`, `(===)`, and other assertion functions (see DA.Assert) now use a new `CanAssert` typeclass constraint instead of `CanAbort`, in preparation for exceptions support.
changelog_end
* Add CanAssert instances for Script and Trigger.
* buildifier-fix
* update script test runner output
* Fix flag and add tests.
* update script test runner again
* Refactor GenerateStablePackages
Summary of changes:
* Split GenerateStablePackages executable into a library (containing the stable package data) and an executable (that writes out the packages)
* Hook up data-dependencies test to the new library so we don't have to manually update the number of stable packages every time we add a stable package or release a new LF version.
changelog_begin
changelog_end
* buildifier-fix
This fixes a race condition in our handling of scenario contexts. See
the comments for details. I verified with a bunch of extra logging
that this is what is actually failing in our tests. I’ll try to
upstream the logging separately since ideally I’d like to have that in CI.
I ran all integration tests with --runs_per_test=20 over night and
with this change I’m no longer able to get it to flake so dropping the
flaky marker.
fixes#6910
changelog_begin
changelog_end
The name of some builtins will be exposed as part of the Exception
message. This PR, try to make conversion builtins more consistent and
more obvious, before we could not rename those.
This is part of #8020
CHANGELOG_BEGIN
CHANGELOG_END
* Parallelize the data-dependencies test.
It runs about twice as fast on my laptop (240s -> 120s) when allowed to
run tests in parallel. I'm not sure this will work or make a huge
difference when it comes to timeouts in CI, but it's worth a shot.
changelog_begin
changelog_end
* TASTY_NUM_THREADS := 3
* set bazel tag for test