Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/scala/stdlib/Implicits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ object Implicits extends FlatSpec with Matchers with org.scalaexercises.definiti
def asDefaultImplicits(res0: BigDecimal) {
def howMuchCanIMake_?(hours: Int)(implicit dollarsPerHour: BigDecimal) = dollarsPerHour * hours

implicit val hourlyRate = BigDecimal(34.00)
implicit val hourlyRate = BigDecimal(34)

howMuchCanIMake_?(30) should be(res0)
}
Expand All @@ -116,7 +116,7 @@ object Implicits extends FlatSpec with Matchers with org.scalaexercises.definiti
def howMuchCanIMake_?(hours: Int)(implicit amount: BigDecimal, currencyName: String) =
(amount * hours).toString() + " " + currencyName

implicit val hourlyRate = BigDecimal(34.00)
implicit val hourlyRate = BigDecimal(34)
implicit val currencyName = "Dollars"

howMuchCanIMake_?(30) should be(res0)
Expand Down
4 changes: 2 additions & 2 deletions src/test/scala/stdlib/ImplicitsSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ImplicitsSpec extends Spec with Checkers {
}

def `implicits for default parameters` = {
val fstAnswer: BigDecimal = 1020.0f
val fstAnswer: BigDecimal = 1020

check(
Test.testSuccess(
Expand All @@ -49,7 +49,7 @@ class ImplicitsSpec extends Spec with Checkers {
check(
Test.testSuccess(
Implicits.listOfImplicitsImplicits _,
"1020.0 Dollars" :: HNil
"1020 Dollars" :: HNil
)
)
}
Expand Down