Commit Graph
14932 Commits
Author SHA1 Message Date
Daniel Rosenwasser f2d6eda60e Merge pull request #38049 from JoshuaKGoldberg/literal-to-primitive-relation-reporting
Report primitive type in literal-to-primitive relation complaints
2020-05-26 13:18:14 -07:00
Alexander T 6214bd29f3 fix(38722): change error message for use-before-declaration on const enum (#38728) 2020-05-26 11:53:18 -07:00
Nathan Shively-Sanders bfa1744586 Merge pull request #37894 from microsoft/always-error-on-property-override-accessor
Always error on property override accessor
2020-05-26 10:37:07 -07:00
Anders Hejlsberg c5b8f4fcd4 Fix relation between generic mapped types and types with index signatures (#38761)
* Fix relation between generic mapped type and type with index signature(s)

* Add tests
2020-05-25 09:55:41 -07:00
Nathan Shively-Sanders 82d9576d9b Merge branch 'master' into always-error-on-property-override-accessor 2020-05-22 07:41:28 -07:00
Daniel d3d282cb45 Less code 2020-05-22 01:49:26 +00:00
Daniel afe90f1314 Feed generalized source type to elaboration. 2020-05-22 01:02:27 +00:00
Daniel a04ecb592c Check constraints deeply on singleton types. 2020-05-22 00:40:28 +00:00
Daniel 8cf2466110 Merge remote-tracking branch 'origin/master' into literal-to-primitive-relation-reporting 2020-05-22 00:09:52 +00:00
Nathan Shively-Sanders 79f1ec32bd Revert "Wrap classes with decorators or static properties in an IIFE, even for ES2015+ (#32011)"
This reverts commit 7cc4a8df94.
2020-05-21 16:23:04 -07:00
Nathan Shively-Sanders 802e87b1eb Merge branch 'master' into always-error-on-property-override-accessor 2020-05-21 16:08:09 -07:00
Wesley Wigham 0018b8f988 Preserve module marker in es2015+ module emit for tool compatability (#38712) 2020-05-21 14:44:23 -07:00
Nathan Shively-Sanders 0b531720d4 Make new error an error, not message 2020-05-20 16:53:17 -07:00
Nathan Shively-Sanders fc83d10388 Merge branch 'master' into diagnose-accidental-accessor-call 2020-05-20 16:46:34 -07:00
Nathan Shively-Sanders 3340142dda Merge pull request #38607 from a-tarasyuk/bug/38295
fix(38295): Duplicated object key in const not detected when the key is a number preceded by `-` or `+`
2020-05-20 14:52:09 -07:00
Alexander T 4e945fbc98 fix(38299): use string literals as keys to creating rest result (#38600) 2020-05-20 13:52:52 -07:00
Nathan Shively-Sanders 68f8f22032 Merge pull request #38425 from dsherret/fixJSDocTagFactoryFuncReturnTypes
Fix some JSDoc factory function return types
2020-05-20 13:22:21 -07:00
Anders Hejlsberg a56960303d Intersection check for empty object type shouldn't cause circularities (#38673)
* isEmptyAnonymousObjectType shouldn't require full member resolution

* Add regression test
2020-05-20 10:56:14 -07:00
Alexander T bbf56b044b Merge branch 'master' of https://github.com/microsoft/TypeScript into bug/38295 2020-05-20 20:13:50 +03:00
Dmitry MakhnevandDmitry Makhnev dbaeed5ad8 Add d.ts for Intl.RelativeTimeFormat (#36084)
* feat(lib/es2020.intl): Add `Intl.RelativeTimeFormat` (part of #29129);

* fix(lib/es2020.intl): fix for tests and linters `Intl.RelativeTimeFormat` (part of #29129);

* feat(lib/es2020.intl): Add TSDoc for `Intl.RelativeTimeFormat` by review request https://github.com/microsoft/TypeScript/pull/36084#issuecomment-584769420;

* fix(lib/es2020.intl): Fix for tests;

Co-authored-by: Dmitry Makhnev <dmitriy.makhnev@jugru.org>
2020-05-20 11:06:28 -04:00
Alexander T e04ab6938a fix(38295): handle duplicate object literal keys which contain '+' and '-' tokens 2020-05-20 14:32:41 +03:00
Wesley Wigham 5f597e69b2 Support naming tuple members (#38234)
* Initial draft of named tuple members

* Show tuple labels and documentation in completions

* Swap allowed syntax to parameter-like

* Add quickfix for labeled tuple syntax mistakes

* Add refactoring to convert list of signatures to single overload

* Fix small bug in visitor verification

* Signature help for rest parameters which are unions of tuples are displayed as seperate entries now

* Expand sanity check test cases in conformance suite

* Add tests and code for preserving tuple names through spreads where possible

* More refactoring tests, some comment preservation and some fixed formatting of multiline tuples

* Handle missing parameter named in isValidDeclarationForTupleLabel

* Minor text fixes
2020-05-19 15:54:02 -07:00
Daniel Rosenwasser 46f100f8ac Merge pull request #38500 from a-tarasyuk/bug/38485
regression(38485): Unable to specify `rawText` when programmatically creating tagged template literals
2020-05-19 14:24:25 -07:00
Anders Hejlsberg 7ba0a6592d No contextual types from circular mapped type properties (#38653)
* No contextual types from circular mapped type properties

* Add regression test
2020-05-19 13:42:30 -07:00
Anders Hejlsberg 3c1f37e913 Use control flow analysis to check 'super(...)' call before 'this' access (#38612)
* Use CFA graph to check this/super accesses are preceded by super() call

* Accept cleaned-up API baselines

* Accept new baselines

* Add tests
2020-05-16 19:58:17 -07:00
Eli Barzilay 33c3e9e2c6 Make processTaggedTemplateExpression visit a returned node
This problem was introduced in 70399e146e (from PR #23801), which added
a `visitTaggedTemplateExpression` case for `TaggedTemplateExpression`,
before that, it would fallback to the default of `visitNode`.  So re-add
that happen in `processTaggedTemplateExpression`.

Since it doesn't hurt, I left a `Debug.checkDefined(property.name)`
instead of `!`-ing it.

Fixes #38558.
2020-05-15 19:46:45 -04:00
Ron Buckton 1cbe7ef000 Fix crash in JS declaration emit (#38508)
* Fix crash in JS decl emit

* Emit as class with private ctor
2020-05-15 14:00:59 -07:00
Wesley Wigham 7fc456f2d7 Include unknown in spread prop override check (#38577) 2020-05-14 14:36:38 -07:00
Greg Hurrell cfc4573c82 Fix (cosmetic) typos in checker.ts comments
Just some small things I noticed while looking at some recent PRs.
2020-05-14 19:40:41 +02:00
Anders Hejlsberg c1f676dd3f Perform intersection reduction before and after getApparentType (#38565)
* Perform intersection reduction before and after getApparentType

* Add regression tests
2020-05-13 20:57:17 -07:00
Daniel Rosenwasser b682ee1a8a Merge pull request #38489 from microsoft/removeDuplicateInfo
Remove duplicate JSDoc comments
2020-05-12 12:52:15 -07:00
Daniel Rosenwasser c2b559403d Merge pull request #38502 from alan-agius4/export-star-colon
fix: add missing semi-colon to `__exportStar` unnamed function
2020-05-12 10:59:03 -07:00
Nathan Shively-Sanders cbf15bb6ed feat(38225): change diagnostic message for remove braces from arrow function body (#38226) 2020-05-12 07:27:09 -07:00
Alan Agius 7ec21e93fe fix: add missing semi-colon to __exportStar unnamed function
Fixes #38501
2020-05-12 13:27:01 +02:00
Alexander T ee3f2ce362 regression(38485): allow using rawText property in processing a tagged template 2020-05-12 12:30:46 +03:00
Daniel Rosenwasser f9e1bcd0c4 Merge pull request #38439 from lissein/void-0-template-strings
Changed template strings to emit void 0 instead of undefined (#38430)
2020-05-11 17:09:28 -07:00
Daniel e9867a7353 Add and use the 'intersperse' helper function. 2020-05-11 22:17:01 +00:00
Ron Buckton d07e866a28 Fix for jsdoc modifiers on constructor params (#38403)
* Fix for jsdoc modifiers on constructor params

* Update Public API baseline and fix unique symbol grammar check for js
2020-05-11 15:07:43 -07:00
Nathan Shively-Sanders 1a88430a7e Improve assert message in binder (#38270)
* 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.

* fix lint

* 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-11 13:40:54 -07:00
Wenqi 1b7b3eb0f7 report error for duplicate @type declaration (#38340) 2020-05-11 12:47:49 -07:00
lissein 946abeadb0 Changed template strings to emit void 0 instead of undefined (#38430)
undefined is not a keyword in es5 and es3 so we now emit void 0 instead in template strings.
2020-05-09 04:53:14 +02:00
Wesley Wigham 7b03835b77 Fix js missing type arguments on existing nodes and jsdoc object literal declaration emit (#38368)
* Fix js missing type arguments on existing nodes and jsdoc object literal declaration emit

* Add special lookups test case, rename helper

* Accept slightly modified baselines
2020-05-08 10:46:28 -07:00
David Sherret 84f89f8702 Fix some JSDoc factory function return types. 2020-05-08 12:26:50 -04:00
Anders Hejlsberg 0091fd6c64 Exclude arrays and tuples from full intersection property check (#38395)
* Exclude arrays and tuples from full intersection property check

* Add regression test
2020-05-07 15:03:51 -07:00
Anders Hejlsberg 7798f532df Fix crash caused by assertion with evolving array type (#38398)
* Properly finalize evolving array type in getTypeAtFlowCall

* Add regression test
2020-05-07 14:05:57 -07:00
Jack Williams 05d59a1f1a Unify logic in typeof narrowing (#33434) 2020-05-06 15:15:24 -07:00
Alexander TandNathan Shively-Sanders 683b3ec058 feat(37782): 'declare method' quick fix for adding a private method (#37806)
* feat(37782): add quick-fix action to declare a private method for names that start from underscore

* better merge order in messages json

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-05-06 15:10:02 -07:00
Wenlu WangandNathan Shively-Sanders e66ce879a9 expose jsdoc factory (#29539)
* expose jsdoc factory

* refactor jsdoc factory

* correctly jsdoc factory types

* update jsdoc factory

* Add check for delete expression must be optional

* accept new basseline

* Revert "Add check for delete expression must be optional"

This reverts commit 76937c3b1a.

* remove newline

* make linter happy

* Add deprecated comment

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-05-06 15:06:12 -07:00
Nathan Shively-Sanders 35c1ba67ba Update LKG 2020 05 06 (#38371)
* Update LKG

* remove now-extraneous casts
2020-05-06 14:42:05 -07:00
Josh GoldbergandOrta Therox be2eb8a2e1 Allowed comment directives to be multiline (#38228)
* Allowed comment directives to be multiline

* Added tests, and perhaps fixed a test runner bug?

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

* Used dynamically computed indexes in verifies

* Added multiline tests

* Increased flexibility for multiline comment parsing

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

* Added baseline tests for multiline comment skipping

Co-authored-by: Orta Therox <orta.therox@gmail.com>
2020-05-06 13:09:29 -07:00