Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solution2.2.6.5 provided #62

Merged
merged 5 commits into from
Apr 15, 2024
Merged

Conversation

andreas-roehler
Copy link
Contributor

No description provided.

*/

def byLength[A](xs: Seq[A], maxLength: Int): Seq[Seq[A]] = {
if (xs.length) <= maxLength then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using both Scala 2 and Scala 3 for the tests. The syntax if a then b else c is supported only in Scala 3.

I suggest rewriting to the old and compatible syntax if (xs.legth <= maxLength) Seq(xs) else Seq(...).

Signed-off-by: Andreas Roehler <[email protected]>
Signed-off-by: Andreas Roehler <[email protected]>
@@ -14,7 +14,7 @@
*/

def byLength[A](xs: Seq[A], maxLength: Int): Seq[Seq[A]] = {
if (xs.length) <= maxLength then
if (xs.length) <= maxLength
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The syntax should be:

if (xs.length <= maxLength)
  Seq(xs)
...

@winitzki winitzki merged commit ac7763f into winitzki:master Apr 15, 2024
4 checks passed
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.

2 participants