33009 Commits

Author SHA1 Message Date
TypeScript Bot
774f419757
Cherry-pick PR #48775 into release-4.6 (#48781)
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>
2022-05-05 15:50:18 -07:00
Daniel Rosenwasser
ef0095c944
Fix blocking of recursive dependencies in getNarrowedTypeOfSymbol (#48941) (#48943)
* Better blocking of recursive dependencies in getNarrowedTypeOfSymbol

* Add regression test

Co-authored-by: Anders Hejlsberg <andersh@microsoft.com>
2022-05-03 15:32:58 -07:00
Jake Bailey
81f1e5f0e0
Fixed multiple prologue directives with parameter properties (#48687) (#48782)
Co-authored-by: Josh Goldberg <me@joshuakgoldberg.com>
2022-05-03 12:32:27 -07:00
TypeScript Bot
79b02a6726
Cherry-pick PR #48765 into release-4.6 (#48780)
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>
2022-05-03 12:29:38 -07:00
TypeScript Bot
c242d4a46b Bump version to 4.6.4 and LKG v4.6.4 2022-03-29 22:35:54 +00:00
TypeScript Bot
fbc2b677bc
Cherry-pick PR #48463 into release-4.6 (#48477)
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>
2022-03-29 15:13:22 -07:00
TypeScript Bot
2bed482323 Bump version to 4.6.3 and LKG v4.6.3 2022-03-16 19:25:26 +00:00
TypeScript Bot
cfdef9de72
Cherry-pick PR #47657 into release-4.6 (#48223)
Component commits:
4516fa8421 fix(47597): ignore commented imports following template expression

Co-authored-by: Oleksandr T <oleksandr.tarasiuk@outlook.com>
2022-03-16 11:57:09 -07:00
TypeScript Bot
e397ed1e38
Cherry-pick PR #48207 into release-4.6 (#48213)
Component commits:
d1b063e7be Move `hasOwn` from Object instance to Object constructor
Fixes #48206

Co-authored-by: Ryan Cavanaugh <ryanca@microsoft.com>
2022-03-11 10:37:41 -08:00
TypeScript Bot
014dc3dc89
🤖 Pick PR #48067 (Fix incorrect parser error assumpti...) into release-4.6 (#48068)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
2022-03-01 10:22:42 -08:00
TypeScript Bot
78ee4cacaf
🤖 Pick PR #47927 (Don't error if binding pattern type...) into release-4.6 (#48005)
* 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>
v4.6.2
2022-02-23 00:56:14 -08:00
TypeScript Bot
f4fe064b38 Bump version to 4.6.2 and LKG 2022-02-22 03:56:28 +00:00
TypeScript Bot
ec6ae0f26c
Cherry-pick PR #47959 into release-4.6 (#47962)
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>
2022-02-18 16:39:47 -08:00
TypeScript Bot
ded20c63fe
Cherry-pick PR #47953 into release-4.6 (#47957)
Component commits:
aa1c25d35d Remove unnecessary check in getNarrowableTypeForReference

f4dcf881dc Add regression test

Co-authored-by: Anders Hejlsberg <andersh@microsoft.com>
2022-02-18 16:39:32 -08:00
TypeScript Bot
57bd60818c
Cherry-pick PR #47738 into release-4.6 (#47907)
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>
2022-02-17 17:03:58 -08:00
TypeScript Bot
ea5a43a290
Cherry-pick PR #47830 into release-4.6 (#47928)
Component commits:
8f0e9356c3 fix(47820): forbid extraction jsdoc

Co-authored-by: Oleksandr T <oleksandr.tarasiuk@outlook.com>
2022-02-17 16:59:09 -08:00
TypeScript Bot
b6ec37aac2
Cherry-pick PR #47909 into release-4.6 (#47912)
Component commits:
f4a5562543 wip: possible fixes

75cb7392f3 pass parameter type to assignBindingElementTypes

4a7de63c83 undo unnecessary changes

b618cf9371 update baselines

Co-authored-by: Gabriela Araujo Britto <gabrielaa@microsoft.com>
2022-02-16 09:05:17 -08:00
Daniel Rosenwasser
83efc9f0d6 Update LKG for 4.6.1-rc. v4.6-rc 2022-02-11 01:14:20 +00:00
Daniel Rosenwasser
85cd73502e Bump version to 4.6.1 RC. 2022-02-11 00:59:17 +00:00
Daniel Rosenwasser
4b395b6d65 Merge remote-tracking branch 'origin/main' into release-4.6 2022-02-11 00:53:32 +00:00
Andrew Branch
0655f32e05
Add missing isolatedModules error for export import (#47838)
* Add missing isolatedModules error for `export import`

* Update existing baseline
2022-02-10 16:13:04 -08:00
Andrew Branch
954d0442eb
Avoid auto-importing from barrel re-exporting index files that are likely to make an import cycle (#47516)
* Avoid auto-importing from barrel re-exporting index files that are likely to make an import cycle

* Finish fixing merge conflict
2022-02-10 15:05:08 -08:00
Oleksandr T
b456702755
feat(11378): check param names in JSDoc (#47257) 2022-02-10 10:02:07 -08:00
Oleksandr T
954ce5b278
fix(46611): allow to use jsdoc type on class methods (#46688) 2022-02-10 09:17:30 -08:00
TypeScript Bot
df673f74f5 Update package-lock.json 2022-02-10 06:07:00 +00:00
Nathan Shively-Sanders
42aa18bf44
mergeSymbol in checker:Remove block-scoped duplicate declaration errors in plain JS (#47825)
* Checker:Remove block-scoped duplicate declaration errors in plain JS

Previously they were issued in mergeSymbol, not they are not issued.

* fix semicolon lint
2022-02-09 16:26:27 -08:00
islandryu
95c22d1750
fix(47076):Fix error term of declaration in modules (#47087)
* 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>
2022-02-09 13:19:30 -08:00
Gabriela Araujo Britto
2d0a00d457
Fix destructuring and narrowing interaction (#47337)
* 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
2022-02-09 12:25:07 -08:00
Nathan Shively-Sanders
d5c3015516
Constructor function methods:Add two missing tag lookups (#47742)
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) {
}
```
2022-02-09 11:22:33 -08:00
Andrew Branch
2cf5afd49e
Avoid pulling on setter type when only getter type is needed to break circularity (#47818) 2022-02-09 10:56:29 -08:00
Oleksandr T
c06849ad16
fix(47787): show QF to delete parameter in getter (#47797) 2022-02-08 13:39:54 -08:00
Andrew Branch
c5b1011e94
Compute writeType from set accessors for union and intersection properties (#47674)
* Compute write type from set accessors for union and intersection properties

* Add test for deferred writeType

* Always check for writeType of symbol
2022-02-08 12:57:34 -08:00
Oleksandr T
17b97ccc43
fix(47788): forbid convertToMappedObjectType QF in invalid index signatures (#47798) 2022-02-08 11:36:45 -08:00
csigs
460908a478
LEGO: Merge pull request 47801
LEGO: Merge pull request 47801
2022-02-08 03:23:26 -08:00
TypeScript Bot
5b53e4ec28 Update package-lock.json 2022-02-08 06:08:53 +00:00
Andrew Casey
c216b2db5b
Trace document registry operations (#47785)
...to help detect misconfigurations like #47687.
2022-02-07 16:10:38 -08:00
Andrew Casey
1b6fb99efe
Log per-project FAR and update baselines (#47781) 2022-02-07 16:10:01 -08:00
Andrew Branch
d8ac54bfb1
Fix substitution types of indexed access types of substitution types (#47791)
* Fix substitution types of indexed access types of substitution types

* Add tests

* Fix accidental unindentation
2022-02-07 15:53:13 -08:00
Oleksandr T
867470ca26
fix(47783): show globals completion in case keyword outside of switch statement (#47786) 2022-02-07 14:08:35 -08:00
Oleksandr T
afeacf41bd
fix(47782): forbid super() extraction outside this container (#47784) 2022-02-07 13:26:39 -08:00
csigs
14feed97a0
LEGO: Merge pull request 47761
LEGO: Merge pull request 47761
2022-02-07 02:50:24 -08:00
TypeScript Bot
163fef9f5d Update package-lock.json 2022-02-06 06:06:05 +00:00
TypeScript Bot
e1532a18ac Update package-lock.json 2022-02-05 06:07:35 +00:00
Andrew Branch
9c3b41d3cc
Refactor named imports to default instead of namespace when esModuleInterop is on and module is an export= (#47744) 2022-02-04 17:11:25 -08:00
Oleksandr T
8ddead50eb
fix(32941): include Template tag constraint to QuickInfo response (#47567) 2022-02-04 16:12:23 -08:00
Ron Buckton
3328feb799
Use 'static {}' for static fields when available and useDefineForClassFields is false (#47707) 2022-02-04 12:34:29 -08:00
Oleksandr T
ceee975052
fix(45917): show completions in string literal followed by a comma (#46970) 2022-02-04 12:15:02 -08:00
Andrew Branch
300a53c333
Auto-import perf: Do symbol name/flags filtering before cache rehydration (#47678)
* 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>
2022-02-04 09:17:55 -08:00
TypeScript Bot
69d06cb359 Update package-lock.json 2022-02-04 06:07:01 +00:00
Oleksandr T
0d5abd8a15
feat(27601): include JSDoc comments for destructuring arguments (#46886) 2022-02-03 11:27:40 -08:00