Note that there are some explanatory texts on larger screens.

plurals
  1. POMissing parameter type for generic scan
    primarykey
    data
    text
    <p>I can't seem to understand why my program needs explicit parameter types for this case. Using the following method:</p> <pre><code>trait DistTraversableLike[+T, +Repr] extends DistTraversable[T] { self: Repr =&gt; ... def scan1lD[T1 &gt;: T, That](assOp: (T1, T1) =&gt; T1)(implicit bf: CanBuildFrom[Repr, T1, That]): That = { val b = bf(this) for (x &lt;- group.prefixSumSeq(part, assOp)) b += x b.result } } </code></pre> <p>I try to use it on a specific implementation like so:</p> <pre><code>val x:DistSeq[Int] = DistSeq((0 until worldSize): _*) val scan = x.scan1lD(_+_) </code></pre> <p>Which yields the following error message:</p> <pre><code>Multiple markers at this line - missing parameter type for expanded function ((x$1: &lt;error&gt;, x$2) =&gt; x$1.$plus{&lt;null&gt;}(x$2{&lt;null&gt;}){&lt;null&gt;}) {&lt;null&gt;} - missing parameter type for expanded function ((x$1, x$2) =&gt; x$1.$plus{&lt;null&gt;}(x$2{&lt;null&gt;}){&lt;null&gt;}){&lt;null&gt;} - missing parameter type for expanded function ((x$1: &lt;error&gt;, x$2) =&gt; x$1.$plus(x$2)) - missing parameter type for expanded function ((x$1, x$2) =&gt; x$1.$plus(x$2)) </code></pre> <p>group is a mixed trait using a method from FooParOps-trait (prototype implementation):</p> <pre><code> def prefixSumSeq[T](part: Seq[T], combiner: (T, T) =&gt; T): Seq[T] = { implicit val srlz = getSerializerFor(part) var result = part.head var msg = part.reduce(combiner) for (i &lt;- 0 until log2i(size)) { val partner = localRank ^ math.pow(2, i).toInt send(partner, msg) val number: T = rcv(partner) msg = combiner(msg, number) if (partner &lt; localRank) result = combiner(number, result) } return (part.tail).scanLeft(result)(combiner) } </code></pre> <p><code>part</code> is from <code>DistTraversable[+T]</code> and defined as <code>def part: Seq[T]</code></p> <p>I don't quite see why explicit parameters are needed here? Please tell me if more information is needed. The program is quite complex right now.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload