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

Add Encoder.at #1537

Closed
wants to merge 5 commits into from
Closed

Add Encoder.at #1537

wants to merge 5 commits into from

Conversation

Lasering
Copy link
Contributor

Closes #1536

@travisbrown
Copy link
Member

Thanks, looks good to me, but do you mind adding a test here?

@Lasering
Copy link
Contributor Author

Lasering commented Sep 16, 2020

Added. Not sure if data should have a more complicated type.

@Lasering
Copy link
Contributor Author

Class Codec no longer compiles because it inherits final member at from both Encoder and Decoder, and JVM does not have reification so we cannot overload a method with different return types.

How do you want to solve this problem? Rename Encoder.at to something else? Suggestions:

  • enclosed
  • inside
  • atField
  • atObject

@travisbrown
Copy link
Member

Oh, right. Another alternative would be to add an implicit x: Dummy argument. Let's see if other people have preferences.

@Lasering
Copy link
Contributor Author

👍 on the dummy implicit.

@Lasering
Copy link
Contributor Author

@travisbrown have you reached a decision on whether to use a different name or a dummy implicit? Meanwhile I changed my opinion. I think using a different, carefully chosen name is simpler and conveys the programmers objective better.

@Lasering
Copy link
Contributor Author

@travisbrown implemented the DummyImplicit

@Lasering
Copy link
Contributor Author

The approach of DummyImplicit fails if we want to implement an at for Codec (which would just return a Codec.from(this.at(field), this.at(field)))

@Lasering Lasering closed this by deleting the head repository Feb 12, 2023
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.

Encoder.at
2 participants