[Types]: TweenChain.remove() issues an error with 1 argument.
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 40.3k
- Forks
- 7.2k
- PR merge metrics
- No merged PRs in 30d
Description
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.
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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked TweenChain.js implementation around line 155 and inspect how the tsgen script represents the overridden remove() method. Resolve whether the generated TypeScript declaration should accept a tween or whether the API needs a distinct name, then verify that the PlayScene.ts call type-checks and the resulting public API is consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100