-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Align warnings / semantics with -Xsource:3 / 3-X
- Loading branch information
Showing
25 changed files
with
495 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
deprecationsFor3.scala:4: warning: Unicode escapes in triple quoted strings are deprecated; use the literal character instead | ||
def inTripleQuoted = """\u0041""" // deprecation | ||
^ | ||
deprecationsFor3.scala:16: warning: Line starts with an operator that in future | ||
will be taken as an infix expression continued from the previous line. | ||
To force the previous interpretation as a separate statement, | ||
add an explicit `;`, add an empty line, or remove spaces after the operator. | ||
`x` (42) // migration | ||
^ | ||
deprecationsFor3.scala:5: warning: Unicode escapes in raw interpolations are deprecated; use literal characters instead | ||
def inRawInterpolation = raw"\u0041" // deprecation | ||
^ | ||
deprecationsFor3.scala:6: warning: Unicode escapes in raw interpolations are deprecated; use literal characters instead | ||
def inRawTripleQuoted = raw"""\u0041""" // deprecation | ||
^ | ||
deprecationsFor3.scala:29: warning: Implicit definition should have explicit type (inferred String => Option[Int]) [quickfixable] | ||
implicit def b = _.toIntOption // error | ||
^ | ||
deprecationsFor3.scala:31: warning: Implicit definition should have explicit type (inferred String) [quickfixable] | ||
implicit def s = "" // error | ||
^ | ||
deprecationsFor3.scala:30: warning: Implicit definition should have explicit type (inferred Int) [quickfixable] | ||
implicit val i = 0 // error | ||
^ | ||
deprecationsFor3.scala:34: warning: method any2stringadd in object Predef is deprecated (since 2.13.0): Implicit injection of + is deprecated. Convert to String to call + | ||
object AnyPlus { def f(xs: List[Int]) = xs + ";" } | ||
^ | ||
deprecationsFor3.scala:38: warning: shadowing a nested class of a parent is deprecated but class X shadows class X defined in class A; rename the class to something else | ||
class B extends A { class X; def f = new X } | ||
^ | ||
error: No warnings can be incurred under -Werror. | ||
9 warnings | ||
1 error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
//> using options -deprecation -Xmigration -Werror | ||
|
||
object UnicodeEscapes { | ||
def inTripleQuoted = """\u0041""" // deprecation | ||
def inRawInterpolation = raw"\u0041" // deprecation | ||
def inRawTripleQuoted = raw"""\u0041""" // deprecation | ||
} | ||
|
||
object InfixNewline extends App { | ||
class K { def x(y: Int) = 0 } | ||
|
||
def x(a: Int) = 1 | ||
|
||
def ok = { | ||
(new K) | ||
`x` (42) // migration | ||
} | ||
} | ||
|
||
case class CaseCompanionMods private (x: Int) // nothing | ||
|
||
trait InferredBase { def f: Object } | ||
object InferredSub extends InferredBase { def f = "a" } // nothing | ||
|
||
trait ExplicitImplicitsBase { | ||
implicit def b: String => Option[Int] | ||
} | ||
object ExplicitImplicits extends ExplicitImplicitsBase { | ||
implicit def b = _.toIntOption // error | ||
implicit val i = 0 // error | ||
implicit def s = "" // error | ||
} | ||
|
||
object AnyPlus { def f(xs: List[Int]) = xs + ";" } | ||
|
||
object NameShadowing { | ||
class A { class X } | ||
class B extends A { class X; def f = new X } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// scalac: -Xsource:3 -Vimplicits | ||
// scalac: -Xsource:3-X -Vimplicits | ||
// | ||
object Test { | ||
true + "what" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
source3Xneg.scala:47: error: value + is not a member of List[Int] | ||
object AnyPlus { def f(xs: List[Int]) = xs + ";" } | ||
^ | ||
source3Xneg.scala:56: error: method copy in class CaseCompanionMods cannot be accessed as a member of CaseCompanionMods from object Test | ||
CaseCompanionMods.i.copy(CaseCompanionMods(2).x) // 2 errors | ||
^ | ||
source3Xneg.scala:56: error: method apply in object CaseCompanionMods cannot be accessed as a member of object CaseCompanionMods from object Test | ||
error after rewriting to CaseCompanionMods.<apply: error> | ||
possible cause: maybe a wrong Dynamic method signature? | ||
CaseCompanionMods.i.copy(CaseCompanionMods(2).x) // 2 errors | ||
^ | ||
source3Xneg.scala:60: error: value toUpperCase is not a member of Object | ||
InferredSub.f.toUpperCase // error | ||
^ | ||
source3Xneg.scala:44: warning: Implicit definition must have explicit type (inferred String) [quickfixable] | ||
implicit def s = "" // error | ||
^ | ||
source3Xneg.scala:43: warning: Implicit definition must have explicit type (inferred Int) [quickfixable] | ||
implicit val i = 0 // error | ||
^ | ||
2 warnings | ||
4 errors |
Oops, something went wrong.