Commit 1f8fc57d authored by Romain Reuillon's avatar Romain Reuillon
Browse files

[Core] fix: missing implicits in scala code

parent bf7cced4
......@@ -18,13 +18,13 @@ package org.openmole.core.code
import org.openmole.core.workspace._
import org.openmole.tool.file.FilePackage
import org.openmole.tool.random
import org.openmole.tool.random.RandomProvider
import org.openmole.tool.statistics.StatisticsPackage
trait CodePackage extends FilePackage with StatisticsPackage with MathPackage {
def Random(seed: Long): java.util.Random = random.Random.apply(seed)
def Random(seed: Long): java.util.Random = org.openmole.tool.random.Random.apply(seed)
def Random()(implicit randomProvider: RandomProvider): java.util.Random = newRandom(randomProvider().nextLong())
def random(implicit randomProvider: RandomProvider) = randomProvider()
@deprecated("8.0")
def newRNG(seed: Long): java.util.Random = Random(seed)
......
......@@ -150,8 +150,9 @@ object ScalaCompilation {
| ${inputs.toSeq.map(i ⇒ s"""var ${i.name} = ${prefix}context("${i.name}").asInstanceOf[${toScalaNativeType(i.`type`)}]""").mkString("; ")}
| }
| import ${inputObject}._
| implicit lazy val ${Val.name(Variable.openMOLENameSpace, "RNG")}: util.Random = ${prefix}RNG()
| implicit lazy val ${Val.name(Variable.openMOLENameSpace, "NewFile")} = ${prefix}NewFile
| implicit def ${Val.name(Variable.openMOLENameSpace, "RNGProvider")} = ${prefix}RNG
| implicit def ${Val.name(Variable.openMOLENameSpace, "NewFile")} = ${prefix}NewFile
|
| $source
| ${wrapping.wrapOutput}
| }: ${toScalaNativeType(returnType)}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment