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 2.13: Block result was adapted via implicit conversion (method apply) taking a by-name parameter #1513

Closed
alonsodomin opened this issue Aug 4, 2021 · 2 comments

Comments

@alonsodomin
Copy link

Facing the following compilation error in Scala 2.13.6:

[error] [...]/cron4s/modules/doobie/src/test/scala/cron4s/doobie/DoobieSpec.scala:65:13: Block result was adapted via implicit conversion (method apply) taking a by-name parameter
[error]       .query[Meeting]
[error]             ^
[error] one error found

The code that is failing to compile is as follows:

def loadMeeting(meetingId: MeetingId): ConnectionIO[Meeting] =
    sql"select subject, description, frequency from meeting where meeting_id = $meetingId"
      .query[Meeting]
      .unique

The previous method can be found in context in the following link: https://github.com/alonsodomin/cron4s/blob/8eddf262965d6ff4ec574ca1fcdde12397994248/modules/doobie/src/test/scala/cron4s/doobie/DoobieSpec.scala#L63

The code compiles in Scala 2.12, the compile error can be found in the following GitHub action log:
https://github.com/alonsodomin/cron4s/runs/3240652398?check_suite_focus=true#step:6:50

@jatcwang
Copy link
Collaborator

jatcwang commented Aug 4, 2021

I suspect this is related to shapelss Lazy according to scala/bug#12072

Since Doobie still supports 2.12 and probably will for a while, I don't think we can stop using Lazy. Does adding the flag (as suggested in the linked issue) help?

@alonsodomin
Copy link
Author

You are right, adding the flag when using Scala 2.13 removes the problem. Thanks.

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

No branches or pull requests

2 participants