Fix typing of nested decoders in daml2js (#6729)

I accidentally broke this when I added the types (very sorry about
that). Unfortunately while the tests should actually have caught this,
they didn’t because they are also broken. The `&&` results in bash
assuming the exit code is handled and `set -e` doesn’t kick in so
despite an error things proceeded just fine.

The change turns
```
  Add2: (<a_a1Ag>(a_a1Ag: damlTypes.Serializable<a_a1Ag>) => damlTypes.Serializable<Expr2.Add2>);
```
into
```
  Add2: (<a_a1Ag>(a_a1Ag: damlTypes.Serializable<a_a1Ag>) => damlTypes.Serializable<Expr2.Add2<a_a1Ag>>);
```

which is obviuosly what we want and also fixes the test. I did verify
that the tests fail afterwards without the change to daml2js.

changelog_begin
changelog_end
This commit is contained in:
Moritz Kiefer 2020-07-14 21:22:55 +02:00 committed by GitHub
parent 918bae2ed4
commit 4ac0a47c81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -444,7 +444,7 @@ renderSerializableDef SerializableDef{..}
[ "export declare const " <> serName <> " :"
, " (" <> tyArgs <> " => damlTypes.Serializable<" <> serName <> tyParams <> ">) & {"
] ++
[ " " <> n <> ": (" <> tyArgs <> " => damlTypes.Serializable<" <> serName <.> n <> ">);"
[ " " <> n <> ": (" <> tyArgs <> " => damlTypes.Serializable<" <> serName <.> n <> tyParams <> ">);"
| (n, _) <- serNestedDecoders
] ++
[ "};"

View File

@ -65,7 +65,8 @@ PATH=`dirname $YARN`:$PATH $DAML2TS -o daml2js $DAR
# Build, lint, test.
cd build-and-lint-test
$YARN install --pure-lockfile > /dev/null
$YARN run build && $YARN run lint
$YARN run build
$YARN run lint
# Invoke 'yarn test'. Control is thereby passed to
# 'language-support/ts/codegen/tests/ts/build-and-lint-test/src/__tests__/test.ts'.
JAVA=$JAVA SANDBOX=$SANDBOX JSON_API=$JSON_API DAR=$DAR $YARN test