mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'master' into interfaceFixes
This commit is contained in:
@@ -2,6 +2,7 @@ language: node_js
|
||||
|
||||
node_js:
|
||||
- 'stable'
|
||||
- '6'
|
||||
- '4'
|
||||
|
||||
sudo: false
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import jobs.generation.Utilities;
|
||||
def project = GithubProject
|
||||
def branch = GithubBranchName
|
||||
|
||||
def nodeVersions = ['stable', '4']
|
||||
def nodeVersions = ['stable', '6', '4']
|
||||
|
||||
nodeVersions.each { nodeVer ->
|
||||
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@
|
||||
"tsserver": "./bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8.0"
|
||||
"node": ">=4.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/browserify": "latest",
|
||||
|
||||
+93
-50
@@ -472,9 +472,7 @@ namespace ts {
|
||||
// other kinds of value declarations take precedence over modules
|
||||
target.valueDeclaration = source.valueDeclaration;
|
||||
}
|
||||
forEach(source.declarations, node => {
|
||||
target.declarations.push(node);
|
||||
});
|
||||
addRange(target.declarations, source.declarations);
|
||||
if (source.members) {
|
||||
if (!target.members) target.members = createMap<Symbol>();
|
||||
mergeSymbolTable(target.members, source.members);
|
||||
@@ -1106,7 +1104,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function getDeclarationOfAliasSymbol(symbol: Symbol): Declaration | undefined {
|
||||
return forEach(symbol.declarations, d => isAliasSymbolDeclaration(d) ? d : undefined);
|
||||
return find<Declaration>(symbol.declarations, isAliasSymbolDeclaration);
|
||||
}
|
||||
|
||||
function getTargetOfImportEqualsDeclaration(node: ImportEqualsDeclaration): Symbol {
|
||||
@@ -1447,9 +1445,8 @@ namespace ts {
|
||||
// May be an untyped module. If so, ignore resolutionDiagnostic.
|
||||
if (!isRelative && resolvedModule && !extensionIsTypeScript(resolvedModule.extension)) {
|
||||
if (isForAugmentation) {
|
||||
Debug.assert(!!moduleNotFoundError);
|
||||
const diag = Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented;
|
||||
error(errorNode, diag, moduleName, resolvedModule.resolvedFileName);
|
||||
error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName);
|
||||
}
|
||||
else if (compilerOptions.noImplicitAny && moduleNotFoundError) {
|
||||
error(errorNode,
|
||||
@@ -1750,7 +1747,19 @@ namespace ts {
|
||||
}
|
||||
|
||||
function getAccessibleSymbolChain(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags, useOnlyExternalAliasing: boolean): Symbol[] {
|
||||
function getAccessibleSymbolChainFromSymbolTable(symbols: SymbolTable): Symbol[] {
|
||||
function getAccessibleSymbolChainFromSymbolTable(symbols: SymbolTable) {
|
||||
return getAccessibleSymbolChainFromSymbolTableWorker(symbols, []);
|
||||
}
|
||||
|
||||
function getAccessibleSymbolChainFromSymbolTableWorker(symbols: SymbolTable, visitedSymbolTables: SymbolTable[]): Symbol[] {
|
||||
if (contains(visitedSymbolTables, symbols)) {
|
||||
return undefined;
|
||||
}
|
||||
visitedSymbolTables.push(symbols);
|
||||
const result = trySymbolTable(symbols);
|
||||
visitedSymbolTables.pop();
|
||||
return result;
|
||||
|
||||
function canQualifySymbol(symbolFromSymbolTable: Symbol, meaning: SymbolFlags) {
|
||||
// If the symbol is equivalent and doesn't need further qualification, this symbol is accessible
|
||||
if (!needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning)) {
|
||||
@@ -1772,34 +1781,36 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
// If symbol is directly available by its name in the symbol table
|
||||
if (isAccessible(symbols[symbol.name])) {
|
||||
return [symbol];
|
||||
}
|
||||
function trySymbolTable(symbols: SymbolTable) {
|
||||
// If symbol is directly available by its name in the symbol table
|
||||
if (isAccessible(symbols[symbol.name])) {
|
||||
return [symbol];
|
||||
}
|
||||
|
||||
// Check if symbol is any of the alias
|
||||
return forEachProperty(symbols, symbolFromSymbolTable => {
|
||||
if (symbolFromSymbolTable.flags & SymbolFlags.Alias
|
||||
&& symbolFromSymbolTable.name !== "export="
|
||||
&& !getDeclarationOfKind(symbolFromSymbolTable, SyntaxKind.ExportSpecifier)) {
|
||||
if (!useOnlyExternalAliasing || // We can use any type of alias to get the name
|
||||
// Is this external alias, then use it to name
|
||||
ts.forEach(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration)) {
|
||||
// Check if symbol is any of the alias
|
||||
return forEachProperty(symbols, symbolFromSymbolTable => {
|
||||
if (symbolFromSymbolTable.flags & SymbolFlags.Alias
|
||||
&& symbolFromSymbolTable.name !== "export="
|
||||
&& !getDeclarationOfKind(symbolFromSymbolTable, SyntaxKind.ExportSpecifier)) {
|
||||
if (!useOnlyExternalAliasing || // We can use any type of alias to get the name
|
||||
// Is this external alias, then use it to name
|
||||
ts.forEach(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration)) {
|
||||
|
||||
const resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable);
|
||||
if (isAccessible(symbolFromSymbolTable, resolveAlias(symbolFromSymbolTable))) {
|
||||
return [symbolFromSymbolTable];
|
||||
}
|
||||
const resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable);
|
||||
if (isAccessible(symbolFromSymbolTable, resolveAlias(symbolFromSymbolTable))) {
|
||||
return [symbolFromSymbolTable];
|
||||
}
|
||||
|
||||
// Look in the exported members, if we can find accessibleSymbolChain, symbol is accessible using this chain
|
||||
// but only if the symbolFromSymbolTable can be qualified
|
||||
const accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined;
|
||||
if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) {
|
||||
return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports);
|
||||
// Look in the exported members, if we can find accessibleSymbolChain, symbol is accessible using this chain
|
||||
// but only if the symbolFromSymbolTable can be qualified
|
||||
const accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTableWorker(resolvedImportedSymbol.exports, visitedSymbolTables) : undefined;
|
||||
if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) {
|
||||
return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (symbol) {
|
||||
@@ -4603,12 +4614,22 @@ namespace ts {
|
||||
|
||||
function getModifiersTypeFromMappedType(type: MappedType) {
|
||||
if (!type.modifiersType) {
|
||||
// If the mapped type was declared as { [P in keyof T]: X } or as { [P in K]: X }, where
|
||||
// K is constrained to 'K extends keyof T', then we will copy property modifiers from T.
|
||||
const declaredType = <MappedType>getTypeFromMappedTypeNode(type.declaration);
|
||||
const constraint = getConstraintTypeFromMappedType(declaredType);
|
||||
const extendedConstraint = constraint.flags & TypeFlags.TypeParameter ? getConstraintOfTypeParameter(<TypeParameter>constraint) : constraint;
|
||||
type.modifiersType = extendedConstraint.flags & TypeFlags.Index ? instantiateType((<IndexType>extendedConstraint).type, type.mapper || identityMapper) : emptyObjectType;
|
||||
const constraintDeclaration = type.declaration.typeParameter.constraint;
|
||||
if (constraintDeclaration.kind === SyntaxKind.TypeOperator) {
|
||||
// If the constraint declaration is a 'keyof T' node, the modifiers type is T. We check
|
||||
// AST nodes here because, when T is a non-generic type, the logic below eagerly resolves
|
||||
// 'keyof T' to a literal union type and we can't recover T from that type.
|
||||
type.modifiersType = instantiateType(getTypeFromTypeNode((<TypeOperatorNode>constraintDeclaration).type), type.mapper || identityMapper);
|
||||
}
|
||||
else {
|
||||
// Otherwise, get the declared constraint type, and if the constraint type is a type parameter,
|
||||
// get the constraint of that type parameter. If the resulting type is an indexed type 'keyof T',
|
||||
// the modifiers type is T. Otherwise, the modifiers type is {}.
|
||||
const declaredType = <MappedType>getTypeFromMappedTypeNode(type.declaration);
|
||||
const constraint = getConstraintTypeFromMappedType(declaredType);
|
||||
const extendedConstraint = constraint.flags & TypeFlags.TypeParameter ? getConstraintOfTypeParameter(<TypeParameter>constraint) : constraint;
|
||||
type.modifiersType = extendedConstraint.flags & TypeFlags.Index ? instantiateType((<IndexType>extendedConstraint).type, type.mapper || identityMapper) : emptyObjectType;
|
||||
}
|
||||
}
|
||||
return type.modifiersType;
|
||||
}
|
||||
@@ -7224,6 +7245,25 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function isUnionOrIntersectionTypeWithoutNullableConstituents(type: Type): boolean {
|
||||
if (!(type.flags & TypeFlags.UnionOrIntersection)) {
|
||||
return false;
|
||||
}
|
||||
// at this point we know that this is union or intersection type possibly with nullable constituents.
|
||||
// check if we still will have compound type if we ignore nullable components.
|
||||
let seenNonNullable = false;
|
||||
for (const t of (<UnionOrIntersectionType>type).types) {
|
||||
if (t.flags & TypeFlags.Nullable) {
|
||||
continue;
|
||||
}
|
||||
if (seenNonNullable) {
|
||||
return true;
|
||||
}
|
||||
seenNonNullable = true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare two types and return
|
||||
* * Ternary.True if they are related with no assumptions,
|
||||
@@ -7258,7 +7298,7 @@ namespace ts {
|
||||
// and intersection types are further deconstructed on the target side, we don't want to
|
||||
// make the check again (as it might fail for a partial target type). Therefore we obtain
|
||||
// the regular source type and proceed with that.
|
||||
if (target.flags & TypeFlags.UnionOrIntersection) {
|
||||
if (isUnionOrIntersectionTypeWithoutNullableConstituents(target)) {
|
||||
source = getRegularTypeOfObjectLiteral(source);
|
||||
}
|
||||
}
|
||||
@@ -11334,13 +11374,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function checkSpreadExpression(node: SpreadElement, contextualMapper?: TypeMapper): Type {
|
||||
// It is usually not safe to call checkExpressionCached if we can be contextually typing.
|
||||
// You can tell that we are contextually typing because of the contextualMapper parameter.
|
||||
// While it is true that a spread element can have a contextual type, it does not do anything
|
||||
// with this type. It is neither affected by it, nor does it propagate it to its operand.
|
||||
// So the fact that contextualMapper is passed is not important, because the operand of a spread
|
||||
// element is not contextually typed.
|
||||
const arrayOrIterableType = checkExpressionCached(node.expression, contextualMapper);
|
||||
const arrayOrIterableType = checkExpression(node.expression, contextualMapper);
|
||||
return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, /*allowStringInput*/ false);
|
||||
}
|
||||
|
||||
@@ -11630,8 +11664,11 @@ namespace ts {
|
||||
if (propertiesArray.length > 0) {
|
||||
spread = getSpreadType(spread, createObjectLiteralType(), /*isFromObjectLiteral*/ true);
|
||||
}
|
||||
spread.flags |= propagatedFlags;
|
||||
spread.symbol = node.symbol;
|
||||
if (spread.flags & TypeFlags.Object) {
|
||||
// only set the symbol and flags if this is a (fresh) object type
|
||||
spread.flags |= propagatedFlags;
|
||||
spread.symbol = node.symbol;
|
||||
}
|
||||
return spread;
|
||||
}
|
||||
|
||||
@@ -16573,6 +16610,10 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function getParameterTypeNodeForDecoratorCheck(node: ParameterDeclaration): TypeNode {
|
||||
return node.dotDotDotToken ? getRestParameterElementType(node.type) : node.type;
|
||||
}
|
||||
|
||||
/** Check the decorators of a node */
|
||||
function checkDecorators(node: Node): void {
|
||||
if (!node.decorators) {
|
||||
@@ -16604,7 +16645,7 @@ namespace ts {
|
||||
const constructor = getFirstConstructorWithBody(<ClassDeclaration>node);
|
||||
if (constructor) {
|
||||
for (const parameter of constructor.parameters) {
|
||||
markTypeNodeAsReferenced(parameter.type);
|
||||
markTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter));
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -16613,15 +16654,17 @@ namespace ts {
|
||||
case SyntaxKind.GetAccessor:
|
||||
case SyntaxKind.SetAccessor:
|
||||
for (const parameter of (<FunctionLikeDeclaration>node).parameters) {
|
||||
markTypeNodeAsReferenced(parameter.type);
|
||||
markTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter));
|
||||
}
|
||||
|
||||
markTypeNodeAsReferenced((<FunctionLikeDeclaration>node).type);
|
||||
break;
|
||||
|
||||
case SyntaxKind.PropertyDeclaration:
|
||||
markTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(<ParameterDeclaration>node));
|
||||
break;
|
||||
case SyntaxKind.Parameter:
|
||||
markTypeNodeAsReferenced((<PropertyDeclaration | ParameterDeclaration>node).type);
|
||||
markTypeNodeAsReferenced((<PropertyDeclaration>node).type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -18092,7 +18135,7 @@ namespace ts {
|
||||
|
||||
const baseTypeNode = getClassExtendsHeritageClauseElement(node);
|
||||
if (baseTypeNode) {
|
||||
if (languageVersion < ScriptTarget.ES2015) {
|
||||
if (languageVersion < ScriptTarget.ES2015 && !isInAmbientContext(node)) {
|
||||
checkExternalEmitHelpers(baseTypeNode.parent, ExternalEmitHelpers.Extends);
|
||||
}
|
||||
|
||||
|
||||
@@ -156,6 +156,9 @@ namespace ts {
|
||||
|
||||
if (!skipTrailingComments) {
|
||||
emitLeadingComments(detachedRange.end, /*isEmittedNode*/ true);
|
||||
if (hasWrittenComment && !writer.isAtStartOfLine()) {
|
||||
writer.writeLine();
|
||||
}
|
||||
}
|
||||
|
||||
if (extendedDiagnostics) {
|
||||
|
||||
@@ -6337,7 +6337,7 @@ namespace ts {
|
||||
break;
|
||||
case SyntaxKind.AsteriskToken:
|
||||
const asterisk = scanner.getTokenText();
|
||||
if (state === JSDocState.SawAsterisk) {
|
||||
if (state === JSDocState.SawAsterisk || state === JSDocState.SavingComments) {
|
||||
// If we've already seen an asterisk, then we can no longer parse a tag on this line
|
||||
state = JSDocState.SavingComments;
|
||||
pushComment(asterisk);
|
||||
@@ -6358,7 +6358,10 @@ namespace ts {
|
||||
case SyntaxKind.WhitespaceTrivia:
|
||||
// only collect whitespace if we're already saving comments or have just crossed the comment indent margin
|
||||
const whitespace = scanner.getTokenText();
|
||||
if (state === JSDocState.SavingComments || margin !== undefined && indent + whitespace.length > margin) {
|
||||
if (state === JSDocState.SavingComments) {
|
||||
comments.push(whitespace);
|
||||
}
|
||||
else if (margin !== undefined && indent + whitespace.length > margin) {
|
||||
comments.push(whitespace.slice(margin - indent - 1));
|
||||
}
|
||||
indent += whitespace.length;
|
||||
@@ -6366,6 +6369,8 @@ namespace ts {
|
||||
case SyntaxKind.EndOfFileToken:
|
||||
break;
|
||||
default:
|
||||
// anything other than whitespace or asterisk at the beginning of the line starts the comment text
|
||||
state = JSDocState.SavingComments;
|
||||
pushComment(scanner.getTokenText());
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2286,14 +2286,19 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
startLexicalEnvironment();
|
||||
let loopBody = visitNode(node.statement, visitor, isStatement);
|
||||
const lexicalEnvironment = endLexicalEnvironment();
|
||||
|
||||
const currentState = convertedLoopState;
|
||||
convertedLoopState = outerConvertedLoopState;
|
||||
|
||||
if (loopOutParameters.length) {
|
||||
if (loopOutParameters.length || lexicalEnvironment) {
|
||||
const statements = isBlock(loopBody) ? (<Block>loopBody).statements.slice() : [loopBody];
|
||||
copyOutParameters(loopOutParameters, CopyDirection.ToOutParameter, statements);
|
||||
if (loopOutParameters.length) {
|
||||
copyOutParameters(loopOutParameters, CopyDirection.ToOutParameter, statements);
|
||||
}
|
||||
addRange(statements, lexicalEnvironment)
|
||||
loopBody = createBlock(statements, /*location*/ undefined, /*multiline*/ true);
|
||||
}
|
||||
|
||||
|
||||
@@ -101,20 +101,21 @@ namespace ts {
|
||||
// So the helper will be emit at the correct position instead of at the top of the source-file
|
||||
const moduleName = tryGetModuleNameFromFile(node, host, compilerOptions);
|
||||
const dependencies = createArrayLiteral(map(dependencyGroups, dependencyGroup => dependencyGroup.name));
|
||||
const updated = updateSourceFileNode(
|
||||
node,
|
||||
createNodeArray([
|
||||
createStatement(
|
||||
createCall(
|
||||
createPropertyAccess(createIdentifier("System"), "register"),
|
||||
const updated = setEmitFlags(
|
||||
updateSourceFileNode(
|
||||
node,
|
||||
createNodeArray([
|
||||
createStatement(
|
||||
createCall(
|
||||
createPropertyAccess(createIdentifier("System"), "register"),
|
||||
/*typeArguments*/ undefined,
|
||||
moduleName
|
||||
? [moduleName, dependencies, moduleBodyFunction]
|
||||
: [dependencies, moduleBodyFunction]
|
||||
moduleName
|
||||
? [moduleName, dependencies, moduleBodyFunction]
|
||||
: [dependencies, moduleBodyFunction]
|
||||
)
|
||||
)
|
||||
)
|
||||
], node.statements)
|
||||
);
|
||||
], node.statements)
|
||||
), EmitFlags.NoTrailingComments);
|
||||
|
||||
if (!(compilerOptions.outFile || compilerOptions.out)) {
|
||||
moveEmitHelpers(updated, moduleBodyBlock, helper => !helper.scoped);
|
||||
|
||||
@@ -1277,7 +1277,7 @@ namespace ts {
|
||||
* @param node The declaration node.
|
||||
* @param allDecorators An object containing all of the decorators for the declaration.
|
||||
*/
|
||||
function transformAllDecoratorsOfDeclaration(node: Declaration, allDecorators: AllDecorators) {
|
||||
function transformAllDecoratorsOfDeclaration(node: Declaration, container: ClassLikeDeclaration, allDecorators: AllDecorators) {
|
||||
if (!allDecorators) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -1285,7 +1285,7 @@ namespace ts {
|
||||
const decoratorExpressions: Expression[] = [];
|
||||
addRange(decoratorExpressions, map(allDecorators.decorators, transformDecorator));
|
||||
addRange(decoratorExpressions, flatMap(allDecorators.parameters, transformDecoratorsOfParameter));
|
||||
addTypeMetadata(node, decoratorExpressions);
|
||||
addTypeMetadata(node, container, decoratorExpressions);
|
||||
return decoratorExpressions;
|
||||
}
|
||||
|
||||
@@ -1334,7 +1334,7 @@ namespace ts {
|
||||
*/
|
||||
function generateClassElementDecorationExpression(node: ClassExpression | ClassDeclaration, member: ClassElement) {
|
||||
const allDecorators = getAllDecoratorsOfClassElement(node, member);
|
||||
const decoratorExpressions = transformAllDecoratorsOfDeclaration(member, allDecorators);
|
||||
const decoratorExpressions = transformAllDecoratorsOfDeclaration(member, node, allDecorators);
|
||||
if (!decoratorExpressions) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -1415,7 +1415,7 @@ namespace ts {
|
||||
*/
|
||||
function generateConstructorDecorationExpression(node: ClassExpression | ClassDeclaration) {
|
||||
const allDecorators = getAllDecoratorsOfConstructor(node);
|
||||
const decoratorExpressions = transformAllDecoratorsOfDeclaration(node, allDecorators);
|
||||
const decoratorExpressions = transformAllDecoratorsOfDeclaration(node, node, allDecorators);
|
||||
if (!decoratorExpressions) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -1468,22 +1468,22 @@ namespace ts {
|
||||
* @param node The declaration node.
|
||||
* @param decoratorExpressions The destination array to which to add new decorator expressions.
|
||||
*/
|
||||
function addTypeMetadata(node: Declaration, decoratorExpressions: Expression[]) {
|
||||
function addTypeMetadata(node: Declaration, container: ClassLikeDeclaration, decoratorExpressions: Expression[]) {
|
||||
if (USE_NEW_TYPE_METADATA_FORMAT) {
|
||||
addNewTypeMetadata(node, decoratorExpressions);
|
||||
addNewTypeMetadata(node, container, decoratorExpressions);
|
||||
}
|
||||
else {
|
||||
addOldTypeMetadata(node, decoratorExpressions);
|
||||
addOldTypeMetadata(node, container, decoratorExpressions);
|
||||
}
|
||||
}
|
||||
|
||||
function addOldTypeMetadata(node: Declaration, decoratorExpressions: Expression[]) {
|
||||
function addOldTypeMetadata(node: Declaration, container: ClassLikeDeclaration, decoratorExpressions: Expression[]) {
|
||||
if (compilerOptions.emitDecoratorMetadata) {
|
||||
if (shouldAddTypeMetadata(node)) {
|
||||
decoratorExpressions.push(createMetadataHelper(context, "design:type", serializeTypeOfNode(node)));
|
||||
}
|
||||
if (shouldAddParamTypesMetadata(node)) {
|
||||
decoratorExpressions.push(createMetadataHelper(context, "design:paramtypes", serializeParameterTypesOfNode(node)));
|
||||
decoratorExpressions.push(createMetadataHelper(context, "design:paramtypes", serializeParameterTypesOfNode(node, container)));
|
||||
}
|
||||
if (shouldAddReturnTypeMetadata(node)) {
|
||||
decoratorExpressions.push(createMetadataHelper(context, "design:returntype", serializeReturnTypeOfNode(node)));
|
||||
@@ -1491,14 +1491,14 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function addNewTypeMetadata(node: Declaration, decoratorExpressions: Expression[]) {
|
||||
function addNewTypeMetadata(node: Declaration, container: ClassLikeDeclaration, decoratorExpressions: Expression[]) {
|
||||
if (compilerOptions.emitDecoratorMetadata) {
|
||||
let properties: ObjectLiteralElementLike[];
|
||||
if (shouldAddTypeMetadata(node)) {
|
||||
(properties || (properties = [])).push(createPropertyAssignment("type", createArrowFunction(/*modifiers*/ undefined, /*typeParameters*/ undefined, [], /*type*/ undefined, createToken(SyntaxKind.EqualsGreaterThanToken), serializeTypeOfNode(node))));
|
||||
}
|
||||
if (shouldAddParamTypesMetadata(node)) {
|
||||
(properties || (properties = [])).push(createPropertyAssignment("paramTypes", createArrowFunction(/*modifiers*/ undefined, /*typeParameters*/ undefined, [], /*type*/ undefined, createToken(SyntaxKind.EqualsGreaterThanToken), serializeParameterTypesOfNode(node))));
|
||||
(properties || (properties = [])).push(createPropertyAssignment("paramTypes", createArrowFunction(/*modifiers*/ undefined, /*typeParameters*/ undefined, [], /*type*/ undefined, createToken(SyntaxKind.EqualsGreaterThanToken), serializeParameterTypesOfNode(node, container))));
|
||||
}
|
||||
if (shouldAddReturnTypeMetadata(node)) {
|
||||
(properties || (properties = [])).push(createPropertyAssignment("returnType", createArrowFunction(/*modifiers*/ undefined, /*typeParameters*/ undefined, [], /*type*/ undefined, createToken(SyntaxKind.EqualsGreaterThanToken), serializeReturnTypeOfNode(node))));
|
||||
@@ -1543,12 +1543,16 @@ namespace ts {
|
||||
* @param node The node to test.
|
||||
*/
|
||||
function shouldAddParamTypesMetadata(node: Declaration): boolean {
|
||||
const kind = node.kind;
|
||||
return kind === SyntaxKind.ClassDeclaration
|
||||
|| kind === SyntaxKind.ClassExpression
|
||||
|| kind === SyntaxKind.MethodDeclaration
|
||||
|| kind === SyntaxKind.GetAccessor
|
||||
|| kind === SyntaxKind.SetAccessor;
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.ClassDeclaration:
|
||||
case SyntaxKind.ClassExpression:
|
||||
return getFirstConstructorWithBody(<ClassLikeDeclaration>node) !== undefined;
|
||||
case SyntaxKind.MethodDeclaration:
|
||||
case SyntaxKind.GetAccessor:
|
||||
case SyntaxKind.SetAccessor:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1573,30 +1577,12 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the most likely element type for a TypeNode. This is not an exhaustive test
|
||||
* as it assumes a rest argument can only be an array type (either T[], or Array<T>).
|
||||
*
|
||||
* @param node The type node.
|
||||
*/
|
||||
function getRestParameterElementType(node: TypeNode) {
|
||||
if (node && node.kind === SyntaxKind.ArrayType) {
|
||||
return (<ArrayTypeNode>node).elementType;
|
||||
}
|
||||
else if (node && node.kind === SyntaxKind.TypeReference) {
|
||||
return singleOrUndefined((<TypeReferenceNode>node).typeArguments);
|
||||
}
|
||||
else {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the types of the parameters of a node for use with decorator type metadata.
|
||||
*
|
||||
* @param node The node that should have its parameter types serialized.
|
||||
*/
|
||||
function serializeParameterTypesOfNode(node: Node): Expression {
|
||||
function serializeParameterTypesOfNode(node: Node, container: ClassLikeDeclaration): Expression {
|
||||
const valueDeclaration =
|
||||
isClassLike(node)
|
||||
? getFirstConstructorWithBody(node)
|
||||
@@ -1606,7 +1592,7 @@ namespace ts {
|
||||
|
||||
const expressions: Expression[] = [];
|
||||
if (valueDeclaration) {
|
||||
const parameters = valueDeclaration.parameters;
|
||||
const parameters = getParametersOfDecoratedDeclaration(valueDeclaration, container);
|
||||
const numParameters = parameters.length;
|
||||
for (let i = 0; i < numParameters; i++) {
|
||||
const parameter = parameters[i];
|
||||
@@ -1625,6 +1611,16 @@ namespace ts {
|
||||
return createArrayLiteral(expressions);
|
||||
}
|
||||
|
||||
function getParametersOfDecoratedDeclaration(node: FunctionLikeDeclaration, container: ClassLikeDeclaration) {
|
||||
if (container && node.kind === SyntaxKind.GetAccessor) {
|
||||
const { setAccessor } = getAllAccessorDeclarations(container.members, <AccessorDeclaration>node);
|
||||
if (setAccessor) {
|
||||
return setAccessor.parameters;
|
||||
}
|
||||
}
|
||||
return node.parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the return type of a node for use with decorator type metadata.
|
||||
*
|
||||
|
||||
@@ -803,6 +803,23 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the most likely element type for a TypeNode. This is not an exhaustive test
|
||||
* as it assumes a rest argument can only be an array type (either T[], or Array<T>).
|
||||
*
|
||||
* @param node The type node.
|
||||
*/
|
||||
export function getRestParameterElementType(node: TypeNode) {
|
||||
if (node && node.kind === SyntaxKind.ArrayType) {
|
||||
return (<ArrayTypeNode>node).elementType;
|
||||
}
|
||||
else if (node && node.kind === SyntaxKind.TypeReference) {
|
||||
return singleOrUndefined((<TypeReferenceNode>node).typeArguments);
|
||||
}
|
||||
else {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
export function isVariableLike(node: Node): node is VariableLikeDeclaration {
|
||||
if (node) {
|
||||
|
||||
@@ -1238,6 +1238,7 @@ namespace ts.projectSystem {
|
||||
projectService.closeExternalProject(externalProjectName);
|
||||
checkNumberOfProjects(projectService, { configuredProjects: 0 });
|
||||
});
|
||||
|
||||
it("external project with included config file opened after configured project and then closed", () => {
|
||||
const file1 = {
|
||||
path: "/a/b/f1.ts",
|
||||
@@ -1797,6 +1798,49 @@ namespace ts.projectSystem {
|
||||
checkNumberOfProjects(projectService, { configuredProjects: 0 });
|
||||
});
|
||||
|
||||
it("language service disabled state is updated in external projects", () => {
|
||||
debugger
|
||||
const f1 = {
|
||||
path: "/a/app.js",
|
||||
content: "var x = 1"
|
||||
};
|
||||
const f2 = {
|
||||
path: "/a/largefile.js",
|
||||
content: ""
|
||||
};
|
||||
const host = createServerHost([f1, f2]);
|
||||
const originalGetFileSize = host.getFileSize;
|
||||
host.getFileSize = (filePath: string) =>
|
||||
filePath === f2.path ? server.maxProgramSizeForNonTsFiles + 1 : originalGetFileSize.call(host, filePath);
|
||||
|
||||
const service = createProjectService(host);
|
||||
const projectFileName = "/a/proj.csproj";
|
||||
|
||||
service.openExternalProject({
|
||||
projectFileName,
|
||||
rootFiles: toExternalFiles([f1.path, f2.path]),
|
||||
options: {}
|
||||
});
|
||||
service.checkNumberOfProjects({ externalProjects: 1 });
|
||||
assert.isFalse(service.externalProjects[0].languageServiceEnabled, "language service should be disabled - 1");
|
||||
|
||||
service.openExternalProject({
|
||||
projectFileName,
|
||||
rootFiles: toExternalFiles([f1.path]),
|
||||
options: {}
|
||||
});
|
||||
service.checkNumberOfProjects({ externalProjects: 1 });
|
||||
assert.isTrue(service.externalProjects[0].languageServiceEnabled, "language service should be enabled");
|
||||
|
||||
service.openExternalProject({
|
||||
projectFileName,
|
||||
rootFiles: toExternalFiles([f1.path, f2.path]),
|
||||
options: {}
|
||||
});
|
||||
service.checkNumberOfProjects({ externalProjects: 1 });
|
||||
assert.isFalse(service.externalProjects[0].languageServiceEnabled, "language service should be disabled - 2");
|
||||
});
|
||||
|
||||
it("language service disabled events are triggered", () => {
|
||||
const f1 = {
|
||||
path: "/a/app.js",
|
||||
|
||||
+26
-6
@@ -75,17 +75,32 @@ namespace ts.server {
|
||||
getFilesAffectedBy(scriptInfo: ScriptInfo): string[];
|
||||
onProjectUpdateGraph(): void;
|
||||
emitFile(scriptInfo: ScriptInfo, writeFile: (path: string, data: string, writeByteOrderMark?: boolean) => void): boolean;
|
||||
clear(): void;
|
||||
}
|
||||
|
||||
abstract class AbstractBuilder<T extends BuilderFileInfo> implements Builder {
|
||||
|
||||
private fileInfos = createFileMap<T>();
|
||||
/**
|
||||
* stores set of files from the project.
|
||||
* NOTE: this field is created on demand and should not be accessed directly.
|
||||
* Use 'getFileInfos' instead.
|
||||
*/
|
||||
private fileInfos_doNotAccessDirectly: FileMap<T>;
|
||||
|
||||
constructor(public readonly project: Project, private ctor: { new (scriptInfo: ScriptInfo, project: Project): T }) {
|
||||
}
|
||||
|
||||
private getFileInfos() {
|
||||
return this.fileInfos_doNotAccessDirectly || (this.fileInfos_doNotAccessDirectly = createFileMap<T>());
|
||||
}
|
||||
|
||||
public clear() {
|
||||
// drop the existing list - it will be re-created as necessary
|
||||
this.fileInfos_doNotAccessDirectly = undefined;
|
||||
}
|
||||
|
||||
protected getFileInfo(path: Path): T {
|
||||
return this.fileInfos.get(path);
|
||||
return this.getFileInfos().get(path);
|
||||
}
|
||||
|
||||
protected getOrCreateFileInfo(path: Path): T {
|
||||
@@ -99,19 +114,19 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
protected getFileInfoPaths(): Path[] {
|
||||
return this.fileInfos.getKeys();
|
||||
return this.getFileInfos().getKeys();
|
||||
}
|
||||
|
||||
protected setFileInfo(path: Path, info: T) {
|
||||
this.fileInfos.set(path, info);
|
||||
this.getFileInfos().set(path, info);
|
||||
}
|
||||
|
||||
protected removeFileInfo(path: Path) {
|
||||
this.fileInfos.remove(path);
|
||||
this.getFileInfos().remove(path);
|
||||
}
|
||||
|
||||
protected forEachFileInfo(action: (fileInfo: T) => any) {
|
||||
this.fileInfos.forEachValue((_path, value) => action(value));
|
||||
this.getFileInfos().forEachValue((_path, value) => action(value));
|
||||
}
|
||||
|
||||
abstract getFilesAffectedBy(scriptInfo: ScriptInfo): string[];
|
||||
@@ -231,6 +246,11 @@ namespace ts.server {
|
||||
|
||||
private projectVersionForDependencyGraph: string;
|
||||
|
||||
public clear() {
|
||||
this.projectVersionForDependencyGraph = undefined;
|
||||
super.clear();
|
||||
}
|
||||
|
||||
private getReferencedFileInfos(fileInfo: ModuleBuilderFileInfo): ModuleBuilderFileInfo[] {
|
||||
if (!fileInfo.isExternalModuleOrHasOnlyAmbientExternalModules()) {
|
||||
return [];
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
export interface OpenConfiguredProjectResult {
|
||||
configFileName?: string;
|
||||
configFileName?: NormalizedPath;
|
||||
configFileErrors?: Diagnostic[];
|
||||
}
|
||||
|
||||
@@ -659,6 +659,13 @@ namespace ts.server {
|
||||
// open file in inferred project
|
||||
(projectsToRemove || (projectsToRemove = [])).push(p);
|
||||
}
|
||||
|
||||
if (!p.languageServiceEnabled) {
|
||||
// if project language service is disabled then we create a program only for open files.
|
||||
// this means that project should be marked as dirty to force rebuilding of the program
|
||||
// on the next request
|
||||
p.markAsDirty();
|
||||
}
|
||||
}
|
||||
if (projectsToRemove) {
|
||||
for (const project of projectsToRemove) {
|
||||
@@ -1052,9 +1059,7 @@ namespace ts.server {
|
||||
project.stopWatchingDirectory();
|
||||
}
|
||||
else {
|
||||
if (!project.languageServiceEnabled) {
|
||||
project.enableLanguageService();
|
||||
}
|
||||
project.enableLanguageService();
|
||||
this.watchConfigDirectoryForProject(project, projectOptions);
|
||||
this.updateNonInferredProject(project, projectOptions.files, fileNamePropertyReader, projectOptions.compilerOptions, projectOptions.typeAcquisition, projectOptions.compileOnSave, configFileErrors);
|
||||
}
|
||||
@@ -1226,9 +1231,22 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean): OpenConfiguredProjectResult {
|
||||
const { configFileName = undefined, configFileErrors = undefined }: OpenConfiguredProjectResult = this.findContainingExternalProject(fileName)
|
||||
? {}
|
||||
: this.openOrUpdateConfiguredProjectForFile(fileName);
|
||||
let configFileName: NormalizedPath;
|
||||
let configFileErrors: Diagnostic[];
|
||||
|
||||
let project: ConfiguredProject | ExternalProject = this.findContainingExternalProject(fileName);
|
||||
if (!project) {
|
||||
({ configFileName, configFileErrors } = this.openOrUpdateConfiguredProjectForFile(fileName));
|
||||
if (configFileName) {
|
||||
project = this.findConfiguredProjectByProjectName(configFileName);
|
||||
}
|
||||
}
|
||||
if (project && !project.languageServiceEnabled) {
|
||||
// if project language service is disabled then we create a program only for open files.
|
||||
// this means that project should be marked as dirty to force rebuilding of the program
|
||||
// on the next request
|
||||
project.markAsDirty();
|
||||
}
|
||||
|
||||
// at this point if file is the part of some configured/external project then this project should be created
|
||||
const info = this.getOrCreateScriptInfoForNormalizedPath(fileName, /*openedByClient*/ true, fileContent, scriptKind, hasMixedContent);
|
||||
@@ -1392,8 +1410,15 @@ namespace ts.server {
|
||||
let exisingConfigFiles: string[];
|
||||
if (externalProject) {
|
||||
if (!tsConfigFiles) {
|
||||
const compilerOptions = convertCompilerOptions(proj.options);
|
||||
if (this.exceededTotalSizeLimitForNonTsFiles(compilerOptions, proj.rootFiles, externalFilePropertyReader)) {
|
||||
externalProject.disableLanguageService();
|
||||
}
|
||||
else {
|
||||
externalProject.enableLanguageService();
|
||||
}
|
||||
// external project already exists and not config files were added - update the project and return;
|
||||
this.updateNonInferredProject(externalProject, proj.rootFiles, externalFilePropertyReader, convertCompilerOptions(proj.options), proj.typeAcquisition, proj.options.compileOnSave, /*configFileErrors*/ undefined);
|
||||
this.updateNonInferredProject(externalProject, proj.rootFiles, externalFilePropertyReader, compilerOptions, proj.typeAcquisition, proj.options.compileOnSave, /*configFileErrors*/ undefined);
|
||||
return;
|
||||
}
|
||||
// some config files were added to external project (that previously were not there)
|
||||
|
||||
+21
-94
@@ -90,87 +90,6 @@ namespace ts.server {
|
||||
}
|
||||
}
|
||||
|
||||
const emptyResult: any[] = [];
|
||||
const getEmptyResult = () => emptyResult;
|
||||
const getUndefined = () => <any>undefined;
|
||||
const emptyEncodedSemanticClassifications = { spans: emptyResult, endOfLineState: EndOfLineState.None };
|
||||
|
||||
export function createNoSemanticFeaturesWrapper(realLanguageService: LanguageService): LanguageService {
|
||||
return {
|
||||
cleanupSemanticCache: noop,
|
||||
getSyntacticDiagnostics: (fileName) =>
|
||||
fileName ? realLanguageService.getSyntacticDiagnostics(fileName) : emptyResult,
|
||||
getSemanticDiagnostics: getEmptyResult,
|
||||
getCompilerOptionsDiagnostics: () =>
|
||||
realLanguageService.getCompilerOptionsDiagnostics(),
|
||||
getSyntacticClassifications: (fileName, span) =>
|
||||
realLanguageService.getSyntacticClassifications(fileName, span),
|
||||
getEncodedSyntacticClassifications: (fileName, span) =>
|
||||
realLanguageService.getEncodedSyntacticClassifications(fileName, span),
|
||||
getSemanticClassifications: getEmptyResult,
|
||||
getEncodedSemanticClassifications: () =>
|
||||
emptyEncodedSemanticClassifications,
|
||||
getCompletionsAtPosition: getUndefined,
|
||||
findReferences: getEmptyResult,
|
||||
getCompletionEntryDetails: getUndefined,
|
||||
getQuickInfoAtPosition: getUndefined,
|
||||
findRenameLocations: getEmptyResult,
|
||||
getNameOrDottedNameSpan: (fileName, startPos, endPos) =>
|
||||
realLanguageService.getNameOrDottedNameSpan(fileName, startPos, endPos),
|
||||
getBreakpointStatementAtPosition: (fileName, position) =>
|
||||
realLanguageService.getBreakpointStatementAtPosition(fileName, position),
|
||||
getBraceMatchingAtPosition: (fileName, position) =>
|
||||
realLanguageService.getBraceMatchingAtPosition(fileName, position),
|
||||
getSignatureHelpItems: getUndefined,
|
||||
getDefinitionAtPosition: getEmptyResult,
|
||||
getRenameInfo: () => ({
|
||||
canRename: false,
|
||||
localizedErrorMessage: getLocaleSpecificMessage(Diagnostics.Language_service_is_disabled),
|
||||
displayName: undefined,
|
||||
fullDisplayName: undefined,
|
||||
kind: undefined,
|
||||
kindModifiers: undefined,
|
||||
triggerSpan: undefined
|
||||
}),
|
||||
getTypeDefinitionAtPosition: getUndefined,
|
||||
getReferencesAtPosition: getEmptyResult,
|
||||
getDocumentHighlights: getEmptyResult,
|
||||
getOccurrencesAtPosition: getEmptyResult,
|
||||
getNavigateToItems: getEmptyResult,
|
||||
getNavigationBarItems: fileName =>
|
||||
realLanguageService.getNavigationBarItems(fileName),
|
||||
getNavigationTree: fileName =>
|
||||
realLanguageService.getNavigationTree(fileName),
|
||||
getOutliningSpans: fileName =>
|
||||
realLanguageService.getOutliningSpans(fileName),
|
||||
getTodoComments: getEmptyResult,
|
||||
getIndentationAtPosition: (fileName, position, options) =>
|
||||
realLanguageService.getIndentationAtPosition(fileName, position, options),
|
||||
getFormattingEditsForRange: (fileName, start, end, options) =>
|
||||
realLanguageService.getFormattingEditsForRange(fileName, start, end, options),
|
||||
getFormattingEditsForDocument: (fileName, options) =>
|
||||
realLanguageService.getFormattingEditsForDocument(fileName, options),
|
||||
getFormattingEditsAfterKeystroke: (fileName, position, key, options) =>
|
||||
realLanguageService.getFormattingEditsAfterKeystroke(fileName, position, key, options),
|
||||
getDocCommentTemplateAtPosition: (fileName, position) =>
|
||||
realLanguageService.getDocCommentTemplateAtPosition(fileName, position),
|
||||
isValidBraceCompletionAtPosition: (fileName, position, openingBrace) =>
|
||||
realLanguageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace),
|
||||
getEmitOutput: getUndefined,
|
||||
getProgram: () =>
|
||||
realLanguageService.getProgram(),
|
||||
getNonBoundSourceFile: fileName =>
|
||||
realLanguageService.getNonBoundSourceFile(fileName),
|
||||
dispose: () =>
|
||||
realLanguageService.dispose(),
|
||||
getCompletionEntrySymbol: getUndefined,
|
||||
getImplementationAtPosition: getEmptyResult,
|
||||
getSourceFile: fileName =>
|
||||
realLanguageService.getSourceFile(fileName),
|
||||
getCodeFixesAtPosition: getEmptyResult
|
||||
};
|
||||
}
|
||||
|
||||
export abstract class Project {
|
||||
private rootFiles: ScriptInfo[] = [];
|
||||
private rootFilesMap: FileMap<ScriptInfo> = createFileMap<ScriptInfo>();
|
||||
@@ -181,8 +100,6 @@ namespace ts.server {
|
||||
private lastCachedUnresolvedImportsList: SortedReadonlyArray<string>;
|
||||
|
||||
private readonly languageService: LanguageService;
|
||||
// wrapper over the real language service that will suppress all semantic operations
|
||||
private readonly noSemanticFeaturesLanguageService: LanguageService;
|
||||
|
||||
public languageServiceEnabled = true;
|
||||
|
||||
@@ -258,7 +175,6 @@ namespace ts.server {
|
||||
this.lsHost.setCompilationSettings(this.compilerOptions);
|
||||
|
||||
this.languageService = ts.createLanguageService(this.lsHost, this.documentRegistry);
|
||||
this.noSemanticFeaturesLanguageService = createNoSemanticFeaturesWrapper(this.languageService);
|
||||
|
||||
if (!languageServiceEnabled) {
|
||||
this.disableLanguageService();
|
||||
@@ -282,9 +198,7 @@ namespace ts.server {
|
||||
if (ensureSynchronized) {
|
||||
this.updateGraph();
|
||||
}
|
||||
return this.languageServiceEnabled
|
||||
? this.languageService
|
||||
: this.noSemanticFeaturesLanguageService;
|
||||
return this.languageService;
|
||||
}
|
||||
|
||||
getCompileOnSaveAffectedFileList(scriptInfo: ScriptInfo): string[] {
|
||||
@@ -373,7 +287,10 @@ namespace ts.server {
|
||||
const result: string[] = [];
|
||||
if (this.rootFiles) {
|
||||
for (const f of this.rootFiles) {
|
||||
result.push(f.fileName);
|
||||
if (this.languageServiceEnabled || f.isScriptOpen()) {
|
||||
// if language service is disabled - process only files that are open
|
||||
result.push(f.fileName);
|
||||
}
|
||||
}
|
||||
if (this.typingFiles) {
|
||||
for (const f of this.typingFiles) {
|
||||
@@ -389,6 +306,10 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
getScriptInfos() {
|
||||
if (!this.languageServiceEnabled) {
|
||||
// if language service is not enabled - return just root files
|
||||
return this.rootFiles;
|
||||
}
|
||||
return map(this.program.getSourceFiles(), sourceFile => {
|
||||
const scriptInfo = this.projectService.getScriptInfoForPath(sourceFile.path);
|
||||
if (!scriptInfo) {
|
||||
@@ -529,10 +450,6 @@ namespace ts.server {
|
||||
* @returns: true if set of files in the project stays the same and false - otherwise.
|
||||
*/
|
||||
updateGraph(): boolean {
|
||||
if (!this.languageServiceEnabled) {
|
||||
return true;
|
||||
}
|
||||
|
||||
this.lsHost.startRecordingFilesWithChangedResolutions();
|
||||
|
||||
let hasChanges = this.updateGraphWorker();
|
||||
@@ -564,6 +481,16 @@ namespace ts.server {
|
||||
if (this.setTypings(cachedTypings)) {
|
||||
hasChanges = this.updateGraphWorker() || hasChanges;
|
||||
}
|
||||
|
||||
// update builder only if language service is enabled
|
||||
// otherwise tell it to drop its internal state
|
||||
if (this.languageServiceEnabled) {
|
||||
this.builder.onProjectUpdateGraph();
|
||||
}
|
||||
else {
|
||||
this.builder.clear();
|
||||
}
|
||||
|
||||
if (hasChanges) {
|
||||
this.projectStructureVersion++;
|
||||
}
|
||||
@@ -602,7 +529,6 @@ namespace ts.server {
|
||||
}
|
||||
}
|
||||
}
|
||||
this.builder.onProjectUpdateGraph();
|
||||
return hasChanges;
|
||||
}
|
||||
|
||||
@@ -673,7 +599,8 @@ namespace ts.server {
|
||||
projectName: this.getProjectName(),
|
||||
version: this.projectStructureVersion,
|
||||
isInferred: this.projectKind === ProjectKind.Inferred,
|
||||
options: this.getCompilerOptions()
|
||||
options: this.getCompilerOptions(),
|
||||
languageServiceDisabled: !this.languageServiceEnabled
|
||||
};
|
||||
const updatedFileNames = this.updatedFileNames;
|
||||
this.updatedFileNames = undefined;
|
||||
|
||||
@@ -904,6 +904,11 @@ namespace ts.server.protocol {
|
||||
* Current set of compiler options for project
|
||||
*/
|
||||
options: ts.CompilerOptions;
|
||||
|
||||
/**
|
||||
* true if project language service is disabled
|
||||
*/
|
||||
languageServiceDisabled: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1026,6 +1026,9 @@ namespace ts.server {
|
||||
if (!project) {
|
||||
Errors.ThrowNoProject();
|
||||
}
|
||||
if (!project.languageServiceEnabled) {
|
||||
return false;
|
||||
}
|
||||
const scriptInfo = project.getScriptInfo(file);
|
||||
return project.builder.emitFile(scriptInfo, (path, data, writeByteOrderMark) => this.host.writeFile(path, data, writeByteOrderMark));
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace ts.JsDoc {
|
||||
"lends",
|
||||
"link",
|
||||
"memberOf",
|
||||
"method",
|
||||
"name",
|
||||
"namespace",
|
||||
"param",
|
||||
|
||||
@@ -208,6 +208,7 @@ function foo() {
|
||||
}
|
||||
(function () { return b; });
|
||||
return { value: 100 };
|
||||
var _a;
|
||||
};
|
||||
for (var _c = 0, _d = []; _c < _d.length; _c++) {
|
||||
var b = _d[_c];
|
||||
@@ -221,6 +222,7 @@ function foo() {
|
||||
}
|
||||
}
|
||||
(function () { return a; });
|
||||
var _b;
|
||||
};
|
||||
var arguments_1 = arguments, x, z, x1, z1;
|
||||
l0: for (var _i = 0, _a = []; _i < _a.length; _i++) {
|
||||
@@ -238,7 +240,6 @@ function foo() {
|
||||
use(z);
|
||||
use(x1);
|
||||
use(z1);
|
||||
var _b, _a;
|
||||
}
|
||||
function foo2() {
|
||||
for (var _i = 0, _a = []; _i < _a.length; _i++) {
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
//// [tests/cases/compiler/circularReferenceInImport.ts] ////
|
||||
|
||||
//// [db.d.ts]
|
||||
|
||||
declare namespace Db {
|
||||
export import Types = Db;
|
||||
}
|
||||
|
||||
export = Db;
|
||||
|
||||
//// [app.ts]
|
||||
import * as Db from "./db"
|
||||
|
||||
export function foo() {
|
||||
return new Object()
|
||||
}
|
||||
|
||||
//// [app.js]
|
||||
"use strict";
|
||||
function foo() {
|
||||
return new Object();
|
||||
}
|
||||
exports.foo = foo;
|
||||
|
||||
|
||||
//// [app.d.ts]
|
||||
export declare function foo(): Object;
|
||||
@@ -0,0 +1,23 @@
|
||||
=== tests/cases/compiler/db.d.ts ===
|
||||
|
||||
declare namespace Db {
|
||||
>Db : Symbol(Types, Decl(db.d.ts, 0, 0))
|
||||
|
||||
export import Types = Db;
|
||||
>Types : Symbol(Types, Decl(db.d.ts, 1, 22))
|
||||
>Db : Symbol(Types, Decl(db.d.ts, 0, 0))
|
||||
}
|
||||
|
||||
export = Db;
|
||||
>Db : Symbol(Db, Decl(db.d.ts, 0, 0))
|
||||
|
||||
=== tests/cases/compiler/app.ts ===
|
||||
import * as Db from "./db"
|
||||
>Db : Symbol(Db, Decl(app.ts, 0, 6))
|
||||
|
||||
export function foo() {
|
||||
>foo : Symbol(foo, Decl(app.ts, 0, 26))
|
||||
|
||||
return new Object()
|
||||
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
=== tests/cases/compiler/db.d.ts ===
|
||||
|
||||
declare namespace Db {
|
||||
>Db : typeof Types
|
||||
|
||||
export import Types = Db;
|
||||
>Types : typeof Types
|
||||
>Db : typeof Types
|
||||
}
|
||||
|
||||
export = Db;
|
||||
>Db : typeof Db
|
||||
|
||||
=== tests/cases/compiler/app.ts ===
|
||||
import * as Db from "./db"
|
||||
>Db : typeof Db
|
||||
|
||||
export function foo() {
|
||||
>foo : () => Object
|
||||
|
||||
return new Object()
|
||||
>new Object() : Object
|
||||
>Object : ObjectConstructor
|
||||
}
|
||||
@@ -14,15 +14,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
let Testing123 = Testing123_1 = class Testing123 {
|
||||
};
|
||||
Testing123.prop1 = Testing123_1.prop0;
|
||||
Testing123 = Testing123_1 = __decorate([
|
||||
Something({ v: () => Testing123_1 }),
|
||||
__metadata("design:paramtypes", [])
|
||||
Something({ v: () => Testing123_1 })
|
||||
], Testing123);
|
||||
exports.Testing123 = Testing123;
|
||||
var Testing123_1;
|
||||
|
||||
@@ -13,14 +13,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
let Testing123 = Testing123_1 = class Testing123 {
|
||||
};
|
||||
Testing123 = Testing123_1 = __decorate([
|
||||
Something({ v: () => Testing123_1 }),
|
||||
__metadata("design:paramtypes", [])
|
||||
Something({ v: () => Testing123_1 })
|
||||
], Testing123);
|
||||
exports.Testing123 = Testing123;
|
||||
var Testing123_1;
|
||||
|
||||
@@ -17,9 +17,6 @@ System.register([], function (exports_1, context_1) {
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
var Testing123, Testing123_1;
|
||||
return {
|
||||
@@ -29,8 +26,7 @@ System.register([], function (exports_1, context_1) {
|
||||
};
|
||||
Testing123.prop1 = Testing123_1.prop0;
|
||||
Testing123 = Testing123_1 = __decorate([
|
||||
Something({ v: () => Testing123_1 }),
|
||||
__metadata("design:paramtypes", [])
|
||||
Something({ v: () => Testing123_1 })
|
||||
], Testing123);
|
||||
exports_1("Testing123", Testing123);
|
||||
}
|
||||
|
||||
@@ -14,9 +14,6 @@ System.register([], function (exports_1, context_1) {
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
var Testing123, Testing123_1;
|
||||
return {
|
||||
@@ -25,8 +22,7 @@ System.register([], function (exports_1, context_1) {
|
||||
Testing123 = Testing123_1 = class Testing123 {
|
||||
};
|
||||
Testing123 = Testing123_1 = __decorate([
|
||||
Something({ v: () => Testing123_1 }),
|
||||
__metadata("design:paramtypes", [])
|
||||
Something({ v: () => Testing123_1 })
|
||||
], Testing123);
|
||||
exports_1("Testing123", Testing123);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
//// [tests/cases/compiler/decoratorMetadataRestParameterWithImportedType.ts] ////
|
||||
|
||||
//// [aux.ts]
|
||||
|
||||
export class SomeClass {
|
||||
field: string;
|
||||
}
|
||||
|
||||
//// [aux1.ts]
|
||||
export class SomeClass1 {
|
||||
field: string;
|
||||
}
|
||||
|
||||
//// [aux2.ts]
|
||||
export class SomeClass2 {
|
||||
field: string;
|
||||
}
|
||||
//// [main.ts]
|
||||
import { SomeClass } from './aux';
|
||||
import { SomeClass1 } from './aux1';
|
||||
|
||||
function annotation(): ClassDecorator {
|
||||
return (target: any): void => { };
|
||||
}
|
||||
|
||||
function annotation1(): MethodDecorator {
|
||||
return (target: any): void => { };
|
||||
}
|
||||
|
||||
@annotation()
|
||||
export class ClassA {
|
||||
array: SomeClass[];
|
||||
|
||||
constructor(...init: SomeClass[]) {
|
||||
this.array = init;
|
||||
}
|
||||
|
||||
@annotation1()
|
||||
foo(... args: SomeClass1[]) {
|
||||
}
|
||||
}
|
||||
|
||||
//// [aux.js]
|
||||
"use strict";
|
||||
var SomeClass = (function () {
|
||||
function SomeClass() {
|
||||
}
|
||||
return SomeClass;
|
||||
}());
|
||||
exports.SomeClass = SomeClass;
|
||||
//// [aux1.js]
|
||||
"use strict";
|
||||
var SomeClass1 = (function () {
|
||||
function SomeClass1() {
|
||||
}
|
||||
return SomeClass1;
|
||||
}());
|
||||
exports.SomeClass1 = SomeClass1;
|
||||
//// [aux2.js]
|
||||
"use strict";
|
||||
var SomeClass2 = (function () {
|
||||
function SomeClass2() {
|
||||
}
|
||||
return SomeClass2;
|
||||
}());
|
||||
exports.SomeClass2 = SomeClass2;
|
||||
//// [main.js]
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var aux_1 = require("./aux");
|
||||
var aux1_1 = require("./aux1");
|
||||
function annotation() {
|
||||
return function (target) { };
|
||||
}
|
||||
function annotation1() {
|
||||
return function (target) { };
|
||||
}
|
||||
var ClassA = (function () {
|
||||
function ClassA() {
|
||||
var init = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
init[_i] = arguments[_i];
|
||||
}
|
||||
this.array = init;
|
||||
}
|
||||
ClassA.prototype.foo = function () {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
};
|
||||
return ClassA;
|
||||
}());
|
||||
__decorate([
|
||||
annotation1(),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [aux1_1.SomeClass1]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], ClassA.prototype, "foo", null);
|
||||
ClassA = __decorate([
|
||||
annotation(),
|
||||
__metadata("design:paramtypes", [aux_1.SomeClass])
|
||||
], ClassA);
|
||||
exports.ClassA = ClassA;
|
||||
@@ -0,0 +1,77 @@
|
||||
=== tests/cases/compiler/aux.ts ===
|
||||
|
||||
export class SomeClass {
|
||||
>SomeClass : Symbol(SomeClass, Decl(aux.ts, 0, 0))
|
||||
|
||||
field: string;
|
||||
>field : Symbol(SomeClass.field, Decl(aux.ts, 1, 24))
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/aux1.ts ===
|
||||
export class SomeClass1 {
|
||||
>SomeClass1 : Symbol(SomeClass1, Decl(aux1.ts, 0, 0))
|
||||
|
||||
field: string;
|
||||
>field : Symbol(SomeClass1.field, Decl(aux1.ts, 0, 25))
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/aux2.ts ===
|
||||
export class SomeClass2 {
|
||||
>SomeClass2 : Symbol(SomeClass2, Decl(aux2.ts, 0, 0))
|
||||
|
||||
field: string;
|
||||
>field : Symbol(SomeClass2.field, Decl(aux2.ts, 0, 25))
|
||||
}
|
||||
=== tests/cases/compiler/main.ts ===
|
||||
import { SomeClass } from './aux';
|
||||
>SomeClass : Symbol(SomeClass, Decl(main.ts, 0, 8))
|
||||
|
||||
import { SomeClass1 } from './aux1';
|
||||
>SomeClass1 : Symbol(SomeClass1, Decl(main.ts, 1, 8))
|
||||
|
||||
function annotation(): ClassDecorator {
|
||||
>annotation : Symbol(annotation, Decl(main.ts, 1, 36))
|
||||
>ClassDecorator : Symbol(ClassDecorator, Decl(lib.d.ts, --, --))
|
||||
|
||||
return (target: any): void => { };
|
||||
>target : Symbol(target, Decl(main.ts, 4, 12))
|
||||
}
|
||||
|
||||
function annotation1(): MethodDecorator {
|
||||
>annotation1 : Symbol(annotation1, Decl(main.ts, 5, 1))
|
||||
>MethodDecorator : Symbol(MethodDecorator, Decl(lib.d.ts, --, --))
|
||||
|
||||
return (target: any): void => { };
|
||||
>target : Symbol(target, Decl(main.ts, 8, 12))
|
||||
}
|
||||
|
||||
@annotation()
|
||||
>annotation : Symbol(annotation, Decl(main.ts, 1, 36))
|
||||
|
||||
export class ClassA {
|
||||
>ClassA : Symbol(ClassA, Decl(main.ts, 9, 1))
|
||||
|
||||
array: SomeClass[];
|
||||
>array : Symbol(ClassA.array, Decl(main.ts, 12, 21))
|
||||
>SomeClass : Symbol(SomeClass, Decl(main.ts, 0, 8))
|
||||
|
||||
constructor(...init: SomeClass[]) {
|
||||
>init : Symbol(init, Decl(main.ts, 15, 16))
|
||||
>SomeClass : Symbol(SomeClass, Decl(main.ts, 0, 8))
|
||||
|
||||
this.array = init;
|
||||
>this.array : Symbol(ClassA.array, Decl(main.ts, 12, 21))
|
||||
>this : Symbol(ClassA, Decl(main.ts, 9, 1))
|
||||
>array : Symbol(ClassA.array, Decl(main.ts, 12, 21))
|
||||
>init : Symbol(init, Decl(main.ts, 15, 16))
|
||||
}
|
||||
|
||||
@annotation1()
|
||||
>annotation1 : Symbol(annotation1, Decl(main.ts, 5, 1))
|
||||
|
||||
foo(... args: SomeClass1[]) {
|
||||
>foo : Symbol(ClassA.foo, Decl(main.ts, 17, 5))
|
||||
>args : Symbol(args, Decl(main.ts, 20, 8))
|
||||
>SomeClass1 : Symbol(SomeClass1, Decl(main.ts, 1, 8))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
=== tests/cases/compiler/aux.ts ===
|
||||
|
||||
export class SomeClass {
|
||||
>SomeClass : SomeClass
|
||||
|
||||
field: string;
|
||||
>field : string
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/aux1.ts ===
|
||||
export class SomeClass1 {
|
||||
>SomeClass1 : SomeClass1
|
||||
|
||||
field: string;
|
||||
>field : string
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/aux2.ts ===
|
||||
export class SomeClass2 {
|
||||
>SomeClass2 : SomeClass2
|
||||
|
||||
field: string;
|
||||
>field : string
|
||||
}
|
||||
=== tests/cases/compiler/main.ts ===
|
||||
import { SomeClass } from './aux';
|
||||
>SomeClass : typeof SomeClass
|
||||
|
||||
import { SomeClass1 } from './aux1';
|
||||
>SomeClass1 : typeof SomeClass1
|
||||
|
||||
function annotation(): ClassDecorator {
|
||||
>annotation : () => ClassDecorator
|
||||
>ClassDecorator : ClassDecorator
|
||||
|
||||
return (target: any): void => { };
|
||||
>(target: any): void => { } : (target: any) => void
|
||||
>target : any
|
||||
}
|
||||
|
||||
function annotation1(): MethodDecorator {
|
||||
>annotation1 : () => MethodDecorator
|
||||
>MethodDecorator : MethodDecorator
|
||||
|
||||
return (target: any): void => { };
|
||||
>(target: any): void => { } : (target: any) => void
|
||||
>target : any
|
||||
}
|
||||
|
||||
@annotation()
|
||||
>annotation() : ClassDecorator
|
||||
>annotation : () => ClassDecorator
|
||||
|
||||
export class ClassA {
|
||||
>ClassA : ClassA
|
||||
|
||||
array: SomeClass[];
|
||||
>array : SomeClass[]
|
||||
>SomeClass : SomeClass
|
||||
|
||||
constructor(...init: SomeClass[]) {
|
||||
>init : SomeClass[]
|
||||
>SomeClass : SomeClass
|
||||
|
||||
this.array = init;
|
||||
>this.array = init : SomeClass[]
|
||||
>this.array : SomeClass[]
|
||||
>this : this
|
||||
>array : SomeClass[]
|
||||
>init : SomeClass[]
|
||||
}
|
||||
|
||||
@annotation1()
|
||||
>annotation1() : MethodDecorator
|
||||
>annotation1 : () => MethodDecorator
|
||||
|
||||
foo(... args: SomeClass1[]) {
|
||||
>foo : (...args: SomeClass1[]) => void
|
||||
>args : SomeClass1[]
|
||||
>SomeClass1 : SomeClass1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
//// [decoratorOnClassAccessor8.ts]
|
||||
declare function dec<T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T>;
|
||||
|
||||
class A {
|
||||
@dec get x() { return 0; }
|
||||
set x(value: number) { }
|
||||
}
|
||||
|
||||
class B {
|
||||
get x() { return 0; }
|
||||
@dec set x(value: number) { }
|
||||
}
|
||||
|
||||
class C {
|
||||
@dec set x(value: number) { }
|
||||
get x() { return 0; }
|
||||
}
|
||||
|
||||
class D {
|
||||
set x(value: number) { }
|
||||
@dec get x() { return 0; }
|
||||
}
|
||||
|
||||
class E {
|
||||
@dec get x() { return 0; }
|
||||
}
|
||||
|
||||
class F {
|
||||
@dec set x(value: number) { }
|
||||
}
|
||||
|
||||
//// [decoratorOnClassAccessor8.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
Object.defineProperty(A.prototype, "x", {
|
||||
get: function () { return 0; },
|
||||
set: function (value) { },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return A;
|
||||
}());
|
||||
__decorate([
|
||||
dec,
|
||||
__metadata("design:type", Object),
|
||||
__metadata("design:paramtypes", [Number])
|
||||
], A.prototype, "x", null);
|
||||
var B = (function () {
|
||||
function B() {
|
||||
}
|
||||
Object.defineProperty(B.prototype, "x", {
|
||||
get: function () { return 0; },
|
||||
set: function (value) { },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return B;
|
||||
}());
|
||||
__decorate([
|
||||
dec,
|
||||
__metadata("design:type", Number),
|
||||
__metadata("design:paramtypes", [Number])
|
||||
], B.prototype, "x", null);
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
Object.defineProperty(C.prototype, "x", {
|
||||
get: function () { return 0; },
|
||||
set: function (value) { },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return C;
|
||||
}());
|
||||
__decorate([
|
||||
dec,
|
||||
__metadata("design:type", Number),
|
||||
__metadata("design:paramtypes", [Number])
|
||||
], C.prototype, "x", null);
|
||||
var D = (function () {
|
||||
function D() {
|
||||
}
|
||||
Object.defineProperty(D.prototype, "x", {
|
||||
get: function () { return 0; },
|
||||
set: function (value) { },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return D;
|
||||
}());
|
||||
__decorate([
|
||||
dec,
|
||||
__metadata("design:type", Object),
|
||||
__metadata("design:paramtypes", [Number])
|
||||
], D.prototype, "x", null);
|
||||
var E = (function () {
|
||||
function E() {
|
||||
}
|
||||
Object.defineProperty(E.prototype, "x", {
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return E;
|
||||
}());
|
||||
__decorate([
|
||||
dec,
|
||||
__metadata("design:type", Object),
|
||||
__metadata("design:paramtypes", [])
|
||||
], E.prototype, "x", null);
|
||||
var F = (function () {
|
||||
function F() {
|
||||
}
|
||||
Object.defineProperty(F.prototype, "x", {
|
||||
set: function (value) { },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return F;
|
||||
}());
|
||||
__decorate([
|
||||
dec,
|
||||
__metadata("design:type", Number),
|
||||
__metadata("design:paramtypes", [Number])
|
||||
], F.prototype, "x", null);
|
||||
@@ -0,0 +1,76 @@
|
||||
=== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor8.ts ===
|
||||
declare function dec<T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T>;
|
||||
>dec : Symbol(dec, Decl(decoratorOnClassAccessor8.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(decoratorOnClassAccessor8.ts, 0, 21))
|
||||
>target : Symbol(target, Decl(decoratorOnClassAccessor8.ts, 0, 24))
|
||||
>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassAccessor8.ts, 0, 36))
|
||||
>descriptor : Symbol(descriptor, Decl(decoratorOnClassAccessor8.ts, 0, 57))
|
||||
>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, --, --))
|
||||
>T : Symbol(T, Decl(decoratorOnClassAccessor8.ts, 0, 21))
|
||||
>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, --, --))
|
||||
>T : Symbol(T, Decl(decoratorOnClassAccessor8.ts, 0, 21))
|
||||
|
||||
class A {
|
||||
>A : Symbol(A, Decl(decoratorOnClassAccessor8.ts, 0, 126))
|
||||
|
||||
@dec get x() { return 0; }
|
||||
>dec : Symbol(dec, Decl(decoratorOnClassAccessor8.ts, 0, 0))
|
||||
>x : Symbol(A.x, Decl(decoratorOnClassAccessor8.ts, 2, 9), Decl(decoratorOnClassAccessor8.ts, 3, 30))
|
||||
|
||||
set x(value: number) { }
|
||||
>x : Symbol(A.x, Decl(decoratorOnClassAccessor8.ts, 2, 9), Decl(decoratorOnClassAccessor8.ts, 3, 30))
|
||||
>value : Symbol(value, Decl(decoratorOnClassAccessor8.ts, 4, 10))
|
||||
}
|
||||
|
||||
class B {
|
||||
>B : Symbol(B, Decl(decoratorOnClassAccessor8.ts, 5, 1))
|
||||
|
||||
get x() { return 0; }
|
||||
>x : Symbol(B.x, Decl(decoratorOnClassAccessor8.ts, 7, 9), Decl(decoratorOnClassAccessor8.ts, 8, 25))
|
||||
|
||||
@dec set x(value: number) { }
|
||||
>dec : Symbol(dec, Decl(decoratorOnClassAccessor8.ts, 0, 0))
|
||||
>x : Symbol(B.x, Decl(decoratorOnClassAccessor8.ts, 7, 9), Decl(decoratorOnClassAccessor8.ts, 8, 25))
|
||||
>value : Symbol(value, Decl(decoratorOnClassAccessor8.ts, 9, 15))
|
||||
}
|
||||
|
||||
class C {
|
||||
>C : Symbol(C, Decl(decoratorOnClassAccessor8.ts, 10, 1))
|
||||
|
||||
@dec set x(value: number) { }
|
||||
>dec : Symbol(dec, Decl(decoratorOnClassAccessor8.ts, 0, 0))
|
||||
>x : Symbol(C.x, Decl(decoratorOnClassAccessor8.ts, 12, 9), Decl(decoratorOnClassAccessor8.ts, 13, 33))
|
||||
>value : Symbol(value, Decl(decoratorOnClassAccessor8.ts, 13, 15))
|
||||
|
||||
get x() { return 0; }
|
||||
>x : Symbol(C.x, Decl(decoratorOnClassAccessor8.ts, 12, 9), Decl(decoratorOnClassAccessor8.ts, 13, 33))
|
||||
}
|
||||
|
||||
class D {
|
||||
>D : Symbol(D, Decl(decoratorOnClassAccessor8.ts, 15, 1))
|
||||
|
||||
set x(value: number) { }
|
||||
>x : Symbol(D.x, Decl(decoratorOnClassAccessor8.ts, 17, 9), Decl(decoratorOnClassAccessor8.ts, 18, 28))
|
||||
>value : Symbol(value, Decl(decoratorOnClassAccessor8.ts, 18, 10))
|
||||
|
||||
@dec get x() { return 0; }
|
||||
>dec : Symbol(dec, Decl(decoratorOnClassAccessor8.ts, 0, 0))
|
||||
>x : Symbol(D.x, Decl(decoratorOnClassAccessor8.ts, 17, 9), Decl(decoratorOnClassAccessor8.ts, 18, 28))
|
||||
}
|
||||
|
||||
class E {
|
||||
>E : Symbol(E, Decl(decoratorOnClassAccessor8.ts, 20, 1))
|
||||
|
||||
@dec get x() { return 0; }
|
||||
>dec : Symbol(dec, Decl(decoratorOnClassAccessor8.ts, 0, 0))
|
||||
>x : Symbol(E.x, Decl(decoratorOnClassAccessor8.ts, 22, 9))
|
||||
}
|
||||
|
||||
class F {
|
||||
>F : Symbol(F, Decl(decoratorOnClassAccessor8.ts, 24, 1))
|
||||
|
||||
@dec set x(value: number) { }
|
||||
>dec : Symbol(dec, Decl(decoratorOnClassAccessor8.ts, 0, 0))
|
||||
>x : Symbol(F.x, Decl(decoratorOnClassAccessor8.ts, 26, 9))
|
||||
>value : Symbol(value, Decl(decoratorOnClassAccessor8.ts, 27, 15))
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
=== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor8.ts ===
|
||||
declare function dec<T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T>;
|
||||
>dec : <T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T>
|
||||
>T : T
|
||||
>target : any
|
||||
>propertyKey : string
|
||||
>descriptor : TypedPropertyDescriptor<T>
|
||||
>TypedPropertyDescriptor : TypedPropertyDescriptor<T>
|
||||
>T : T
|
||||
>TypedPropertyDescriptor : TypedPropertyDescriptor<T>
|
||||
>T : T
|
||||
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
@dec get x() { return 0; }
|
||||
>dec : <T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T>
|
||||
>x : number
|
||||
>0 : 0
|
||||
|
||||
set x(value: number) { }
|
||||
>x : number
|
||||
>value : number
|
||||
}
|
||||
|
||||
class B {
|
||||
>B : B
|
||||
|
||||
get x() { return 0; }
|
||||
>x : number
|
||||
>0 : 0
|
||||
|
||||
@dec set x(value: number) { }
|
||||
>dec : <T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T>
|
||||
>x : number
|
||||
>value : number
|
||||
}
|
||||
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
@dec set x(value: number) { }
|
||||
>dec : <T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T>
|
||||
>x : number
|
||||
>value : number
|
||||
|
||||
get x() { return 0; }
|
||||
>x : number
|
||||
>0 : 0
|
||||
}
|
||||
|
||||
class D {
|
||||
>D : D
|
||||
|
||||
set x(value: number) { }
|
||||
>x : number
|
||||
>value : number
|
||||
|
||||
@dec get x() { return 0; }
|
||||
>dec : <T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T>
|
||||
>x : number
|
||||
>0 : 0
|
||||
}
|
||||
|
||||
class E {
|
||||
>E : E
|
||||
|
||||
@dec get x() { return 0; }
|
||||
>dec : <T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T>
|
||||
>x : number
|
||||
>0 : 0
|
||||
}
|
||||
|
||||
class F {
|
||||
>F : F
|
||||
|
||||
@dec set x(value: number) { }
|
||||
>dec : <T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T>
|
||||
>x : number
|
||||
>value : number
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
//// [decoratorOnClassConstructor4.ts]
|
||||
declare var dec: any;
|
||||
|
||||
@dec
|
||||
class A {
|
||||
}
|
||||
|
||||
@dec
|
||||
class B {
|
||||
constructor(x: number) {}
|
||||
}
|
||||
|
||||
@dec
|
||||
class C extends A {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassConstructor4.js]
|
||||
var __extends = (this && this.__extends) || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
return A;
|
||||
}());
|
||||
A = __decorate([
|
||||
dec
|
||||
], A);
|
||||
var B = (function () {
|
||||
function B(x) {
|
||||
}
|
||||
return B;
|
||||
}());
|
||||
B = __decorate([
|
||||
dec,
|
||||
__metadata("design:paramtypes", [Number])
|
||||
], B);
|
||||
var C = (function (_super) {
|
||||
__extends(C, _super);
|
||||
function C() {
|
||||
return _super.apply(this, arguments) || this;
|
||||
}
|
||||
return C;
|
||||
}(A));
|
||||
C = __decorate([
|
||||
dec
|
||||
], C);
|
||||
@@ -0,0 +1,28 @@
|
||||
=== tests/cases/conformance/decorators/class/constructor/decoratorOnClassConstructor4.ts ===
|
||||
declare var dec: any;
|
||||
>dec : Symbol(dec, Decl(decoratorOnClassConstructor4.ts, 0, 11))
|
||||
|
||||
@dec
|
||||
>dec : Symbol(dec, Decl(decoratorOnClassConstructor4.ts, 0, 11))
|
||||
|
||||
class A {
|
||||
>A : Symbol(A, Decl(decoratorOnClassConstructor4.ts, 0, 21))
|
||||
}
|
||||
|
||||
@dec
|
||||
>dec : Symbol(dec, Decl(decoratorOnClassConstructor4.ts, 0, 11))
|
||||
|
||||
class B {
|
||||
>B : Symbol(B, Decl(decoratorOnClassConstructor4.ts, 4, 1))
|
||||
|
||||
constructor(x: number) {}
|
||||
>x : Symbol(x, Decl(decoratorOnClassConstructor4.ts, 8, 16))
|
||||
}
|
||||
|
||||
@dec
|
||||
>dec : Symbol(dec, Decl(decoratorOnClassConstructor4.ts, 0, 11))
|
||||
|
||||
class C extends A {
|
||||
>C : Symbol(C, Decl(decoratorOnClassConstructor4.ts, 9, 1))
|
||||
>A : Symbol(A, Decl(decoratorOnClassConstructor4.ts, 0, 21))
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
=== tests/cases/conformance/decorators/class/constructor/decoratorOnClassConstructor4.ts ===
|
||||
declare var dec: any;
|
||||
>dec : any
|
||||
|
||||
@dec
|
||||
>dec : any
|
||||
|
||||
class A {
|
||||
>A : A
|
||||
}
|
||||
|
||||
@dec
|
||||
>dec : any
|
||||
|
||||
class B {
|
||||
>B : B
|
||||
|
||||
constructor(x: number) {}
|
||||
>x : number
|
||||
}
|
||||
|
||||
@dec
|
||||
>dec : any
|
||||
|
||||
class C extends A {
|
||||
>C : C
|
||||
>A : A
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
//// [explicitAnyAfterSpreadNoImplicitAnyError.ts]
|
||||
({ a: [], ...(null as any) });
|
||||
let x: any;
|
||||
|
||||
|
||||
//// [explicitAnyAfterSpreadNoImplicitAnyError.js]
|
||||
var __assign = (this && this.__assign) || Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
(__assign({ a: [] }, null));
|
||||
var x;
|
||||
@@ -0,0 +1,7 @@
|
||||
=== tests/cases/compiler/explicitAnyAfterSpreadNoImplicitAnyError.ts ===
|
||||
({ a: [], ...(null as any) });
|
||||
>a : Symbol(a, Decl(explicitAnyAfterSpreadNoImplicitAnyError.ts, 0, 2))
|
||||
|
||||
let x: any;
|
||||
>x : Symbol(x, Decl(explicitAnyAfterSpreadNoImplicitAnyError.ts, 1, 3))
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
=== tests/cases/compiler/explicitAnyAfterSpreadNoImplicitAnyError.ts ===
|
||||
({ a: [], ...(null as any) });
|
||||
>({ a: [], ...(null as any) }) : any
|
||||
>{ a: [], ...(null as any) } : any
|
||||
>a : undefined[]
|
||||
>[] : undefined[]
|
||||
>(null as any) : any
|
||||
>null as any : any
|
||||
>null : null
|
||||
|
||||
let x: any;
|
||||
>x : any
|
||||
|
||||
@@ -64,8 +64,7 @@ tslib_1.__decorate([
|
||||
tslib_1.__metadata("design:returntype", void 0)
|
||||
], C.prototype, "method", null);
|
||||
C = tslib_1.__decorate([
|
||||
dec,
|
||||
tslib_1.__metadata("design:paramtypes", [])
|
||||
dec
|
||||
], C);
|
||||
//// [script.js]
|
||||
var __extends = (this && this.__extends) || function (d, b) {
|
||||
@@ -111,6 +110,5 @@ __decorate([
|
||||
__metadata("design:returntype", void 0)
|
||||
], C.prototype, "method", null);
|
||||
C = __decorate([
|
||||
dec,
|
||||
__metadata("design:paramtypes", [])
|
||||
dec
|
||||
], C);
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
=== tests/cases/compiler/declaration.d.ts ===
|
||||
export declare class D {
|
||||
>D : Symbol(D, Decl(declaration.d.ts, 0, 0))
|
||||
}
|
||||
export declare class E extends D {
|
||||
>E : Symbol(E, Decl(declaration.d.ts, 1, 1))
|
||||
>D : Symbol(D, Decl(declaration.d.ts, 0, 0))
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
=== tests/cases/compiler/declaration.d.ts ===
|
||||
export declare class D {
|
||||
>D : D
|
||||
}
|
||||
export declare class E extends D {
|
||||
>E : E
|
||||
>D : D
|
||||
}
|
||||
@@ -64,8 +64,7 @@ tslib_1.__decorate([
|
||||
tslib_1.__metadata("design:returntype", void 0)
|
||||
], C.prototype, "method", null);
|
||||
C = tslib_1.__decorate([
|
||||
dec,
|
||||
tslib_1.__metadata("design:paramtypes", [])
|
||||
dec
|
||||
], C);
|
||||
//// [script.js]
|
||||
"use strict";
|
||||
@@ -96,6 +95,5 @@ tslib_1.__decorate([
|
||||
tslib_1.__metadata("design:returntype", void 0)
|
||||
], C.prototype, "method", null);
|
||||
C = tslib_1.__decorate([
|
||||
dec,
|
||||
tslib_1.__metadata("design:paramtypes", [])
|
||||
dec
|
||||
], C);
|
||||
|
||||
@@ -63,8 +63,7 @@ tslib_1.__decorate([
|
||||
tslib_1.__metadata("design:returntype", void 0)
|
||||
], C.prototype, "method", null);
|
||||
C = tslib_1.__decorate([
|
||||
dec,
|
||||
tslib_1.__metadata("design:paramtypes", [])
|
||||
dec
|
||||
], C);
|
||||
var o = { a: 1 };
|
||||
var y = tslib_1.__assign({}, o);
|
||||
@@ -113,6 +112,5 @@ __decorate([
|
||||
__metadata("design:returntype", void 0)
|
||||
], C.prototype, "method", null);
|
||||
C = __decorate([
|
||||
dec,
|
||||
__metadata("design:paramtypes", [])
|
||||
dec
|
||||
], C);
|
||||
|
||||
@@ -56,8 +56,7 @@ tslib_1.__decorate([
|
||||
tslib_1.__metadata("design:returntype", void 0)
|
||||
], C.prototype, "method", null);
|
||||
C = tslib_1.__decorate([
|
||||
dec,
|
||||
tslib_1.__metadata("design:paramtypes", [])
|
||||
dec
|
||||
], C);
|
||||
//// [script.js]
|
||||
var __extends = (this && this.__extends) || function (d, b) {
|
||||
@@ -103,6 +102,5 @@ __decorate([
|
||||
__metadata("design:returntype", void 0)
|
||||
], C.prototype, "method", null);
|
||||
C = __decorate([
|
||||
dec,
|
||||
__metadata("design:paramtypes", [])
|
||||
dec
|
||||
], C);
|
||||
|
||||
@@ -19,12 +19,14 @@ var v01: Pick<Pick<T, keyof T>, keyof T>;
|
||||
var v02: TP;
|
||||
var v02: { [P in keyof T]?: T[P] };
|
||||
var v02: Partial<T>;
|
||||
var v02: Pick<TP, keyof T>;
|
||||
var v02: { [P in keyof TP]: TP[P] }
|
||||
var v02: Pick<TP, keyof TP>;
|
||||
|
||||
var v03: TR;
|
||||
var v03: { readonly [P in keyof T]: T[P] };
|
||||
var v03: Readonly<T>;
|
||||
var v03: Pick<TR, keyof T>;
|
||||
var v03: { [P in keyof TR]: TR[P] }
|
||||
var v03: Pick<TR, keyof TR>;
|
||||
|
||||
var v04: TPR;
|
||||
var v04: { readonly [P in keyof T]?: T[P] };
|
||||
@@ -32,6 +34,7 @@ var v04: Partial<TR>;
|
||||
var v04: Readonly<TP>;
|
||||
var v04: Partial<Readonly<T>>;
|
||||
var v04: Readonly<Partial<T>>;
|
||||
var v04: { [P in keyof TPR]: TPR[P] }
|
||||
var v04: Pick<TPR, keyof T>;
|
||||
|
||||
type Boxified<T> = { [P in keyof T]: { x: T[P] } };
|
||||
@@ -55,12 +58,14 @@ var b01: Pick<Pick<B, keyof B>, keyof B>;
|
||||
var b02: BP;
|
||||
var b02: { [P in keyof B]?: B[P] };
|
||||
var b02: Partial<B>;
|
||||
var b02: Pick<BP, keyof B>;
|
||||
var b02: { [P in keyof BP]: BP[P] }
|
||||
var b02: Pick<BP, keyof BP>;
|
||||
|
||||
var b03: BR;
|
||||
var b03: { readonly [P in keyof B]: B[P] };
|
||||
var b03: Readonly<B>;
|
||||
var b03: Pick<BR, keyof B>;
|
||||
var b03: { [P in keyof BR]: BR[P] }
|
||||
var b03: Pick<BR, keyof BR>;
|
||||
|
||||
var b04: BPR;
|
||||
var b04: { readonly [P in keyof B]?: B[P] };
|
||||
@@ -68,7 +73,8 @@ var b04: Partial<BR>;
|
||||
var b04: Readonly<BP>;
|
||||
var b04: Partial<Readonly<B>>;
|
||||
var b04: Readonly<Partial<B>>;
|
||||
var b04: Pick<BPR, keyof B>;
|
||||
var b04: { [P in keyof BPR]: BPR[P] }
|
||||
var b04: Pick<BPR, keyof BPR>;
|
||||
|
||||
//// [mappedTypeModifiers.js]
|
||||
var v00;
|
||||
@@ -84,10 +90,13 @@ var v02;
|
||||
var v02;
|
||||
var v02;
|
||||
var v02;
|
||||
var v02;
|
||||
var v03;
|
||||
var v03;
|
||||
var v03;
|
||||
var v03;
|
||||
var v03;
|
||||
var v04;
|
||||
var v04;
|
||||
var v04;
|
||||
var v04;
|
||||
@@ -108,6 +117,8 @@ var b02;
|
||||
var b02;
|
||||
var b02;
|
||||
var b02;
|
||||
var b02;
|
||||
var b03;
|
||||
var b03;
|
||||
var b03;
|
||||
var b03;
|
||||
@@ -119,3 +130,4 @@ var b04;
|
||||
var b04;
|
||||
var b04;
|
||||
var b04;
|
||||
var b04;
|
||||
|
||||
@@ -65,249 +65,291 @@ var v01: Pick<Pick<T, keyof T>, keyof T>;
|
||||
>T : Symbol(T, Decl(mappedTypeModifiers.ts, 0, 0))
|
||||
|
||||
var v02: TP;
|
||||
>v02 : Symbol(v02, Decl(mappedTypeModifiers.ts, 17, 3), Decl(mappedTypeModifiers.ts, 18, 3), Decl(mappedTypeModifiers.ts, 19, 3), Decl(mappedTypeModifiers.ts, 20, 3))
|
||||
>v02 : Symbol(v02, Decl(mappedTypeModifiers.ts, 17, 3), Decl(mappedTypeModifiers.ts, 18, 3), Decl(mappedTypeModifiers.ts, 19, 3), Decl(mappedTypeModifiers.ts, 20, 3), Decl(mappedTypeModifiers.ts, 21, 3))
|
||||
>TP : Symbol(TP, Decl(mappedTypeModifiers.ts, 1, 34))
|
||||
|
||||
var v02: { [P in keyof T]?: T[P] };
|
||||
>v02 : Symbol(v02, Decl(mappedTypeModifiers.ts, 17, 3), Decl(mappedTypeModifiers.ts, 18, 3), Decl(mappedTypeModifiers.ts, 19, 3), Decl(mappedTypeModifiers.ts, 20, 3))
|
||||
>v02 : Symbol(v02, Decl(mappedTypeModifiers.ts, 17, 3), Decl(mappedTypeModifiers.ts, 18, 3), Decl(mappedTypeModifiers.ts, 19, 3), Decl(mappedTypeModifiers.ts, 20, 3), Decl(mappedTypeModifiers.ts, 21, 3))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 18, 12))
|
||||
>T : Symbol(T, Decl(mappedTypeModifiers.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(mappedTypeModifiers.ts, 0, 0))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 18, 12))
|
||||
|
||||
var v02: Partial<T>;
|
||||
>v02 : Symbol(v02, Decl(mappedTypeModifiers.ts, 17, 3), Decl(mappedTypeModifiers.ts, 18, 3), Decl(mappedTypeModifiers.ts, 19, 3), Decl(mappedTypeModifiers.ts, 20, 3))
|
||||
>v02 : Symbol(v02, Decl(mappedTypeModifiers.ts, 17, 3), Decl(mappedTypeModifiers.ts, 18, 3), Decl(mappedTypeModifiers.ts, 19, 3), Decl(mappedTypeModifiers.ts, 20, 3), Decl(mappedTypeModifiers.ts, 21, 3))
|
||||
>Partial : Symbol(Partial, Decl(lib.d.ts, --, --))
|
||||
>T : Symbol(T, Decl(mappedTypeModifiers.ts, 0, 0))
|
||||
|
||||
var v02: Pick<TP, keyof T>;
|
||||
>v02 : Symbol(v02, Decl(mappedTypeModifiers.ts, 17, 3), Decl(mappedTypeModifiers.ts, 18, 3), Decl(mappedTypeModifiers.ts, 19, 3), Decl(mappedTypeModifiers.ts, 20, 3))
|
||||
var v02: { [P in keyof TP]: TP[P] }
|
||||
>v02 : Symbol(v02, Decl(mappedTypeModifiers.ts, 17, 3), Decl(mappedTypeModifiers.ts, 18, 3), Decl(mappedTypeModifiers.ts, 19, 3), Decl(mappedTypeModifiers.ts, 20, 3), Decl(mappedTypeModifiers.ts, 21, 3))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 20, 12))
|
||||
>TP : Symbol(TP, Decl(mappedTypeModifiers.ts, 1, 34))
|
||||
>TP : Symbol(TP, Decl(mappedTypeModifiers.ts, 1, 34))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 20, 12))
|
||||
|
||||
var v02: Pick<TP, keyof TP>;
|
||||
>v02 : Symbol(v02, Decl(mappedTypeModifiers.ts, 17, 3), Decl(mappedTypeModifiers.ts, 18, 3), Decl(mappedTypeModifiers.ts, 19, 3), Decl(mappedTypeModifiers.ts, 20, 3), Decl(mappedTypeModifiers.ts, 21, 3))
|
||||
>Pick : Symbol(Pick, Decl(lib.d.ts, --, --))
|
||||
>TP : Symbol(TP, Decl(mappedTypeModifiers.ts, 1, 34))
|
||||
>T : Symbol(T, Decl(mappedTypeModifiers.ts, 0, 0))
|
||||
>TP : Symbol(TP, Decl(mappedTypeModifiers.ts, 1, 34))
|
||||
|
||||
var v03: TR;
|
||||
>v03 : Symbol(v03, Decl(mappedTypeModifiers.ts, 22, 3), Decl(mappedTypeModifiers.ts, 23, 3), Decl(mappedTypeModifiers.ts, 24, 3), Decl(mappedTypeModifiers.ts, 25, 3))
|
||||
>v03 : Symbol(v03, Decl(mappedTypeModifiers.ts, 23, 3), Decl(mappedTypeModifiers.ts, 24, 3), Decl(mappedTypeModifiers.ts, 25, 3), Decl(mappedTypeModifiers.ts, 26, 3), Decl(mappedTypeModifiers.ts, 27, 3))
|
||||
>TR : Symbol(TR, Decl(mappedTypeModifiers.ts, 2, 37))
|
||||
|
||||
var v03: { readonly [P in keyof T]: T[P] };
|
||||
>v03 : Symbol(v03, Decl(mappedTypeModifiers.ts, 22, 3), Decl(mappedTypeModifiers.ts, 23, 3), Decl(mappedTypeModifiers.ts, 24, 3), Decl(mappedTypeModifiers.ts, 25, 3))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 23, 21))
|
||||
>v03 : Symbol(v03, Decl(mappedTypeModifiers.ts, 23, 3), Decl(mappedTypeModifiers.ts, 24, 3), Decl(mappedTypeModifiers.ts, 25, 3), Decl(mappedTypeModifiers.ts, 26, 3), Decl(mappedTypeModifiers.ts, 27, 3))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 24, 21))
|
||||
>T : Symbol(T, Decl(mappedTypeModifiers.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(mappedTypeModifiers.ts, 0, 0))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 23, 21))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 24, 21))
|
||||
|
||||
var v03: Readonly<T>;
|
||||
>v03 : Symbol(v03, Decl(mappedTypeModifiers.ts, 22, 3), Decl(mappedTypeModifiers.ts, 23, 3), Decl(mappedTypeModifiers.ts, 24, 3), Decl(mappedTypeModifiers.ts, 25, 3))
|
||||
>v03 : Symbol(v03, Decl(mappedTypeModifiers.ts, 23, 3), Decl(mappedTypeModifiers.ts, 24, 3), Decl(mappedTypeModifiers.ts, 25, 3), Decl(mappedTypeModifiers.ts, 26, 3), Decl(mappedTypeModifiers.ts, 27, 3))
|
||||
>Readonly : Symbol(Readonly, Decl(lib.d.ts, --, --))
|
||||
>T : Symbol(T, Decl(mappedTypeModifiers.ts, 0, 0))
|
||||
|
||||
var v03: Pick<TR, keyof T>;
|
||||
>v03 : Symbol(v03, Decl(mappedTypeModifiers.ts, 22, 3), Decl(mappedTypeModifiers.ts, 23, 3), Decl(mappedTypeModifiers.ts, 24, 3), Decl(mappedTypeModifiers.ts, 25, 3))
|
||||
var v03: { [P in keyof TR]: TR[P] }
|
||||
>v03 : Symbol(v03, Decl(mappedTypeModifiers.ts, 23, 3), Decl(mappedTypeModifiers.ts, 24, 3), Decl(mappedTypeModifiers.ts, 25, 3), Decl(mappedTypeModifiers.ts, 26, 3), Decl(mappedTypeModifiers.ts, 27, 3))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 26, 12))
|
||||
>TR : Symbol(TR, Decl(mappedTypeModifiers.ts, 2, 37))
|
||||
>TR : Symbol(TR, Decl(mappedTypeModifiers.ts, 2, 37))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 26, 12))
|
||||
|
||||
var v03: Pick<TR, keyof TR>;
|
||||
>v03 : Symbol(v03, Decl(mappedTypeModifiers.ts, 23, 3), Decl(mappedTypeModifiers.ts, 24, 3), Decl(mappedTypeModifiers.ts, 25, 3), Decl(mappedTypeModifiers.ts, 26, 3), Decl(mappedTypeModifiers.ts, 27, 3))
|
||||
>Pick : Symbol(Pick, Decl(lib.d.ts, --, --))
|
||||
>TR : Symbol(TR, Decl(mappedTypeModifiers.ts, 2, 37))
|
||||
>T : Symbol(T, Decl(mappedTypeModifiers.ts, 0, 0))
|
||||
>TR : Symbol(TR, Decl(mappedTypeModifiers.ts, 2, 37))
|
||||
|
||||
var v04: TPR;
|
||||
>v04 : Symbol(v04, Decl(mappedTypeModifiers.ts, 27, 3), Decl(mappedTypeModifiers.ts, 28, 3), Decl(mappedTypeModifiers.ts, 29, 3), Decl(mappedTypeModifiers.ts, 30, 3), Decl(mappedTypeModifiers.ts, 31, 3), Decl(mappedTypeModifiers.ts, 32, 3), Decl(mappedTypeModifiers.ts, 33, 3))
|
||||
>v04 : Symbol(v04, Decl(mappedTypeModifiers.ts, 29, 3), Decl(mappedTypeModifiers.ts, 30, 3), Decl(mappedTypeModifiers.ts, 31, 3), Decl(mappedTypeModifiers.ts, 32, 3), Decl(mappedTypeModifiers.ts, 33, 3), Decl(mappedTypeModifiers.ts, 34, 3), Decl(mappedTypeModifiers.ts, 35, 3), Decl(mappedTypeModifiers.ts, 36, 3))
|
||||
>TPR : Symbol(TPR, Decl(mappedTypeModifiers.ts, 3, 53))
|
||||
|
||||
var v04: { readonly [P in keyof T]?: T[P] };
|
||||
>v04 : Symbol(v04, Decl(mappedTypeModifiers.ts, 27, 3), Decl(mappedTypeModifiers.ts, 28, 3), Decl(mappedTypeModifiers.ts, 29, 3), Decl(mappedTypeModifiers.ts, 30, 3), Decl(mappedTypeModifiers.ts, 31, 3), Decl(mappedTypeModifiers.ts, 32, 3), Decl(mappedTypeModifiers.ts, 33, 3))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 28, 21))
|
||||
>v04 : Symbol(v04, Decl(mappedTypeModifiers.ts, 29, 3), Decl(mappedTypeModifiers.ts, 30, 3), Decl(mappedTypeModifiers.ts, 31, 3), Decl(mappedTypeModifiers.ts, 32, 3), Decl(mappedTypeModifiers.ts, 33, 3), Decl(mappedTypeModifiers.ts, 34, 3), Decl(mappedTypeModifiers.ts, 35, 3), Decl(mappedTypeModifiers.ts, 36, 3))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 30, 21))
|
||||
>T : Symbol(T, Decl(mappedTypeModifiers.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(mappedTypeModifiers.ts, 0, 0))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 28, 21))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 30, 21))
|
||||
|
||||
var v04: Partial<TR>;
|
||||
>v04 : Symbol(v04, Decl(mappedTypeModifiers.ts, 27, 3), Decl(mappedTypeModifiers.ts, 28, 3), Decl(mappedTypeModifiers.ts, 29, 3), Decl(mappedTypeModifiers.ts, 30, 3), Decl(mappedTypeModifiers.ts, 31, 3), Decl(mappedTypeModifiers.ts, 32, 3), Decl(mappedTypeModifiers.ts, 33, 3))
|
||||
>v04 : Symbol(v04, Decl(mappedTypeModifiers.ts, 29, 3), Decl(mappedTypeModifiers.ts, 30, 3), Decl(mappedTypeModifiers.ts, 31, 3), Decl(mappedTypeModifiers.ts, 32, 3), Decl(mappedTypeModifiers.ts, 33, 3), Decl(mappedTypeModifiers.ts, 34, 3), Decl(mappedTypeModifiers.ts, 35, 3), Decl(mappedTypeModifiers.ts, 36, 3))
|
||||
>Partial : Symbol(Partial, Decl(lib.d.ts, --, --))
|
||||
>TR : Symbol(TR, Decl(mappedTypeModifiers.ts, 2, 37))
|
||||
|
||||
var v04: Readonly<TP>;
|
||||
>v04 : Symbol(v04, Decl(mappedTypeModifiers.ts, 27, 3), Decl(mappedTypeModifiers.ts, 28, 3), Decl(mappedTypeModifiers.ts, 29, 3), Decl(mappedTypeModifiers.ts, 30, 3), Decl(mappedTypeModifiers.ts, 31, 3), Decl(mappedTypeModifiers.ts, 32, 3), Decl(mappedTypeModifiers.ts, 33, 3))
|
||||
>v04 : Symbol(v04, Decl(mappedTypeModifiers.ts, 29, 3), Decl(mappedTypeModifiers.ts, 30, 3), Decl(mappedTypeModifiers.ts, 31, 3), Decl(mappedTypeModifiers.ts, 32, 3), Decl(mappedTypeModifiers.ts, 33, 3), Decl(mappedTypeModifiers.ts, 34, 3), Decl(mappedTypeModifiers.ts, 35, 3), Decl(mappedTypeModifiers.ts, 36, 3))
|
||||
>Readonly : Symbol(Readonly, Decl(lib.d.ts, --, --))
|
||||
>TP : Symbol(TP, Decl(mappedTypeModifiers.ts, 1, 34))
|
||||
|
||||
var v04: Partial<Readonly<T>>;
|
||||
>v04 : Symbol(v04, Decl(mappedTypeModifiers.ts, 27, 3), Decl(mappedTypeModifiers.ts, 28, 3), Decl(mappedTypeModifiers.ts, 29, 3), Decl(mappedTypeModifiers.ts, 30, 3), Decl(mappedTypeModifiers.ts, 31, 3), Decl(mappedTypeModifiers.ts, 32, 3), Decl(mappedTypeModifiers.ts, 33, 3))
|
||||
>v04 : Symbol(v04, Decl(mappedTypeModifiers.ts, 29, 3), Decl(mappedTypeModifiers.ts, 30, 3), Decl(mappedTypeModifiers.ts, 31, 3), Decl(mappedTypeModifiers.ts, 32, 3), Decl(mappedTypeModifiers.ts, 33, 3), Decl(mappedTypeModifiers.ts, 34, 3), Decl(mappedTypeModifiers.ts, 35, 3), Decl(mappedTypeModifiers.ts, 36, 3))
|
||||
>Partial : Symbol(Partial, Decl(lib.d.ts, --, --))
|
||||
>Readonly : Symbol(Readonly, Decl(lib.d.ts, --, --))
|
||||
>T : Symbol(T, Decl(mappedTypeModifiers.ts, 0, 0))
|
||||
|
||||
var v04: Readonly<Partial<T>>;
|
||||
>v04 : Symbol(v04, Decl(mappedTypeModifiers.ts, 27, 3), Decl(mappedTypeModifiers.ts, 28, 3), Decl(mappedTypeModifiers.ts, 29, 3), Decl(mappedTypeModifiers.ts, 30, 3), Decl(mappedTypeModifiers.ts, 31, 3), Decl(mappedTypeModifiers.ts, 32, 3), Decl(mappedTypeModifiers.ts, 33, 3))
|
||||
>v04 : Symbol(v04, Decl(mappedTypeModifiers.ts, 29, 3), Decl(mappedTypeModifiers.ts, 30, 3), Decl(mappedTypeModifiers.ts, 31, 3), Decl(mappedTypeModifiers.ts, 32, 3), Decl(mappedTypeModifiers.ts, 33, 3), Decl(mappedTypeModifiers.ts, 34, 3), Decl(mappedTypeModifiers.ts, 35, 3), Decl(mappedTypeModifiers.ts, 36, 3))
|
||||
>Readonly : Symbol(Readonly, Decl(lib.d.ts, --, --))
|
||||
>Partial : Symbol(Partial, Decl(lib.d.ts, --, --))
|
||||
>T : Symbol(T, Decl(mappedTypeModifiers.ts, 0, 0))
|
||||
|
||||
var v04: { [P in keyof TPR]: TPR[P] }
|
||||
>v04 : Symbol(v04, Decl(mappedTypeModifiers.ts, 29, 3), Decl(mappedTypeModifiers.ts, 30, 3), Decl(mappedTypeModifiers.ts, 31, 3), Decl(mappedTypeModifiers.ts, 32, 3), Decl(mappedTypeModifiers.ts, 33, 3), Decl(mappedTypeModifiers.ts, 34, 3), Decl(mappedTypeModifiers.ts, 35, 3), Decl(mappedTypeModifiers.ts, 36, 3))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 35, 12))
|
||||
>TPR : Symbol(TPR, Decl(mappedTypeModifiers.ts, 3, 53))
|
||||
>TPR : Symbol(TPR, Decl(mappedTypeModifiers.ts, 3, 53))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 35, 12))
|
||||
|
||||
var v04: Pick<TPR, keyof T>;
|
||||
>v04 : Symbol(v04, Decl(mappedTypeModifiers.ts, 27, 3), Decl(mappedTypeModifiers.ts, 28, 3), Decl(mappedTypeModifiers.ts, 29, 3), Decl(mappedTypeModifiers.ts, 30, 3), Decl(mappedTypeModifiers.ts, 31, 3), Decl(mappedTypeModifiers.ts, 32, 3), Decl(mappedTypeModifiers.ts, 33, 3))
|
||||
>v04 : Symbol(v04, Decl(mappedTypeModifiers.ts, 29, 3), Decl(mappedTypeModifiers.ts, 30, 3), Decl(mappedTypeModifiers.ts, 31, 3), Decl(mappedTypeModifiers.ts, 32, 3), Decl(mappedTypeModifiers.ts, 33, 3), Decl(mappedTypeModifiers.ts, 34, 3), Decl(mappedTypeModifiers.ts, 35, 3), Decl(mappedTypeModifiers.ts, 36, 3))
|
||||
>Pick : Symbol(Pick, Decl(lib.d.ts, --, --))
|
||||
>TPR : Symbol(TPR, Decl(mappedTypeModifiers.ts, 3, 53))
|
||||
>T : Symbol(T, Decl(mappedTypeModifiers.ts, 0, 0))
|
||||
|
||||
type Boxified<T> = { [P in keyof T]: { x: T[P] } };
|
||||
>Boxified : Symbol(Boxified, Decl(mappedTypeModifiers.ts, 33, 28))
|
||||
>T : Symbol(T, Decl(mappedTypeModifiers.ts, 35, 14))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 35, 22))
|
||||
>T : Symbol(T, Decl(mappedTypeModifiers.ts, 35, 14))
|
||||
>x : Symbol(x, Decl(mappedTypeModifiers.ts, 35, 38))
|
||||
>T : Symbol(T, Decl(mappedTypeModifiers.ts, 35, 14))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 35, 22))
|
||||
>Boxified : Symbol(Boxified, Decl(mappedTypeModifiers.ts, 36, 28))
|
||||
>T : Symbol(T, Decl(mappedTypeModifiers.ts, 38, 14))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 38, 22))
|
||||
>T : Symbol(T, Decl(mappedTypeModifiers.ts, 38, 14))
|
||||
>x : Symbol(x, Decl(mappedTypeModifiers.ts, 38, 38))
|
||||
>T : Symbol(T, Decl(mappedTypeModifiers.ts, 38, 14))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 38, 22))
|
||||
|
||||
type B = { a: { x: number }, b: { x: string } };
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 35, 51))
|
||||
>a : Symbol(a, Decl(mappedTypeModifiers.ts, 37, 10))
|
||||
>x : Symbol(x, Decl(mappedTypeModifiers.ts, 37, 15))
|
||||
>b : Symbol(b, Decl(mappedTypeModifiers.ts, 37, 28))
|
||||
>x : Symbol(x, Decl(mappedTypeModifiers.ts, 37, 33))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
>a : Symbol(a, Decl(mappedTypeModifiers.ts, 40, 10))
|
||||
>x : Symbol(x, Decl(mappedTypeModifiers.ts, 40, 15))
|
||||
>b : Symbol(b, Decl(mappedTypeModifiers.ts, 40, 28))
|
||||
>x : Symbol(x, Decl(mappedTypeModifiers.ts, 40, 33))
|
||||
|
||||
type BP = { a?: { x: number }, b?: { x: string } };
|
||||
>BP : Symbol(BP, Decl(mappedTypeModifiers.ts, 37, 48))
|
||||
>a : Symbol(a, Decl(mappedTypeModifiers.ts, 38, 11))
|
||||
>x : Symbol(x, Decl(mappedTypeModifiers.ts, 38, 17))
|
||||
>b : Symbol(b, Decl(mappedTypeModifiers.ts, 38, 30))
|
||||
>x : Symbol(x, Decl(mappedTypeModifiers.ts, 38, 36))
|
||||
>BP : Symbol(BP, Decl(mappedTypeModifiers.ts, 40, 48))
|
||||
>a : Symbol(a, Decl(mappedTypeModifiers.ts, 41, 11))
|
||||
>x : Symbol(x, Decl(mappedTypeModifiers.ts, 41, 17))
|
||||
>b : Symbol(b, Decl(mappedTypeModifiers.ts, 41, 30))
|
||||
>x : Symbol(x, Decl(mappedTypeModifiers.ts, 41, 36))
|
||||
|
||||
type BR = { readonly a: { x: number }, readonly b: { x: string } };
|
||||
>BR : Symbol(BR, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
>a : Symbol(a, Decl(mappedTypeModifiers.ts, 39, 11))
|
||||
>x : Symbol(x, Decl(mappedTypeModifiers.ts, 39, 25))
|
||||
>b : Symbol(b, Decl(mappedTypeModifiers.ts, 39, 38))
|
||||
>x : Symbol(x, Decl(mappedTypeModifiers.ts, 39, 52))
|
||||
>BR : Symbol(BR, Decl(mappedTypeModifiers.ts, 41, 51))
|
||||
>a : Symbol(a, Decl(mappedTypeModifiers.ts, 42, 11))
|
||||
>x : Symbol(x, Decl(mappedTypeModifiers.ts, 42, 25))
|
||||
>b : Symbol(b, Decl(mappedTypeModifiers.ts, 42, 38))
|
||||
>x : Symbol(x, Decl(mappedTypeModifiers.ts, 42, 52))
|
||||
|
||||
type BPR = { readonly a?: { x: number }, readonly b?: { x: string } };
|
||||
>BPR : Symbol(BPR, Decl(mappedTypeModifiers.ts, 39, 67))
|
||||
>a : Symbol(a, Decl(mappedTypeModifiers.ts, 40, 12))
|
||||
>x : Symbol(x, Decl(mappedTypeModifiers.ts, 40, 27))
|
||||
>b : Symbol(b, Decl(mappedTypeModifiers.ts, 40, 40))
|
||||
>x : Symbol(x, Decl(mappedTypeModifiers.ts, 40, 55))
|
||||
>BPR : Symbol(BPR, Decl(mappedTypeModifiers.ts, 42, 67))
|
||||
>a : Symbol(a, Decl(mappedTypeModifiers.ts, 43, 12))
|
||||
>x : Symbol(x, Decl(mappedTypeModifiers.ts, 43, 27))
|
||||
>b : Symbol(b, Decl(mappedTypeModifiers.ts, 43, 40))
|
||||
>x : Symbol(x, Decl(mappedTypeModifiers.ts, 43, 55))
|
||||
|
||||
var b00: "a" | "b";
|
||||
>b00 : Symbol(b00, Decl(mappedTypeModifiers.ts, 42, 3), Decl(mappedTypeModifiers.ts, 43, 3), Decl(mappedTypeModifiers.ts, 44, 3), Decl(mappedTypeModifiers.ts, 45, 3), Decl(mappedTypeModifiers.ts, 46, 3))
|
||||
>b00 : Symbol(b00, Decl(mappedTypeModifiers.ts, 45, 3), Decl(mappedTypeModifiers.ts, 46, 3), Decl(mappedTypeModifiers.ts, 47, 3), Decl(mappedTypeModifiers.ts, 48, 3), Decl(mappedTypeModifiers.ts, 49, 3))
|
||||
|
||||
var b00: keyof B;
|
||||
>b00 : Symbol(b00, Decl(mappedTypeModifiers.ts, 42, 3), Decl(mappedTypeModifiers.ts, 43, 3), Decl(mappedTypeModifiers.ts, 44, 3), Decl(mappedTypeModifiers.ts, 45, 3), Decl(mappedTypeModifiers.ts, 46, 3))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 35, 51))
|
||||
>b00 : Symbol(b00, Decl(mappedTypeModifiers.ts, 45, 3), Decl(mappedTypeModifiers.ts, 46, 3), Decl(mappedTypeModifiers.ts, 47, 3), Decl(mappedTypeModifiers.ts, 48, 3), Decl(mappedTypeModifiers.ts, 49, 3))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
|
||||
var b00: keyof BP;
|
||||
>b00 : Symbol(b00, Decl(mappedTypeModifiers.ts, 42, 3), Decl(mappedTypeModifiers.ts, 43, 3), Decl(mappedTypeModifiers.ts, 44, 3), Decl(mappedTypeModifiers.ts, 45, 3), Decl(mappedTypeModifiers.ts, 46, 3))
|
||||
>BP : Symbol(BP, Decl(mappedTypeModifiers.ts, 37, 48))
|
||||
>b00 : Symbol(b00, Decl(mappedTypeModifiers.ts, 45, 3), Decl(mappedTypeModifiers.ts, 46, 3), Decl(mappedTypeModifiers.ts, 47, 3), Decl(mappedTypeModifiers.ts, 48, 3), Decl(mappedTypeModifiers.ts, 49, 3))
|
||||
>BP : Symbol(BP, Decl(mappedTypeModifiers.ts, 40, 48))
|
||||
|
||||
var b00: keyof BR;
|
||||
>b00 : Symbol(b00, Decl(mappedTypeModifiers.ts, 42, 3), Decl(mappedTypeModifiers.ts, 43, 3), Decl(mappedTypeModifiers.ts, 44, 3), Decl(mappedTypeModifiers.ts, 45, 3), Decl(mappedTypeModifiers.ts, 46, 3))
|
||||
>BR : Symbol(BR, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
>b00 : Symbol(b00, Decl(mappedTypeModifiers.ts, 45, 3), Decl(mappedTypeModifiers.ts, 46, 3), Decl(mappedTypeModifiers.ts, 47, 3), Decl(mappedTypeModifiers.ts, 48, 3), Decl(mappedTypeModifiers.ts, 49, 3))
|
||||
>BR : Symbol(BR, Decl(mappedTypeModifiers.ts, 41, 51))
|
||||
|
||||
var b00: keyof BPR;
|
||||
>b00 : Symbol(b00, Decl(mappedTypeModifiers.ts, 42, 3), Decl(mappedTypeModifiers.ts, 43, 3), Decl(mappedTypeModifiers.ts, 44, 3), Decl(mappedTypeModifiers.ts, 45, 3), Decl(mappedTypeModifiers.ts, 46, 3))
|
||||
>BPR : Symbol(BPR, Decl(mappedTypeModifiers.ts, 39, 67))
|
||||
>b00 : Symbol(b00, Decl(mappedTypeModifiers.ts, 45, 3), Decl(mappedTypeModifiers.ts, 46, 3), Decl(mappedTypeModifiers.ts, 47, 3), Decl(mappedTypeModifiers.ts, 48, 3), Decl(mappedTypeModifiers.ts, 49, 3))
|
||||
>BPR : Symbol(BPR, Decl(mappedTypeModifiers.ts, 42, 67))
|
||||
|
||||
var b01: B;
|
||||
>b01 : Symbol(b01, Decl(mappedTypeModifiers.ts, 48, 3), Decl(mappedTypeModifiers.ts, 49, 3), Decl(mappedTypeModifiers.ts, 50, 3), Decl(mappedTypeModifiers.ts, 51, 3))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 35, 51))
|
||||
>b01 : Symbol(b01, Decl(mappedTypeModifiers.ts, 51, 3), Decl(mappedTypeModifiers.ts, 52, 3), Decl(mappedTypeModifiers.ts, 53, 3), Decl(mappedTypeModifiers.ts, 54, 3))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
|
||||
var b01: { [P in keyof B]: B[P] };
|
||||
>b01 : Symbol(b01, Decl(mappedTypeModifiers.ts, 48, 3), Decl(mappedTypeModifiers.ts, 49, 3), Decl(mappedTypeModifiers.ts, 50, 3), Decl(mappedTypeModifiers.ts, 51, 3))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 49, 12))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 35, 51))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 35, 51))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 49, 12))
|
||||
>b01 : Symbol(b01, Decl(mappedTypeModifiers.ts, 51, 3), Decl(mappedTypeModifiers.ts, 52, 3), Decl(mappedTypeModifiers.ts, 53, 3), Decl(mappedTypeModifiers.ts, 54, 3))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 52, 12))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 52, 12))
|
||||
|
||||
var b01: Pick<B, keyof B>;
|
||||
>b01 : Symbol(b01, Decl(mappedTypeModifiers.ts, 48, 3), Decl(mappedTypeModifiers.ts, 49, 3), Decl(mappedTypeModifiers.ts, 50, 3), Decl(mappedTypeModifiers.ts, 51, 3))
|
||||
>b01 : Symbol(b01, Decl(mappedTypeModifiers.ts, 51, 3), Decl(mappedTypeModifiers.ts, 52, 3), Decl(mappedTypeModifiers.ts, 53, 3), Decl(mappedTypeModifiers.ts, 54, 3))
|
||||
>Pick : Symbol(Pick, Decl(lib.d.ts, --, --))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 35, 51))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 35, 51))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
|
||||
var b01: Pick<Pick<B, keyof B>, keyof B>;
|
||||
>b01 : Symbol(b01, Decl(mappedTypeModifiers.ts, 48, 3), Decl(mappedTypeModifiers.ts, 49, 3), Decl(mappedTypeModifiers.ts, 50, 3), Decl(mappedTypeModifiers.ts, 51, 3))
|
||||
>b01 : Symbol(b01, Decl(mappedTypeModifiers.ts, 51, 3), Decl(mappedTypeModifiers.ts, 52, 3), Decl(mappedTypeModifiers.ts, 53, 3), Decl(mappedTypeModifiers.ts, 54, 3))
|
||||
>Pick : Symbol(Pick, Decl(lib.d.ts, --, --))
|
||||
>Pick : Symbol(Pick, Decl(lib.d.ts, --, --))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 35, 51))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 35, 51))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 35, 51))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
|
||||
var b02: BP;
|
||||
>b02 : Symbol(b02, Decl(mappedTypeModifiers.ts, 53, 3), Decl(mappedTypeModifiers.ts, 54, 3), Decl(mappedTypeModifiers.ts, 55, 3), Decl(mappedTypeModifiers.ts, 56, 3))
|
||||
>BP : Symbol(BP, Decl(mappedTypeModifiers.ts, 37, 48))
|
||||
>b02 : Symbol(b02, Decl(mappedTypeModifiers.ts, 56, 3), Decl(mappedTypeModifiers.ts, 57, 3), Decl(mappedTypeModifiers.ts, 58, 3), Decl(mappedTypeModifiers.ts, 59, 3), Decl(mappedTypeModifiers.ts, 60, 3))
|
||||
>BP : Symbol(BP, Decl(mappedTypeModifiers.ts, 40, 48))
|
||||
|
||||
var b02: { [P in keyof B]?: B[P] };
|
||||
>b02 : Symbol(b02, Decl(mappedTypeModifiers.ts, 53, 3), Decl(mappedTypeModifiers.ts, 54, 3), Decl(mappedTypeModifiers.ts, 55, 3), Decl(mappedTypeModifiers.ts, 56, 3))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 54, 12))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 35, 51))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 35, 51))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 54, 12))
|
||||
>b02 : Symbol(b02, Decl(mappedTypeModifiers.ts, 56, 3), Decl(mappedTypeModifiers.ts, 57, 3), Decl(mappedTypeModifiers.ts, 58, 3), Decl(mappedTypeModifiers.ts, 59, 3), Decl(mappedTypeModifiers.ts, 60, 3))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 57, 12))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 57, 12))
|
||||
|
||||
var b02: Partial<B>;
|
||||
>b02 : Symbol(b02, Decl(mappedTypeModifiers.ts, 53, 3), Decl(mappedTypeModifiers.ts, 54, 3), Decl(mappedTypeModifiers.ts, 55, 3), Decl(mappedTypeModifiers.ts, 56, 3))
|
||||
>b02 : Symbol(b02, Decl(mappedTypeModifiers.ts, 56, 3), Decl(mappedTypeModifiers.ts, 57, 3), Decl(mappedTypeModifiers.ts, 58, 3), Decl(mappedTypeModifiers.ts, 59, 3), Decl(mappedTypeModifiers.ts, 60, 3))
|
||||
>Partial : Symbol(Partial, Decl(lib.d.ts, --, --))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 35, 51))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
|
||||
var b02: Pick<BP, keyof B>;
|
||||
>b02 : Symbol(b02, Decl(mappedTypeModifiers.ts, 53, 3), Decl(mappedTypeModifiers.ts, 54, 3), Decl(mappedTypeModifiers.ts, 55, 3), Decl(mappedTypeModifiers.ts, 56, 3))
|
||||
var b02: { [P in keyof BP]: BP[P] }
|
||||
>b02 : Symbol(b02, Decl(mappedTypeModifiers.ts, 56, 3), Decl(mappedTypeModifiers.ts, 57, 3), Decl(mappedTypeModifiers.ts, 58, 3), Decl(mappedTypeModifiers.ts, 59, 3), Decl(mappedTypeModifiers.ts, 60, 3))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 59, 12))
|
||||
>BP : Symbol(BP, Decl(mappedTypeModifiers.ts, 40, 48))
|
||||
>BP : Symbol(BP, Decl(mappedTypeModifiers.ts, 40, 48))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 59, 12))
|
||||
|
||||
var b02: Pick<BP, keyof BP>;
|
||||
>b02 : Symbol(b02, Decl(mappedTypeModifiers.ts, 56, 3), Decl(mappedTypeModifiers.ts, 57, 3), Decl(mappedTypeModifiers.ts, 58, 3), Decl(mappedTypeModifiers.ts, 59, 3), Decl(mappedTypeModifiers.ts, 60, 3))
|
||||
>Pick : Symbol(Pick, Decl(lib.d.ts, --, --))
|
||||
>BP : Symbol(BP, Decl(mappedTypeModifiers.ts, 37, 48))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 35, 51))
|
||||
>BP : Symbol(BP, Decl(mappedTypeModifiers.ts, 40, 48))
|
||||
>BP : Symbol(BP, Decl(mappedTypeModifiers.ts, 40, 48))
|
||||
|
||||
var b03: BR;
|
||||
>b03 : Symbol(b03, Decl(mappedTypeModifiers.ts, 58, 3), Decl(mappedTypeModifiers.ts, 59, 3), Decl(mappedTypeModifiers.ts, 60, 3), Decl(mappedTypeModifiers.ts, 61, 3))
|
||||
>BR : Symbol(BR, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
>b03 : Symbol(b03, Decl(mappedTypeModifiers.ts, 62, 3), Decl(mappedTypeModifiers.ts, 63, 3), Decl(mappedTypeModifiers.ts, 64, 3), Decl(mappedTypeModifiers.ts, 65, 3), Decl(mappedTypeModifiers.ts, 66, 3))
|
||||
>BR : Symbol(BR, Decl(mappedTypeModifiers.ts, 41, 51))
|
||||
|
||||
var b03: { readonly [P in keyof B]: B[P] };
|
||||
>b03 : Symbol(b03, Decl(mappedTypeModifiers.ts, 58, 3), Decl(mappedTypeModifiers.ts, 59, 3), Decl(mappedTypeModifiers.ts, 60, 3), Decl(mappedTypeModifiers.ts, 61, 3))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 59, 21))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 35, 51))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 35, 51))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 59, 21))
|
||||
>b03 : Symbol(b03, Decl(mappedTypeModifiers.ts, 62, 3), Decl(mappedTypeModifiers.ts, 63, 3), Decl(mappedTypeModifiers.ts, 64, 3), Decl(mappedTypeModifiers.ts, 65, 3), Decl(mappedTypeModifiers.ts, 66, 3))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 63, 21))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 63, 21))
|
||||
|
||||
var b03: Readonly<B>;
|
||||
>b03 : Symbol(b03, Decl(mappedTypeModifiers.ts, 58, 3), Decl(mappedTypeModifiers.ts, 59, 3), Decl(mappedTypeModifiers.ts, 60, 3), Decl(mappedTypeModifiers.ts, 61, 3))
|
||||
>b03 : Symbol(b03, Decl(mappedTypeModifiers.ts, 62, 3), Decl(mappedTypeModifiers.ts, 63, 3), Decl(mappedTypeModifiers.ts, 64, 3), Decl(mappedTypeModifiers.ts, 65, 3), Decl(mappedTypeModifiers.ts, 66, 3))
|
||||
>Readonly : Symbol(Readonly, Decl(lib.d.ts, --, --))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 35, 51))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
|
||||
var b03: Pick<BR, keyof B>;
|
||||
>b03 : Symbol(b03, Decl(mappedTypeModifiers.ts, 58, 3), Decl(mappedTypeModifiers.ts, 59, 3), Decl(mappedTypeModifiers.ts, 60, 3), Decl(mappedTypeModifiers.ts, 61, 3))
|
||||
var b03: { [P in keyof BR]: BR[P] }
|
||||
>b03 : Symbol(b03, Decl(mappedTypeModifiers.ts, 62, 3), Decl(mappedTypeModifiers.ts, 63, 3), Decl(mappedTypeModifiers.ts, 64, 3), Decl(mappedTypeModifiers.ts, 65, 3), Decl(mappedTypeModifiers.ts, 66, 3))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 65, 12))
|
||||
>BR : Symbol(BR, Decl(mappedTypeModifiers.ts, 41, 51))
|
||||
>BR : Symbol(BR, Decl(mappedTypeModifiers.ts, 41, 51))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 65, 12))
|
||||
|
||||
var b03: Pick<BR, keyof BR>;
|
||||
>b03 : Symbol(b03, Decl(mappedTypeModifiers.ts, 62, 3), Decl(mappedTypeModifiers.ts, 63, 3), Decl(mappedTypeModifiers.ts, 64, 3), Decl(mappedTypeModifiers.ts, 65, 3), Decl(mappedTypeModifiers.ts, 66, 3))
|
||||
>Pick : Symbol(Pick, Decl(lib.d.ts, --, --))
|
||||
>BR : Symbol(BR, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 35, 51))
|
||||
>BR : Symbol(BR, Decl(mappedTypeModifiers.ts, 41, 51))
|
||||
>BR : Symbol(BR, Decl(mappedTypeModifiers.ts, 41, 51))
|
||||
|
||||
var b04: BPR;
|
||||
>b04 : Symbol(b04, Decl(mappedTypeModifiers.ts, 63, 3), Decl(mappedTypeModifiers.ts, 64, 3), Decl(mappedTypeModifiers.ts, 65, 3), Decl(mappedTypeModifiers.ts, 66, 3), Decl(mappedTypeModifiers.ts, 67, 3), Decl(mappedTypeModifiers.ts, 68, 3), Decl(mappedTypeModifiers.ts, 69, 3))
|
||||
>BPR : Symbol(BPR, Decl(mappedTypeModifiers.ts, 39, 67))
|
||||
>b04 : Symbol(b04, Decl(mappedTypeModifiers.ts, 68, 3), Decl(mappedTypeModifiers.ts, 69, 3), Decl(mappedTypeModifiers.ts, 70, 3), Decl(mappedTypeModifiers.ts, 71, 3), Decl(mappedTypeModifiers.ts, 72, 3), Decl(mappedTypeModifiers.ts, 73, 3), Decl(mappedTypeModifiers.ts, 74, 3), Decl(mappedTypeModifiers.ts, 75, 3))
|
||||
>BPR : Symbol(BPR, Decl(mappedTypeModifiers.ts, 42, 67))
|
||||
|
||||
var b04: { readonly [P in keyof B]?: B[P] };
|
||||
>b04 : Symbol(b04, Decl(mappedTypeModifiers.ts, 63, 3), Decl(mappedTypeModifiers.ts, 64, 3), Decl(mappedTypeModifiers.ts, 65, 3), Decl(mappedTypeModifiers.ts, 66, 3), Decl(mappedTypeModifiers.ts, 67, 3), Decl(mappedTypeModifiers.ts, 68, 3), Decl(mappedTypeModifiers.ts, 69, 3))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 64, 21))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 35, 51))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 35, 51))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 64, 21))
|
||||
>b04 : Symbol(b04, Decl(mappedTypeModifiers.ts, 68, 3), Decl(mappedTypeModifiers.ts, 69, 3), Decl(mappedTypeModifiers.ts, 70, 3), Decl(mappedTypeModifiers.ts, 71, 3), Decl(mappedTypeModifiers.ts, 72, 3), Decl(mappedTypeModifiers.ts, 73, 3), Decl(mappedTypeModifiers.ts, 74, 3), Decl(mappedTypeModifiers.ts, 75, 3))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 69, 21))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 69, 21))
|
||||
|
||||
var b04: Partial<BR>;
|
||||
>b04 : Symbol(b04, Decl(mappedTypeModifiers.ts, 63, 3), Decl(mappedTypeModifiers.ts, 64, 3), Decl(mappedTypeModifiers.ts, 65, 3), Decl(mappedTypeModifiers.ts, 66, 3), Decl(mappedTypeModifiers.ts, 67, 3), Decl(mappedTypeModifiers.ts, 68, 3), Decl(mappedTypeModifiers.ts, 69, 3))
|
||||
>b04 : Symbol(b04, Decl(mappedTypeModifiers.ts, 68, 3), Decl(mappedTypeModifiers.ts, 69, 3), Decl(mappedTypeModifiers.ts, 70, 3), Decl(mappedTypeModifiers.ts, 71, 3), Decl(mappedTypeModifiers.ts, 72, 3), Decl(mappedTypeModifiers.ts, 73, 3), Decl(mappedTypeModifiers.ts, 74, 3), Decl(mappedTypeModifiers.ts, 75, 3))
|
||||
>Partial : Symbol(Partial, Decl(lib.d.ts, --, --))
|
||||
>BR : Symbol(BR, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
>BR : Symbol(BR, Decl(mappedTypeModifiers.ts, 41, 51))
|
||||
|
||||
var b04: Readonly<BP>;
|
||||
>b04 : Symbol(b04, Decl(mappedTypeModifiers.ts, 63, 3), Decl(mappedTypeModifiers.ts, 64, 3), Decl(mappedTypeModifiers.ts, 65, 3), Decl(mappedTypeModifiers.ts, 66, 3), Decl(mappedTypeModifiers.ts, 67, 3), Decl(mappedTypeModifiers.ts, 68, 3), Decl(mappedTypeModifiers.ts, 69, 3))
|
||||
>b04 : Symbol(b04, Decl(mappedTypeModifiers.ts, 68, 3), Decl(mappedTypeModifiers.ts, 69, 3), Decl(mappedTypeModifiers.ts, 70, 3), Decl(mappedTypeModifiers.ts, 71, 3), Decl(mappedTypeModifiers.ts, 72, 3), Decl(mappedTypeModifiers.ts, 73, 3), Decl(mappedTypeModifiers.ts, 74, 3), Decl(mappedTypeModifiers.ts, 75, 3))
|
||||
>Readonly : Symbol(Readonly, Decl(lib.d.ts, --, --))
|
||||
>BP : Symbol(BP, Decl(mappedTypeModifiers.ts, 37, 48))
|
||||
>BP : Symbol(BP, Decl(mappedTypeModifiers.ts, 40, 48))
|
||||
|
||||
var b04: Partial<Readonly<B>>;
|
||||
>b04 : Symbol(b04, Decl(mappedTypeModifiers.ts, 63, 3), Decl(mappedTypeModifiers.ts, 64, 3), Decl(mappedTypeModifiers.ts, 65, 3), Decl(mappedTypeModifiers.ts, 66, 3), Decl(mappedTypeModifiers.ts, 67, 3), Decl(mappedTypeModifiers.ts, 68, 3), Decl(mappedTypeModifiers.ts, 69, 3))
|
||||
>b04 : Symbol(b04, Decl(mappedTypeModifiers.ts, 68, 3), Decl(mappedTypeModifiers.ts, 69, 3), Decl(mappedTypeModifiers.ts, 70, 3), Decl(mappedTypeModifiers.ts, 71, 3), Decl(mappedTypeModifiers.ts, 72, 3), Decl(mappedTypeModifiers.ts, 73, 3), Decl(mappedTypeModifiers.ts, 74, 3), Decl(mappedTypeModifiers.ts, 75, 3))
|
||||
>Partial : Symbol(Partial, Decl(lib.d.ts, --, --))
|
||||
>Readonly : Symbol(Readonly, Decl(lib.d.ts, --, --))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 35, 51))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
|
||||
var b04: Readonly<Partial<B>>;
|
||||
>b04 : Symbol(b04, Decl(mappedTypeModifiers.ts, 63, 3), Decl(mappedTypeModifiers.ts, 64, 3), Decl(mappedTypeModifiers.ts, 65, 3), Decl(mappedTypeModifiers.ts, 66, 3), Decl(mappedTypeModifiers.ts, 67, 3), Decl(mappedTypeModifiers.ts, 68, 3), Decl(mappedTypeModifiers.ts, 69, 3))
|
||||
>b04 : Symbol(b04, Decl(mappedTypeModifiers.ts, 68, 3), Decl(mappedTypeModifiers.ts, 69, 3), Decl(mappedTypeModifiers.ts, 70, 3), Decl(mappedTypeModifiers.ts, 71, 3), Decl(mappedTypeModifiers.ts, 72, 3), Decl(mappedTypeModifiers.ts, 73, 3), Decl(mappedTypeModifiers.ts, 74, 3), Decl(mappedTypeModifiers.ts, 75, 3))
|
||||
>Readonly : Symbol(Readonly, Decl(lib.d.ts, --, --))
|
||||
>Partial : Symbol(Partial, Decl(lib.d.ts, --, --))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 35, 51))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 38, 51))
|
||||
|
||||
var b04: Pick<BPR, keyof B>;
|
||||
>b04 : Symbol(b04, Decl(mappedTypeModifiers.ts, 63, 3), Decl(mappedTypeModifiers.ts, 64, 3), Decl(mappedTypeModifiers.ts, 65, 3), Decl(mappedTypeModifiers.ts, 66, 3), Decl(mappedTypeModifiers.ts, 67, 3), Decl(mappedTypeModifiers.ts, 68, 3), Decl(mappedTypeModifiers.ts, 69, 3))
|
||||
var b04: { [P in keyof BPR]: BPR[P] }
|
||||
>b04 : Symbol(b04, Decl(mappedTypeModifiers.ts, 68, 3), Decl(mappedTypeModifiers.ts, 69, 3), Decl(mappedTypeModifiers.ts, 70, 3), Decl(mappedTypeModifiers.ts, 71, 3), Decl(mappedTypeModifiers.ts, 72, 3), Decl(mappedTypeModifiers.ts, 73, 3), Decl(mappedTypeModifiers.ts, 74, 3), Decl(mappedTypeModifiers.ts, 75, 3))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 74, 12))
|
||||
>BPR : Symbol(BPR, Decl(mappedTypeModifiers.ts, 42, 67))
|
||||
>BPR : Symbol(BPR, Decl(mappedTypeModifiers.ts, 42, 67))
|
||||
>P : Symbol(P, Decl(mappedTypeModifiers.ts, 74, 12))
|
||||
|
||||
var b04: Pick<BPR, keyof BPR>;
|
||||
>b04 : Symbol(b04, Decl(mappedTypeModifiers.ts, 68, 3), Decl(mappedTypeModifiers.ts, 69, 3), Decl(mappedTypeModifiers.ts, 70, 3), Decl(mappedTypeModifiers.ts, 71, 3), Decl(mappedTypeModifiers.ts, 72, 3), Decl(mappedTypeModifiers.ts, 73, 3), Decl(mappedTypeModifiers.ts, 74, 3), Decl(mappedTypeModifiers.ts, 75, 3))
|
||||
>Pick : Symbol(Pick, Decl(lib.d.ts, --, --))
|
||||
>BPR : Symbol(BPR, Decl(mappedTypeModifiers.ts, 39, 67))
|
||||
>B : Symbol(B, Decl(mappedTypeModifiers.ts, 35, 51))
|
||||
>BPR : Symbol(BPR, Decl(mappedTypeModifiers.ts, 42, 67))
|
||||
>BPR : Symbol(BPR, Decl(mappedTypeModifiers.ts, 42, 67))
|
||||
|
||||
|
||||
@@ -80,11 +80,18 @@ var v02: Partial<T>;
|
||||
>Partial : Partial<T>
|
||||
>T : T
|
||||
|
||||
var v02: Pick<TP, keyof T>;
|
||||
var v02: { [P in keyof TP]: TP[P] }
|
||||
>v02 : TP
|
||||
>P : P
|
||||
>TP : TP
|
||||
>TP : TP
|
||||
>P : P
|
||||
|
||||
var v02: Pick<TP, keyof TP>;
|
||||
>v02 : TP
|
||||
>Pick : Pick<T, K>
|
||||
>TP : TP
|
||||
>T : T
|
||||
>TP : TP
|
||||
|
||||
var v03: TR;
|
||||
>v03 : TR
|
||||
@@ -102,11 +109,18 @@ var v03: Readonly<T>;
|
||||
>Readonly : Readonly<T>
|
||||
>T : T
|
||||
|
||||
var v03: Pick<TR, keyof T>;
|
||||
var v03: { [P in keyof TR]: TR[P] }
|
||||
>v03 : TR
|
||||
>P : P
|
||||
>TR : TR
|
||||
>TR : TR
|
||||
>P : P
|
||||
|
||||
var v03: Pick<TR, keyof TR>;
|
||||
>v03 : TR
|
||||
>Pick : Pick<T, K>
|
||||
>TR : TR
|
||||
>T : T
|
||||
>TR : TR
|
||||
|
||||
var v04: TPR;
|
||||
>v04 : TPR
|
||||
@@ -141,6 +155,13 @@ var v04: Readonly<Partial<T>>;
|
||||
>Partial : Partial<T>
|
||||
>T : T
|
||||
|
||||
var v04: { [P in keyof TPR]: TPR[P] }
|
||||
>v04 : TPR
|
||||
>P : P
|
||||
>TPR : TPR
|
||||
>TPR : TPR
|
||||
>P : P
|
||||
|
||||
var v04: Pick<TPR, keyof T>;
|
||||
>v04 : TPR
|
||||
>Pick : Pick<T, K>
|
||||
@@ -244,11 +265,18 @@ var b02: Partial<B>;
|
||||
>Partial : Partial<T>
|
||||
>B : B
|
||||
|
||||
var b02: Pick<BP, keyof B>;
|
||||
var b02: { [P in keyof BP]: BP[P] }
|
||||
>b02 : BP
|
||||
>P : P
|
||||
>BP : BP
|
||||
>BP : BP
|
||||
>P : P
|
||||
|
||||
var b02: Pick<BP, keyof BP>;
|
||||
>b02 : BP
|
||||
>Pick : Pick<T, K>
|
||||
>BP : BP
|
||||
>B : B
|
||||
>BP : BP
|
||||
|
||||
var b03: BR;
|
||||
>b03 : BR
|
||||
@@ -266,11 +294,18 @@ var b03: Readonly<B>;
|
||||
>Readonly : Readonly<T>
|
||||
>B : B
|
||||
|
||||
var b03: Pick<BR, keyof B>;
|
||||
var b03: { [P in keyof BR]: BR[P] }
|
||||
>b03 : BR
|
||||
>P : P
|
||||
>BR : BR
|
||||
>BR : BR
|
||||
>P : P
|
||||
|
||||
var b03: Pick<BR, keyof BR>;
|
||||
>b03 : BR
|
||||
>Pick : Pick<T, K>
|
||||
>BR : BR
|
||||
>B : B
|
||||
>BR : BR
|
||||
|
||||
var b04: BPR;
|
||||
>b04 : BPR
|
||||
@@ -305,9 +340,16 @@ var b04: Readonly<Partial<B>>;
|
||||
>Partial : Partial<T>
|
||||
>B : B
|
||||
|
||||
var b04: Pick<BPR, keyof B>;
|
||||
var b04: { [P in keyof BPR]: BPR[P] }
|
||||
>b04 : BPR
|
||||
>P : P
|
||||
>BPR : BPR
|
||||
>BPR : BPR
|
||||
>P : P
|
||||
|
||||
var b04: Pick<BPR, keyof BPR>;
|
||||
>b04 : BPR
|
||||
>Pick : Pick<T, K>
|
||||
>BPR : BPR
|
||||
>B : B
|
||||
>BPR : BPR
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
tests/cases/compiler/nestedFreshLiteral.ts(12,21): error TS2322: Type '{ nested: { prop: { colour: string; }; }; }' is not assignable to type 'NestedCSSProps'.
|
||||
Types of property 'nested' are incompatible.
|
||||
Type '{ prop: { colour: string; }; }' is not assignable to type 'NestedSelector | undefined'.
|
||||
Type '{ prop: { colour: string; }; }' is not assignable to type 'NestedSelector'.
|
||||
Types of property 'prop' are incompatible.
|
||||
Type '{ colour: string; }' is not assignable to type 'CSSProps'.
|
||||
Object literal may only specify known properties, and 'colour' does not exist in type 'CSSProps'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/nestedFreshLiteral.ts (1 errors) ====
|
||||
interface CSSProps {
|
||||
color?: string
|
||||
}
|
||||
interface NestedCSSProps {
|
||||
nested?: NestedSelector
|
||||
}
|
||||
interface NestedSelector {
|
||||
prop: CSSProps;
|
||||
}
|
||||
|
||||
let stylen: NestedCSSProps = {
|
||||
nested: { prop: { colour: 'red' } }
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '{ nested: { prop: { colour: string; }; }; }' is not assignable to type 'NestedCSSProps'.
|
||||
!!! error TS2322: Types of property 'nested' are incompatible.
|
||||
!!! error TS2322: Type '{ prop: { colour: string; }; }' is not assignable to type 'NestedSelector | undefined'.
|
||||
!!! error TS2322: Type '{ prop: { colour: string; }; }' is not assignable to type 'NestedSelector'.
|
||||
!!! error TS2322: Types of property 'prop' are incompatible.
|
||||
!!! error TS2322: Type '{ colour: string; }' is not assignable to type 'CSSProps'.
|
||||
!!! error TS2322: Object literal may only specify known properties, and 'colour' does not exist in type 'CSSProps'.
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
//// [nestedFreshLiteral.ts]
|
||||
interface CSSProps {
|
||||
color?: string
|
||||
}
|
||||
interface NestedCSSProps {
|
||||
nested?: NestedSelector
|
||||
}
|
||||
interface NestedSelector {
|
||||
prop: CSSProps;
|
||||
}
|
||||
|
||||
let stylen: NestedCSSProps = {
|
||||
nested: { prop: { colour: 'red' } }
|
||||
}
|
||||
|
||||
//// [nestedFreshLiteral.js]
|
||||
var stylen = {
|
||||
nested: { prop: { colour: 'red' } }
|
||||
};
|
||||
@@ -0,0 +1,31 @@
|
||||
//// [newLexicalEnvironmentForConvertedLoop.ts]
|
||||
function baz(x: any) {
|
||||
return [[x, x]];
|
||||
}
|
||||
|
||||
function foo(set: any) {
|
||||
for (const [value, i] of baz(set.values)) {
|
||||
const bar: any = [];
|
||||
(() => bar);
|
||||
|
||||
set.values.push(...[]);
|
||||
}
|
||||
};
|
||||
|
||||
//// [newLexicalEnvironmentForConvertedLoop.js]
|
||||
function baz(x) {
|
||||
return [[x, x]];
|
||||
}
|
||||
function foo(set) {
|
||||
var _loop_1 = function (value, i) {
|
||||
var bar = [];
|
||||
(function () { return bar; });
|
||||
(_a = set.values).push.apply(_a, []);
|
||||
var _a;
|
||||
};
|
||||
for (var _i = 0, _a = baz(set.values); _i < _a.length; _i++) {
|
||||
var _b = _a[_i], value = _b[0], i = _b[1];
|
||||
_loop_1(value, i);
|
||||
}
|
||||
}
|
||||
;
|
||||
@@ -0,0 +1,30 @@
|
||||
=== tests/cases/compiler/newLexicalEnvironmentForConvertedLoop.ts ===
|
||||
function baz(x: any) {
|
||||
>baz : Symbol(baz, Decl(newLexicalEnvironmentForConvertedLoop.ts, 0, 0))
|
||||
>x : Symbol(x, Decl(newLexicalEnvironmentForConvertedLoop.ts, 0, 13))
|
||||
|
||||
return [[x, x]];
|
||||
>x : Symbol(x, Decl(newLexicalEnvironmentForConvertedLoop.ts, 0, 13))
|
||||
>x : Symbol(x, Decl(newLexicalEnvironmentForConvertedLoop.ts, 0, 13))
|
||||
}
|
||||
|
||||
function foo(set: any) {
|
||||
>foo : Symbol(foo, Decl(newLexicalEnvironmentForConvertedLoop.ts, 2, 1))
|
||||
>set : Symbol(set, Decl(newLexicalEnvironmentForConvertedLoop.ts, 4, 13))
|
||||
|
||||
for (const [value, i] of baz(set.values)) {
|
||||
>value : Symbol(value, Decl(newLexicalEnvironmentForConvertedLoop.ts, 5, 14))
|
||||
>i : Symbol(i, Decl(newLexicalEnvironmentForConvertedLoop.ts, 5, 20))
|
||||
>baz : Symbol(baz, Decl(newLexicalEnvironmentForConvertedLoop.ts, 0, 0))
|
||||
>set : Symbol(set, Decl(newLexicalEnvironmentForConvertedLoop.ts, 4, 13))
|
||||
|
||||
const bar: any = [];
|
||||
>bar : Symbol(bar, Decl(newLexicalEnvironmentForConvertedLoop.ts, 6, 9))
|
||||
|
||||
(() => bar);
|
||||
>bar : Symbol(bar, Decl(newLexicalEnvironmentForConvertedLoop.ts, 6, 9))
|
||||
|
||||
set.values.push(...[]);
|
||||
>set : Symbol(set, Decl(newLexicalEnvironmentForConvertedLoop.ts, 4, 13))
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,45 @@
|
||||
=== tests/cases/compiler/newLexicalEnvironmentForConvertedLoop.ts ===
|
||||
function baz(x: any) {
|
||||
>baz : (x: any) => any[][]
|
||||
>x : any
|
||||
|
||||
return [[x, x]];
|
||||
>[[x, x]] : any[][]
|
||||
>[x, x] : any[]
|
||||
>x : any
|
||||
>x : any
|
||||
}
|
||||
|
||||
function foo(set: any) {
|
||||
>foo : (set: any) => void
|
||||
>set : any
|
||||
|
||||
for (const [value, i] of baz(set.values)) {
|
||||
>value : any
|
||||
>i : any
|
||||
>baz(set.values) : any[][]
|
||||
>baz : (x: any) => any[][]
|
||||
>set.values : any
|
||||
>set : any
|
||||
>values : any
|
||||
|
||||
const bar: any = [];
|
||||
>bar : any
|
||||
>[] : undefined[]
|
||||
|
||||
(() => bar);
|
||||
>(() => bar) : () => any
|
||||
>() => bar : () => any
|
||||
>bar : any
|
||||
|
||||
set.values.push(...[]);
|
||||
>set.values.push(...[]) : any
|
||||
>set.values.push : any
|
||||
>set.values : any
|
||||
>set : any
|
||||
>values : any
|
||||
>push : any
|
||||
>...[] : undefined
|
||||
>[] : undefined[]
|
||||
}
|
||||
};
|
||||
@@ -200,7 +200,6 @@ let cplus: { p: number, plus(): void } = { ...c, plus() { return this.p + 1; } }
|
||||
>plus : Symbol(plus, Decl(objectSpread.ts, 49, 23))
|
||||
>c : Symbol(c, Decl(objectSpread.ts, 45, 3))
|
||||
>plus : Symbol(plus, Decl(objectSpread.ts, 49, 48))
|
||||
>this : Symbol(__object, Decl(objectSpread.ts, 41, 15))
|
||||
|
||||
cplus.plus();
|
||||
>cplus.plus : Symbol(plus, Decl(objectSpread.ts, 49, 23))
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
tests/cases/compiler/selfReferencingSpreadInLoop.ts(1,5): error TS7034: Variable 'additional' implicitly has type 'any[]' in some locations where its type cannot be determined.
|
||||
tests/cases/compiler/selfReferencingSpreadInLoop.ts(3,22): error TS7005: Variable 'additional' implicitly has an 'any[]' type.
|
||||
|
||||
|
||||
==== tests/cases/compiler/selfReferencingSpreadInLoop.ts (2 errors) ====
|
||||
let additional = [];
|
||||
~~~~~~~~~~
|
||||
!!! error TS7034: Variable 'additional' implicitly has type 'any[]' in some locations where its type cannot be determined.
|
||||
for (const subcomponent of [1, 2, 3]) {
|
||||
additional = [...additional, subcomponent];
|
||||
~~~~~~~~~~
|
||||
!!! error TS7005: Variable 'additional' implicitly has an 'any[]' type.
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
//// [selfReferencingSpreadInLoop.ts]
|
||||
let additional = [];
|
||||
for (const subcomponent of [1, 2, 3]) {
|
||||
additional = [...additional, subcomponent];
|
||||
}
|
||||
|
||||
|
||||
//// [selfReferencingSpreadInLoop.js]
|
||||
var additional = [];
|
||||
for (var _i = 0, _a = [1, 2, 3]; _i < _a.length; _i++) {
|
||||
var subcomponent = _a[_i];
|
||||
additional = additional.concat([subcomponent]);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
//// [systemModuleTrailingComments.ts]
|
||||
export const test = "TEST";
|
||||
|
||||
//some comment
|
||||
|
||||
//// [systemModuleTrailingComments.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
var test;
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
exports_1("test", test = "TEST");
|
||||
//some comment
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,5 @@
|
||||
=== tests/cases/compiler/systemModuleTrailingComments.ts ===
|
||||
export const test = "TEST";
|
||||
>test : Symbol(test, Decl(systemModuleTrailingComments.ts, 0, 12))
|
||||
|
||||
//some comment
|
||||
@@ -0,0 +1,6 @@
|
||||
=== tests/cases/compiler/systemModuleTrailingComments.ts ===
|
||||
export const test = "TEST";
|
||||
>test : "TEST"
|
||||
>"TEST" : "TEST"
|
||||
|
||||
//some comment
|
||||
@@ -0,0 +1,19 @@
|
||||
/node_modules/augmenter/index.d.ts(3,16): error TS2665: Invalid module name in augmentation. Module 'js' resolves to an untyped module at '/node_modules/js/index.js', which cannot be augmented.
|
||||
|
||||
|
||||
==== /a.ts (0 errors) ====
|
||||
import { } from "augmenter";
|
||||
|
||||
==== /node_modules/augmenter/index.d.ts (1 errors) ====
|
||||
// This tests that augmenting an untyped module is forbidden even in an ambient context. Contrast with `moduleAugmentationInDependency.ts`.
|
||||
|
||||
declare module "js" {
|
||||
~~~~
|
||||
!!! error TS2665: Invalid module name in augmentation. Module 'js' resolves to an untyped module at '/node_modules/js/index.js', which cannot be augmented.
|
||||
export const j: number;
|
||||
}
|
||||
export {};
|
||||
|
||||
==== /node_modules/js/index.js (0 errors) ====
|
||||
This file is not processed.
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
//// [tests/cases/compiler/untypedModuleImport_withAugmentation2.ts] ////
|
||||
|
||||
//// [index.d.ts]
|
||||
// This tests that augmenting an untyped module is forbidden even in an ambient context. Contrast with `moduleAugmentationInDependency.ts`.
|
||||
|
||||
declare module "js" {
|
||||
export const j: number;
|
||||
}
|
||||
export {};
|
||||
|
||||
//// [index.js]
|
||||
This file is not processed.
|
||||
|
||||
//// [a.ts]
|
||||
import { } from "augmenter";
|
||||
|
||||
|
||||
//// [a.js]
|
||||
"use strict";
|
||||
@@ -0,0 +1,15 @@
|
||||
// @declaration: true
|
||||
|
||||
// @filename: db.d.ts
|
||||
declare namespace Db {
|
||||
export import Types = Db;
|
||||
}
|
||||
|
||||
export = Db;
|
||||
|
||||
// @filename: app.ts
|
||||
import * as Db from "./db"
|
||||
|
||||
export function foo() {
|
||||
return new Object()
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
// @experimentalDecorators: true
|
||||
// @emitDecoratorMetadata: true
|
||||
// @target: es5
|
||||
|
||||
// @filename: aux.ts
|
||||
export class SomeClass {
|
||||
field: string;
|
||||
}
|
||||
|
||||
// @filename: aux1.ts
|
||||
export class SomeClass1 {
|
||||
field: string;
|
||||
}
|
||||
|
||||
// @filename: aux2.ts
|
||||
export class SomeClass2 {
|
||||
field: string;
|
||||
}
|
||||
// @filename: main.ts
|
||||
import { SomeClass } from './aux';
|
||||
import { SomeClass1 } from './aux1';
|
||||
|
||||
function annotation(): ClassDecorator {
|
||||
return (target: any): void => { };
|
||||
}
|
||||
|
||||
function annotation1(): MethodDecorator {
|
||||
return (target: any): void => { };
|
||||
}
|
||||
|
||||
@annotation()
|
||||
export class ClassA {
|
||||
array: SomeClass[];
|
||||
|
||||
constructor(...init: SomeClass[]) {
|
||||
this.array = init;
|
||||
}
|
||||
|
||||
@annotation1()
|
||||
foo(... args: SomeClass1[]) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
// @noImplicitAny: true
|
||||
({ a: [], ...(null as any) });
|
||||
let x: any;
|
||||
@@ -0,0 +1,9 @@
|
||||
// @importHelpers: true
|
||||
// @target: es5
|
||||
// @module: commonjs
|
||||
// @moduleResolution: classic
|
||||
// @filename: declaration.d.ts
|
||||
export declare class D {
|
||||
}
|
||||
export declare class E extends D {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// @strictNullChecks: true
|
||||
interface CSSProps {
|
||||
color?: string
|
||||
}
|
||||
interface NestedCSSProps {
|
||||
nested?: NestedSelector
|
||||
}
|
||||
interface NestedSelector {
|
||||
prop: CSSProps;
|
||||
}
|
||||
|
||||
let stylen: NestedCSSProps = {
|
||||
nested: { prop: { colour: 'red' } }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// @target: es5
|
||||
function baz(x: any) {
|
||||
return [[x, x]];
|
||||
}
|
||||
|
||||
function foo(set: any) {
|
||||
for (const [value, i] of baz(set.values)) {
|
||||
const bar: any = [];
|
||||
(() => bar);
|
||||
|
||||
set.values.push(...[]);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
// @noImplicitAny: true
|
||||
let additional = [];
|
||||
for (const subcomponent of [1, 2, 3]) {
|
||||
additional = [...additional, subcomponent];
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// @module: system
|
||||
export const test = "TEST";
|
||||
|
||||
//some comment
|
||||
@@ -0,0 +1,14 @@
|
||||
// @noImplicitReferences: true
|
||||
// This tests that augmenting an untyped module is forbidden even in an ambient context. Contrast with `moduleAugmentationInDependency.ts`.
|
||||
|
||||
// @Filename: /node_modules/augmenter/index.d.ts
|
||||
declare module "js" {
|
||||
export const j: number;
|
||||
}
|
||||
export {};
|
||||
|
||||
// @Filename: /node_modules/js/index.js
|
||||
This file is not processed.
|
||||
|
||||
// @Filename: /a.ts
|
||||
import { } from "augmenter";
|
||||
@@ -0,0 +1,32 @@
|
||||
// @target:es5
|
||||
// @experimentaldecorators: true
|
||||
// @emitdecoratormetadata: true
|
||||
declare function dec<T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T>;
|
||||
|
||||
class A {
|
||||
@dec get x() { return 0; }
|
||||
set x(value: number) { }
|
||||
}
|
||||
|
||||
class B {
|
||||
get x() { return 0; }
|
||||
@dec set x(value: number) { }
|
||||
}
|
||||
|
||||
class C {
|
||||
@dec set x(value: number) { }
|
||||
get x() { return 0; }
|
||||
}
|
||||
|
||||
class D {
|
||||
set x(value: number) { }
|
||||
@dec get x() { return 0; }
|
||||
}
|
||||
|
||||
class E {
|
||||
@dec get x() { return 0; }
|
||||
}
|
||||
|
||||
class F {
|
||||
@dec set x(value: number) { }
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// @target: es5
|
||||
// @module: commonjs
|
||||
// @experimentaldecorators: true
|
||||
// @emitdecoratormetadata: true
|
||||
declare var dec: any;
|
||||
|
||||
@dec
|
||||
class A {
|
||||
}
|
||||
|
||||
@dec
|
||||
class B {
|
||||
constructor(x: number) {}
|
||||
}
|
||||
|
||||
@dec
|
||||
class C extends A {
|
||||
}
|
||||
@@ -19,12 +19,14 @@ var v01: Pick<Pick<T, keyof T>, keyof T>;
|
||||
var v02: TP;
|
||||
var v02: { [P in keyof T]?: T[P] };
|
||||
var v02: Partial<T>;
|
||||
var v02: Pick<TP, keyof T>;
|
||||
var v02: { [P in keyof TP]: TP[P] }
|
||||
var v02: Pick<TP, keyof TP>;
|
||||
|
||||
var v03: TR;
|
||||
var v03: { readonly [P in keyof T]: T[P] };
|
||||
var v03: Readonly<T>;
|
||||
var v03: Pick<TR, keyof T>;
|
||||
var v03: { [P in keyof TR]: TR[P] }
|
||||
var v03: Pick<TR, keyof TR>;
|
||||
|
||||
var v04: TPR;
|
||||
var v04: { readonly [P in keyof T]?: T[P] };
|
||||
@@ -32,6 +34,7 @@ var v04: Partial<TR>;
|
||||
var v04: Readonly<TP>;
|
||||
var v04: Partial<Readonly<T>>;
|
||||
var v04: Readonly<Partial<T>>;
|
||||
var v04: { [P in keyof TPR]: TPR[P] }
|
||||
var v04: Pick<TPR, keyof T>;
|
||||
|
||||
type Boxified<T> = { [P in keyof T]: { x: T[P] } };
|
||||
@@ -55,12 +58,14 @@ var b01: Pick<Pick<B, keyof B>, keyof B>;
|
||||
var b02: BP;
|
||||
var b02: { [P in keyof B]?: B[P] };
|
||||
var b02: Partial<B>;
|
||||
var b02: Pick<BP, keyof B>;
|
||||
var b02: { [P in keyof BP]: BP[P] }
|
||||
var b02: Pick<BP, keyof BP>;
|
||||
|
||||
var b03: BR;
|
||||
var b03: { readonly [P in keyof B]: B[P] };
|
||||
var b03: Readonly<B>;
|
||||
var b03: Pick<BR, keyof B>;
|
||||
var b03: { [P in keyof BR]: BR[P] }
|
||||
var b03: Pick<BR, keyof BR>;
|
||||
|
||||
var b04: BPR;
|
||||
var b04: { readonly [P in keyof B]?: B[P] };
|
||||
@@ -68,4 +73,5 @@ var b04: Partial<BR>;
|
||||
var b04: Readonly<BP>;
|
||||
var b04: Partial<Readonly<B>>;
|
||||
var b04: Readonly<Partial<B>>;
|
||||
var b04: Pick<BPR, keyof B>;
|
||||
var b04: { [P in keyof BPR]: BPR[P] }
|
||||
var b04: Pick<BPR, keyof BPR>;
|
||||
@@ -105,6 +105,14 @@
|
||||
//// * second time information about the param again
|
||||
//// */
|
||||
////function /*l*/l(param1: string) { /*9*/param1 = "hello"; }
|
||||
//// /**
|
||||
//// * This is firstLine
|
||||
//// This is second Line
|
||||
//// [1]: third * line
|
||||
//// @param param1 first Line text
|
||||
//// second line text
|
||||
//// */
|
||||
////function /*m*/m(param1: string) { /*10*/param1 = "hello"; }
|
||||
|
||||
verify.quickInfos({
|
||||
a: ["var a: string", "This is firstLine\nThis is second Line\n\nThis is fourth Line"],
|
||||
@@ -136,5 +144,8 @@ verify.quickInfos({
|
||||
8: ["(parameter) param1: string", "hello "],
|
||||
|
||||
l: ["function l(param1: string): void", "This is firstLine\nThis is second Line"],
|
||||
9: ["(parameter) param1: string", "first Line text\nblank line that shouldnt be shown when starting this \nsecond time information about the param again"]
|
||||
9: ["(parameter) param1: string", "first Line text\nblank line that shouldnt be shown when starting this \nsecond time information about the param again"],
|
||||
|
||||
m: ["function m(param1: string): void", "This is firstLine\nThis is second Line\n[1]: third * line"],
|
||||
10: ["(parameter) param1: string", "first Line text\nsecond line text"]
|
||||
});
|
||||
|
||||
@@ -30,6 +30,7 @@ goTo.marker('1');
|
||||
verify.completionListContains("constructor");
|
||||
verify.completionListContains("param");
|
||||
verify.completionListContains("type");
|
||||
verify.completionListContains("method");
|
||||
|
||||
goTo.marker('2');
|
||||
verify.completionListContains("constructor");
|
||||
|
||||
Reference in New Issue
Block a user