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
scala>lazyvala:Int= a
lazyvala:Int
scala> a
<hangs>
Suggestion
In Scala 2 this situation results in a stack overflow, but in Scala 3 it hangs awaiting an object monitor. It also happens with given values that reference themselves directly, which seem to desugar to a lazy val. I ran into this when someone new to doobie was trying to bring an instance into scope by saying
givenMeta[Json] =Meta[Json]
and his program deadlocked trying to summon the instance. This ends up being a common beginner mistake.
In any case my suggestion is that we detect at least this specific case at compile time because it can be very hard to track down.
The text was updated successfully, but these errors were encountered:
Compiler version
3.0.0
Minimized code
Suggestion
In Scala 2 this situation results in a stack overflow, but in Scala 3 it hangs awaiting an object monitor. It also happens with
given
values that reference themselves directly, which seem to desugar to alazy val
. I ran into this when someone new to doobie was trying to bring an instance into scope by sayingand his program deadlocked trying to summon the instance. This ends up being a common beginner mistake.
In any case my suggestion is that we detect at least this specific case at compile time because it can be very hard to track down.
The text was updated successfully, but these errors were encountered: