Ref #3282
We used to wrap InputStream so it will inject Thread.sleep, which then allows the thread to be cancelled, emulating a non-blocking readLine. This trick doesn't seem to work for Windows.
For non-Cygwin, actually just removing the wrapping does the job, but I couldn't get it to work for Cygwin.
To test, run some command via network, and then type `show name` into the terminal. On Cygwin, it will not respond.
Looks like the reason that util-cache depended on util-collection was to
define the sjson-new formats (HListFormats) for util-collection's HList.
Given that util-collection already depends on sjsonnew, HListFormats can
also be defined in util-collection.
All that was left then was (a) HListFormatSpec requires
sjsonnewScalaJson, so that was added in test scope, and (b) HListFormats
had to be dropped from sbt.util.CacheImplicits - HListFormats will have
to be imported and/or mixed-in where required downstream. For importing
convenience I defined a companion object.
Simply
import OptJsonWriter.OptOut._
And you'll get the implicit lift, but not the implicit fallback.
You get an ambiguous compile error like this:
[error] /d/sbt-util/internal/util-collection/src/main/scala/sbt/util/OptJsonWriter.scala:28: ambiguous implicit values:
[error] both method conflictingFallback1 in trait OptOut0 of type [A]=> sbt.util.NoJsonWriter[A]
[error] and method conflictingFallback2 in trait OptOut0 of type [A]=> sbt.util.NoJsonWriter[A]
[error] match expected type sbt.util.OptJsonWriter[Foo]
[error] val x = implicitly[OptJsonWriter[Foo]]
[error] ^
Uses TypeTag to recover the full name of type parameter, which is calculated by StringTypeTag. This is sent along in ObjectEvent.
On the other end, we can lookup typeclass instances using the tag key.