Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 27 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
libes2022Erroralready hascause, so parameter propertyconstructor(public cause: Error, ...)inFetchErrorgives TS4115 undernoImplicitOverride. Addingoverrideis not an option, it failes with lib below es2022 (TS4113)Now
causeis assigned in constructor and typed through interface merged with the class.declare cause: Errorin class body also compiles, but Babel 7 rejectsdeclarefields unlessallowDeclareFieldsis on, so went with interface (same name is needed for merging, this is the question from #24575). OnlyFetchErroris changed, other parameter properties left as they areChecked generated
runtime.tswith tsc 5.0, 5.9 and 6.0,--strict --noImplicitOverride, lib es2022 and es2015: no errors, master has TS4115 on es2022.e.causeis still typed asError. Added test inTypeScriptFetchClientCodegenTest, typescript tests pass. Regenerated all 93 typescript configs, only 25 typescript-fetchruntime.tschange, same hunk in eachFixes #14515
PR checklist
@TiFu @taxpon @sebastianhaas @kenisteward @Vrolijkx @macjohnny @topce @akehir @petejohansonxo @amakhrov @davidgamero @mkusaka @joscha @KannaKim
Summary by cubic
Fixes the TypeScript 4115 compiler error in typescript-fetch's generated
FetchErrorwhennoImplicitOverrideis enabled and the lib is es2022, whereErroralready declarescause.Bug Fixes
causeis now assigned in the constructor instead of using a parameter property, sinceoverridefails with lib es2015 anddeclarefields are rejected by Babel 7.causeis typed via a declaration-merged interface and stays typed asError; verified with tsc 5.0, 5.9, and 6.0 under--strict --noImplicitOverridewith es2015 and es2022 libs, and all 25 typescript-fetch samples were regenerated.Fixes #14515
Written for commit af7087c. Summary will update on new commits.