Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

daml2ts: Lift type annotation for variant decoders to jtv.oneOf #3994

Merged
merged 1 commit into from
Jan 9, 2020

Conversation

hurryabit
Copy link
Contributor

@hurryabit hurryabit commented Jan 9, 2020

Currently, the generated decoder for, say, Either looks like

() => jtv.oneOf(
  jtv.object<Either<a, b>>(...),
  jtv.object<Either<a, b>>(...),
)

After this PR, the generated code will look like

() => jtv.oneOf<Either<a, b>>(
  jtv.object(...),
  jtv.object(...),
)

That saves us a few type annotations but nothing major.

CHANGELOG_BEGIN
CHANGELOG_END

Pull Request Checklist

  • Read and understand the contribution guidelines
  • Include appropriate tests
  • Set a descriptive title and thorough description
  • Add a reference to the issue this PR will solve, if appropriate
  • Include changelog additions in one or more commit message bodies between the CHANGELOG_BEGIN and CHANGELOG_END tags
  • Normal production system change, include purpose of change in description

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.


This change is Reviewable

Currently, the generated decoder for, say, `Either` looks like
```ts
() => jtv.oneOf(
  jtv.object<Either<a, b>>(...),
  jtv.object<Either<a, b>>(...),
)
```
After this PR, the generated code will look like
```ts
() => jtv.oneOf<Either<a, b>>(
  jtv.object(...),
  jtv.object(...),
)
```
That saves us a few type annotations but nothing major.

CHANGELOG_BEGIN
CHANGELOG_END
@hurryabit hurryabit requested a review from a user January 9, 2020 10:04
@hurryabit
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it works then great.

@mergify mergify bot merged commit 1d07d82 into master Jan 9, 2020
@mergify mergify bot deleted the daml2ts-variant-type-annot branch January 9, 2020 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant