Skip to content

[Types]: TweenChain.remove() issues an error with 1 argument. #7131

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

Open
raaaahman opened this issue May 3, 2025 · 0 comments
Open

[Types]: TweenChain.remove() issues an error with 1 argument. #7131

raaaahman opened this issue May 3, 2025 · 0 comments

Comments

@raaaahman
Copy link
Contributor

When using the TweenChain.remove() method with an argument, the TypeScript compiler issues an error:

src/scenes/PlayScene.ts:481:46 - error TS2554: Expected 0 arguments, but got 1.

481             this.finalScoreAnimation?.remove(tween);

Even though the finalScoreAnimation property is recognized as a TweenChain but the remove() method is typed as BaseTween.remove(). This might be an issue with how the tsgen script handles overrides.

remove: function (tween)

When thinking about it a little more, the change from a 0 argument method to a 1 argument method in the child class doesn't really comply with the Liskov Substitution Principle (it doesn't event have the same effect). Maybe renaming this method to something like removeTween() would make more sense?

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

No branches or pull requests

1 participant