-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Given conversion loosing type, when inlined #8276
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
Labels
Comments
It works fine if I give the default argument explicitly:
There's a little too much going on here at the same time. To rely on an implicit conversion to make a default argument conform to the indicated type is a bit crazy. The problem might go away by itself if we redesign default arguments. Until then it's better to wait. |
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Jun 12, 2020
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Jun 12, 2020
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Jun 12, 2020
Workaround object NOTHING
inline given [A]: Conversion[NOTHING.type, Option[A]] = _ => None
def apply[A](p: Vector[A], o: Option[A] = NOTHING: Option[A]): Unit = ???
def test = apply[String](Vector.empty)
|
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 12, 2021
Closes scala#8276
Merged
michelou
pushed a commit
to michelou/scala3
that referenced
this issue
Apr 13, 2021
Closes scala#8276
michelou
pushed a commit
to michelou/scala3
that referenced
this issue
Apr 14, 2021
Closes scala#8276
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The code does not compile, but would compile if 'inline' is removed.
Introduced in 0.22, was fine in 0.21
The text was updated successfully, but these errors were encountered: