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

docs: annotate Yolo value with type #2075

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

evertedsphere
Copy link

Fixes some strange errors I get with Scala 3 when following the tutorial:

val yolo = xa.yolo
import yolo.*
[E] [E2] src/main/scala/Main.scala:34:8
[E]      yolo.Option does not take type parameters
[E]      L34:   gnp: Option[Double],
[E]                  ^^^^^^^^^^^^^^^
[E] [E1] src/main/scala/Main.scala:19:42
[E]      import yolo.* needs result type because its right-hand side attempts implicit search
[E]
[E]       Run with -explain-cyclic for more details.
[E]      L19: val xa = Transactor.fromDriverManager[IO](
[E]                                                    ^
[E] src/main/scala/Main.scala: L19 [E1], L34 [E2]

Adding a type annotation fixes this and (I think) should be backwards-compatible with Scala 2, so I figured I'd raise a PR for this.

@mergify mergify bot added the docs label Aug 4, 2024
@evertedsphere
Copy link
Author

I suppose the type signature would also have to be added everywhere else that mentions YOLO mode, unless there's a way to eliminate the problem altogether and fix the type inference? (It happens to be my first day writing Scala, so I wouldn't know yet.)

Copy link
Collaborator

@jatcwang jatcwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I'll see whether there's a way to make this work nicely in Scaal 3 without type annotation

@jatcwang
Copy link
Collaborator

jatcwang commented Aug 5, 2024

@evertedsphere Welcome to Scala 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants