--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-languag...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
For calls flatMap on each element, and you can't call methods on null.Hello,
DMY(optYear) = sd
for (sd <- sdLst if sd != null; DMY(optYear) = sd; y <- optYear)yield y
val sdLst = List(Option("10.12.95"), Option(null), Option(""), Option("01.04.97)", Option("1.4.97"))for (sdO <- sdLst; sd <- sdO; DMY(optYear) = sd; y <- optYear)yield y
--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-language+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-languag...@googlegroups.com.
I think you have more tickets to make. (Besides null not being a NonFatal exception.)That is, if this is the desired behavior, for extractors to be null-friendly.
scala> 'apm match { case Symbol(x) => x }
res0: String = apm
scala> null match { case Symbol(x) => x }
java.lang.NullPointerException
at scala.Symbol$.keyFromValue(Symbol.scala:37)
at scala.Symbol$.keyFromValue(Symbol.scala:34)
at scala.UniquenessCache.unapply(Symbol.scala:89)
... 33 elided
On Fri, Aug 8, 2014 at 8:49 AM, Som Snytt <som....@gmail.com> wrote:
I was curious if unapplies everywhere are required to do this.
scala> null match { case util.control.NonFatal(x) => true }
res1: Boolean = true
On Fri, Aug 8, 2014 at 6:51 AM, Simon Schäfer <ma...@antoras.de> wrote:
That is a bug in Regex.unapplySeq. It calls a Java API which doesn't handle null correctly. Therefore, the unapplySeq should handle the null case. Please open a ticket.
On 08/08/2014 12:33 PM, Stefano Di Martino wrote:
Hi,
I thought that pattern matching with null should work, but it doesn't. The following code ist copied from a book:
--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-languag...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-languag...@googlegroups.com.
----------------------------------------
This message is intended exclusively for the individual(s) or entity to
which it is addressed. It may contain information that is proprietary,
privileged or confidential or otherwise legally exempt from disclosure.
If you are not the named addressee, you are not authorized to read,
print, retain, copy or disseminate this message or any part of it.
If you have received this message in error, please notify the sender
immediately by e-mail and delete all copies of the message.