Skip to content

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

@scabug

Description

@scabug

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions