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
inlinedeff(inlinex: Int):Unit= {
inlinevaltwice= x + x
}
deftest:Unit= f(3)
Output
--Error:Foo.scala:7:18-------------------------------------------------------7|deftest:Unit= f(3)
|^^^^|typeof inline must be a known value
|This location contains code that was inlined from Foo.scala:3
result of Foo.scala after typer:
package<empty> {
finallazy module valFoo$package:Foo$package$ =newFoo$package$()
final module classFoo$package$() extendsObject(), _root_.scala.Serializable
{
this:Foo$package.type=>inlinedeff(inlinex: Int):Unit=
{
inlinevaltwice:Int= x.+(x)
()
}:Unitdeftest:Unit=
{
{
inlinevaltwice:Int=6
()
}:Unit
}
}
}
Expectation
When f is inlined, the type of twice should be 6. Therewise we wont be able to inline this value.
deftest:Unit=
{
{
inlinevaltwice:6=6
()
}:Unit
}
The text was updated successfully, but these errors were encountered:
Minimized code
Output
Expectation
When
f
is inlined, the type oftwice
should be6
. Therewise we wont be able to inline this value.The text was updated successfully, but these errors were encountered: