Unexpected result mapping a PathSet

28 views
Skip to first unread message

Daniel Sobral

unread,
Apr 24, 2013, 2:26:58 PM4/24/13
to scala-i...@googlegroups.com
I wanted to get the filenames from a PathSet, so I tried doing this:

ps.map(_.name)

That, unexpectedly, doesn't really work. Well, it works, but the result is not a PathSet[String]. Instead, the result is:

scalax.file.PathSet[Comparable[_ >: String with scalax.file.Path <: Comparable[_ >: String with scalax.file.Path <: Comparable[_ >: String with scalax.file.Path <: Object]]]]

It works if I use breakOut, and it works if I transform it into something other than a PathSet first.

Is this truly necessary, or could it be solved by dropping a covariance or moving some implicit to a lower priority?

--
Daniel C. Sobral

I travel to the future all the time.

Jesse Eichar

unread,
Apr 29, 2013, 3:53:18 AM4/29/13
to scala-i...@googlegroups.com
Hmmm.  THought I already sent this email.  SOrry it is so late:


I can take a look.  One of the reasons for the type signature is to permit the +++, ---, etc... operations.  It is possible (and preferable) to be able to get the PathSet[String] from your example and I will make a ticket to that effect and see if I can make it happen.

Jesse


--
 
---
You received this message because you are subscribed to the Google Groups "Scala Incubator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-incubat...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages