import Importable.*
inline def fragment: Shader[FragEnv, Int] =
Shader { _ =>
val value = 10
addOne(value)
}
Scala 3.3.x
Unfortunately the way inlines are represented in the AST has now changed, and the old method does not work anymore. Luckily there is a simple, if boring, workaround. All we have to do is create a local proxy with the same signature that delegates to the original function:
import Importable.*
inline def fragment: Shader[FragEnv, Int] =
Shader { _ =>
val proxy: Int => Int = addOne
val value = 10
proxy(value)
}
Upgrades Ultraviolet to Scala 3.3.0, as well as other deps and the examples..
The only thing to really know is that calling external inlined functions doesn't work the way it used to. Here's a simple example...
Given an object called
Importable
:In Scala 3.2.x
This used to work:
Scala 3.3.x
Unfortunately the way inlines are represented in the AST has now changed, and the old method does not work anymore. Luckily there is a simple, if boring, workaround. All we have to do is create a local proxy with the same signature that delegates to the original function: