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
Motivation: Given opaque type R[A] = Context ?=> A, I want to allow type conversion R[A] -> A but deny A -> R[A]
// Context.scalaclassContextopaquetypeR[A] =Context?=>AobjectR:defapply[A](a: A):R[A] = a // A.scalavalnum1:R[Int] =R(42) // okvalnum2:R[Int] =42// error because R[A] is opaquegivenContext=newContext() valnum3:Int= num1 +1// ok, evaluation should work for opaque types
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Motivation: Given
opaque type R[A] = Context ?=> A, I want to allow type conversionR[A] -> Abut denyA -> R[A]BetaWas this translation helpful?Give feedback.
All reactions