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

New warnings prevent absolute 2.10 compatibility under -Xfatal-warnings #7195

Closed
scabug opened this issue Feb 28, 2013 · 11 comments
Closed

New warnings prevent absolute 2.10 compatibility under -Xfatal-warnings #7195

scabug opened this issue Feb 28, 2013 · 11 comments
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Feb 28, 2013

From Rex Kerr

bq. Note that the change in behavior in 2.10.1 to throw warnings for stuff like
bq. maths/package.scala:1281: warning: class OutlierDist should be placed directly in package maths instead of package object maths. Under some circumstances companion objects and case classes in package objects can fail to recompile. See #5954.
bq. and also
bq. mwt/MultiSensed.scala:143: warning: The outer reference in this type test cannot be checked at run time. final case class NotValid(val i0: Int, val i1: Int) extends Chunk {}
bq. means that I can no longer run with -Xfatal-warnings, which was how I found all the places I needed to import language.whatever; now any new instances will be lost in the screensfull of warnings.
bq. Incidentally, is there a way to make the latter warning go away? I don't want to push the trait and case classes out of the enclosing class since they don't make any logical sense elsewhere and they are class-relative information (despite not linking back to the superclass). But I would like to be able to declare that I don't intend to check that aspect of the type at runtime; compile time is sufficient. (I realize that I could just refer to the enclosing class, but I'd rather avoid the extra field since there will be millions of these things.) If the underlying bug for 5954 is fixed, I'd want to fix these also so I can -Xfatal-warnings again.

@scabug
Copy link
Author

@scabug scabug commented Feb 28, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7195?orig=1
Reporter: @JamesIry
Affected Versions: 2.10.1-RC1, 2.10.1-RC2

@scabug
Copy link
Author

@scabug scabug commented Feb 28, 2013

@JamesIry said (edited on Feb 28, 2013 5:16:07 PM UTC):
One option is to get rid of the warnings entirely from the 2.10.1 and 2.10.x branches and just live with the pain that the underlying issues cause.

Another option is to add some mechanism for suppressing the warnings. That's not going to be forward binary compatible because Settings leaks into the public API via reflect.

A third option is to not guarantee compatibility under -Xfatal-warnings

What's probably not an option is to fix the underlying issues being warned about in an RC. For the first warning we don't even know what the fix is but we know it involves some deeply bad stuff happening in the compiler that's been happening at least since 2.9. It's very likely that fixing it would break compatibility. Fixing the second would absolutely break compatibility.

@scabug
Copy link
Author

@scabug scabug commented Feb 28, 2013

@JamesIry said:
A variant of the third option that Adriaan proposed is hiding the new warnings under -Xlint (or some other warning flag). Then we'd be incompatible with the combination -Xlint -Xfatal-warnings.

@scabug
Copy link
Author

@scabug scabug commented Feb 28, 2013

@som-snytt said:
There's scalac -Xfuture. Why is there no scalac -Xpast?

where the past is understood to extend to the last major release, ignoring all other evolutionary history, as one does when counting the generations to Adam.

@scabug
Copy link
Author

@scabug scabug commented Feb 28, 2013

@JamesIry said:
Another option is to make the new warnings not fatal under -Xfatal-warnings in 2.10.1.

@scabug
Copy link
Author

@scabug scabug commented Feb 28, 2013

@JamesIry said (edited on Feb 28, 2013 7:18:15 PM UTC):
A variant on option 1 is to make them not warnings, but dump to console under -Ydebug.

@scabug
Copy link
Author

@scabug scabug commented Feb 28, 2013

@retronym said (edited on Feb 28, 2013 9:58:38 PM UTC):
Hijacking this ticket: could we please tone the following down to debugwarn while we're at it? The user has no recourse but worried head scratching.

"[warn] /Users/jason/code/scalaz/concurrent/src/main/scala/scalaz/concurrent/Actor.scala:52: Visited SCOPE_EXIT before visiting corresponding SCOPE_ENTER. SI-6049"

@scabug
Copy link
Author

@scabug scabug commented Feb 28, 2013

@JamesIry said:
Is it a new warning in 2.10.1-RCx that prevents compatibility under -Xfatal-warnings? If not it goes in another ticket.

@scabug
Copy link
Author

@scabug scabug commented Feb 28, 2013

@retronym said:
It's unfinished business in SI-6049, I noticed a trickle of confusion in the comments over there, and I just got the warning myself. But it's been around since 2.10.0, so it's a regresson against 2.9.2 with -Xfatal-warnings. I'll lodge another ticket.

@scabug
Copy link
Author

@scabug scabug commented Mar 2, 2013

@adriaanm said:
It looks like I'm assigned, so I'll take door number 1, the -Ydebug variant.

@scabug
Copy link
Author

@scabug scabug commented Mar 2, 2013

@scabug scabug closed this Mar 4, 2013
@scabug scabug added this to the 2.10.1 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants