Navigation Menu

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

Repl abhors an inlining #8779

Closed
scabug opened this issue Aug 5, 2014 · 4 comments
Closed

Repl abhors an inlining #8779

scabug opened this issue Aug 5, 2014 · 4 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Aug 5, 2014

$ scala -optimise -Yinline-warnings
Welcome to Scala version 2.11.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_11).
Type in expressions to have them evaluated.
Type :help for more information.

scala> @inline def f(body: =>Unit) = body
f: (body: => Unit)Unit

scala> def g() = f(println("hi"))
<console>:8: warning: Could not inline required method f because bytecode unavailable.
       def g() = f(println("hi"))
                  ^
<console>:8: warning: At the end of the day, could not inline @inline-marked method f
       def g() = f(println("hi"))
                  ^
g: ()Unit

and

$ scala -optimise -Yinline-warnings -Yrepl-class-based
Welcome to Scala version 2.11.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_11).
Type in expressions to have them evaluated.
Type :help for more information.

scala> @inline def f(body: =>Unit) = body
f: (body: => Unit)Unit

scala> def g() = f(println("hi"))
<console>:8: warning: At the end of the day, could not inline @inline-marked method f
       def g() = f(println("hi"))
                  ^
g: ()Unit
@scabug
Copy link
Author

scabug commented Aug 5, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8779?orig=1
Reporter: @som-snytt
Affected Versions: 2.12.0

@scabug
Copy link
Author

scabug commented Nov 12, 2016

@som-snytt said:
At the end of the day,

$ scala -Dscala.repl.info -opt:inline-global -opt-warnings:_ 
Welcome to Scala 2.12.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_111).
Type in expressions for evaluation. Or try :help.
[info] started at Sat Nov 12 01:44:37 PST 2016

scala 2.12.0> <console>:11: warning: failed to determine if value should be inlined:
The method value()Lscala/tools/nsc/interpreter/IMain; could not be found in the class  or any of its parents.
Note that class  could not be found on the classpath.
              val $intp = value
                                       ^


scala 2.12.0> @inline def f(body: => Unit) = body
f: (body: => Unit)Unit

scala 2.12.0> def g() = f(println("hi"))
<console>:12: warning: failed to determine if f should be inlined:
The method f(Lscala/Function0;)V could not be found in the class  or any of its parents.
Note that class  could not be found on the classpath.
              def g() = f(println("hi"))
                         ^
g: ()Unit


@scabug
Copy link
Author

scabug commented Nov 16, 2016

@SethTisue said:
I've changed the "Affects version" to just 2.12.0 since that's the only version of the issue that could plausibly receive a fix, giving the changeover of back ends.

@scabug
Copy link
Author

scabug commented Nov 18, 2016

@retronym said:
scala/scala#5544

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants