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
typeSerializableList[T<:Serializable] =List[T]
scala>caseclassNetworkDataCC(things: SerializableList[_])
<console>:9:error: typearguments [_$1] do not conform to typeSerializableList'stypeparameter bounds [T<:Serializable]
But this works:
scala>typeSL=SerializableList[_]
defined typealiasSL
scala>caseclassNetworkDataCC(things: SL)
defined classNetworkDataCC
I think redeclaring the bound is the right approach with Scala's current existential implementation. We've tried a few alternatives (see #1786), but haven't found a robust way to avoid that boilerplate.
This doesn't work:
But this works:
You can also workaround it using high-order type:
It's reproducing for case classes only.
The text was updated successfully, but these errors were encountered: