You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lucmac:sandbox luc$ javac A.java
lucmac:sandbox luc$ qsc -Yopt:l:classpath -Yopt-warnings:_ Test.scala A.java
Test.scala:2: warning: there was a problem determining if method bar can be inlined:
No inline information for method A::bar()I could be found.
@inline final def foo = A.bar()
^
one warning found
Here's the InlineInfo for A (copied from the debugger), note that method bar is not in there:
Probably related to the fact that bar is static. Check how the inline info is built: from classfile? symbol? note that A.java is being "compiled". When A.java is not passed to scalac (A.class read from the classpath), there's no warning.
The text was updated successfully, but these errors were encountered:
Calls to synthetic case class apply methods are inlined to the
underlying constructor invocation in refchecks.
However, this can lead to accessibility errors if the constructor
is private.
This commit ensures that the constructor is at least as accessible
as the apply method before performing this tranform.
I've manually checked that other the optimization still works in other
cases:
scala> class CaseApply { Some(42) }
defined class CaseApply
scala> :javap -c CaseApply
Compiled from "<console>"
public class CaseApply {
public CaseApply();
Code:
0: aload_0
1: invokespecial #9 // Method java/lang/Object."<init>":()V
4: new #11 // class scala/Some
7: dup
8: bipush 42
10: invokestatic #17 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer;
13: invokespecial #20 // Method scala/Some."<init>":(Ljava/lang/Object;)V
16: pop
17: return
}
Uh oh!
There was an error while loading. Please reload this page.
A.java
Test.scala
Here's the InlineInfo for A (copied from the debugger), note that method
bar
is not in there:Probably related to the fact that
bar
is static. Check how the inline info is built: from classfile? symbol? note that A.java is being "compiled". When A.java is not passed to scalac (A.class read from the classpath), there's no warning.The text was updated successfully, but these errors were encountered: