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

If the same extension is applied twice, a warning (if not an exception) should be thrown #11499

Open
GuySartorelli opened this issue Dec 6, 2024 · 0 comments

Comments

@GuySartorelli
Copy link
Member

There's no valid use case for applying the same extension twice to any class, and having an extension applied twice means hooks fire twice which will only ever cause problems.

If an extension is applied, and that extension is already present, a warning or exception should be thrown. Probably an exception.

Things to consider:

  1. Is suddenly throwing an exception a breaking change?
  2. Do we check for class inheritance? e.g. I have Versioned applied, I make a MyVersionedSubclass extends Versioned and apply it. Does this throw the same warning or exception?
    • I think it should, since the subclass will have all the same methods the original class does and therefore cause the same problems as if the original class was applied a second time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant