Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Failed attempt to resolve the warnings via implicit priorities #617

Closed
wants to merge 1 commit into from

Conversation

MateuszKubuszok
Copy link
Member

@MateuszKubuszok MateuszKubuszok commented Oct 3, 2024

This PR was created only to document that using implicit priorities to solve the new 3.7-givens behavior have failed: Scala 3.5.1 still generates the warnings that would become failures in 3.7.

[warn] -- Warning: /home/runner/work/chimney/chimney/chimney/src/test/scala-3/io/scalaland/chimney/IssuesScala3Spec.scala:19:38 
[warn] 19 |    Foo(1, "value").transformInto[Bar] ==> Bar(10, "value")
[warn]    |                                      ^
[warn]    |Given search preference for io.scalaland.chimney.Transformer.AutoDerived[Foo, Bar] between alternatives
[warn]    |  (Foo.totalTransformer : io.scalaland.chimney.Transformer[Foo, Bar])
[warn]    |and
[warn]    |  (io.scalaland.chimney.Transformer.AutoDerived.deriveAutomatic :
[warn]    |  [From, To]: io.scalaland.chimney.Transformer.AutoDerived[From, To])
[warn]    |will change.
[warn]    |Current choice           : the first alternative
[warn]    |New choice from Scala 3.7: none - it's ambiguous
[warn] -- Warning: /home/runner/work/chimney/chimney/chimney/src/test/scala-3/io/scalaland/chimney/IssuesScala3Spec.scala:20:45 
[warn] 20 |    Foo(1, "value").transformIntoPartial[Bar].asOption.get ==> Bar(20, "value")
[warn]    |                                             ^
[warn]    |Given search preference for io.scalaland.chimney.PartialTransformer.AutoDerived[Foo, Bar] between alternatives
[warn]    |  (Foo.partialTransformer : io.scalaland.chimney.PartialTransformer[Foo, Bar])
[warn]    |and
[warn]    |  (io.scalaland.chimney.PartialTransformer.AutoDerived.deriveAutomatic :
[warn]    |  [From, To]: io.scalaland.chimney.PartialTransformer.AutoDerived[From, To])
[warn]    |will change.
[warn]    |Current choice           : the first alternative
[warn]    |New choice from Scala 3.7: none - it's ambiguous
[warn] -- Warning: /home/runner/work/chimney/chimney/chimney/src/test/scala-3/io/scalaland/chimney/IssuesScala3Spec.scala:21:39 
[warn] 21 |    Foo(1, "value").patchUsing(Baz(30)) ==> Foo(30, "patched")
[warn]    |                                       ^
[warn]    |Given search preference for io.scalaland.chimney.Patcher.AutoDerived[Foo, Baz] between alternatives
[warn]    |  (Foo.patcher : io.scalaland.chimney.Patcher[Foo, Baz])
[warn]    |and
[warn]    |  (io.scalaland.chimney.Patcher.AutoDerived.deriveAutomatic :
[warn]    |  [A, Patch]: io.scalaland.chimney.Patcher.AutoDerived[A, Patch])
[warn]    |will change.
[warn]    |Current choice           : the first alternative
[warn]    |New choice from Scala 3.7: none - it's ambiguous

I gave up on fixing this issue in backward compatible way, the only way I found - https://scastie.scala-lang.org/eKrwKqN8S2uHp5pjr61uiw - is a breaking change that might not be cross-compilable.

@MateuszKubuszok MateuszKubuszok deleted the fix-warning-on-3.7 branch December 18, 2024 22:40
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant