Skip to content

Conversation

@sjrd
Copy link

@sjrd sjrd commented Nov 27, 2023

Refine the definition of EnumerationUtil.Aux to make it comply with the legal match types of SIP-56. Although weird, it is the "standard" trick for extracting enumeration Value's uner SIP-56.

Refine the result type of EnumerationReader.findEnumValue to be path-dependent instead of using the match type. It is strictly more precise.

Ref scala/improvement-proposals#65, scala/scala3#18262

Refine the definition of `EnumerationUtil.Aux` to make it comply
with the legal match types of SIP-56. Although weird, it is the
"standard" trick for extracting enumeration Value's uner SIP-56.

Refine the result type of `EnumerationReader.findEnumValue` to
be path-dependent instead of using the match type. It is strictly
more precise.
@soronpo
Copy link

soronpo commented Nov 27, 2023

OMG, I didn't even know this syntax was possible

@sjrd
Copy link
Author

sjrd commented Nov 27, 2023

{ type Value } is implicitly AnyRef { type Value}. It's a valid type. Then we create another refinement of that type, so { type Value } { type Value = A } is (AnyRef { type Value }) { type Value = A }. There's nothing surprising if you follow the grammar.

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.

2 participants