-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Redundant end markers #11581
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
Comments
It might be good to support the following one class Abc {
}
end Abc It has the combined advantage to be explicit and collapsible by most IDEs |
Docs say: "Braces are not much better since a brace by itself also contains no information about what region is closed." An end marker is not redundant with right brace, even where the brace is a template body and not a block.
Here it's clear that the end marker is not redundant because "we opted for optional braces".
I suggest moving the doc for end marker out of "optional braces" and into "optional line comment saying where something ends". Because really the feature replaces:
Real-world example FSR I loathe the comment but love the end marker. (Perhaps because the comment means: I know this method is too big, so good luck trying to refactor it. End marker means: this method is bigger than a simple expression, thanks for reading my code.) Someone should start a thread on contributors forum as to whether there is a use case for redundant
Easy use case for checking end marker is that more than one symbol may be in play.
|
I've created PR solving the issue with multiple consecutive end markers. It is not touching anything related to the question if an end marker should be allowed after a right brace. Personally, I would love to be able to write something like this: class A {
def a = ???
} end A It is much better than comment, as it is checked by the compiler. Nevertheless, it is probably much too late for a change like this. |
Compiler version
3.0.0-RC1
Minimized code
Output
Compiles.
Expectation
Does not compile.
First
end Abc
is redundant since definition ofAbc
is closed with braces.Then I added another
end Abc
and it compiles too...The text was updated successfully, but these errors were encountered: