Uh oh!
There was an error while loading. Please reload this page.
fix: class field is not accessible via super - #54056
fix: class field is not accessible via super#54056Nathan Shively-Sanders (sandersn) merged 3 commits into
Conversation
Breno Salles (Guergeiro)
commented
Jun 2, 2023
Just a question, does this handle the JS getter methods? Get methods work with super call in JS. |
Jack Works (Jack-Works)
commented
Jun 3, 2023
Only class fields are affected. getter and setters work normally. |
8cd587c to
1a3b36bCompareUh oh!
There was an error while loading. Please reload this page.
I was referred to this fix from my issue: I believe: fixes #54900 |
e66a0ec to
2dc49dbCompareAndrew Branch (andrewbranch)
commented
Jul 7, 2023
TypeScript Bot (@typescript-bot) run dt |
Heya Andrew Branch (@andrewbranch), I've started to run the diff-based top-repos suite on this PR at 2dc49db. You can monitor the build here. Update: The results are in! |
Heya Andrew Branch (@andrewbranch), I've started to run the parallelized Definitely Typed test suite on this PR at 2dc49db. You can monitor the build here. Update: The results are in! |
TypeScript Bot (typescript-bot)
commented
Jul 7, 2023
Andrew Branch (@andrewbranch) Here are the results of running the top-repos suite comparing Something interesting changed - please have a look. Details
|
TypeScript Bot (typescript-bot)
commented
Jul 7, 2023
Hey Andrew Branch (@andrewbranch), the results of running the DT tests are ready. |
Andrew Branch (andrewbranch)
commented
Jul 7, 2023
These errors might be interesting to look at. |
Andrew Branch (andrewbranch)
commented
Jul 7, 2023
In appsmith, the code presumably works at runtime because the compile target is |
Jack Works (Jack-Works)
commented
Jul 8, 2023
Sorry, I'm confused, in what case it can be valid? I cannot think of a setup that defines a class field on the prototype instead of the instance. |
Andrew Branch (andrewbranch)
commented
Jul 10, 2023
Hm, I assumed that a quirk of the transformation down to ES2015 would make it work somehow, but I think you’re right. Maybe this stuff isn’t working at all? This is very odd 🤔 |
Even stranger, the first error, in appsmith, looks like a typo. |
Nathan Shively-Sanders (sandersn)
left a comment
There was a problem hiding this comment.
I agree that this should go into 5.3 to avoid breaking vscode after the 5.2 beta.
In the meantime, I had one small nit about the test, but I'm not 100% what a better solution is.
Uh oh!
There was an error while loading. Please reload this page.
2dc49db to
4b820cbCompareCo-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
- Bumps `typescript` and `ts-expose-internals` to v5.3.3 - Removes the test diagnostic for `noSuperProperty` as the compiler catches this now (microsoft/TypeScript/pull/54056) - Make 1:1 changes for methods and fields - Handles the `NoSubstitutionTemplateLiteral` node from microsoft/TypeScript/pull/55930 Please take a look at the module resolution change. I'm not sure if this will have downstream effects that I couldn't catch in testing. Closes#2610 --------- Co-authored-by: Osyris <osyrisrblx@gmail.com>
TypeScript/JavaScript uses prototype-based inheritance where fields are stored in a flat structure and not in the scope of a particular class definition in the hierarchy. This means that a field specified by a parent class can be replaced by one specified by one of the children. To signal this behaviour, starting in v5.3.0, the TypeScript compiler prevents a class from assigning values to fields specified by a parent class using "super" (microsoft/TypeScript#54056). This patch, upgrades the TypeScript compiler to the latest version and fixes the remaining issues related to the topic mentioned above that now result in compiler errors. Additionally, it also updates the launch task that runs the compiler to ensure it uses a local version of the compiler, as specified by the dependency graph of the VSCode Extension package. Change-Id: Ib3ef774028ec4587c6b8e5eaa2eb395188e0d5a1
TypeScript/JavaScript uses prototype-based inheritance where fields are stored in a flat structure and not in the scope of a particular class definition in the hierarchy. This means that a field specified by a parent class can be replaced by one specified by one of the children. To signal this behaviour, starting in v5.3.0, the TypeScript compiler prevents a class from assigning values to fields specified by a parent class using "super" (microsoft/TypeScript#54056). This patch, upgrades the TypeScript compiler to the latest version and fixes the remaining issues related to the topic mentioned above that now result in compiler errors. Additionally, it also updates the launch task that runs the compiler to ensure it uses a local version of the compiler, as specified by the dependency graph of the VSCode Extension package. Change-Id: Ib3ef774028ec4587c6b8e5eaa2eb395188e0d5a1
TypeScript/JavaScript uses prototype-based inheritance where fields are stored in a flat structure and not in the scope of a particular class definition in the hierarchy. This means that a field specified by a parent class can be replaced by one specified by one of the children. To signal this behaviour, starting in v5.3.0, the TypeScript compiler prevents a class from assigning values to fields specified by a parent class using "super" (microsoft/TypeScript#54056). This patch, upgrades the TypeScript compiler to the latest version and fixes the remaining issues related to the topic mentioned above that now result in compiler errors. Additionally, it also updates the launch task that runs the compiler to ensure it uses a local version of the compiler, as specified by the dependency graph of the VSCode Extension package. Change-Id: Ib3ef774028ec4587c6b8e5eaa2eb395188e0d5a1
fixes#54054
fixes#35314
fixes#54900