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

Prevent classes and methods from declared both final and abstract #36

Merged
merged 1 commit into from Aug 28, 2018

Conversation

@pierredup
Copy link
Contributor

pierredup commented Aug 11, 2018

  • bug fix? Yes
  • BC break? yes
  • doc PR: N/A

Classes and methods cannot be declared final and abstract. This will now throw an exception if you try to generate a final abstract class or method. It's a BC break because of the new exception, but the generated code would never have been valid, so I doubt there is any use that will break

…al and abstract [BC break]
@dg

This comment has been minimized.

Copy link
Member

dg commented Aug 28, 2018

It's probably better to check it when the code is generated, to allow this anytime:

$class->setAbstract(true)->setFinal(false);

ie. in cases when $class is already marked as final

@dg dg merged commit a0178d7 into nette:master Aug 28, 2018
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.03%) to 97.341%
Details
dg added a commit that referenced this pull request Aug 28, 2018
dg added a commit that referenced this pull request Aug 28, 2018
dg added a commit that referenced this pull request Aug 29, 2018
dg added a commit that referenced this pull request Aug 29, 2018
dg added a commit that referenced this pull request Aug 29, 2018
dg added a commit that referenced this pull request Aug 29, 2018
…m declared both final and abstract [BC break] (#36)
dg added a commit that referenced this pull request Aug 29, 2018
…m declared both final and abstract [BC break] (#36)
dg added a commit that referenced this pull request Aug 29, 2018
…m declared both final and abstract [BC break] (#36)
dg added a commit that referenced this pull request Aug 29, 2018
…m declared both final and abstract [BC break] (#36)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.