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

Scala 3 updates #18

Merged
merged 20 commits into from
Jun 8, 2023
Merged

Scala 3 updates #18

merged 20 commits into from
Jun 8, 2023

Conversation

mrdziuban
Copy link
Contributor

@mrdziuban mrdziuban commented Jun 8, 2023

Rewrites the majority of the shapeless-like record typeclasses in typify.labelled (now namespaced under typify.record) and adds a handful of tuple typeclasses (for HLists in scala 2) under the typify.tuple namespace.

There were a number of hurdles but all had workarounds:

This is necessary to fix some implicit resolution errors. Included is an implicit conversion from `K ->> V` back to `V` so in most cases it will still seem like `(K ->> V) <: V`.
This is necessary to work around what I'm assuming is a bug in the scala 3 compiler -- the following code errors when it's simply an opaque type for `V`:

```scala
import typify.tuple._
import typify.record._

val t = ("s" ->> "foo") *: ("i" ->> 3) *: EmptyTuple
val s = Selector[("s" ->> String) *: ("i" ->> Int) *: EmptyTuple, "i"]
// java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.String
```
@mrdziuban mrdziuban merged commit cb291a8 into master Jun 8, 2023
@mrdziuban mrdziuban deleted the scala-3-updates branch June 8, 2023 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant