Component commits:
74c337bc5f Fix handling of prologue statements when there are parameter property declarations If there is a prologue (and no super) in a constructor, the prologue won't be skipped when calculating the parameter properties, leading to the prologue being included twice
bd2a2ecc31 Add second test case
d45098e23b Update to match old TS version: parameter properties after prologue
891cb6f317 Parametert properties should be added after any prologue
Co-authored-by: John Lusty <54030459+jlusty@users.noreply.github.com>
Component commits:
1b9a9d8312 Fix transformed constructor code when there is code between prologue statements and super call
Co-authored-by: Patrick Szmucer <pszmucer@palantir.com>
Component commits:
91631435ca Fix newline inserted in empty block at end of formatting range
79b600aaa3 Clean up
19ef6b67c5 Fix refactoring mistake
Co-authored-by: Andrew Branch <andrew@wheream.io>
* Cherry-pick PR #47927 into release-4.6
Component commits:
c4aa31b67f early return if pattern type is never
* Update LKG
Co-authored-by: Gabriela Araujo Britto <gabrielaa@microsoft.com>
Co-authored-by: typescript-bot <typescript@microsoft.com>
Component commits:
465042e278 Only issue @param suggestions with codefixes in TS
Previously, there were 2 JS errors that were issued as suggestions in TS
files. But there was no codefix for these errors, and the errors were
incorrect in TS.
This PR only issues the JS-specific errors on JS files.
4056b38860 Minimise test
4fb10f170a Merge branch 'main' into only-suggest-param-codefixes-in-ts
72499acabf Merge branch 'main' into only-suggest-param-codefixes-in-ts
Co-authored-by: Nathan Shively-Sanders <nathansa@microsoft.com>
Component commits:
628da10d8a Eliminate redundant or meaningless elaborations in type relations
a009ee1116 Accept new baselines
a65794c84d Add resetErrorInfo (though, oddly, shouldn't be necessary)
f269f4252c Less aggressive reduction in second pass union/intersection checks
1312e8a420 Accept new baselines
b82966fbaa Restructure and back off a little bit more
f0b87421ed Only cache union/intersection relations once
9404e06128 Accept new baselines
4866ce562d Properly cache identity relations, clean up error reporting
2670b26187 Move more logic to cached side of relation checks
adb37a5abb Optimize and remove more redundant elaborations
16b986bd5f Accept new baselines
1c69acb43d Remove unnecessary error state capture
530c8765d5 More optimizing
25a71c4de6 Cache isWeakType computation
c427a46aff Revert "Cache isWeakType computation"
This reverts commit 25a71c4de61f6366ffac080d19685dcb200f42b9.
1d70b01236 Address CR feedback
28439f7028 Merge branch 'main' into fix47668
# Conflicts:
# src/compiler/diagnosticMessages.json
c472ba5087 Accept new baselines
Co-authored-by: Anders Hejlsberg <andersh@microsoft.com>
* Checker:Remove block-scoped duplicate declaration errors in plain JS
Previously they were issued in mergeSymbol, not they are not issued.
* fix semicolon lint
* Fix error term of declaration in modules
* fix test
* change error code of "An import declaration can only be used at the top level of a module."
* Separate js and ts files for export errors in module.
* Change non-top-level error in namespace
* format
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* WIP: pass in checkmode to getNarrowableTypeForReference
* add tests
* another pass through new check mode argument
* rename new check mode
* only use rest flag for rest elements in objects
* add and update tests
* change check mode flag name
* restore package-lock.json
* fix comments
* get rid of fourslash tests
* fix caching in checkExpressionCached when checkMode is not normal
* Don't distinguish between object and array rest elements
* get rid of undefined check mode
* don't make includeOptionality into checkmode flag
1. During name resolution, `@param` and `@return` tags should walk up
through the jsdoc comment and then jump to the host function. Previously they
did not, which would cause them to not resolve type parameters bound in
the scope of a host that was not a sibling of the comment. The example
from #46618 is a prototype method:
```js
/**
* @template {T}
* @param {T} t
*/
C.prototype.m = function (t) {
}
```
2. During name resolution, prototype methods are supposed to resolve
types both from the host function's location and from the containing
class' location. The containing class lookup happens in a separate call
to `resolveName`. Previously, the code that finds the containing class
only worked for the above style of comment, which is on the outer
ExpressionStatement, but not for the below style, which is on the
function expression itself:
```js
C.prototype.m =
/**
* @template {T}
* @param {T} t
*/
function (t) {
}
```
* Do symbol name filtering before cache rehydration
* Fix typo
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Update test
* Fix variable clobbered in merge conflict
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>