3268 Commits

Author SHA1 Message Date
Ron Buckton
344dba8809
Fix incorrect parameter types for AsyncIterator next/return (#33354) 2019-09-17 21:02:12 -07:00
Wesley Wigham
56e2cb31ad
Reverse mapped types should have inferable indexes if their source had an inferable index (#33450) 2019-09-17 15:36:00 -07:00
Orta
2c967c49eb
Merge branch 'master' into ts-in-js 2019-09-11 21:22:01 +02:00
Orta
7435425842
Merge pull request #33199 from jack-williams/fix-32809
Fix #32809
2019-09-11 21:07:00 +02:00
Jack Williams
630499eca2 Assume void variables are initialized 2019-09-11 00:02:39 +01:00
Alexander
9ee2b4d526 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-09-07 10:11:49 +03:00
Wesley Wigham
a93298665c
Add heuristic for extracting irreducible null and undefined types from intersections of unions (#33150) 2019-09-06 11:32:22 -07:00
Alexander T
4584b31db8 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-09-05 17:16:25 +03:00
Anders Hejlsberg
c5e6d95e93
Merge pull request #33252 from microsoft/fix33131
Make lower priority inference when source is completely matched in target
2019-09-05 06:27:23 -07:00
Alexander T
7ea134bacd Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-09-05 09:52:04 +03:00
Wesley Wigham
72bb4c2bdc
Mark deep indexed access comparisons as expanding (#33144)
* mark deep indexed accesses as deeply nested in comparisons

* Add test derived from lodash example
2019-09-04 17:00:55 -07:00
Anders Hejlsberg
5de180e878 Merge branch 'master' into fix33131
# Conflicts:
#	src/compiler/checker.ts
2019-09-04 16:54:11 -07:00
Anders Hejlsberg
228b727ff1 Add regression test 2019-09-04 16:49:59 -07:00
Wesley Wigham
3109b646a6
Elevate mapped types over type parameters in the same way as naked type parameters in intersection inference prioritization (#33223) 2019-09-04 16:23:08 -07:00
Nathan Shively-Sanders
8ca36f3516
someTypeRelatedToType now passes isIntersectionConstituent (#33213)
* someTypeRelatedToType now passes isIntersectionConstituent

* Fix [][] lint
2019-09-04 13:36:50 -07:00
Alexander T
0d941d6943 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-21 10:02:57 +03:00
Wesley Wigham
a34ac8084c
Walk up parenthesized type nodes when looking for the type alias hosting a node (#32924) 2019-08-20 16:43:06 -07:00
Alexander T
fea9e11174 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-20 11:07:18 +03:00
Wesley Wigham
fd1e22bbf1
Instantiate generic conditional infer source types in the context of the target conditional (#31545)
* Instantiate generic conditional infer source types in the context of the target conditional

* Add test case from #26627
2019-08-19 13:01:08 -07:00
rChaser53
d75de60548 Fix Cannot read property 'text' of undefined crash (#32734)
* Fix Cannot read property 'text' of undefined crash

* fix condition for tsx

* Rename and improve the method
2019-08-19 12:08:34 -07:00
Wesley Wigham
d9f0212324
Resolve SymbolFlags.Type only at first in jsdoc getTypeFromTypeReference (#32947)
* Fix lookup of exported eunm type alias in local scope in JS

* Fix by adjusting type lookup fallback behavior to not include SymbolFlags.Value in its initial lookup instead
2019-08-19 11:31:47 -07:00
Klaus Meinhardt
1d942f4ddc Detect more TS syntax in JS files
* optional class methods
* type arguments on tagged template expressions
2019-08-18 21:46:53 +02:00
Alexander
a7f41621fb Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-17 16:37:39 +03:00
Brendan Kenny
f45add0a7d checkJs: require JSDoc type argument for Array, Object, and Promise in noImplicitAny (#32829)
* Require type argument for JSDoc Array, Object, and Promise in noImplicitAny

* add jsdoc Array/Object/Promise noImplicitAny tests
2019-08-16 12:41:09 -07:00
Alexander T
b6d981aec8 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-16 12:13:57 +03:00
阿卡琳
a53e4a19ef Allow to omit the begin parameter of %TypedArray%.prototype.subarray (#32125)
* Allow to omit the begin parameter of %TypedArray%.prototype.subarray

* update baselines
2019-08-15 15:58:24 -07:00
Tan Li Hau
dcb763f624 Report error when using generic class in js file (#31723)
* Report error when using generic class in js file

* Replace "ClassDeclaration | ClassExpression" to ClassLikeDeclaration

Co-Authored-By: Klaus Meinhardt <klaus.meinhardt1@gmail.com>

* add noEmit:true
2019-08-15 15:49:50 -07:00
Orta
6cd8bcd6c9
Merge pull request #31185 from collin5/b30851
Restrict spreading for Instantiable Type with non object constraint
2019-08-15 13:50:01 -07:00
Kagami Sascha Rosylight
f304b81fa5 Point es2020 in esnext.d.ts (#32776) 2019-08-15 10:06:46 -07:00
Alexander T
f20a2828f2 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-15 10:32:45 +03:00
Klaus Meinhardt
8eeb763cdd report invalid modifiers on class expression properties
Fixes: #32532
2019-08-14 21:00:19 +02:00
Sheetal Nandi
0e93cf61fc Disallow incremental with noEmit
Fixes #32882
2019-08-14 09:47:49 -07:00
Alexander T
b728bf4bfa Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-14 13:42:02 +03:00
Wesley Wigham
602966ba4e
Fix references to path-mapped ambient modules in declaration files (#32878)
* Fix references to path-mapped ambient modules in declaration files

* Fix lint
2019-08-13 16:34:03 -07:00
Alexander
23a3b340b0 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-10 09:58:25 +03:00
Wesley Wigham
f2719f95b4
Allow functions and ambient classes to merge (#32584) 2019-08-09 16:10:10 -07:00
Ron Buckton
05af8faac6
Support tree-shakable imports for --target es2015 (#32742)
* Support tree-shakable imports for --target es2015

* Alias external helper imports for --module es2015
2019-08-09 14:02:18 -07:00
Alexander T
6988e25985 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-09 09:39:36 +03:00
Nathan Shively-Sanders
b24050aefd
Excess discriminated types match all discriminable properties (#32755)
* Target types in excess property checking must match all discriminable properties

This allows fewer types to be discriminated in excess properties, which
fixes some examples.

* Add excess property test

* Fix semicolon lint

* Remove extra semicolon!

* Improve EPC for unions with multiple discriminants
2019-08-08 15:34:52 -07:00
Alexander
481d70d50d Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-07 21:23:10 +03:00
Wesley Wigham
abd127f308
Only check import = reference when target is Value (#32747) 2019-08-06 16:44:42 -07:00
Wesley Wigham
f333684179
Fix unicode escapes in jsx identifiers and extended unicode characters in jsdoc (#32716)
* Fix unicode escapes in jsx identifiers and extended unicode characters in jsdoc

* Support unicode escapes in JSDoc

* Add tests for extended escapes
2019-08-06 15:14:32 -07:00
Nathan Shively-Sanders
480b73915f
Improve excess property checking for intersections (#32582)
* Improve excess property checking for intersections

Still a draft, the implementation needs improvement

* Use mutable isIntersection in checkTypeRelatedTo

This makes parameter lists a lot shorter. Seems like a slight
improvement, although I can revert if I change my mind.

* Fix semicolon lint

* Remove TODOOOO

* Revert "Use mutable isIntersection in checkTypeRelatedTo"

This reverts commit b8dccff2a25495867cff070b94601015e689b8ff.
2019-08-06 15:03:24 -07:00
Wesley Wigham
d00056f096
Support extended unicode escapes in identifiers, per es6 spec (#32725) 2019-08-06 14:43:41 -07:00
Wesley Wigham
7adc175dfc
Adjust isIdentifierText to skip multiple characters when a code point is multiple chars long (#32720)
* Adjust isIdentifierText to skip multiple characters when a code point is multiple chars long

* Add a few examples with mixed unicode characters

* for posterity, add some unicode cursive script characters

* Test some more planes more explicitly
2019-08-05 23:37:26 -07:00
Alexander T
034ba9fd25 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-06 09:07:48 +03:00
Ron Buckton
e3f4979736
Fix emit for object rest on a module export (#32699)
* Fix emit for object rest on a module export

* Add tests for exports of empty object/array binding patterns

* Add delay for exec to ensure diff tool has enough time to start
2019-08-05 16:53:21 -07:00
Wesley Wigham
3b54ffcf0e
Preserve const enums should keep import refs (#28498)
* Preserve const enums should keep import refs

for exported const enums exported via export default

Move some functionality around, small cleanup

Remove unneeded const enum check

* Only mark const enums as references with preserveConstEnums on in export assignments

* Limit change to declarations and preserveConstEnums mode
2019-08-05 16:47:29 -07:00
Alexander
a292ae1789 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-04 15:35:41 +03:00
Wesley Wigham
6b4f730535
Fix binding of jsdoc typedefs with no in-comment name attached to an expression statement (#32610)
* Fix binding of jsdoc typedefs with no in-comment name attached to an expression statement

* Check toplevel flag before bind

* Small renames
2019-08-02 16:14:19 -07:00