Skip to content

Conversation

nscarcella
Copy link
Contributor

@nscarcella nscarcella commented May 24, 2021

I think this if expression is missing either a then or parenthesis.

I'm not so sure about the other change (replacing Any type for Matchable), since it seems to be valid Scala code, at least on worksheets. But maybe it would be better presented this way, to avoid conflicting with this quote from other section of the book:

The top-type Any has a subtype Matchable, which is used to mark all types that we can perform pattern matching on. We will not go into details here, but in summary, it means that we cannot pattern match on values of type Any, but only on values that are a subtype of Matchable.

Just a small fix of what I believe was a typo
@nscarcella nscarcella changed the title Fixed missing then keyword Fixed what I believe to be typos May 24, 2021
Copy link
Contributor

@julienrf julienrf left a comment

Choose a reason for hiding this comment

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

Thank you @nscarcella, I agree with your changes but I think we should give a short explanation about Matchable (or just a link to another page of the docs that explains Matchable)

Co-authored-by: Julien Richard-Foy <julien@richard-foy.fr>
Copy link
Contributor

@julienrf julienrf left a comment

Choose a reason for hiding this comment

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

Thank you @nscarcella !

@julienrf julienrf merged commit 619652e into scala:main Jun 3, 2021
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