-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type bounds #22
Comments
Hi @marklister, didn't really understand this bug. Can you explain a bit? |
Creating a CollSeq from a Seq[TupleN] fails because the lib is expecting a Seq[ProductN]. It's not to hard to workaround (use : _ * or specify the type as Iterator[ProductN]) but the real fix is to set the upper bound of CollSeq.apply () to ProductN. This came up because I had to produce an Iterator[TupleN] instead of an Iterator[ProductN] on the i/o component to work around a probable scala bug. It's only likely to affect people who are trying to create CollSeqs using the iterator I exposed last week. |
scala> CsvParser[String,Int,Double].iterator(new java.io.FileReader("sample.csv")).toSeq
res2: Seq[(String, Int, Double)] = Stream((Jan,10,22.33), ?)
scala> CollSeq(res2 :_*)
res4: com.github.marklister.collections.immutable.CollSeq3[String,Int,Double] =
CollSeq((Jan,10,22.33),
(Feb,20,44.2),
(Mar,25,55.1)) More attention could be paid to type bounds in the future but right now I think this is good enough for government work. Closing with aabb0ad. |
Nice workaround! |
#20 and #21 exposed a probable bug in scala relating to
tupled
on aFunctionN
. The workaround is to returnTuples
in theIterator
s notProduct
s but this exposes some incorrect type assumptions made in product-collections...The text was updated successfully, but these errors were encountered: