Closed brownbonnie closed 2 years ago
I've raised this in an issue also: https://github.com/exercism/scala/issues/708
This is not actually a bug, but a feature :) The goal of this exercise is to have students use optional parameters with a default value. Hence the test without a name being passed.
Ah very interesting, thanks. Would it be possible to add examples of default parameters in the tutorial?
Hello,
I would argue that a test not compiling is not a result of the failure of the one trying to solve the question.
The tests are supposed to be units of truth outside of the structure of the solution program. Having a test not compile is not the same as it failing, per test driven development. All tests should compile, in order to verify the solution program.
It's a neat thing to consider (passing in defaults), but I don't think it makes sense for a test to not compile like it does here. At the very least it should be mentioned somewhere as it is creating confusion and looks like a bug.
Thanks!
@mrybak834 That's a really good point!
The ergonomics here are a bit odd. It might be better to convert the exercise to use an Option[T]
parameter instead.
I've added a small fix to get the unit tests into a compiling state.