20035 Commits

Author SHA1 Message Date
Ryan Cavanaugh
885d4d63c8
Remove "generate types" code (#31075) 2019-04-23 13:51:47 -07:00
Wesley Wigham
b47194bfa1
Fix contextual types for a single jsx child (#31040) 2019-04-23 13:51:39 -07:00
Andrii Dieiev
54fa950757 Skip primitive types comparison with array and object types (#31077) 2019-04-23 13:49:32 -07:00
Wesley Wigham
b02b823f03
Track parameter references errors in resolve name rather than secondary pass (#30349) 2019-04-23 13:46:19 -07:00
tkondo
84b8ab816c Fix iterable SetConstructor interface (#29777) 2019-04-23 13:27:30 -07:00
Klaus Meinhardt
760393f893 fix false positive 'variable is used before being assigned' in destructuring (#29636)
Fixes: #29458
2019-04-23 13:22:37 -07:00
Matt McCutchen
6487d1ffe0 Remove the rule that replaces a union of literal types with the base type when comparing equality to a type that isn't a union of literal types. (#27588)
type when comparing equality to a type that isn't a union of literal
types.

The rule is redundant because a primitive type is already directed-
comparable to a value of that primitive type, and it causes errors to be
missed when comparing a type parameter _constrained_ by a union of
literal types to another union of literal types.

The baseline changes look like improvements to me.

Fixes #26758.
2019-04-23 12:59:07 -07:00
Wenlu Wang
bd178746de improve error message when type have same name (#27065)
* improve error message when type have same name

* fix lint and function name

* update test case

* accept baseline
2019-04-23 12:56:03 -07:00
Andrew Branch
cd56398a53
Merge pull request #30743 from andrewbranch/bug/30675
Make anonymous function formatting apply to anonymous generators too
2019-04-23 09:35:35 -07:00
Daniel Rosenwasser
c74d25c115
30837 - Bad error message when default 'import'-ing an 'export =' without 'esModuleInterop' (#30847)
30837 - Bad error message when default 'import'-ing an 'export =' without 'esModuleInterop'
2019-04-23 11:23:06 -04:00
Daniel Rosenwasser
6427711f99
Better erreor messages for properties mis-handled as shorthand property declarations (#31039)
Better erreor messages for properties mis-handled as shorthand property declarations
2019-04-22 16:14:21 -04:00
Wesley Wigham
7a3e68fc5c
Only return the substitute in substitution instantiation when assignability fails (rather than subtype) (#31027)
* Only return the substitute in substitution instantiation when assignability fails (rather than subtype)

* Add test from issue
2019-04-19 16:02:11 -07:00
Wesley Wigham
40a2eb2b4b
Unify couldContainTypeVariables and the similar check done during instantiation (#30969)
* Stop symbol based filtering in couldContainTypeVariables

* Unify couldContainTypeVariables and the similar check done during instantiation
2019-04-19 16:01:53 -07:00
Wesley Wigham
1a4c15fb11
handle generic types in getArrayifiedType (#30606) 2019-04-19 14:32:33 -07:00
karthikkp
181d126b02 diagnostic messages conflicts resolved 2019-04-20 01:38:17 +05:30
Daniel Rosenwasser
2eea21636b
Merge pull request #29242 from Kingwl/attach_property_to_default_export
add transformer for emit add property to default export
2019-04-18 23:30:48 -04:00
Andrew Branch
b6a0988052
Merge pull request #30776 from andrewbranch/feature/10178
Add flag to allow access to UMD globals from modules
2019-04-18 18:05:44 -07:00
Matt Bierner
7ccc89b0d7 Check to make sure default npm exists at path before trying to use it (#30910)
* Check to make sure default npm exists at path before trying to use it

**Bug**
If the typings installer is run under a copy of node that does not include npm—but on a machine that does have npm installed—it will incorrectly try to use the npm that does not exist next to its running version of node

**Fix**
Make sure that we check that npm we select exists before trying to use it as the default. Otherwise, fall back to using plain old `npm`

* Add command line flag to gate new behavior

* Fix missing semicolon
2019-04-18 14:24:41 -07:00
Nathan Shively-Sanders
c3a9429420
Handle JSDoc backticks in the parser, not scanner (#30939)
* Scan backticks in jsdoc as a single token less often

Previously, matching backticks in jsdoc would always be scanned as one
token to aid parsing incorrect jsdoc that uses backticks for parameter
names:

``js
/** @param {string} `nope`
 * @param {number} `not needed`
 */
```

However, this is wrong for code fences, which use triple backticks. This
fix parses a single backtick as a single token if it's immediately
followed by another backtick or by a newline. It retains the
questionable tokenisation of backticks-as-pairs in other cases, however.
A better fix might be to have the parser ignore backticks in jsdoc
instead.

* Add test case

* Handle jsdoc backticks in the parser, not scanner

Previously, the jsdoc scanner had ad-hoc handling of backticks that was
similar in structure to the normal scanner's handling, but much simpler.
This was a smaller code change, but is handled backwards: the special
case of backtick-quoted parameter names was handled in the scanner
instead of in the jsdoc identifier parsing code. That made it overapply
and block correct handling of asterisks across newlines, which was most
obvious in code fences inside jsdoc, as in #23517.

Fixes #23517

* More cleanup
2019-04-18 09:35:40 -07:00
Anders Hejlsberg
33c3ce9cd0
Merge pull request #31002 from Microsoft/fixIsStringIndexSignatureOnlyType
Fix isStringIndexSignatureOnlyType function
2019-04-17 17:19:34 -07:00
Sheetal Nandi
b337565747 Merge branch 'master' into tsbuildTestPerf 2019-04-17 16:05:00 -07:00
Sheetal Nandi
0c18d032e7 Merge branch 'master' into incrementalLateSymbol 2019-04-17 15:41:53 -07:00
Sheetal Nandi
acbedade42 No need to fix hash of lib files since the content is now fixed 2019-04-17 15:37:56 -07:00
Sheetal Nandi
dc7d77f2c7 Make the tsbuild tests use simple libFile instead of bigger lib file set 2019-04-17 15:35:00 -07:00
Sheetal Nandi
b9145f98e1
Merge pull request #30980 from Microsoft/configChangeForEmit
Make sure to emit again if change in compiler option affects emit
2019-04-17 15:14:12 -07:00
Anders Hejlsberg
a40b08d1d7
Merge pull request #30944 from Microsoft/fixInferenceToMappedType
Fix inference from enum object type to generic mapped type
2019-04-17 15:10:34 -07:00
Anders Hejlsberg
9b3b8e3203 Ignore generic mapped types in isStringIndexSignatureOnlyType 2019-04-17 14:59:28 -07:00
Nathan Shively-Sanders
4420d1083b
Add diagnostics for relation cache size (#30999)
* Add diagnostics for relation cache size

* Move to extendedDiagnostics

* Single method that returns a 3-property object

* Fix double-space lint
2019-04-17 14:32:18 -07:00
Anders Hejlsberg
50fdeccd7f One more iteration 2019-04-17 13:58:05 -07:00
Sheetal Nandi
3af78ae77a Revert and always use merged symbol to get members of late bound symbol
Fixes #30891
2019-04-17 12:58:12 -07:00
Wesley Wigham
169e485d90
Perform excess property checking on intersection and union members (#30853)
* Perform excess property checking on intersection and union members

* Allow partial union props to contain the undefined type

* Add test case from #30771

* Un-terse getPossiblePropertiesOfUnionType side-effecting code

* Fix bug exposed in RWC

* Cache results of getPossiblePropertiesOfUnionType

* Fix whitespace
2019-04-16 21:58:48 -07:00
Anders Hejlsberg
3435451dcc Even more succinct 2019-04-16 18:26:24 -07:00
Anders Hejlsberg
efa16ac11f Address CR feedback 2019-04-16 17:41:33 -07:00
Sheetal Nandi
15ae8a7273 Make sure to emit again if change in compiler option affects emit
Fixes #30736
2019-04-16 16:18:37 -07:00
Sheetal Nandi
3c67608715 When interfaces are merged, always ensure that the parent symbol of the late bound member symbol is declared symbol containing the node.
Ensure that resolvedMembers adds the late bound symbol even when its resolved sunce lateBoundMember may or may not be added to resolved members depending on when its checked
Fixes #30891
2019-04-16 12:36:46 -07:00
Sheetal Nandi
9f5090cec7 Test case for #30891 2019-04-16 12:33:21 -07:00
Anders Hejlsberg
f617d1641b
Merge pull request #30963 from Microsoft/fixObjectFlagsPropagation
Fix object flags propagation
2019-04-16 07:25:41 -10:00
Anders Hejlsberg
6ac0dbcaef Propagate ObjectFlags.NonInferrableType through widening 2019-04-16 09:46:45 -07:00
Alexander T
f5d4e66451 Bad error message when default 'import'-ing an 'export =' without 'esModuleInterop' 2019-04-16 14:39:16 +03:00
Wesley Wigham
d405662eb6
Explicitly encode keyof behaviors for never and unknown into getIndexType (#30753)
* Explicitly encode keyof behaviors for never and unknown into getIndexType

* Merge similar cases
2019-04-15 17:52:13 -07:00
Anders Hejlsberg
cc2ea68492 Fix inference from enum object type to generic mapped type 2019-04-15 15:06:44 -07:00
Daniel Rosenwasser
3dc78b6f3b
Merge pull request #30916 from jack-williams/array-elaboration
Elaborate array and tuple relation errors
2019-04-15 14:00:22 -07:00
Andrew
13d9f08976 Gracefully parse 'super' with type arguments (#10677) (#30913) 2019-04-15 13:06:29 -07:00
Jack Williams
2ea91a0e9c Elaborate array and tuple relation errors 2019-04-15 18:16:38 +01:00
Anders Hejlsberg
b9f805f2f4 Remove incorrect optimization in getUnionConstraintOfIntersection 2019-04-13 08:15:28 -10:00
Adam Postma
e951455215 Update misspelling 'identifer' to 'identifier' (#30894)
* fix typo - identifer to identifier

* fix typo - identifer to identifier
2019-04-12 13:29:00 -07:00
Anders Hejlsberg
4574c7a375
Merge pull request #30877 from Microsoft/fixConditionalTypeSimplification
Fix conditional type simplification
2019-04-12 07:35:19 -10:00
Anders Hejlsberg
6282645e3c
Merge pull request #30857 from Microsoft/fixInferenceToIntersection
Fix inference to intersections
2019-04-12 07:34:40 -10:00
Anders Hejlsberg
6cd229b4b9
Merge pull request #30769 from Microsoft/saferIndexedAccessTypes
Improve soundness of indexed access types
2019-04-12 07:33:50 -10:00
Anders Hejlsberg
2ee2ffb8e7 Use object identity check instead of IsTypeIdenticalTo 2019-04-11 16:14:21 -10:00