Commit Graph

2802 Commits

Author SHA1 Message Date
Ron Buckton b460d8cd26 Expose getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment with better name (#31564) 2019-05-23 17:50:44 -07:00
Anders Hejlsberg 4b5968eb6d Revert change to substitution type simplification 2019-05-14 07:45:29 -07:00
Anders Hejlsberg 1b3589ba27 Remove simplification logic from getConditionalType + simplify substitution types 2019-05-13 16:23:51 -07:00
Wesley Wigham 8ba53b6fd5 Simplify conditionals upon comparison, rather than instantiation 2019-05-13 11:18:28 -07:00
Anders Hejlsberg 71fe8e824e Defer resolution of the true and false branches of conditional types 2019-05-11 09:39:06 -07:00
Anders Hejlsberg ae3d1d45c1 Merge pull request #31221 from microsoft/improveReverseMappedTypes
Improve reverse mapped types
2019-05-10 13:42:22 -07:00
Wesley Wigham d8f2702a5d Cache control flow results across invocations (#31003)
* Modify flow loop cache key to include all inputs

* Add test case, cache similarly to loop cache, reuse loop cache key (now corrected)

* Use simpler singleton key and type cache for FlowAssignment nodes
2019-05-10 11:48:44 -07:00
Anders Hejlsberg 4af3a3b541 Lower priority for inferences made from partial reverse mapped types 2019-05-08 14:11:51 -07:00
Ron Buckton 0c1a283bf9 Add opt-in behavior for custom transforms to support bundles 2019-05-07 17:29:02 -07:00
Titian Cernicova-Dragomir 4b77f34243 Fixed several typos, mostly in comments and parameter names. (#31287) 2019-05-07 11:00:56 -07:00
Wesley Wigham b365e657d4 Add unmeasurable variance kind for marking types whose variance result is unreliable (#30416)
* Add unmeasurable variance kind for marking types whose variance result is unreliable

* Remove now-unneeded nongeneric checks

* Add rule allowing `Readonly<any>` to be `any` instead of `{readonly [index: string]: any}`

* All Unmeasurable variances to still shortcut structural comparisons in some cases

* Separate unmeasurable from unreliable to reduce the impact of this change, for now

* Fix lint

* Remove Readonly<any> -> any callout

* Add fix for circularity error triggered by deep signature return type comparisons with `this` types
2019-05-03 14:42:17 -07:00
Klaus Meinhardt 5bc8a8dddf JSDocTypeTag.typeExpression is not optional (#30452) 2019-04-30 09:46:32 -07:00
Sheetal Nandi 1e22110991 Merge branch 'master' into cacheParseConfigFile 2019-04-29 13:08:30 -07:00
Sheetal Nandi d4c2fdc6fd Make changes to public API 2019-04-26 13:59:04 -07:00
Kagami Sascha Rosylight 1a75d525fa add ES2020 matchAll APIs (#30936) 2019-04-25 14:11:50 -07:00
Sheetal Nandi fecafebf76 Add getParsedCommandLine optional method on compiler host to be able to provide parsedCommandLine instead of redoing work 2019-04-24 11:57:49 -07:00
David Sherret 8fc6640f55 Rename _objectLiteralBrandBrand to _objectLiteralBrand. (#30797) 2019-04-23 14:33:54 -07: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
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
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
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
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
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
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 411e7144a9 Add new nonInferrableType with ObjectFlags.NonInferrableType 2019-04-10 16:53:38 -10:00
Andrew Branch 2ee93bf0f2 Add allowUmdGlobalAccess flag 2019-04-08 09:46:46 -07:00
Anders Hejlsberg 294580287d Merge branch 'master' into saferIndexedAccessTypes 2019-04-05 16:23:48 -10:00
Wesley Wigham ca98a50574 Use const contexts and tuple mapped types to simplify some explicitly elucidated types (#30654)
* Use const contexts and tuple mapped types to simplify some explicitly elucidated types

* Fix lint

* Further cleanup - refactor mapped type into its own alias for readability

* Slightly more cleanup - PragmaPsuedoMap neednt be partial, thus removing tons of nonull assertions

* Remove GH#18217 comments
2019-04-02 13:04:51 -07:00
Anders Hejlsberg fc95dc42f9 Improve soundness of indexed access type relations 2019-03-29 13:00:00 -07:00
Wesley Wigham b7881a26a0 Unify substitution type any handling into costruction and instantiation (#30592)
* Unify substitution type `any` handling into costruction and instantiation

* Strengthen supertype reduction check to reduce breakage

* Rename conditional type fields per convention

* Explicitly handle anyish signatures in compareSignaturesRelated so strict variance doesnt kill subtyping

* Allow tuple expansions to an `any` rest to be considered an `any` signature as well
2019-03-27 12:55:17 -07:00
Sheetal Nandi 8da384d32a Report output file not built error for any module resolution that ends up to source file
Fixes #29918
2019-03-21 08:55:12 -07:00
Gabriela Britto 10b9051624 Fix convert to named parameters rest parameter tuple (#30286)
* check if rest parameter is of tuple type in isOptionalParameter

* expose isArrayType and isTupleType in checker

* don't offer refactor if rest parameter type is neither array nor tuple type

* add tests for rest parameters

* fix tests for renamed refactor

* remove unnecessary conditional operator
2019-03-18 10:31:38 -07:00
Anders Hejlsberg d0646a629a Merge pull request #30084 from dragomirtitian/GH-26563
Improved argument description for parameters originating from tuples
2019-03-18 06:14:52 -10:00
Sheetal Nandi bd229b5ed1 Exclude Json files from Project reference redirects from files to be emitted list
Fixes #30382
2019-03-14 11:22:26 -07:00
Anders Hejlsberg ba95fcac87 Merge pull request #30334 from Microsoft/inferenceContextCleanup
Revise InferenceContext implementation
2019-03-12 10:13:55 -07:00
Anders Hejlsberg de3f5f90cd Remove redundant typeParameters property from InferenceContext 2019-03-12 06:17:33 -07:00
Wenlu Wang b97b1a8de6 add jsx factory and hold text in jsxtext node (#29439)
* add jsx factory and hold text in jsxtext node

* update jsxtext prop name and factory
2019-03-11 16:00:18 -07:00
Anders Hejlsberg af8cf90e49 InferenceContext has-a (not is-a) mapper and has-a new nonFixingMapper 2019-03-11 15:56:03 -07:00
Anders Hejlsberg 42b6ef0c96 Rename contextualMapper to inferenceContext (which it always is) 2019-03-11 06:45:26 -07:00
Titian Cernicova-Dragomir d433042386 Fixed isVariadic handling when signature parameters are expanded for itemInfoForParameters 2019-03-11 02:55:10 +02:00
Titian Cernicova-Dragomir 88babf2a90 Merge remote-tracking branch 'remotes/origin/master' into GH-26563 2019-03-11 02:31:07 +02:00
Anders Hejlsberg 79813b8ece Show expanded parameter lists in signature help 2019-03-09 12:23:57 -08:00
Sheetal Nandi 97fbc87e98 Merge pull request #29813 from Microsoft/incrementalBuildInfo
Build .tsbuildinfo file when building using tsc --b
2019-03-08 15:49:44 -08:00
Ron Buckton 6607e00b8f Merge pull request #30259 from Microsoft/transformFlagCleanup
Transform flag cleanup
2019-03-08 15:08:26 -08:00
Sheetal Nandi 409d6c911e Add compiler version to buildInfo 2019-03-08 13:32:43 -08:00
Sheetal Nandi 990b199ebd Merge branch 'master' into incrementalBuildInfo 2019-03-08 11:42:19 -08:00
Ron Buckton 1c0f9a8ce3 Renumber transform flags 2019-03-07 10:52:17 -08:00
Ron Buckton 8e5178d6e6 Merge branch 'master' into transformFlagCleanup 2019-03-07 10:46:38 -08:00
Ron Buckton 1f212ec265 Remove DestructuringAssignment and Generator flags 2019-03-06 15:04:13 -08:00
Ron Buckton cc9e2f4e57 Remove Super/ContainsSuper transform flags 2019-03-06 14:33:42 -08:00