-
Notifications
You must be signed in to change notification settings - Fork 21
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
reconsider removal of -Yno-adapted-args in 2.13 #11110
Comments
There doesn't seem to be a warning without the flag, though. |
You need to use That said, I always turn on |
Duplicate of scala/scala-dev#496, I'd say. |
yes, this "feature" is on its slow way out of existence.
ah, right, thanks for the correction. note that this warning has been part of
I see your point, but that one's targeted for 2.13.1. I opened this ticket specifically to ask what we're going to do for 2.13.0-RC1/2.13.0, since changes have already been made in this area in the milestones. |
I think that one should target RC1. |
For migration to dotty, we can adjust adaption use -Xsource. Since we're out of time for RC1, re-scheduling for 2.13.1. If someone manages to fix this for the RC1, that's fine too, but we won't hold up the RCs for this. |
@szeiger's Scala Days talk has a slide on this. from https://downloads.lightbend.com/website/scaladays/2018/ny/slides/migrating-to-scala-2-13.pdf |
@adriaanm Does it even make sense to revert this in 2.13.1 (or later) now that 2.13.0 shipped without the option? |
(IMO yes. most open-source libraries are already on 2.13, but most Scala users aren't yet) |
As useful as this is, I don't want to regress on our policy, nor remove the pressure to actually implement the migration under -Xsource. For now, the warning + fatal warning will have to suffice. |
I don't follow. Are you proposing that certain source levels enable or disable the warnings automatically? If so, which ones? |
No, I wasn't thinking of the warnings. They are still available, right? I'm referring to the change to the adapt logic that actually prevented the insertion of A "future" (i.e. 2.14 or 3.0) source level will implement (a refinement of) the policy implemented by We're talking about not inserting |
So you're saying we should not restore |
You're right, it would not be a lot of work to bring back, but then there's less incentive to switch to the -Xsource mechanism, which provides a more coherent upgrade-prep experience. |
There's apparently a single use case where auto-tupling is useful, so I suggested in https://contributors.scala-lang.org/t/lets-drop-auto-tupling/1799/14?u=eed3si9n that we create an opt-in marker called def foo[A](params: A): Unit = println(params.toString)
def bar[A: ParamList](params: A): Unit = println(params.toString) so foo(1, "hello", Option(3)) // won't compile
bar(1, "hello", Option(3)) // prints (1, "hello", Option(3)) |
While we're still considering things, I'm rescheduling this for 2.13.2. |
given that we still have |
I also wanted to have something like
For me it does not work:
The new configurable warning convention does not work:
I could use |
right. thank you for the correction but note also that it's included in
as for the turning the warning into an error,
note that I'm running a nightly build, since 2.13.2 isn't released yet |
yeah — it isn't clear to me why some things are |
Warnings that are not noisy and also "recommended" can be promoted to lint. E.g.,
The borderline promotable warnings IMHO are numeric-widen and value-discard. |
I'm confused why
-Yno-adapted-args
got the axe (in scala/scala#6505, under the umbrella ofscala/scala-dev#430)
might this have been overzealous?
-Yno-adapted-args
is both widely used and useful IMOand it only causes "language fragmentation" in the sense that it makes some code — code that has been producing compiler warnings since Scala 2.11 (EDIT: under
-Xlint
, that is, not by default) — give a hard error instead of a warningif we were to get rid of argument adaptation entirely, as I expect to happen in Scala 2.14 and/or Scala 3, then it will make sense to remove the flag at that time. but I don't see that it makes sense to remove now
The text was updated successfully, but these errors were encountered: