From fe433ea5ba314236986e808ea06f7718e09475e3 Mon Sep 17 00:00:00 2001 From: rjdestigter Date: Thu, 4 Jan 2018 09:14:39 -0700 Subject: [PATCH] Fix return type of forecastInFahrenheit forecastInFahrenheit returns a `Seq[Double]`, not a `Double` --- _tour/higher-order-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_tour/higher-order-functions.md b/_tour/higher-order-functions.md index ce76323f2f..c2b47097cb 100644 --- a/_tour/higher-order-functions.md +++ b/_tour/higher-order-functions.md @@ -53,7 +53,7 @@ case class WeeklyWeatherForecast(temperatures: Seq[Double]) { private def convertCtoF(temp: Double) = temp * 1.8 + 32 - def forecastInFahrenheit: Double = temperatures.map(convertCtoF) // <-- passing the method convertCtoF + def forecastInFahrenheit: Seq[Double] = temperatures.map(convertCtoF) // <-- passing the method convertCtoF } ``` Here the method `convertCtoF` is passed to forecastInFahrenheit This is possible because the compiler coerces `convertCtoF` to the function `x => convertCtoF(x)` (note: `x` will