12879 Commits

Author SHA1 Message Date
Anders Hejlsberg
109fcd5d43 Address CR feedback 2018-12-17 15:06:15 -08:00
Anders Hejlsberg
92f47a7a7b Use synthetic access expressions for destructuring control flow analysis 2018-12-15 16:49:53 -08:00
Anders Hejlsberg
43811dd16f Use getIndexedAccessType when computing destructured types 2018-12-13 12:13:13 -08:00
Anders Hejlsberg
fecbdb68bd
Merge pull request #28965 from Microsoft/simplifyIndexedAccess
Simplify indexed access types applied to mapped types
2018-12-11 17:56:03 -08:00
Anders Hejlsberg
0dcaaa5c50 Simplify indexed accesses on mapped types with no depth limit 2018-12-11 15:11:57 -08:00
Daniel Rosenwasser
5ab24ed7e0
Merge pull request #28951 from Microsoft/fixLibToIterableAndES5
Only use 'es2015.iterable' to avoid accidental es2015 feature usage.
2018-12-11 13:29:39 -08:00
Anders Hejlsberg
44116b5241 Simplify indexed accesses on mapped types up to five levels deep 2018-12-11 12:11:07 -08:00
Philip Pesca
e6aa992095 Fix error message when type argument arity is wrong (#28366)
* Fix error message when type argument arity is wrong

* Parenthesize 's' in plurals

* Update baseline

* Update baseline

* Use old error message

* Revert parantheses
2018-12-11 09:54:38 -08:00
Daniel Rosenwasser
28c3663e62 Don't use 'fill' in 'fill'. 2018-12-10 21:20:32 -08:00
Anders Hejlsberg
c5c4908ab6
Merge pull request #28948 from Microsoft/discriminatedUnionIndexSignature
Fix crash related to discriminated unions with index signatures
2018-12-10 17:16:30 -08:00
Daniel Rosenwasser
b99c60a68f
Merge pull request #28921 from ajafff/no-set
Avoid uses of ES6 Set, use Array instead
2018-12-10 17:15:19 -08:00
Daniel Rosenwasser
c77fcf217b
Merge pull request #28932 from j-oliveras/No-es2015-usages
Change es2015 usages to existing ts functions
2018-12-10 17:11:28 -08:00
Anders Hejlsberg
9479353d5c Fix handling of index signatures in discriminated unions 2018-12-10 16:30:21 -08:00
Daniel Rosenwasser
bc59582c7d
Merge pull request #28627 from ajafff/arrow-arguments
ArrowFunction has no own 'arguments'
2018-12-10 11:42:43 -08:00
Daniel Rosenwasser
3e6a666b5e
Merge pull request #28919 from a-tarasyuk/feature/28893-allow-trailing-comma-on-tuple-types
feature/28893 allow trailing comma on tuple types
2018-12-10 11:33:33 -08:00
Anders Hejlsberg
a8964cbc60 Type parameter with 'unknown' constraint not assignable to '{}' 2018-12-10 08:59:12 -08:00
Jordi Oliveras Rovira
6a82b0a96b
Add newline, bad edit 2018-12-09 20:42:02 +01:00
Jordi Oliveras Rovira
3d23e7a0a4 Change usage of String.prototype.startsWith to ts.startsWith. 2018-12-09 20:24:48 +01:00
Jordi Oliveras Rovira
f41b4e088d Change usage of Array.prototype.find to ts.find. 2018-12-09 20:23:56 +01:00
Klaus Meinhardt
67f037ccf4 Avoid uses of ES6 Set, use Array instead
Fixes: #28918
2018-12-08 22:34:47 +01:00
Alexander
94b3d1a2b5 Allow trailing comma on tuple types 2018-12-08 11:53:18 +02:00
Anders Hejlsberg
34d9d4bc8c
Merge pull request #28870 from Microsoft/discriminatedUnionInference
Improved type inference for discriminated unions
2018-12-07 15:44:41 -08:00
Daniel Rosenwasser
8150169762
Merge pull request #28857 from JoshuaKGoldberg/identifiers-after-numeric-literals
Added error for IdentifierStart immediately after a NumericLiteral
2018-12-06 11:49:56 -08:00
Josh Goldberg
a211184347 Clarified error message; extended error to identifier end
Lengthening the reported error length to include all of the identifier necessitates scanning for all of the identifier. I also reset the `pos` after so other identifier scanning still happens.
2018-12-06 11:17:06 -08:00
Anders Hejlsberg
676d8af43a Only infer from constituents with matching discriminants in unions 2018-12-05 11:46:06 -08:00
Anders Hejlsberg
07dbc56208
Merge pull request #28854 from Microsoft/fixExcessPropertyChecks
Improve excess property checks
2018-12-05 08:51:08 -08:00
Wesley Wigham
2109c34a8c
Merge pull request #28856 from weswigham/showConfig-exhaustive-test
Fix paths showConfig, exhaustively test showConfig
2018-12-04 23:19:35 -08:00
Josh Goldberg
51d10ee4a0 Removed excess new check 2018-12-04 18:29:58 -08:00
Josh Goldberg
174816fc26 Added error for IdentifierStart immediately after a NumericLiteral
Fixes #4702.
2018-12-04 17:59:20 -08:00
Wesley Wigham
86ec885c33
Merge pull request #28772 from r7kamura/feature/tsconfig-newline
Add terminating newline to generated tsconfig.json
2018-12-04 16:54:00 -08:00
Wesley Wigham
19de47f2db
Fix paths showConfig, exhaustively test showConfig 2018-12-04 16:24:25 -08:00
Anders Hejlsberg
b34c73f7e8
Merge pull request #28851 from Microsoft/deferConditionalTypes
Defer resolution of conditional types with generic check or extends types
2018-12-04 15:48:57 -08:00
Anders Hejlsberg
1d2df84a77 Improve excess property checking logic 2018-12-04 14:50:56 -08:00
Anders Hejlsberg
b032e063cd Resolve conditional type only when check and extends types are non-generic 2018-12-04 13:06:53 -08:00
Nathan Shively-Sanders
24b39f90c9
Skip implicit any suggestions with no codefix (#28822)
The only unsupported one is binding patterns, which aren't supported by the codefix.
The code was a lot faster to write without supporting them, but there's
no real barrier besides that.
2018-12-04 09:17:37 -08:00
Wesley Wigham
2103ed69e6
Merge pull request #28782 from weswigham/global-merge-no-crash
Fix crash on umd and module merge, allow umds to be accessed when merged with a non-UMD symbol
2018-12-03 09:43:04 -08:00
Wesley Wigham
03a98a2840
Merge pull request #28783 from weswigham/fix-typeparam-parent
Add missing case to declaration diagnostic handler
2018-12-03 09:15:38 -08:00
Anders Hejlsberg
28f8fdaccd
Merge pull request #28784 from Microsoft/controlFlowDestructuringLoop
Fix control flow analysis of destructuring in loops
2018-12-01 07:01:43 -08:00
Wesley Wigham
cd6fdb11d6 Add constructor case 2018-11-30 17:44:25 -08:00
Daniel Rosenwasser
6d2c0037fc Only count singleton unit types. 2018-11-30 16:42:14 -08:00
Anders Hejlsberg
d25baf1c97 Handle destructuring in control flow reference matching 2018-11-30 16:28:10 -08:00
Wesley Wigham
fa8df0d32c Add missing case to declaration diagnostic handler 2018-11-30 16:25:07 -08:00
Wesley Wigham
d92771d61a Fix crash on umd and module merge, allow umds to be accessed when merged with a non-UMD symbol 2018-11-30 15:55:20 -08:00
Daniel Rosenwasser
d35cfc13cf Merge remote-tracking branch 'origin/master' into singlyOverlappyTypes 2018-11-30 15:46:56 -08:00
Daniel Rosenwasser
01f77f7454
Merge pull request #28695 from weswigham/overlappy-count-unit-only
Count only unit types when counting overlapping keys
2018-11-30 15:43:32 -08:00
Daniel Rosenwasser
ba5ba41876 Types are only overlappy if their index types are single 'keyof's or literal types. 2018-11-30 15:09:02 -08:00
r7kamura
0f5121df9f Add terminating newline to generated tsconfig.json
This commit adds a terminating newline to tsconfig.json
generated by `tsc --init`, just like `npm init`'s package.json.

The main reason I created this pull request is for editor friendliness.
Recently I created a new TypeScript project with `tsc --init`,
then I modified some compilerOptions and tried to git-commit the change,
but I found a newline was automatically added by my editor.

I think it's better that the default tsconfig.json template has a
terminating newline.
2018-12-01 03:07:11 +09:00
Anders Hejlsberg
92a8cc9f5f Fix logic that bails out of incremental parsing in certain contexts 2018-11-29 10:19:42 -08:00
Anders Hejlsberg
36dc04b982
Merge pull request #28718 from Microsoft/fixDefinitelyAssignableRelation
Fix definitely assignable relation
2018-11-28 17:38:51 -08:00
Anders Hejlsberg
01ee1b9c25 Exclude T[K] assignability check from definitelyAssignableRelation 2018-11-28 14:56:49 -08:00