Skip to content

doc(inline): fix listing in override and fixes in transparent section #8848

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

Merged
merged 2 commits into from
May 4, 2020

Conversation

robstoll
Copy link
Contributor

@robstoll robstoll commented May 1, 2020

No description provided.

@@ -241,18 +241,20 @@ class B extends A {
}

transparent inline def choose(b: Boolean): A =
if b then A() else B
if b then A else B
Copy link
Member

Choose a reason for hiding this comment

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

When calling a no-argument class constructor without using new, the parens are mandatory (https://dotty.epfl.ch/docs/reference/other-new-features/creator-applications.html), so I think in fact this needs to be:

Suggested change
if b then A else B
if b then A() else B()

... though perhaps a different example should be used which doesn't use an unrelated new feature people might be unfamiliar with.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, I am going to change it to new A() ...

@smarter smarter merged commit ec8d439 into scala:master May 4, 2020
@robstoll robstoll deleted the doc-inline branch May 4, 2020 10:44
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