Skip to content

add getField method to Record - #1201

Merged
fwbrasil merged 3 commits into
getkyo:mainfrom
road21:get-field-record
May 26, 2025
Merged

fwbrasil merged 3 commits into
getkyo:mainfrom
road21:get-field-record

Conversation

@road21

@road21 road21 commented May 23, 2025

Copy link
Copy Markdown
Contributor

Closes #1200

* @param name
* The field name to look up
*/
def getField[Name <: String & Singleton, Value](using

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you use clause interleaving to make Value inferred? ithink the ValueOf can be put after the first type parameter.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

agreed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

AnyVal doesn't play well with multiple type arg groups
scala/scala3#23266

I can remove extends AnyVal temporary (I hope), would It be ok?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think avoiding the allocation is more important. Could you open an issue on our side as well so we can follow up if the compiler gets fixed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@fwbrasil fwbrasil left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM besides the lack of clause interleaving in getField

@fwbrasil
fwbrasil merged commit 8614018 into getkyo:main May 26, 2025
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.

[data] Support any field name in Records

3 participants