Commit Graph
5280 Commits
Author SHA1 Message Date
Nathan Shively-Sanders 7dbea0e82d Merge branch 'master' into fix2-getConstraintOfIndexedAccess 2018-01-10 12:40:35 -08:00
Wesley WighamandGitHub ee87cf409b Print the correct type in the top level chain as the message indicates (#21127) 2018-01-10 11:41:14 -08:00
Wesley WighamandGitHub c9ef52b9d8 Do not always instantiate jsx signatures (#21108) 2018-01-09 17:22:19 -08:00
Stanislav IlievandMohamed Hegazy 03fd77657d Issue implicit any errors for mapped types without annotations (#21104)
* Fixed #21011

* Updated code of merged message

* Reversed message code change and moved error to it's appropriate position

* Applied suggested improvements

* Fixed wrong diagnostics message in checker

* Reverted diagnostic message change
2018-01-09 17:11:57 -08:00
AndyandGitHub 8bce69e6bd Add refactoring to convert CommonJS module to ES6 module (#19916)
* Add refactoring to convert CommonJS module to ES6 module

* Code review

* includeGlobals -> excludeGlobals

* Improve handling of `module.exports = require("...")`

* Allow NoSubstitutionTemplateLiteral as argument to createLiteral
2018-01-09 13:15:47 -08:00
Wesley WighamandGitHub fdd8a52240 Offer per-member diagnostics for incorrectly implemented inherited members (#21036)
* Offer per-member diagnostics for incorrectly implemented inherited members on classes

* Revise error message, make containingChain a thunk

* Fix typo in comment
2018-01-09 10:20:07 -08:00
AndyandGitHub 5ab5694a5b Don't count self-reference in more cases (skip more nodes when setting lastNonBlockLocation) (#21095) 2018-01-09 09:53:39 -08:00
Wenlu WangandMohamed Hegazy 062f97a6fa allow const enum in type query (#21083) 2018-01-09 09:24:00 -08:00
Remo H. JansenandMohamed Hegazy 73e3e8d790 Fixes #20026 (#20157)
* Added test case for #20026

* Implemented #20026

* Addresed comments at Microsoft/TypeScript/pull/20157#discussion_r152086287

* Fixed merge issues

* Fixed baseline issue

* Merged upstream
2018-01-08 17:25:56 -08:00
AndyandMohamed Hegazy 37d4f6a69d Mark references to dynamically-named properties as used (#21010)
* Mark references to dynamically-named properties as used

* Avoid showing the symbol ID

* Use symbolToString instead of showSymbol
2018-01-08 16:44:58 -08:00
Wesley WighamandGitHub 7e6315075d Synthesize namespace records for proper esm interop (#19675)
* Integrate importStar and importDefault helpers

* Accept baselines

* Support dynamic imports, write helpers for umd module (and amd is possible) kinds

* Accept baselines

* Support AMD, use same helper initialization as is normal

* update typechecker to have errors on called imported namespaces and good error recovery with a quickfix

* Overhaul allowSyntheticDefaultExports to be safer

* Put the new behavior behind a flag

* Rename strictESM to ESMInterop

* ESMInterop -> ESModuleInterop, make default for tsc --init

* Rename ESMInterop -> ESModuleInterop in module.ts, add emit test (since fourslash doesnt do that)

* Remove erroneous semicolons from helper

* Reword diagnostic

* Change style

* Edit followup diagnostic

* Add secondary quickfix for call sites, tests forthcoming

* Add synth default to namespace import type, enhance quickfix

* Pair of spare tests for good measure

* Fix typos in diagnostic message

* Improve comment clarity

* Actually accept the updated changes to the esmodule interop description

* ESModule -> esModule

* Use find and not forEach

* Use guard

* Rely on implicit falsiness of Result.False

* These should have been emit flags
2018-01-08 16:36:23 -08:00
Daniel RosenwasserandGitHub 6d596c058e Merge pull request #20726 from kujon/indexable_types
Improved error messaging for index signature parameters
2018-01-08 13:23:39 -08:00
Wenlu WangandMohamed Hegazy a82d1f8580 ignore Initial check if left of DestructuringAsignment (#20906) 2018-01-08 13:13:23 -08:00
Wenlu WangandMohamed Hegazy 06c9a28b36 fix narrowType check with template literals (#21024) 2018-01-08 13:06:58 -08:00
Wesley WighamandGitHub b5fda4970d Use emptyObjectType for omitted members instead of unknownType (#20940)
* Use emptyObjectType for omitted members instead of unknownType

* Use similar logic as is used for empty arrays for missing elements
2018-01-08 12:27:11 -08:00
AndyandGitHub 20c846d671 Add helper functions to simplify getCompletionEntryDisplayNameForSymbol (#20552) 2018-01-08 11:48:25 -08:00
AndyandGitHub 50fa0f61f5 Fix bug: Resolve module symbol before checking whether module export is a re-export (#20989)
* Fix bug: Resolve module symbol before checking whether module export is a re-export

* Remove unnecessary @nolib
2018-01-08 11:33:57 -08:00
AndyandGitHub fef7ad4986 Remove unncessary existence check (#21029) 2018-01-08 11:30:36 -08:00
AndyandGitHub fc18f08e63 Remove 'indexOf' helper, use 'arr.indexOf()' (#20194) 2018-01-08 10:39:52 -08:00
AndyandGitHub 7e150a914e Remove mutually-recursive functions (#20425) 2018-01-08 10:38:11 -08:00
AndyandGitHub 76eafe0e75 Fix invalid cast (#20426) 2018-01-08 10:37:48 -08:00
AndyandGitHub 6f2ba15446 Start linting for double spaces (#20820)
* Start linting for double spaces

* Code review

* Fix cases that were excluded by countDoubleSpaces

* Remove extraneous closing parenthesis
2018-01-08 08:52:13 -08:00
Nathan Shively-SandersandGitHub e78ac47208 Merge pull request #20711 from Microsoft/defer-inference-for-recursive-mapped-types
Defer inference for homomorphic mapped types
2018-01-05 16:01:26 -08:00
Nathan Shively-Sanders f8c86552bc Better name for deferred mapped type:ReverseMapped 2018-01-05 15:44:38 -08:00
AndyandGitHub c6e4373403 In checkAndAggregateReturnExpressionTypes, treat MethodDeclaration in an object literal same as a FunctionExpression (#20052)
* In checkAndAggregateReturnExpressionTypes, treat MethodDeclaration in an object literal same as a FunctionExpression

* Add original test case
2018-01-05 12:34:01 -08:00
AndyandGitHub f6dc0ad707 Check for unused getter/setter in classes (#21013)
* Check for unused getter/setter in classes

* Write-only use of setter is still a reference; and don't error on setter if getter exists
2018-01-05 09:10:58 -08:00
Ron BucktonandGitHub ed5e62442f Merge pull request #20883 from HerringtonDarkholme/relax-type-constraint
fix #20018, allow skip constraint when merging interfaces
2018-01-04 17:09:45 -08:00
Josh GoldbergandMohamed Hegazy 131cf4714c Allowed trailing commas in type parameter/argument lists (#20599)
This change is only one source file and one error file... there must be something I'm missing!?
2018-01-04 16:54:51 -08:00
Matt BiernerandMohamed Hegazy 3f577b8617 Fix quick info for require template string (#20851)
* Fix quick info for require template string

Fixes #20850

* Add path completions tests
2018-01-04 15:17:40 -08:00
Nathan Shively-Sanders 5e7ce21a9e Print inferred mapped property types as any not {}
This makes them compatible in d.ts and slightly less misleading in
services.
2018-01-04 12:34:01 -08:00
Nathan Shively-Sanders b9fb4cce88 Fix quickinfo display of deferred mapped types 2018-01-03 16:26:23 -08:00
Nathan Shively-Sanders 9aa5443bbc Fix printing of deferred mapped types' index signatures 2018-01-03 16:10:26 -08:00
Nathan Shively-Sanders 8616170060 Fix printing of deferred mapped types
A deferred mapped type with a source that has an index signature now
prints {} as the type of the index signature. This avoids an infinite
recursion.
2018-01-03 15:49:09 -08:00
Nathan Shively-Sanders a43adad080 Simplify DeferredMappedType construction 2018-01-03 14:44:34 -08:00
Nathan Shively-Sanders 35244230d5 Add deferred mapped types
This allows index signature inference to be inferred as well.
2018-01-03 14:20:14 -08:00
AndyandGitHub a33f229d82 Support completions contextual types in more places (#20768)
* Support completions contextual types in more places

* Adjust formatting
2018-01-03 13:51:33 -08:00
Nathan Shively-Sanders 7393433593 Merge branch 'master' into defer-inference-for-recursive-mapped-types 2018-01-03 12:19:21 -08:00
Wesley WighamandGitHub e0f20334d2 Use inference for filling JSX attributes in getJsxElementInstanceType (#20973)
* Add simple type inference for JSX elements

* Small cleanups from PR feedback
2018-01-03 11:30:41 -08:00
Nathan Shively-SandersandGitHub 5539e11b76 Merge pull request #20609 from Microsoft/getRootSymbols
Ensure getRootSymbols always works recursively
2018-01-03 09:44:27 -08:00
Wesley WighamandGitHub 29378b2ce2 Call back into getTypeOfFuncClassEnumModule in getTypeOfVariableOrParameterOrProperty if valueDeclaration is irregular kind (#20939) 2018-01-02 17:19:42 -08:00
Daniel RosenwasserandGitHub 0477f91dba Merge pull request #20928 from Microsoft/initializerWithPropertyAccessUseBeforeDeclaration
Check whether we have a class before testing whether we have a super-class
2017-12-29 14:47:13 -08:00
Daniel Rosenwasser ea94a3430d Check whether we have a class before testing whether we have a super-class. 2017-12-29 12:30:27 -08:00
Wesley WighamandGitHub ae211983eb Add method signature handler to getTypeOfVariableOrParameterOrProperty (#20825) 2017-12-28 19:00:54 -08:00
Anders HejlsbergandGitHub ff4f03c51d Merge pull request #20882 from Microsoft/fixNarrowTypeBySwitch
Fix narrowing of type variable in switch statement
2017-12-28 09:22:26 -08:00
Herrington Darkholme 303786a3b8 fix #20018, allow skip constraint when merging interfaces 2017-12-24 17:05:05 +08:00
Anders Hejlsberg 5d3ecaebad Fix narrowTypeBySwitchOnDiscriminant function 2017-12-23 19:12:49 -08:00
Nathan Shively-Sanders 2df7a89e61 Merge branch 'master' into limit-recursive-structured-type-resolution 2017-12-22 14:41:58 -08:00
Nathan Shively-Sanders fb3042c3f7 Move recursion limiter to individual resolve* functions 2017-12-22 14:39:25 -08:00
Wesley WighamandGitHub cedcba9285 Reset partial memberlist on defered circularity to calculate the correct members (#20179)
* Reset partial memberlist on defered circularity to calculate the correct members

* Remove return type
2017-12-22 11:41:39 -08:00
Wesley WighamandGitHub 7ad0d7b9fd Fix higher order inference on indexed access types (#20165) 2017-12-21 14:47:03 -08:00