Skip to content

Commit c1edbb8

Browse files
committed
Merge branch 'master' into incrementalBuild
2 parents abc8618 + fadd95f commit c1edbb8

File tree

62 files changed

+1690
-119
lines changed

Some content is hidden

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

62 files changed

+1690
-119
lines changed

completionAtDottedNamespace.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference path='fourslash.ts'/>
2+
3+
////namespace wwer./**/w
4+
5+
verify.completions({ marker: "", exact: [], isNewIdentifierLocation: true });

src/compiler/binder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ namespace ts {
753753

754754
function isNarrowableReference(expr: Expression): boolean {
755755
return expr.kind === SyntaxKind.Identifier || expr.kind === SyntaxKind.ThisKeyword || expr.kind === SyntaxKind.SuperKeyword ||
756-
isPropertyAccessExpression(expr) && isNarrowableReference(expr.expression) ||
756+
(isPropertyAccessExpression(expr) || isNonNullExpression(expr) || isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression) ||
757757
isElementAccessExpression(expr) && expr.argumentExpression &&
758758
(isStringLiteral(expr.argumentExpression) || isNumericLiteral(expr.argumentExpression)) &&
759759
isNarrowableReference(expr.expression);

src/compiler/builder.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ namespace ts {
9999
if (useOldState) {
100100
// Verify the sanity of old state
101101
if (!oldState!.currentChangedFilePath) {
102-
Debug.assert(!oldState!.affectedFiles && (!oldState!.currentAffectedFilesSignatures || !oldState!.currentAffectedFilesSignatures!.size), "Cannot reuse if only few affected files of currentChangedFile were iterated");
102+
const affectedSignatures = oldState!.currentAffectedFilesSignatures;
103+
Debug.assert(!oldState!.affectedFiles && (!affectedSignatures || !affectedSignatures.size), "Cannot reuse if only few affected files of currentChangedFile were iterated");
103104
}
104105
if (canCopySemanticDiagnostics) {
105106
Debug.assert(!forEachKey(oldState!.changedFilesSet, path => oldState!.semanticDiagnosticsPerFile!.has(path)), "Semantic diagnostics shouldnt be available for changed files");

src/compiler/checker.ts

Lines changed: 98 additions & 70 deletions
Large diffs are not rendered by default.

src/compiler/diagnosticMessages.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1776,7 +1776,7 @@
17761776
"category": "Error",
17771777
"code": 2496
17781778
},
1779-
"Module '{0}' resolves to a non-module entity and cannot be imported using this construct.": {
1779+
"This module can only be referenced with ECMAScript imports/exports by turning on the '{0}' flag and referencing its default export.": {
17801780
"category": "Error",
17811781
"code": 2497
17821782
},
@@ -4815,5 +4815,9 @@
48154815
"Add names to all parameters without names": {
48164816
"category": "Message",
48174817
"code": 95073
4818+
},
4819+
"Enable the 'experimentalDecorators' option in your configuration file": {
4820+
"category": "Message",
4821+
"code": 95074
48184822
}
48194823
}

src/compiler/emitter.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2561,6 +2561,7 @@ namespace ts {
25612561
function emitJsxSelfClosingElement(node: JsxSelfClosingElement) {
25622562
writePunctuation("<");
25632563
emitJsxTagName(node.tagName);
2564+
emitTypeArguments(node, node.typeArguments);
25642565
writeSpace();
25652566
emit(node.attributes);
25662567
writePunctuation("/>");
@@ -2577,6 +2578,7 @@ namespace ts {
25772578

25782579
if (isJsxOpeningElement(node)) {
25792580
emitJsxTagName(node.tagName);
2581+
emitTypeArguments(node, node.typeArguments);
25802582
if (node.attributes.properties && node.attributes.properties.length > 0) {
25812583
writeSpace();
25822584
}

src/compiler/parser.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7774,17 +7774,18 @@ namespace ts {
77747774
const libReferenceDirectives = context.libReferenceDirectives;
77757775
forEach(toArray(entryOrList), (arg: PragmaPseudoMap["reference"]) => {
77767776
// TODO: GH#18217
7777+
const { types, lib, path } = arg!.arguments;
77777778
if (arg!.arguments["no-default-lib"]) {
77787779
context.hasNoDefaultLib = true;
77797780
}
7780-
else if (arg!.arguments.types) {
7781-
typeReferenceDirectives.push({ pos: arg!.arguments.types!.pos, end: arg!.arguments.types!.end, fileName: arg!.arguments.types!.value });
7781+
else if (types) {
7782+
typeReferenceDirectives.push({ pos: types.pos, end: types.end, fileName: types.value });
77827783
}
7783-
else if (arg!.arguments.lib) {
7784-
libReferenceDirectives.push({ pos: arg!.arguments.lib!.pos, end: arg!.arguments.lib!.end, fileName: arg!.arguments.lib!.value });
7784+
else if (lib) {
7785+
libReferenceDirectives.push({ pos: lib.pos, end: lib.end, fileName: lib.value });
77857786
}
7786-
else if (arg!.arguments.path) {
7787-
referencedFiles.push({ pos: arg!.arguments.path!.pos, end: arg!.arguments.path!.end, fileName: arg!.arguments.path!.value });
7787+
else if (path) {
7788+
referencedFiles.push({ pos: path.pos, end: path.end, fileName: path.value });
77887789
}
77897790
else {
77907791
reportDiagnostic(arg!.range.pos, arg!.range.end - arg!.range.pos, Diagnostics.Invalid_reference_directive_syntax);

src/compiler/program.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2234,8 +2234,9 @@ namespace ts {
22342234
processReferencedFiles(file, isDefaultLib);
22352235
processTypeReferenceDirectives(file);
22362236
}
2237-
2238-
processLibReferenceDirectives(file);
2237+
if (!options.noLib) {
2238+
processLibReferenceDirectives(file);
2239+
}
22392240

22402241
modulesWithElidedImports.set(file.path, false);
22412242
processImportedModules(file);
@@ -2322,8 +2323,10 @@ namespace ts {
23222323
processReferencedFiles(file, isDefaultLib);
23232324
processTypeReferenceDirectives(file);
23242325
}
2326+
if (!options.noLib) {
2327+
processLibReferenceDirectives(file);
2328+
}
23252329

2326-
processLibReferenceDirectives(file);
23272330

23282331
// always process imported modules to record module name resolutions
23292332
processImportedModules(file);

src/compiler/transformers/ts.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,6 +1898,7 @@ namespace ts {
18981898
case SyntaxKind.StringLiteral:
18991899
return createIdentifier("String");
19001900

1901+
case SyntaxKind.PrefixUnaryExpression:
19011902
case SyntaxKind.NumericLiteral:
19021903
return createIdentifier("Number");
19031904

src/compiler/types.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3916,7 +3916,9 @@ namespace ts {
39163916
aliasTypeArguments?: ReadonlyArray<Type>; // Alias type arguments (if any)
39173917
/* @internal */ aliasTypeArgumentsContainsMarker?: boolean; // Alias type arguments (if any)
39183918
/* @internal */
3919-
wildcardInstantiation?: Type; // Instantiation with type parameters mapped to wildcard type
3919+
permissiveInstantiation?: Type; // Instantiation with type parameters mapped to wildcard type
3920+
/* @internal */
3921+
restrictiveInstantiation?: Type; // Instantiation with type parameters mapped to unconstrained form
39203922
/* @internal */
39213923
immediateBaseConstraint?: Type; // Immediate base constraint cache
39223924
}

0 commit comments

Comments
 (0)