- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
A collection of LinearSeqLike
Tue, 2012-01-24, 16:36
Dear All,I would like to implement something like thatclass MultipleCollection[A](items:IndexedSeq[LinearSeqLike[A,_]){
def filter = new example(items.map(_.filter)); }
this does not work because the _ is resolved to Any, and therefore filter returns any.
How does one solve this?
Best Regards
Edmondo
def filter = new example(items.map(_.filter)); }
this does not work because the _ is resolved to Any, and therefore filter returns any.
How does one solve this?
Best Regards
Edmondo
What is the problem of adding a B to the type parameters and writing
LienarSeqLike[A, B]?
On Tue, Jan 24, 2012 at 13:36, Edmondo Porcu wrote:
> Dear All,
> I would like to implement something like that
> class MultipleCollection[A](items:IndexedSeq[LinearSeqLike[A,_]){
>
> def filter = new example(items.map(_.filter));
> }
>
> this does not work because the _ is resolved to Any, and therefore filter
> returns any.
>
> How does one solve this?
>
> Best Regards
>
> Edmondo