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
Here is the block of code to reproduce the problem:
objectTestItextendsApp {
{ // if you remove this bracket block, the compiler does not complaindefmemoize1[A, B](f: A=>B):Function1[A, B] =newFunction1[A, B] {
valresults= collection.mutable.Map.empty[A, B]
defapply(in: A) = results.getOrElseUpdate(in, f(in))
}
valmaxLatency1:Function1[(Int, Int), Int] = memoize1 { t: (Int, Int) =>val (s, d) = t
if (s == d) 0else {
maxLatency1((1, 2))
}
}
} // end of block
}