-
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.
Mechanism to exclude l:none from -opt:_ (#8454)
Mechanism to exclude l:none from -opt:_
- Loading branch information
Showing
6 changed files
with
72 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
t11746.scala:18: warning: failed to determine if e should be inlined: | ||
The method e()Ljava/lang/Throwable; could not be found in the class java/lang/Object or any of its parents. | ||
case Failure(e) => println(e.toString) | ||
^ | ||
error: No warnings can be incurred under -Werror. | ||
one warning found | ||
one error found |
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,20 @@ | ||
// | ||
// scalac: -Werror -opt:l:inline -opt-inline-from:'**' -opt-warnings:none,_ | ||
// | ||
// compare -opt-warnings:none,at-inline-failed-summary | ||
|
||
trait Try | ||
|
||
object Try { | ||
def apply(s: String): Try = Success(s) | ||
} | ||
|
||
case class Success(s: String) extends Try | ||
case class Failure(e: Throwable) extends Try | ||
|
||
class C { | ||
private def get(a: String): Unit = Try(a) match { | ||
case Failure(e: Exception) => | ||
case Failure(e) => println(e.toString) | ||
} | ||
} |
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,23 @@ | ||
|
||
import scala.tools.partest.DirectTest | ||
import scala.tools.nsc.reporters.{Reporter, StoreReporter} | ||
import scala.tools.nsc.Settings | ||
import scala.tools.nsc.util.stringFromStream | ||
|
||
object Test extends DirectTest { | ||
|
||
override def extraSettings = "-usejavacp -opt:_ -opt-inline-from:** -Vinline _" | ||
|
||
override def reporter(settings: Settings): Reporter = new StoreReporter(settings) | ||
|
||
override def code = "class C { def f = locally(42) }" | ||
|
||
override def show() = { | ||
val res = stringFromStream { os => | ||
Console.withOut(os) { | ||
assert(compile()) | ||
} | ||
} | ||
assert(res.startsWith("Inlining into C.f")) | ||
} | ||
} |
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