Commit Graph

180 Commits

Author SHA1 Message Date
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
5c00481ae0
Source location plumbing (#16269)
* Update protobuf to include sourceloc for implements and coimplements
Relevant haskell changes

* Update error ranges in tests

* Extract source locations from various template/interface parts

* Improve ExprSource extraction

* Move location from instance head to template/interface parts
Add location to instance print
2023-02-10 16:26:34 +00:00
nickchapman-da
d406e0a8df
remove clunky of suffix from with-authority internal names (#16214) 2023-02-01 16:19:06 +00:00
Moisés Ackerman
8784ebd9ce
Add choiceController and choiceObserver functions (#16088)
* Add daml test file for choice functions

* Add HasChoice{Controller,Observer} type classes

* Add choice_{controller,observer} in LF

* Update GHC_REV

* Generate HasChoice{Controller,Observer} instances

* Remove manual instances in daml test file for choice functions

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

* update *.desugared-daml golden files

* Apply code review suggestion

* Update GHC_REV (da-master-8.8.1)

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

- Updating `./COPY` to say `2023`.
- Running `./dev-env/bin/dade-copyright-headers update .`
2023-01-04 18:21:15 +01:00
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
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
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
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
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
Remy
5a07b6596f
LF: check viewtype is a monomorphic record (#14802)
CHANGELOG_BEGIN
CHANGELOG_END
2022-08-25 10:02:13 +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
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
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
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
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
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
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
d0058dcff3
[Interface] make all ContractIds serializable (#14307)
CHANGELOG_BEGIN
CHANGELOG_END
2022-07-01 11:07:12 +02: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
d3264236ba
Interface: drop collision check between inherited choice name (#13939)
CHANGELOG_BEGIN
CHANGELOG_END
2022-05-24 17:53:18 +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
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
Moisés Ackerman
f59d1cd0b4
Convert experimental primitive TYPEREP_TYCON_NAME into proper LF builtin (#13465)
* Convert experimental primitive TYPEREP_TYCON_NAME into proper LF builtin

* Add entry for TYPEREP_TYCON_NAME in daml-lf spec

* disable quickcheck test in DA.Test.Packaging

changelog_begin
changelog_end
2022-03-31 14:35:46 +02:00
Moisés Ackerman
f9f1611d46
Unsafe interface conversion primitives (#13391)
* Add unsafeFromInterface method to HasFromInterface class

* Use unsafeFromInterface instead of fromInterface + experimental primitive

* Drop THROW_WRONGLY_TYPED_CONTRACT experimental primitive

* Add UnsafeFrom{,Required}Interface LF primitives

* Add convertPrim cases for UnsafeFrom{,Required}Interface

* Add InterfaceGuarded tests for WronglyTypedContract cases

changelog_begin
changelog_end

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2022-03-25 10:07:14 +00:00
Sofia Faro
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
Gary Verhaegen
961ca80b77
hunt down DAML (#13191)
Process:

- `git ls-files | xargs sed -i 's/DAML/Daml/g'`
- `git add -p`

To review:

- Check for false positives by carefully reviewing the diff in this PR.
- Check for false negatives with `git grep DAML`.

CHANGELOG_BEGIN
- Removed all traces of DAML. This may affect error messages and debug
  outputs.
CHANGELOG_END
2022-03-08 14:25:25 +01:00
Sofia Faro
b2d6f8014c
LF: Use template parameter (this) in method bodies. (#13142)
* Use `this` param in method bodies in LF.

Instead of having method bodies be functions from the template, have them reuse the existing template parameter (usually `this`).

Fixes #13123

changelog_begin
changelog_end

* fix validation-test
2022-03-03 13:50:59 +00:00
Sofia Faro
db100c131a
Prevent iface choice & method name collisions. (#13075)
* Prevent iface choice & method name collisions.

This PR adds interface choices and methods to the name collision checker.

changelog_begin
changelog_end

* check the names from interfaces

* add error

* implement name collision check in scala side

* scalafmt
2022-02-28 13:21:41 +00:00
Sofia Faro
b842b53ff4
Delete vestigial InterfaceChoice from AST (#13017)
* Delete vestigial InterfaceChoice from AST

This is a leftover from when interfaces had virtual choices.

changelog_begin
changelog_end

* delete more
2022-02-22 13:59:04 +00:00
Sofia Faro
b626aeb632
Add experimental builtin to show template typerep (#13004)
Part of #12792, this is the builtin we need to be able to effectively
store a TemplateTypeRep inside a template (i.e. you store a string
containing the template id, not a typerep).

changelog_begin
changelog_end
2022-02-21 18:24:56 +00:00
Moisés Ackerman
3ce272b9f0
Replace experimental interface primitives with proper LF primitives (#12678)
* Add new primitives to proto spec

* implement E{Signatory,Observer}Interface in terms of EResolveVirtual{Signatory,Observer}

* define EToTypeRep primitive in terms of EToTypeRep Expr

* Remove experimental primitives TO_TYPE_REP and RESOLVE_VIRTUAL_{SIGNATORY,OBSERVER} 

changelog_begin
changelog_end
2022-02-03 13:36:45 +00:00
Sofia Faro
dcbb398cae
Typecheck experimental primitives in damlc (#12650)
Adds a check that experimental primitive is defined in damlc, before you can use it.

This is only for the Haskell side, and only intended so we can catch bugs in the compiler more easily. (It would have caught the bug where `observer` wasn't defined correctly in LFConversion.)

I also removed RESOLVE_VIRTUAL_CREATE since we're not using it anywhere, it has been superseded by UCreateInterface.

changelog_begin
changelog_end
2022-01-31 09:33:34 +00:00
Moritz Kiefer
d5ede55066
Turn name collision warnings for virtual modules into errors (#12627)
fixes https://github.com/digital-asset/daml/issues/11321

changelog_begin
changelog_end
2022-01-27 17:58:02 +01:00
Moritz Kiefer
ce06eb00fb
Add serializability check for interface payloads in Haskell (#12560)
* Add serializability check for interface payloads in Haskell

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* cleanup

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2022-01-25 14:20:25 +01:00
Moritz Kiefer
42aadec073
Cleanup Haskell serializability check (#12565)
I got unreasonably confused why we sometimes pass `Nothing` here and
why the templates are sometimes unused so this PR attempts to clarify
this a bit.

changelog_begin
changelog_end
2022-01-25 10:03:30 +00:00
Moritz Kiefer
681f8fca6b
Add missing serializability checks for interfaces (#12483)
* Add missing serializability checks for interfaces

The checks for argument & result type were missing before. I openey
https://github.com/digital-asset/daml/issues/12482 to do the same fix
on the Scala side.

fixes #12475 

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2022-01-19 17:24:46 +01:00
Gary Verhaegen
d2e2c21684
update copyright headers (#12240)
New year, new copyright, new expected unknown issues with various files
that won't be covered by the script and/or will be but shouldn't change.

I'll do the details on Jan 1, but would appreciate this being
preapproved so I can actually get it merged by then.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-03 16:36:51 +00:00
Moritz Kiefer
77a37cf213
Drop damlc code for LF <= 1.11 (#12121)
* Drop damlc code for LF <= 1.11

Still a tiny bit left for pre 1.14 but this covers most of it.

changelog_begin
changelog_end

* delete numeric equal prmitives

changelog_begin
changelog_end
2021-12-13 14:19:48 +00:00
Moritz Kiefer
82465e2e85
Drop Decimal completely from damlc (#12120)
no need to keep it if we can neither read nor write it.

changelog_begin
changelog_end
2021-12-13 12:30:53 +00:00
Sofia Faro
cbeab4b672
interfaces: Prevent circular and non-closed requirements. (#12073)
* interfaces: Prevent circular and non-closed reqs

Updates the haskell side to be more strict about requirements:
- requirements must be transitively closed, so if A requires B, and B requires C,
  then A requires C.
- no circular requirements allowed

The logic for circular requirements is a bit duplicated to get a better
error message.

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

changelog_begin
changelog_end

* Update compiler/daml-lf-tools/src/DA/Daml/LF/TypeChecker/Check.hs

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* take a list in NotClosed error

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-12-09 14:27:15 +00:00
Sofia Faro
04dd386dcc
interfaces: Add up/downcast in haskell AST (#12048)
Adds EToRequiredInterface and EFromRequiredInterface in
the Haskell AST, and the typechecker.

Part of #11978

changelog_begin
changelog_end
2021-12-08 13:22:08 +00:00
Sofia Faro
1dd813170d
interfaces: Add "requires" field in Haskell AST. (#12016)
* interfaces: Add "requires" field in Haskell AST.

Part of #11978. Adds typechecking for this on the interface and
implementation side.

changelog_begin
changelog_end

* Fix all the errors
2021-12-07 17:01:45 +00:00
Moritz Kiefer
cf172619e5
Drop support for Daml-LF party literals-LF from the Haskell side (#11930)
This PR enforces that forbidPartyLiterals is always `true` and drops
the corresponding literals from the AST in our Haskell code. Scala
code will follow separately.

part of #11581

changelog_begin
changelog_end
2021-12-01 11:00:09 +01:00