com-lihaoyi / upickle

uPickle: a simple, fast, dependency-free JSON & Binary (MessagePack) serialization library for Scala
https://com-lihaoyi.github.io/upickle
MIT License
721 stars 165 forks source link

WIP: Named tuples #641

Closed Quafadas closed 6 hours ago

Quafadas commented 1 week ago

Compiling fails with this;

[1/1] show
[1-148/162] upickle_named_tuples.jvm[3.6.1].compile
[1-148] [info] compiling 1 Scala source to /Users/simon/Code/upickle/out/upickle_named_tuples/jvm/3.6.1/compile.dest/classes ...
[1-148] [error] -- [E008] Not Found Error: /Users/simon/Code/upickle/upickle_named_tuples/src/NamedTupleReadWriter.scala:4:15 
[1-148] [error] 4 |import upickle.default.*
[1-148] [error]   |       ^^^^^^^^^^^^^^^
[1-148] [error]   |       value default is not a member of upickle
[1-148] [error] -- [E046] Cyclic Error: /Users/simon/Code/upickle/upickle_named_tuples/src/NamedTupleReadWriter.scala:8:45 
[1-148] [error] 8 |  inline given [N <: Tuple, V <: Tuple, T <: NamedTuple[N, V]]: ReadWriter[T] =
[1-148] [error]   |                                             ^
[1-148] [error]   |                               Cyclic reference involving val <import>
[1-148] [error]   |
[1-148] [error]   |                                Run with -explain-cyclic for more details.
[1-148] [error]   |
[1-148] [error]   | longer explanation available when compiling with `-explain`
[1-148] [error] -- [E008] Not Found Error: /Users/simon/Code/upickle/upickle_named_tuples/src/NamedTupleReadWriter.scala:3:13 
[1-148] [error] 3 |import scala.NamedTuple.NamedTuple
[1-148] [error]   |       ^^^^^^^^^^^^^^^^
[1-148] [error]   |       value NamedTuple is not a member of scala
[1-148] [error] three errors found

Which makes me think I've stuffed up the build horridly, as it apparently doesn't resolve either pickle or named tuples.

I can't see how tho - if anyone is willing to point me in the right direction I'd be grateful

Quafadas commented 6 hours ago

I believethat modules can't easily depend on different scala 3 versions, which makes this PR painful to do in a reasonable way.

Conclusion, wait until scala has an LTS > 3.6.x