summaryrefslogtreecommitdiff
path: root/test/files/pos/javaConversions-2.10-regression.scala
Commit message (Collapse)AuthorAgeFilesLines
* SI-9684 Deprecate JavaConversionsSom Snytt2016-04-221-3/+3
| | | | | | | | | Implicit conversions are now in package convert as ImplicitConversions, ImplicitConversionsToScala and ImplicitConversionsToJava. Deprecated WrapAsJava, WrapAsScala and the values in package object. Improve documentation.
* SI-6811 Remove scala.collection.mutable.ConcurrentMapSimon Ochsenreither2013-01-171-3/+3
|
* Ensure implicit conversions to concurrent map are unambiguousPaolo Giarrusso2012-08-221-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even after the parent change, implicit conversions should still convert ConcurrentHashMap to concurrent.Map and not to mutable.ConcurrentMap. I'll include the comment by axel22 which prompting this change (taken from https://github.com/scala/scala/pull/1172#issuecomment-7928285) since it is highly informative and links to pull request comments might not be very stable: << Instead of just testing an implicit conversion to ConcurrentMap, the test should call ConcurrentMap methods such as putIfAbsent (which returns an Option[T]) and replace, to see if the correct Scala concurrent map trait is being resolved. The problem is that putIfAbsent already exists on juc.ConcurrentMap so instead of triggering an implicit conversion, a type mismatch error is output anyway. And we cannot test that the correct concurrent map trait is returned using methods like map, flatMap and friends, because concurrent map traits extends mutable.Map anyway. For this reason, I recommend to add this to the test: scala> val a = new java.util.concurrent.ConcurrentHashMap[String, String]() += (("", "")) a: scala.collection.concurrent.Map[String,String] = Map("" -> "") and make sure that the returned map is concurrent.Map, not mutable.ConcurrentMap (the above += is one of the few methods in collection that has the return type this.type). >>
* JavaConversions: Restore source compatibility with 2.9Paolo Giarrusso2012-08-201-0/+11
Readd an implicit conversion which was available in 2.9, the one from `java.util.concurrent.ConcurrentMap` (`juc.ConcurrentMap`) to the (now deprecated) type `scala.collection.mutable.ConcurrentMap`. This implicit conversion can also be used to convert from `juc.ConcurrentMap` to `collection.Map` and creates an ambiguity error in test/files/run/map_java_conversions.scala. To fix this, I have given lower priority to the new conversion. Moreover, update the documentation in `JavaConversions`: mark this conversion as deprecated and mention the new conversion which replaces it, converting to `scala.collection.concurrent.Map`. I discussed this issue previously with Paul Phillips on scala-language: https://groups.google.com/d/topic/scala-language/uXKRiGXb-44/discussion