generics - How to declare a covariant type correctly in Scala? -


I have created a property with the following symptoms and methods (descriptions are omitted):

 < Code> property trash [A and lieutenant;: java.io.Serializable] {Def Push (key: string, value: a) = ??? Def bridge (key: string): A = ??? }  

The following code is not compiled (the document class implies java.io.Serializable , and the list tool Scala.Sableializable which extends java.io.Serializable ):

Class Docs enhances service waste [list [document]] {. ..}

The error message said something like this: The Cachable [list [document]] type does not correspond to Cachable [A & lt;: java.io.Serializable].

If I understand the issue properly, the compiler means that Cachable [scala.Serializable] Cachable [java.io.Serializable] Does not have a subtype.

I thought, & lt ;: is like the statement of Java?

How can this fix in scale?

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -