30123 Commits

Author SHA1 Message Date
Daniel Rosenwasser
1ae7dbbcf0
Update corePublic.ts 2020-05-08 19:15:01 -07:00
TypeScript Bot
551f0dd9a1 Bump version to 3.9.2 and LKG v3.9.2 2020-05-08 23:44:27 +00:00
Daniel Rosenwasser
8bd8a88ab5
Merge pull request #38434 from typescript-bot/pick/38270/release-3.9
🤖 Pick PR #38270 (Improve assert message in binder) into release-3.9
2020-05-08 16:32:31 -07:00
Nathan Shively-Sanders
7eb4cdedb9 Cherry-pick PR #38270 into release-3.9
Component commits:
9795fa6631 Improve assert message in binder
Looking at the code, I don't think the assert can ever fire, but it
clearly does, or did in the past. This will make it easier for people to
create a repro.

d815effa9b fix lint

add6bbcfce Use BindableStaticNameExpression not BindableStaticAccessExpression
This type does allow identifiers, but those are ruled out earlier, so I added
an assert for that case.
2020-05-08 23:11:51 +00:00
Daniel Rosenwasser
a073560ebe
Merge pull request #38372 from typescript-bot/pick/38368/release-3.9
🤖 Pick PR #38368 (Fix js missing type arguments on ex...) into release-3.9
2020-05-08 10:54:35 -07:00
Wesley Wigham
623f78e20f Cherry-pick PR #38368 into release-3.9
Component commits:
c827007a38 Fix js missing type arguments on existing nodes and jsdoc object literal declaration emit

128ef9370b Merge branch 'master' into js-declaration-fixes-mk2

a90f97c6f6 Add special lookups test case, rename helper

04e6b6fe92 Accept slightly modified baselines
2020-05-08 07:06:07 +00:00
Daniel Rosenwasser
659677f6d0
Merge pull request #38364 from typescript-bot/pick/38351/release-3.9
🤖 Pick PR #38351 (Fix regression in name resolution i...) into release-3.9
2020-05-07 23:56:51 -07:00
Daniel Rosenwasser
9edf9ecc4b
Cherry-pick PR #38395 into release-3.9 (#38402)
Component commits:
6fe4be21e4 Exclude arrays and tuples from full intersection property check

9019e399e5 Add regression test

Co-authored-by: Anders Hejlsberg <andersh@microsoft.com>
2020-05-07 23:56:33 -07:00
TypeScript Bot
ef028bcd08
Cherry-pick PR #38377 into release-3.9 (#38386)
Component commits:
4baff1b241 moveToNewFile: handle namespace imports too
Fixes #35591

Co-authored-by: Eli Barzilay <eli@barzilay.org>
2020-05-07 23:56:14 -07:00
TypeScript Bot
d906a471dd
Cherry-pick PR #38398 into release-3.9 (#38400)
Component commits:
99c5c096c5 Properly finalize evolving array type in getTypeAtFlowCall

b355cd4da4 Add regression test

Co-authored-by: Anders Hejlsberg <andersh@microsoft.com>
2020-05-07 23:50:20 -07:00
Daniel
8f79cd42f4 ESLint suppressions because ain't nobody got time for this. 2020-05-08 00:12:41 +00:00
Daniel
946f4be633 Remove unnecessary casts. 2020-05-07 23:45:00 +00:00
Daniel
54fa1b7a8d Update LKG. 2020-05-07 20:32:57 +00:00
Daniel Rosenwasser
b7d34594ba
Properly handle private/protected members in unions of object types (#38277) (#38334)
* Property handle private/protected properties in unions of object types

* Add regression test

Co-authored-by: Anders Hejlsberg <andersh@microsoft.com>
2020-05-07 13:18:27 -07:00
Anders Hejlsberg
9d6f126c78 Cherry-pick PR #38395 into release-3.9
Component commits:
6fe4be21e4 Exclude arrays and tuples from full intersection property check

9019e399e5 Add regression test
2020-05-07 20:15:20 +00:00
TypeScript Bot
e261cdd2f6
Cherry-pick PR #38228 into release-3.9 (#38350)
Component commits:
956ac2132a Allowed comment directives to be multiline

12749c9291 Added tests, and perhaps fixed a test runner bug?

99bb366fd6 I think it's going to need a consistent variable to loop over

a21477d6ac Used dynamically computed indexes in verifies

992441d9b8 Added multiline tests

199d256ba2 Increased flexibility for multiline comment parsing

65a7587432 Undid a couple of formatting changes; removed backslashes from multiline regexp

036a4ae922 Merge branch 'master'

b620104be2 Merge branch 'master' of https://github.com/microsoft/TypeScript into multiline-comment-directives

Co-authored-by: Orta Therox <orta.therox@gmail.com>
2020-05-06 13:11:45 -07:00
Ron Buckton
e6709a4cd4 Cherry-pick PR #38351 into release-3.9
Component commits:
39e68564ff Fix regression in name resolution in parameter
2020-05-06 16:05:17 +00:00
TypeScript Bot
90570dfe09
Cherry-pick PR #38278 into release-3.9 (#38330)
Component commits:
d905cede25 Add missing getApparentType call

c635e43ccc Add regression tests

Co-authored-by: Anders Hejlsberg <andersh@microsoft.com>
2020-05-04 17:12:58 -07:00
TypeScript Bot
2c9900f9d1
🤖 Pick PR #38273 (Harden node builder APIs to no long...) into release-3.9 (#38333)
* Cherry-pick PR #38273 into release-3.9

Component commits:
c80c177b44 Harden node builder APIs to no longer return `undefined` for a node when `NodeBuilderFlags.IgnoreErrors` is provided

* Undo API changes for release branch

Co-authored-by: Wesley Wigham <t-weswig@microsoft.com>
Co-authored-by: Wesley Wigham <wwigham@gmail.com>
2020-05-04 16:15:41 -07:00
TypeScript Bot
90f12d6396
Cherry-pick PR #38276 into release-3.9 (#38300)
Component commits:
b664c3dc6b Fix jsdoc variadic type nodes not being remapped to equivalent TS in output

Co-authored-by: Wesley Wigham <t-weswig@microsoft.com>
2020-05-04 13:36:02 -07:00
TypeScript Bot
67ca514a7d
Cherry-pick PR #38296 into release-3.9 (#38297)
Component commits:
168be30fe1 Fix incorrect line text computation to stop comment directive searching Fixes #38289

Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
2020-05-04 13:03:18 -07:00
TypeScript Bot
53ee1945aa
Cherry-pick PR #38213 into release-3.9 (#38281)
Component commits:
17f0dfbf9c fix(38177): add auto-import for missing argument type in new functions/methods

Co-authored-by: Alexander T <alexander.tarasyuk@outlook.com>
2020-05-04 12:37:18 -07:00
TypeScript Bot
391a1596be
Cherry-pick PR #38272 into release-3.9 (#38274)
Component commits:
d6477f9167 Fix crash on duplicate default exports

Co-authored-by: Andrew Branch <andrew@wheream.io>
2020-04-30 13:46:59 -07:00
TypeScript Bot
f2c93987c2
🤖 Pick PR #38101 (Skip comparing optional property fl...) into release-3.9 (#38199)
* Cherry-pick PR #38101 into release-3.9

Component commits:
f0aeef14bf Skip comparing optional property flag when comparing against discriminant properties

* Update LKG

Co-authored-by: Wesley Wigham <t-weswig@microsoft.com>
Co-authored-by: typescript-bot <typescript@microsoft.com>
v3.9-rc
2020-04-26 15:30:00 -07:00
TypeScript Bot
cefa5f4b05 Bump version to 3.9.1-rc and LKG 2020-04-24 23:47:49 +00:00
Daniel
b07ed3322a Merge branch 'master' into release-3.9 2020-04-24 23:33:46 +00:00
Daniel Rosenwasser
1b8c68d746
Revert "Add check for delete expression must be optional (#37921)" (#38154)
This reverts commit 39beb1d011a6bc412a67e1dfa2ec1cb1de438b4f.
2020-04-24 16:05:18 -07:00
Ryan Cavanaugh
84c83da3a9
Revert #37106 (#38172) 2020-04-24 16:04:33 -07:00
csigs
b1d464d5e5
LEGO: Merge pull request 38171
LEGO: Merge pull request 38171
2020-04-24 15:11:42 -07:00
csigs
b0b677649a LEGO: check in for master to temporary branch. 2020-04-24 22:10:50 +00:00
Ron Buckton
968943f355
Reset error variable in downlevel for-await-of loop (#38170)
* Rename forAwait tests

* Reset error var in for-await loop
2020-04-24 14:59:41 -07:00
Daniel Rosenwasser
d28e38f573
Revert "make splice deleteCount required in es5.d.ts (#32643)" (#38169)
This reverts commit ddcf139668c3a0aeda1da6a0d44887735ad37cdf.
2020-04-24 14:30:28 -07:00
Alexander T
31b81bafe7
fix(38138): show suggestions for identifier in class property initializer (#38157) 2020-04-24 13:50:34 -07:00
Andrew Branch
ce95d9ca6b
Fix values and types merging in JS module exports (#37896)
* Fix values and types merging in JS module exports

* Fix everything

* Share `setValueDeclaration` between binder (local merge) and checker (cross-file merge)

* Revert accidental changes to baselines

* Update baseline from master merge
2020-04-24 13:49:48 -07:00
Wesley Wigham
1785d6c707
Special-case export assigned namespaces in getSpecifierForModuleSymbol so they behave like their containing module symbol (#38151) 2020-04-24 13:10:34 -07:00
Andrew Branch
fe140acc09
Fix truthiness call check for this-property access (#38163) 2020-04-24 13:02:17 -07:00
Ron Buckton
38ff7762ec
Fix temp variable scoping in async generators (#38121) 2020-04-24 12:10:29 -07:00
Andrew Branch
689822c183
convertToAsyncFunction: Disable for .then with both fulfillment and rejection handlers (#38152)
* Disable convert to async for `.then` with both fulfillment and rejection handlers

* Delete baselines

* Also disable refactor for 3+ arguments
2020-04-24 09:52:18 -07:00
Ron Buckton
a7d6825e25
Fix temp vars referenced in parameter (#38130)
* Fix temp vars referenced in parameter

* Update error message
2020-04-23 20:45:39 -07:00
Wesley Wigham
815dc90dc5
Issue an error on cross-file merges we cant emit (#38148) 2020-04-23 19:01:16 -07:00
Daniel Rosenwasser
d7e437a409
Have the ChangeTracker filter out edits that are no-ops (#38123)
* Filter out edits that are no-ops in 'organize imports'.

* Updated tests for 'organize imports'.

* Always remove no-op changes from the change tracker.

* Add a new `stringContainsAt` helper function to avoid traversing the entire file contents.

* Combine `map`/`filter` sequence into `mapDefined`.

* Fix up documentation.
2020-04-23 12:54:49 -07:00
Andrew Branch
9569e8aaa4
Fix newline issues when adding multiple imports (#38119)
* Add new import declarations in a single TextChanges call

* Refactor
2020-04-23 11:59:38 -07:00
csigs
c28bd6579d
LEGO: Merge pull request 38132
LEGO: Merge pull request 38132
2020-04-22 21:11:18 -07:00
csigs
ef5f0ef58d LEGO: check in for master to temporary branch. 2020-04-23 04:10:34 +00:00
TypeScript Bot
ab0428c82e
Update user baselines (#38109)
Co-authored-by: typescript-bot <typescript@microsoft.com>
2020-04-22 16:58:14 -07:00
Nathan Shively-Sanders
032aa90289
Filter undefined from binding elements with initialisers without undefined in the type (#38122)
* Filter undefined from binding elts w/o undefined-containing inits

* use getTypeOfInitializer instead

* improve comment based on Wesleys suggestion
2020-04-22 15:45:15 -07:00
Josh Goldberg
ef83109dbf
Prefer a likely literal over anonymous type in --noImplicitAny codefixes (#36015)
* Prefer a likely literal over anonymous type in --noImplicitAny codefixes

Before trying to make an anonymous type for a type's usage, we'll first check if there is exactly one builtin primitive the usage is assignable to, and use it if so. Right now that's only `number` and `string` because `boolean` has no distinguishable members.

A couple of implementation details:
* `tryInsertTypeAnnotation` needed to know to insert a type _after_ a node's `exclamationToken` if it exists
* This code area was written before `??` 😉

* Used unknown/any instead of void when applicable

* Fix little whitespace change in tests/cases/fourslash/codeFixInferFromUsagePropertyAccessJS.ts

* Undid some now-unnecessary unknown additions

* Took advice on restricting void to just call expressions
2020-04-22 11:28:11 -07:00
Nathan Shively-Sanders
f248567dab
Filter undefined only in binding patterns in params (#38116)
initialiser. But this is only correct when the initialiser is for a
parameter. For example:

```ts
declare let x: { s: string } | undefined;
const { s } = x;
```

This PR removes undefined from the type of a binding pattern only when
the binding pattern's parent is a parameter. This fixes the regression
from 3.8. However, it's still not the ideal fix; we should be able to
use control flow to solve this problem. Consider:

```ts
const { s }: { s: string } | undefined = { s: 'hi' }
declare function f({ s }: { s: string } | undefined = { s: 'hi' }): void
```

Neither line should have an error, but the first does in 3.8 and after
this change.
2020-04-22 09:56:32 -07:00
Alexander T
d2016912b5
fix(37825): exclude private fields from completions in subclasses (#37906) 2020-04-22 12:07:36 -04:00
Alexander T
92a63741a2
fix(38080): add outlining spans for TypeLiteral (#38089) 2020-04-22 11:51:36 -04:00