Skip to content

Commit f069534

Browse files
committed
Merge branch 'master' into builderAPI
2 parents b3dac18 + fb6ae38 commit f069534

File tree

56 files changed

+30039
-394
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+30039
-394
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
2+
# TypeScript
3+
4+
[![Join the chat at https://gitter.im/Microsoft/TypeScript](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Microsoft/TypeScript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
15
[![Build Status](https://travis-ci.org/microsoft/TypeScript.svg?branch=master)](https://travis-ci.org/Microsoft/TypeScript)
26
[![VSTS Build Status](https://dev.azure.com/typescript/TypeScript/_apis/build/status/Typescript/node10)](https://dev.azure.com/typescript/TypeScript/_build/latest?definitionId=4&view=logs)
37
[![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript)
48
[![Downloads](https://img.shields.io/npm/dm/typescript.svg)](https://www.npmjs.com/package/typescript)
59

6-
# TypeScript
710

8-
[![Join the chat at https://gitter.im/Microsoft/TypeScript](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Microsoft/TypeScript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
911

1012
[TypeScript](https://www.typescriptlang.org/) is a language for application-scale JavaScript. TypeScript adds optional types to JavaScript that support tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the [playground](https://www.typescriptlang.org/play/), and stay up to date via [our blog](https://blogs.msdn.microsoft.com/typescript) and [Twitter account](https://twitter.com/typescript).
1113

src/compiler/checker.ts

Lines changed: 125 additions & 122 deletions
Large diffs are not rendered by default.

src/compiler/types.ts

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2546,6 +2546,8 @@ namespace ts {
25462546
Shared = 1 << 10, // Referenced as antecedent more than once
25472547
PreFinally = 1 << 11, // Injected edge that links pre-finally label and pre-try flow
25482548
AfterFinally = 1 << 12, // Injected edge that links post-finally flow with the rest of the graph
2549+
/** @internal */
2550+
Cached = 1 << 13, // Indicates that at least one cross-call cache entry exists for this node, even if not a loop participant
25492551
Label = BranchLabel | LoopLabel,
25502552
Condition = TrueCondition | FalseCondition
25512553
}
@@ -3967,6 +3969,8 @@ namespace ts {
39673969
StructuredOrInstantiable = StructuredType | Instantiable,
39683970
/* @internal */
39693971
ObjectFlagsType = Nullable | Never | Object | Union | Intersection,
3972+
/* @internal */
3973+
Simplifiable = IndexedAccess | Conditional | Substitution,
39703974
// 'Narrowable' types are types where narrowing actually narrows.
39713975
// This *should* be every type other than null, undefined, void, and never
39723976
Narrowable = Any | Unknown | StructuredOrInstantiable | StringLike | NumberLike | BigIntLike | BooleanLike | ESSymbol | UniqueESSymbol | NonPrimitive,
@@ -4339,8 +4343,8 @@ namespace ts {
43394343
root: ConditionalRoot;
43404344
checkType: Type;
43414345
extendsType: Type;
4342-
trueType: Type;
4343-
falseType: Type;
4346+
resolvedTrueType: Type;
4347+
resolvedFalseType: Type;
43444348
/* @internal */
43454349
resolvedInferredTrueType?: Type; // The `trueType` instantiated with the `combinedMapper`, if present
43464350
/* @internal */
@@ -4425,15 +4429,16 @@ namespace ts {
44254429
export type TypeMapper = (t: TypeParameter) => Type;
44264430

44274431
export const enum InferencePriority {
4428-
NakedTypeVariable = 1 << 0, // Naked type variable in union or intersection type
4429-
HomomorphicMappedType = 1 << 1, // Reverse inference for homomorphic mapped type
4430-
MappedTypeConstraint = 1 << 2, // Reverse inference for mapped type
4431-
ReturnType = 1 << 3, // Inference made from return type of generic function
4432-
LiteralKeyof = 1 << 4, // Inference made from a string literal to a keyof T
4433-
NoConstraints = 1 << 5, // Don't infer from constraints of instantiable types
4434-
AlwaysStrict = 1 << 6, // Always use strict rules for contravariant inferences
4435-
4436-
PriorityImpliesCombination = ReturnType | MappedTypeConstraint | LiteralKeyof, // These priorities imply that the resulting type should be a combination of all candidates
4432+
NakedTypeVariable = 1 << 0, // Naked type variable in union or intersection type
4433+
HomomorphicMappedType = 1 << 1, // Reverse inference for homomorphic mapped type
4434+
PartialHomomorphicMappedType = 1 << 2, // Partial reverse inference for homomorphic mapped type
4435+
MappedTypeConstraint = 1 << 3, // Reverse inference for mapped type
4436+
ReturnType = 1 << 4, // Inference made from return type of generic function
4437+
LiteralKeyof = 1 << 5, // Inference made from a string literal to a keyof T
4438+
NoConstraints = 1 << 6, // Don't infer from constraints of instantiable types
4439+
AlwaysStrict = 1 << 7, // Always use strict rules for contravariant inferences
4440+
4441+
PriorityImpliesCombination = ReturnType | MappedTypeConstraint | LiteralKeyof, // These priorities imply that the resulting type should be a combination of all candidates
44374442
}
44384443

44394444
/* @internal */

src/lib/es5.d.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,9 +1446,7 @@ type Extract<T, U> = T extends U ? T : never;
14461446
/**
14471447
* Construct a type with the properties of T except for those in type K.
14481448
*/
1449-
type Omit<T, K extends keyof any> = {
1450-
[P in Exclude<keyof T, K>]: T[P]
1451-
};
1449+
type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
14521450

14531451
/**
14541452
* Exclude null and undefined from T

tests/baselines/reference/api/tsserverlibrary.d.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2391,8 +2391,8 @@ declare namespace ts {
23912391
root: ConditionalRoot;
23922392
checkType: Type;
23932393
extendsType: Type;
2394-
trueType: Type;
2395-
falseType: Type;
2394+
resolvedTrueType: Type;
2395+
resolvedFalseType: Type;
23962396
}
23972397
interface SubstitutionType extends InstantiableType {
23982398
typeVariable: TypeVariable;
@@ -2419,12 +2419,13 @@ declare namespace ts {
24192419
enum InferencePriority {
24202420
NakedTypeVariable = 1,
24212421
HomomorphicMappedType = 2,
2422-
MappedTypeConstraint = 4,
2423-
ReturnType = 8,
2424-
LiteralKeyof = 16,
2425-
NoConstraints = 32,
2426-
AlwaysStrict = 64,
2427-
PriorityImpliesCombination = 28
2422+
PartialHomomorphicMappedType = 4,
2423+
MappedTypeConstraint = 8,
2424+
ReturnType = 16,
2425+
LiteralKeyof = 32,
2426+
NoConstraints = 64,
2427+
AlwaysStrict = 128,
2428+
PriorityImpliesCombination = 56
24282429
}
24292430
/** @deprecated Use FileExtensionInfo instead. */
24302431
type JsFileExtensionInfo = FileExtensionInfo;

tests/baselines/reference/api/typescript.d.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2391,8 +2391,8 @@ declare namespace ts {
23912391
root: ConditionalRoot;
23922392
checkType: Type;
23932393
extendsType: Type;
2394-
trueType: Type;
2395-
falseType: Type;
2394+
resolvedTrueType: Type;
2395+
resolvedFalseType: Type;
23962396
}
23972397
interface SubstitutionType extends InstantiableType {
23982398
typeVariable: TypeVariable;
@@ -2419,12 +2419,13 @@ declare namespace ts {
24192419
enum InferencePriority {
24202420
NakedTypeVariable = 1,
24212421
HomomorphicMappedType = 2,
2422-
MappedTypeConstraint = 4,
2423-
ReturnType = 8,
2424-
LiteralKeyof = 16,
2425-
NoConstraints = 32,
2426-
AlwaysStrict = 64,
2427-
PriorityImpliesCombination = 28
2422+
PartialHomomorphicMappedType = 4,
2423+
MappedTypeConstraint = 8,
2424+
ReturnType = 16,
2425+
LiteralKeyof = 32,
2426+
NoConstraints = 64,
2427+
AlwaysStrict = 128,
2428+
PriorityImpliesCombination = 56
24282429
}
24292430
/** @deprecated Use FileExtensionInfo instead. */
24302431
type JsFileExtensionInfo = FileExtensionInfo;

0 commit comments

Comments
 (0)