Skip to content

Conversation

@agam
Copy link

@agam agam commented Feb 26, 2020

As an example, on OSX with Scala version 2.13.1, I see

scala> def average(x: Int, xs: Int*): Double =
     | (x :: xs.to(List)).sum.toDouble / (xs.size + 1)
<console>:13: error: type mismatch;
 found   : scala.collection.immutable.List.type
 required: scala.collection.generic.CanBuildFrom[Nothing,Int,?]
       (x :: xs.to(List)).sum.toDouble / (xs.size + 1)
                   ^

As an example, on OSX with Scala version `2.13.1`, I see 

```
scala> def average(x: Int, xs: Int*): Double =
     | (x :: xs.to(List)).sum.toDouble / (xs.size + 1)
<console>:13: error: type mismatch;
 found   : scala.collection.immutable.List.type
 required: scala.collection.generic.CanBuildFrom[Nothing,Int,?]
       (x :: xs.to(List)).sum.toDouble / (xs.size + 1)
                   ^
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant