Scala type error

what is problem with blow code. I’m getting “type mismatch; found : Long required: Int => Long” in println(delay(time(12))) line

object DelayFunction {

def time(t:Int):Long = {
println(“Now I’m entering time method”)
System.nanoTime()
}
def delay(t: => Long) = {

println("So farnot called")
println("Now calling : "+t)
t

}

def main(args: Array[String]): Unit = {
println(delay(time(12)))
}

}

Try this code below:
Issue is input of delay should be a function but in ur code u are passing in Long…Also u don’t need main in object
object DelayFunction {
|
| println(delay(time(12)))
| def time(t:Int):Long = {
| println(“Now I’m entering time method”)
| System.nanoTime()
| }
| def delay(t:Long):Long = {
|
| println(“So farnot called”)
| println("Now calling : "+t)
| t
| }

Thanks naveen. My code is passing time function with parameter as 12. see the below code without passing parameter and its working fine. I just modified below code with passing parameter to time function.
object DelayFunction {

def time():Long = {
println(“Now I’m entering time method”)
System.nanoTime()
}
def delay(t: => Long) = {

println("So farnot called")
println("Now calling : "+t)
t

}
def main(args: Array[String]): Unit = {
println(delay(time()));
}

}