3543 Commits

Author SHA1 Message Date
Ron Buckton
346d488c62 Merge branch 'master' into emitHelper 2016-11-15 17:13:57 -08:00
Anders Hejlsberg
73ada7a78d Merge pull request #12251 from Microsoft/fixTypePredicateStructuralMatch
Fix type predicates with structurally identical types
2016-11-15 13:20:35 -08:00
Anders Hejlsberg
0ba23483e8 Merge pull request #12276 from Microsoft/libMappedTypes
Predefined mapped types in lib.d.ts
2016-11-15 13:19:58 -08:00
Anders Hejlsberg
fe3f88cd08 Properly handle identity relation for mapped types 2016-11-15 12:14:02 -08:00
Nathan Shively-Sanders
2496756aed Merge branch 'master' into object-spread-rest-fixes 2016-11-15 11:19:01 -08:00
Nathan Shively-Sanders
b9fa06f90b Address PR commennts
Update baselines with smaller emit as part of that.
2016-11-15 09:10:55 -08:00
Nathan Shively-Sanders
a74e9d8ccf Merge pull request #12158 from Microsoft/fix-literal-comparability-in-relational-comparison-operators
Fix literal comparability in relational comparison operators
2016-11-15 08:24:06 -08:00
Anders Hejlsberg
d2c0952801 Revert type predicates to not have instanceof special casing 2016-11-14 17:13:49 -08:00
Nathan Shively-Sanders
6f274eaabe Spread+rest fixes
1. Rename finds identifiers in spread assignment expressions.
2. Spreads with computed properties of type number or any no longer
crash the compiler.
3. Rest emit uses indexOf === -1 instead of !indexOf to filter properties.
4. Rest emit correctly refers to computed properties' generated temps.
2016-11-14 16:20:43 -08:00
Ron Buckton
bb218107a9 Fix missing alias for decorated classes in es5 2016-11-14 15:50:47 -08:00
Ron Buckton
cb1bb19358 Update comment 2016-11-14 15:26:33 -08:00
Ron Buckton
06a13b9d10 Fix string constituent check in checkElementTypeOfArrayOrString 2016-11-14 15:22:04 -08:00
Mohamed Hegazy
a0338d15e1 Ignore optionality in the comparable relationship (#12202)
* Added tests.

* Accepted baselines.

* Avoid checking for optionality in comparability checks.

* Accepted baselines.
2016-11-14 10:47:48 -08:00
Anders Hejlsberg
f437c8f318 Merge pull request #12114 from Microsoft/mappedTypes
Mapped types
2016-11-13 15:39:32 -08:00
Anders Hejlsberg
cd05c079ce Add comment explaining type alias instantiation strategy 2016-11-13 15:25:16 -08:00
Anders Hejlsberg
24567445d6 Add early bail out for call expressions that are never type predicates 2016-11-13 08:29:21 -08:00
Daniel Rosenwasser
375437ef3c Avoid checking for optionality in comparability checks. 2016-11-12 12:59:43 -08:00
Anders Hejlsberg
9ac7667d5c Address CR feedback 2016-11-12 08:55:23 -08:00
Nathan Shively-Sanders
9b2b2ca19b Error on non-identifier rest in destructuring assignment 2016-11-11 08:56:35 -08:00
Anders Hejlsberg
364142c062 Improve type inference for types with same generic type alias 2016-11-11 07:39:51 -08:00
Nathan Shively-Sanders
e301cfe58c Raise literal type to its base in a comparison
Similar to ===, except that it always applies, even when comparing two
literals.
2016-11-10 14:29:48 -08:00
Mohamed Hegazy
d537b79c61 Merge release-2.1 into master (#12157)
* Update LKG

* Update version

* Update LKG

* Skip overloads with too-short function parameters

If the parameter of an overload is a function and the argument is also a
function, skip the overload if the parameter has fewer arguments than
the argument does. That overload cannot possibly apply, and should not
participate in, for example, contextual typing.

Example:

```ts
interface I {
  (a: number): void;
  (b: string, c): void;
}
declare function f(i: I): void;
f((x, y) => {});
```

This code now skips the first overload instead of considering.

This was a longstanding bug but was only uncovered now that more
functions expressions are context sensitive.

* Test skip overloads w/too-short function params

1. Update changed baseline.
2. Add a new test with baseline.

* Minor style improvements

* Ignore optionality when skipping overloads

* Do not use contextual signatures with too few parameters

* isAritySmaller runs later: getNonGenericSignature

* rewrite void-returning statements in constructors that capture result of super call (#11868)

* rewrite void-returning statements in constructors that capture result of super call

* linter

* Update LKG

* Fix emit inferred type which is a generic type-alias both fully and partially fill type parameters

* Add tests and baselines

* Skip trying to use alias if there is target type

* Update baselines

* Add diagnostics to remind adding tsconfig file for certain external project (#11932)

* Add diagnostics for certain external project

* Show tsconfig suggestion

* fix lint error

* Address pr

* fix comment

* Update error message

* Flag for not overwrite js files by default without generating errors (#11980)

* WIP

* Properly naming things

* refactor

* apply the option to all files and check out options

* Fix typo

* Update LKG

* lockLinter

* use local registry to check if typings package exist (#12014) (#12032)

use local registry to check if typings package exist

* Add test for https://github.com/Microsoft/TypeScript/pull/11980 (#12027)

* add test for the fix for overwrite emitting error

* cr feedback

* enable sending telemetry events to tsserver client (#12034) (#12051)

enable sending telemetry events

* Update LKG

* Reuse subtree transform flags for incrementally parsed nodes (#12088)

* Update LKG

* Update version

* Update LKG

* Do not emit "use strict" when targeting es6 or higher or module kind is es2015 and the file is external module

* Add tests and baselines

* [Release 2.1] fix11754 global augmentation (#12133)

* Exclude global augmentation from module resolution logic

* Address PR: check using string literal instead of NodeFlags.globalAugmentation

* Remove comment
2016-11-10 14:28:34 -08:00
Nathan Shively-Sanders
6e1aac1c42 Merge pull request #12147 from mylesmegyesi/12050-IncompatableAssignementOfIdenticallyNamedTypes
Adds error message for incompatible assignment of identically named type
2016-11-10 13:17:31 -08:00
Nathan Shively-Sanders
0d4ac01574 Report errors for import helpers missing __rest 2016-11-10 11:45:56 -08:00
Anders Hejlsberg
64d269885c Merge branch 'master' into mappedTypes
# Conflicts:
#	src/compiler/checker.ts
2016-11-10 11:17:53 -08:00
Anders Hejlsberg
aca1ab3bfe Check mapped type constraint is assignable to string | number 2016-11-10 10:41:17 -08:00
Anders Hejlsberg
b81c226639 Use pull model to obtain type alias information for type nodes 2016-11-10 10:31:24 -08:00
Sheetal Nandi
c458576553 Merge pull request #12135 from Microsoft/jsxFactory
Support for --jsxFactory option
2016-11-10 09:49:57 -08:00
Myles Megyesi
c05e226c4b
Adds error message for incompatible assignment of identically named type
Fixes issue #12050
2016-11-10 11:32:03 -06:00
Nathan Shively-Sanders
be5e5fb872 Merge pull request #11150 from Microsoft/object-spread
Object spread/rest
2016-11-10 09:28:58 -08:00
Nathan Shively-Sanders
6398e0d6dd Merge pull request #11633 from Microsoft/fix-comparable-in-switch
Fix comparable in switch
2016-11-10 09:20:46 -08:00
Nathan Shively-Sanders
25462c9571 Merge pull request #12028 from Microsoft/object-rest
Object rest
2016-11-10 09:18:13 -08:00
Anders Hejlsberg
2170ff6f16 Defer resolution of mapped types to enable recursive definitions 2016-11-10 09:11:21 -08:00
Sheetal Nandi
dd7f00f20b Parse the jsxFactory again in the checker instead of using cached value in the program 2016-11-10 08:54:13 -08:00
Sheetal Nandi
06affa6672 Resolve first identifier of the jsxFactory as part of type check 2016-11-09 15:35:54 -08:00
Nathan Shively-Sanders
fcf32c444f Treat | undefined like optionality in spread type 2016-11-09 13:39:42 -08:00
Anders Hejlsberg
3dd11e48a9 Properly implement type relationship for '[P in S]: X' and '[P in T]: Y' 2016-11-09 09:59:15 -08:00
Ron Buckton
bac9350847 Merge branch 'master' into emitHelper 2016-11-08 16:36:31 -08:00
Anders Hejlsberg
aca7e2fa3b Don't include private/protected properties in keyof T 2016-11-08 13:38:52 -08:00
Anders Hejlsberg
cf2953bc44 Add relations for keyof S / keyof T and [P in S]: X / [P in T]: X 2016-11-08 12:21:44 -08:00
Anders Hejlsberg
a562d6e63f Make keyof T assignable to and subtype of string | number 2016-11-08 10:14:44 -08:00
Anders Hejlsberg
7ca5923214 Merge branch 'master' into mappedTypes
# Conflicts:
#	src/compiler/checker.ts
2016-11-08 07:12:35 -08:00
Anders Hejlsberg
8aef1e6bb1 Type inference for mapped types 2016-11-08 06:55:35 -08:00
Anders Hejlsberg
2282477012 Merge pull request #12068 from Microsoft/fixTypeAliasDisplay
Fix type alias display
2016-11-08 06:43:38 -08:00
Nathan Shively-Sanders
e1c50e1c40 Address more PR comments 2016-11-07 13:57:26 -08:00
Nathan Shively-Sanders
bd5ce284c9 Set spread type symbols in checkObjectLiteral
Instead of getSpreadType.

Also clean up special-case handling inside getSpreadType to be more
readable.
2016-11-07 13:35:36 -08:00
Nathan Shively-Sanders
567f5636e3 Create spread property types eagerly
This avoids the need for a synthetic symbol and later code called from
getTypeOfSymbol.
2016-11-07 13:02:05 -08:00
Nathan Shively-Sanders
1866d0580c Rename variable in checkSwitchStatement per PR 2016-11-07 11:16:54 -08:00
Nathan Shively-Sanders
609cd0016b Merge branch 'object-spread' into object-rest 2016-11-07 11:10:29 -08:00
Nathan Shively-Sanders
f03fecbd31 Merge branch 'master' into object-spread 2016-11-07 11:02:49 -08:00