diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 3adb0627d0a..9aa01bc1b8b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -885,13 +885,13 @@ module ts { if (accessibleSymbolChain) { var hasAccessibleDeclarations = hasVisibleDeclarations(accessibleSymbolChain[0]); if (!hasAccessibleDeclarations) { - return { + return { accessibility: SymbolAccessibility.NotAccessible, errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, SymbolFlags.Namespace) : undefined, }; } - return { accessibility: SymbolAccessibility.Accessible, aliasesToMakeVisible: hasAccessibleDeclarations.aliasesToMakeVisible }; + return hasAccessibleDeclarations; } // If we haven't got the accessible symbol, it doesn't mean the symbol is actually inaccessible. @@ -948,12 +948,12 @@ module ts { (declaration.kind === SyntaxKind.SourceFile && isExternalModule(declaration)); } - function hasVisibleDeclarations(symbol: Symbol): { aliasesToMakeVisible?: ImportDeclaration[]; } { + function hasVisibleDeclarations(symbol: Symbol): SymbolVisibilityResult { var aliasesToMakeVisible: ImportDeclaration[]; if (forEach(symbol.declarations, declaration => !getIsDeclarationVisible(declaration))) { return undefined; } - return { aliasesToMakeVisible }; + return { accessibility: SymbolAccessibility.Accessible, aliasesToMakeVisible }; function getIsDeclarationVisible(declaration: Declaration) { if (!isDeclarationVisible(declaration)) { @@ -982,14 +982,32 @@ module ts { } } - function isImportDeclarationEntityNameReferenceDeclarationVisibile(entityName: EntityName): SymbolAccessiblityResult { + function isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult { + // get symbol of the first identifier of the entityName + var meaning: SymbolFlags; + if (entityName.parent.kind === SyntaxKind.TypeQuery) { + // Typeof value + meaning = SymbolFlags.Value | SymbolFlags.ExportValue; + } + else if (entityName.kind === SyntaxKind.QualifiedName || + entityName.parent.kind === SyntaxKind.ImportDeclaration) { + // Left identifier from type reference or TypeAlias + // Entity name of the import declaration + meaning = SymbolFlags.Namespace; + } + else { + // Type Reference or TypeAlias entity = Identifier + meaning = SymbolFlags.Type; + } var firstIdentifier = getFirstIdentifier(entityName); - var symbolOfNameSpace = resolveName(entityName.parent, (firstIdentifier).text, SymbolFlags.Namespace, Diagnostics.Cannot_find_name_0, firstIdentifier); + var symbol = resolveName(enclosingDeclaration, (firstIdentifier).text, meaning, /*nodeNotFoundErrorMessage*/ undefined, /*nameArg*/ undefined); + // Verify if the symbol is accessible - var hasNamespaceDeclarationsVisibile = hasVisibleDeclarations(symbolOfNameSpace); - return hasNamespaceDeclarationsVisibile ? - { accessibility: SymbolAccessibility.Accessible, aliasesToMakeVisible: hasNamespaceDeclarationsVisibile.aliasesToMakeVisible } : - { accessibility: SymbolAccessibility.NotAccessible, errorSymbolName: declarationNameToString(firstIdentifier) }; + return hasVisibleDeclarations(symbol) || { + accessibility: SymbolAccessibility.NotAccessible, + errorSymbolName: getTextOfNode(firstIdentifier), + errorNode: firstIdentifier + }; } function releaseStringWriter(writer: StringSymbolWriter) { @@ -1601,6 +1619,7 @@ module ts { case SyntaxKind.IndexSignature: case SyntaxKind.Parameter: case SyntaxKind.ModuleBlock: + case SyntaxKind.TypeParameter: return isDeclarationVisible(node.parent); // Source file is always visible @@ -9135,7 +9154,7 @@ module ts { writeTypeAtLocation, writeReturnTypeOfSignatureDeclaration, isSymbolAccessible, - isImportDeclarationEntityNameReferenceDeclarationVisibile, + isEntityNameVisible, getConstantValue, }; checkProgram(); diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 402fcbe93e7..cac9f75e2ee 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -275,27 +275,16 @@ module ts { Type_alias_name_cannot_be_0: { code: 2457, category: DiagnosticCategory.Error, key: "Type alias name cannot be '{0}'" }, An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: DiagnosticCategory.Error, key: "An AMD module cannot have multiple name assignments." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." }, - Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, - Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4003, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4005, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4007, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4009, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4011, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4013, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4015, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4017, category: DiagnosticCategory.Error, key: "Implements clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4018, category: DiagnosticCategory.Error, key: "Extends clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: DiagnosticCategory.Error, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: DiagnosticCategory.Error, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2: { code: 4021, category: DiagnosticCategory.Error, key: "Extends clause of exported interface '{0}' has or is using name '{1}' from private module '{2}'." }, Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: DiagnosticCategory.Error, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, @@ -353,8 +342,6 @@ module ts { Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, - Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4079, category: DiagnosticCategory.Error, key: "Exported type alias '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, - Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2: { code: 4080, category: DiagnosticCategory.Error, key: "Exported type alias '{0}' has or is using name '{1}' from private module '{2}'." }, Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: DiagnosticCategory.Error, key: "Exported type alias '{0}' has or is using private name '{1}'." }, Enum_declarations_must_all_be_const_or_non_const: { code: 4082, category: DiagnosticCategory.Error, key: "Enum declarations must all be const or non-const." }, In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 4083, category: DiagnosticCategory.Error, key: "In 'const' enum declarations member initializer must be constant expression.", isEarly: true }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 353f0390145..adf1bf041cf 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1097,78 +1097,38 @@ "category": "Error", "code": 4000 }, - "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4001 - }, "Type parameter '{0}' of exported class has or is using private name '{1}'.": { "category": "Error", "code": 4002 }, - "Type parameter '{0}' of exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4003 - }, "Type parameter '{0}' of exported interface has or is using private name '{1}'.": { "category": "Error", "code": 4004 }, - "Type parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4005 - }, "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'.": { "category": "Error", "code": 4006 }, - "Type parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4007 - }, "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'.": { "category": "Error", "code": 4008 }, - "Type parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4009 - }, "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'.": { "category": "Error", "code": 4010 }, - "Type parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4011 - }, "Type parameter '{0}' of public method from exported class has or is using private name '{1}'.": { "category": "Error", "code": 4012 }, - "Type parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4013 - }, "Type parameter '{0}' of method from exported interface has or is using private name '{1}'.": { "category": "Error", "code": 4014 }, - "Type parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4015 - }, "Type parameter '{0}' of exported function has or is using private name '{1}'.": { "category": "Error", "code": 4016 }, - "Implements clause of exported class '{0}' has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4017 - }, - "Extends clause of exported class '{0}' has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4018 - }, "Implements clause of exported class '{0}' has or is using private name '{1}'.": { "category": "Error", "code": 4019 @@ -1177,10 +1137,6 @@ "category": "Error", "code": 4020 }, - "Extends clause of exported interface '{0}' has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4021 - }, "Extends clause of exported interface '{0}' has or is using private name '{1}'.": { "category": "Error", "code": 4022 @@ -1409,14 +1365,6 @@ "category": "Error", "code": 4078 }, - "Exported type alias '{0}' has or is using name '{1}' from external module {2} but cannot be named.": { - "category": "Error", - "code": 4079 - }, - "Exported type alias '{0}' has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4080 - }, "Exported type alias '{0}' has or is using private name '{1}'.": { "category": "Error", "code": 4081 diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 7f6773b0f9f..6328b83eddd 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -6,6 +6,7 @@ module ts { interface EmitTextWriter { write(s: string): void; + writeTextOfNode(node: Node): void; writeLine(): void; increaseIndent(): void; decreaseIndent(): void; @@ -18,7 +19,15 @@ module ts { getIndent(): number; } + interface SymbolAccessibilityDiagnostic { + errorNode: Node; + diagnosticMessage: DiagnosticMessage; + typeName?: DeclarationName; + } + type GetSymbolAccessibilityDiagnostic = (symbolAccesibilityResult: SymbolAccessiblityResult) => SymbolAccessibilityDiagnostic; + interface EmitTextWriterWithSymbolWriter extends EmitTextWriter, SymbolWriter{ + getSymbolAccessibilityDiagnostic: GetSymbolAccessibilityDiagnostic; } var indentStrings: string[] = ["", " "]; @@ -156,11 +165,16 @@ module ts { } } + function writeTextOfNode(node: Node) { + write(getSourceTextOfLocalNode(node)); + } + return { - write: write, - rawWrite: rawWrite, - writeLiteral: writeLiteral, - writeLine: writeLine, + write, + rawWrite, + writeTextOfNode, + writeLiteral, + writeLine, increaseIndent: () => indent++, decreaseIndent: () => indent--, getIndent: () => indent, @@ -317,6 +331,7 @@ module ts { function emitJavaScript(jsFilePath: string, root?: SourceFile) { var writer = createTextWriter(); var write = writer.write; + var writeTextOfNode = writer.writeTextOfNode; var writeLine = writer.writeLine; var increaseIndent = writer.increaseIndent; var decreaseIndent = writer.decreaseIndent; @@ -933,7 +948,7 @@ module ts { write((node).text); } else { - write(getSourceTextOfLocalNode(node)); + writeTextOfNode(node); } write("\""); @@ -977,7 +992,7 @@ module ts { write(prefix); write("."); } - write(getSourceTextOfLocalNode(node)); + writeTextOfNode(node); } function emitIdentifier(node: Identifier) { @@ -985,7 +1000,7 @@ module ts { emitExpressionIdentifier(node); } else { - write(getSourceTextOfLocalNode(node)); + writeTextOfNode(node); } } @@ -2549,11 +2564,13 @@ module ts { } function emitDeclarations(jsFilePath: string, root?: SourceFile) { - var writer = createTextWriterWithSymbolWriter(); - var write = writer.write; - var writeLine = writer.writeLine; - var increaseIndent = writer.increaseIndent; - var decreaseIndent = writer.decreaseIndent; + var write: (s: string) => void; + var writeLine: () => void; + var increaseIndent: () => void; + var decreaseIndent: () => void; + var writeTextOfNode: (node: Node) => void; + + var writer = createAndSetNewTextWriterWithSymbolWriter(); var enclosingDeclaration: Node; var reportedDeclarationError = false; @@ -2567,13 +2584,7 @@ module ts { asynchronousOutput?: string; // If the output for alias was written asynchronously, the corresponding output }[] = []; - var getSymbolVisibilityDiagnosticMessage: (symbolAccesibilityResult: SymbolAccessiblityResult) => { - errorNode: Node; - diagnosticMessage: DiagnosticMessage; - typeName?: DeclarationName - } - - function createTextWriterWithSymbolWriter(): EmitTextWriterWithSymbolWriter { + function createAndSetNewTextWriterWithSymbolWriter(): EmitTextWriterWithSymbolWriter { var writer = createTextWriter(); writer.trackSymbol = trackSymbol; writer.writeKeyword = writer.write; @@ -2583,28 +2594,36 @@ module ts { writer.writeStringLiteral = writer.writeLiteral; writer.writeParameter = writer.write; writer.writeSymbol = writer.write; + setWriter(writer); return writer; } + function setWriter(newWriter: EmitTextWriterWithSymbolWriter) { + writer = newWriter; + write = newWriter.write; + writeTextOfNode = newWriter.writeTextOfNode; + writeLine = newWriter.writeLine; + increaseIndent = newWriter.increaseIndent; + decreaseIndent = newWriter.decreaseIndent; + } + function writeAsychronousImportDeclarations(importDeclarations: ImportDeclaration[]) { var oldWriter = writer; forEach(importDeclarations, aliasToWrite => { var aliasEmitInfo = forEach(aliasDeclarationEmitInfo, declEmitInfo => declEmitInfo.declaration === aliasToWrite ? declEmitInfo : undefined); - writer = createTextWriterWithSymbolWriter(); + createAndSetNewTextWriterWithSymbolWriter(); for (var declarationIndent = aliasEmitInfo.indent; declarationIndent; declarationIndent--) { - writer.increaseIndent(); + increaseIndent(); } writeImportDeclaration(aliasToWrite); aliasEmitInfo.asynchronousOutput = writer.getText(); }); - writer = oldWriter; + setWriter(oldWriter); } - function trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) { - var symbolAccesibilityResult = resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning); + function handleSymbolAccessibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { if (symbolAccesibilityResult.accessibility === SymbolAccessibility.Accessible) { - // write the aliases if (symbolAccesibilityResult && symbolAccesibilityResult.aliasesToMakeVisible) { writeAsychronousImportDeclarations(symbolAccesibilityResult.aliasesToMakeVisible); @@ -2613,17 +2632,17 @@ module ts { else { // Report error reportedDeclarationError = true; - var errorInfo = getSymbolVisibilityDiagnosticMessage(symbolAccesibilityResult); + var errorInfo = writer.getSymbolAccessibilityDiagnostic(symbolAccesibilityResult); if (errorInfo) { if (errorInfo.typeName) { - diagnostics.push(createDiagnosticForNode(errorInfo.errorNode, + diagnostics.push(createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, getSourceTextOfLocalNode(errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); } else { - diagnostics.push(createDiagnosticForNode(errorInfo.errorNode, + diagnostics.push(createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); @@ -2632,23 +2651,55 @@ module ts { } } + function trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) { + handleSymbolAccessibilityError(resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning)); + } + + function writeTypeAtLocation(location: Node, type: TypeNode, getSymbolAccessibilityDiagnostic: GetSymbolAccessibilityDiagnostic) { + writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; + write(": "); + if (type) { + // Write the type + emitType(type); + } + else { + resolver.writeTypeAtLocation(location, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); + } + } + + function writeReturnTypeAtSignature(signature: SignatureDeclaration, getSymbolAccessibilityDiagnostic: GetSymbolAccessibilityDiagnostic) { + writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; + write(": "); + if (signature.type) { + // Write the type + emitType(signature.type); + } + else { + resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); + } + } + function emitLines(nodes: Node[]) { for (var i = 0, n = nodes.length; i < n; i++) { emitNode(nodes[i]); } } - function emitCommaList(nodes: Node[], eachNodeEmitFn: (node: Node) => void) { + function emitSeparatedList(nodes: Node[], separator: string, eachNodeEmitFn: (node: Node) => void) { var currentWriterPos = writer.getTextPos(); for (var i = 0, n = nodes.length; i < n; i++) { if (currentWriterPos !== writer.getTextPos()) { - write(", "); + write(separator); } currentWriterPos = writer.getTextPos(); eachNodeEmitFn(nodes[i]); } } + function emitCommaList(nodes: Node[], eachNodeEmitFn: (node: Node) => void) { + emitSeparatedList(nodes, ", ", eachNodeEmitFn); + } + function writeJsDocComments(declaration: Declaration) { if (declaration) { var jsDocComments = getJsDocComments(declaration, currentSourceFile); @@ -2658,8 +2709,112 @@ module ts { } } - function emitSourceTextOfNode(node: Node) { - write(getSourceTextOfLocalNode(node)); + function emitTypeWithNewGetSymbolAccessibilityDiangostic(type: TypeNode, getSymbolAccessibilityDiagnostic: GetSymbolAccessibilityDiagnostic) { + writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; + emitType(type); + } + + function emitType(type: TypeNode) { + switch (type.kind) { + case SyntaxKind.AnyKeyword: + case SyntaxKind.StringKeyword: + case SyntaxKind.NumberKeyword: + case SyntaxKind.BooleanKeyword: + case SyntaxKind.VoidKeyword: + case SyntaxKind.StringLiteral: + return writeTextOfNode(type); + case SyntaxKind.TypeReference: + return emitTypeReference(type); + case SyntaxKind.TypeQuery: + return emitTypeQuery(type); + case SyntaxKind.ArrayType: + return emitArrayType(type); + case SyntaxKind.TupleType: + return emitTupleType(type); + case SyntaxKind.UnionType: + return emitUnionType(type); + case SyntaxKind.ParenType: + return emitParenType(type); + case SyntaxKind.FunctionType: + case SyntaxKind.ConstructorType: + return emitSignatureDeclarationWithJsDocComments(type); + case SyntaxKind.TypeLiteral: + return emitTypeLiteral(type); + case SyntaxKind.Identifier: + return emitEntityName(type); + case SyntaxKind.QualifiedName: + return emitEntityName(type); + default: + Debug.fail("Unknown type annotation: " + type.kind); + } + + function emitEntityName(entityName: EntityName) { + var visibilityResult = resolver.isEntityNameVisible(entityName, + // Aliases can be written asynchronously so use correct enclosing declaration + entityName.parent.kind === SyntaxKind.ImportDeclaration ? entityName.parent : enclosingDeclaration); + + handleSymbolAccessibilityError(visibilityResult); + writeEntityName(entityName); + + function writeEntityName(entityName: EntityName) { + if (entityName.kind === SyntaxKind.Identifier) { + writeTextOfNode(entityName); + } + else { + var qualifiedName = entityName; + writeEntityName(qualifiedName.left); + write("."); + writeTextOfNode(qualifiedName.right); + } + } + } + + function emitTypeReference(type: TypeReferenceNode) { + emitEntityName(type.typeName); + if (type.typeArguments) { + write("<"); + emitCommaList(type.typeArguments, emitType); + write(">"); + } + } + + function emitTypeQuery(type: TypeQueryNode) { + write("typeof "); + emitEntityName(type.exprName); + } + + function emitArrayType(type: ArrayTypeNode) { + emitType(type.elementType); + write("[]"); + } + + function emitTupleType(type: TupleTypeNode) { + write("["); + emitCommaList(type.elementTypes, emitType); + write("]"); + } + + function emitUnionType(type: UnionTypeNode) { + emitSeparatedList(type.types, " | ", emitType); + } + + function emitParenType(type: ParenTypeNode) { + write("("); + emitType(type.type); + write(")"); + } + + function emitTypeLiteral(type: TypeLiteralNode) { + write("{"); + if (type.members.length) { + writeLine(); + increaseIndent(); + // write members + emitLines(type.members); + decreaseIndent(); + } + write("}"); + } } function emitSourceFile(node: SourceFile) { @@ -2670,42 +2825,38 @@ module ts { function emitExportAssignment(node: ExportAssignment) { write("export = "); - emitSourceTextOfNode(node.exportName); + writeTextOfNode(node.exportName); write(";"); writeLine(); } - function emitDeclarationFlags(node: Declaration) { - if (node.flags & NodeFlags.Static) { - if (node.flags & NodeFlags.Private) { - write("private "); + function emitModuleElementDeclarationFlags(node: Declaration) { + // If the node is parented in the current source file we need to emit export declare or just export + if (node.parent === currentSourceFile) { + // If the node is exported + if (node.flags & NodeFlags.Export) { + write("export "); } - else if (node.flags & NodeFlags.Protected) { - write("protected "); - } - write("static "); - } - else { - if (node.flags & NodeFlags.Private) { - write("private "); - } - else if (node.flags & NodeFlags.Protected) { - write("protected "); - } - // If the node is parented in the current source file we need to emit export declare or just export - else if (node.parent === currentSourceFile) { - // If the node is exported - if (node.flags & NodeFlags.Export) { - write("export "); - } - if (node.kind !== SyntaxKind.InterfaceDeclaration) { - write("declare "); - } + if (node.kind !== SyntaxKind.InterfaceDeclaration) { + write("declare "); } } } + function emitClassMemberDeclarationFlags(node: Declaration) { + if (node.flags & NodeFlags.Private) { + write("private "); + } + else if (node.flags & NodeFlags.Protected) { + write("protected "); + } + + if (node.flags & NodeFlags.Static) { + write("static "); + } + } + function emitImportDeclaration(node: ImportDeclaration) { var nodeEmitInfo = { declaration: node, @@ -2724,52 +2875,41 @@ module ts { // correct writer especially to handle asynchronous alias writing emitJsDocComments(node); if (node.flags & NodeFlags.Export) { - writer.write("export "); + write("export "); } - writer.write("import "); - writer.write(getSourceTextOfLocalNode(node.name)); - writer.write(" = "); + write("import "); + writeTextOfNode(node.name); + write(" = "); if (node.entityName) { - checkEntityNameAccessible(); - writer.write(getSourceTextOfLocalNode(node.entityName)); - writer.write(";"); + emitTypeWithNewGetSymbolAccessibilityDiangostic(node.entityName, getImportEntityNameVisibilityError); + write(";"); } else { - writer.write("require("); - writer.write(getSourceTextOfLocalNode(node.externalModuleName)); - writer.write(");"); + write("require("); + writeTextOfNode(node.externalModuleName); + write(");"); } writer.writeLine(); - function checkEntityNameAccessible() { - var symbolAccesibilityResult = resolver.isImportDeclarationEntityNameReferenceDeclarationVisibile(node.entityName); - if (symbolAccesibilityResult.accessibility === SymbolAccessibility.Accessible) { - // write the aliases - if (symbolAccesibilityResult.aliasesToMakeVisible) { - writeAsychronousImportDeclarations(symbolAccesibilityResult.aliasesToMakeVisible); - } - } - else { - // Report error - reportedDeclarationError = true; - diagnostics.push(createDiagnosticForNode(node, - Diagnostics.Import_declaration_0_is_using_private_name_1, - getSourceTextOfLocalNode(node.name), - symbolAccesibilityResult.errorSymbolName)); - } + function getImportEntityNameVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { + return { + diagnosticMessage: Diagnostics.Import_declaration_0_is_using_private_name_1, + errorNode: node, + typeName: node.name + }; } } function emitModuleDeclaration(node: ModuleDeclaration) { if (resolver.isDeclarationVisible(node)) { emitJsDocComments(node); - emitDeclarationFlags(node); + emitModuleElementDeclarationFlags(node); write("module "); - emitSourceTextOfNode(node.name); + writeTextOfNode(node.name); while (node.body.kind !== SyntaxKind.ModuleBlock) { node = node.body; write("."); - emitSourceTextOfNode(node.name); + writeTextOfNode(node.name); } var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; @@ -2787,24 +2927,18 @@ module ts { function emitTypeAliasDeclaration(node: TypeAliasDeclaration) { if (resolver.isDeclarationVisible(node)) { emitJsDocComments(node); - emitDeclarationFlags(node); + emitModuleElementDeclarationFlags(node); write("type "); - emitSourceTextOfNode(node.name); + writeTextOfNode(node.name); write(" = "); - getSymbolVisibilityDiagnosticMessage = getTypeAliasDeclarationVisibilityError; - resolver.writeTypeAtLocation(node.type, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); + emitTypeWithNewGetSymbolAccessibilityDiangostic(node.type, getTypeAliasDeclarationVisibilityError); write(";"); writeLine(); } - function getTypeAliasDeclarationVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { - var diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1; + function getTypeAliasDeclarationVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { return { - diagnosticMessage, - errorNode: node, + diagnosticMessage: Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1, + errorNode: node.type, typeName: node.name }; } @@ -2813,12 +2947,12 @@ module ts { function emitEnumDeclaration(node: EnumDeclaration) { if (resolver.isDeclarationVisible(node)) { emitJsDocComments(node); - emitDeclarationFlags(node); + emitModuleElementDeclarationFlags(node); if (isConst(node)) { write("const ") } write("enum "); - emitSourceTextOfNode(node.name); + writeTextOfNode(node.name); write(" {"); writeLine(); increaseIndent(); @@ -2831,7 +2965,7 @@ module ts { function emitEnumMemberDeclaration(node: EnumMember) { emitJsDocComments(node); - emitSourceTextOfNode(node.name); + writeTextOfNode(node.name); var enumMemberValue = resolver.getEnumMemberValue(node); if (enumMemberValue !== undefined) { write(" = "); @@ -2843,56 +2977,62 @@ module ts { function emitTypeParameters(typeParameters: TypeParameterDeclaration[]) { function emitTypeParameter(node: TypeParameterDeclaration) { - function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { + increaseIndent(); + emitJsDocComments(node); + decreaseIndent(); + writeTextOfNode(node.name); + // If there is constraint present and this is not a type parameter of the private method emit the constraint + if (node.constraint && (node.parent.kind !== SyntaxKind.Method || !(node.parent.flags & NodeFlags.Private))) { + write(" extends "); + if (node.parent.kind === SyntaxKind.FunctionType || + node.parent.kind === SyntaxKind.ConstructorType || + (node.parent.parent && node.parent.parent.kind === SyntaxKind.TypeLiteral)) { + Debug.assert(node.parent.kind === SyntaxKind.Method || + node.parent.kind === SyntaxKind.FunctionType || + node.parent.kind === SyntaxKind.ConstructorType || + node.parent.kind === SyntaxKind.CallSignature || + node.parent.kind === SyntaxKind.ConstructSignature); + emitType(node.constraint); + } + else { + emitTypeWithNewGetSymbolAccessibilityDiangostic(node.constraint, getTypeParameterConstraintVisibilityError); + } + } + + function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage: DiagnosticMessage; switch (node.parent.kind) { case SyntaxKind.ClassDeclaration: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; + diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; case SyntaxKind.InterfaceDeclaration: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; + diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; case SyntaxKind.ConstructSignature: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; + diagnosticMessage = Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; case SyntaxKind.CallSignature: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; + diagnosticMessage = Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; case SyntaxKind.Method: if (node.parent.flags & NodeFlags.Static) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; + diagnosticMessage = Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } else if (node.parent.parent.kind === SyntaxKind.ClassDeclaration) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; + diagnosticMessage = Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; + diagnosticMessage = Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; case SyntaxKind.FunctionDeclaration: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; + diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -2905,17 +3045,6 @@ module ts { typeName: node.name }; } - - increaseIndent(); - emitJsDocComments(node); - decreaseIndent(); - emitSourceTextOfNode(node.name); - // If there is constraint present and this is not a type parameter of the private method emit the constraint - if (node.constraint && (node.parent.kind !== SyntaxKind.Method || !(node.parent.flags & NodeFlags.Private))) { - write(" extends "); - getSymbolVisibilityDiagnosticMessage = getTypeParameterConstraintVisibilityError; - resolver.writeTypeAtLocation(node.constraint, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); - } } if (typeParameters) { @@ -2932,36 +3061,20 @@ module ts { } function emitTypeOfTypeReference(node: Node) { - getSymbolVisibilityDiagnosticMessage = getHeritageClauseVisibilityError; - resolver.writeTypeAtLocation(node, enclosingDeclaration, TypeFormatFlags.WriteArrayAsGenericType | TypeFormatFlags.UseTypeOfFunction, writer); + emitTypeWithNewGetSymbolAccessibilityDiangostic(node, getHeritageClauseVisibilityError); - function getHeritageClauseVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { + function getHeritageClauseVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { var diagnosticMessage: DiagnosticMessage; // Heritage clause is written by user so it can always be named if (node.parent.kind === SyntaxKind.ClassDeclaration) { - // Class - if (symbolAccesibilityResult.errorModuleName) { - // Module is inaccessible - diagnosticMessage = isImplementsList ? - Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2; - } - else { - // Class or Interface implemented/extended is inaccessible - diagnosticMessage = isImplementsList ? - Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : - Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; - } + // Class or Interface implemented/extended is inaccessible + diagnosticMessage = isImplementsList ? + Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : + Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; } else { - if (symbolAccesibilityResult.errorModuleName) { - // Module is inaccessible - diagnosticMessage = Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2; - } - else { - // interface is inaccessible - diagnosticMessage = Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; - } + // interface is inaccessible + diagnosticMessage = Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; } return { @@ -2986,9 +3099,9 @@ module ts { if (resolver.isDeclarationVisible(node)) { emitJsDocComments(node); - emitDeclarationFlags(node); + emitModuleElementDeclarationFlags(node); write("class "); - emitSourceTextOfNode(node.name); + writeTextOfNode(node.name); var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; emitTypeParameters(node.typeParameters); @@ -3011,9 +3124,9 @@ module ts { function emitInterfaceDeclaration(node: InterfaceDeclaration) { if (resolver.isDeclarationVisible(node)) { emitJsDocComments(node); - emitDeclarationFlags(node); + emitModuleElementDeclarationFlags(node); write("interface "); - emitSourceTextOfNode(node.name); + writeTextOfNode(node.name); var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; emitTypeParameters(node.typeParameters); @@ -3031,7 +3144,7 @@ module ts { function emitPropertyDeclaration(node: PropertyDeclaration) { emitJsDocComments(node); - emitDeclarationFlags(node); + emitClassMemberDeclarationFlags(node); emitVariableDeclaration(node); write(";"); writeLine(); @@ -3042,19 +3155,20 @@ module ts { // If we are emitting property it isn't moduleElement and hence we already know it needs to be emitted // so there is no check needed to see if declaration is visible if (node.kind !== SyntaxKind.VariableDeclaration || resolver.isDeclarationVisible(node)) { - emitSourceTextOfNode(node.name); + writeTextOfNode(node.name); // If optional property emit ? if (node.kind === SyntaxKind.Property && (node.flags & NodeFlags.QuestionMark)) { write("?"); } - if (!(node.flags & NodeFlags.Private)) { - write(": "); - getSymbolVisibilityDiagnosticMessage = getVariableDeclarationTypeVisibilityError; - resolver.writeTypeAtLocation(node, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); + if (node.kind === SyntaxKind.Property && node.parent.kind === SyntaxKind.TypeLiteral) { + emitTypeOfVariableDeclarationFromTypeLiteral(node); + } + else if (!(node.flags & NodeFlags.Private)) { + writeTypeAtLocation(node, node.type, getVariableDeclarationTypeVisibilityError); } } - function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { + function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { var diagnosticMessage: DiagnosticMessage; if (node.kind === SyntaxKind.VariableDeclaration) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? @@ -3089,18 +3203,28 @@ module ts { } return diagnosticMessage !== undefined ? { - diagnosticMessage: diagnosticMessage, + diagnosticMessage, errorNode: node, typeName: node.name } : undefined; } } + function emitTypeOfVariableDeclarationFromTypeLiteral(node: VariableDeclaration) { + // if this is property of type literal, + // or is parameter of method/call/construct/index signature of type literal + // emit only if type is specified + if (node.type) { + write(": "); + emitType(node.type); + } + } + function emitVariableStatement(node: VariableStatement) { var hasDeclarationWithEmit = forEach(node.declarations, varDeclaration => resolver.isDeclarationVisible(varDeclaration)); if (hasDeclarationWithEmit) { emitJsDocComments(node); - emitDeclarationFlags(node); + emitModuleElementDeclarationFlags(node); if (isLet(node)) { write("let "); } @@ -3121,22 +3245,38 @@ module ts { if (node === accessors.firstAccessor) { emitJsDocComments(accessors.getAccessor); emitJsDocComments(accessors.setAccessor); - emitDeclarationFlags(node); - emitSourceTextOfNode(node.name); + emitClassMemberDeclarationFlags(node); + writeTextOfNode(node.name); if (!(node.flags & NodeFlags.Private)) { - write(": "); - getSymbolVisibilityDiagnosticMessage = getAccessorDeclarationTypeVisibilityError; - resolver.writeTypeAtLocation(node, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); + var accessorWithTypeAnnotation: AccessorDeclaration = node; + var type = getTypeAnnotationFromAccessor(node); + if (!type) { + // couldn't get type for the first accessor, try the another one + var anotherAccessor = node.kind === SyntaxKind.GetAccessor ? accessors.setAccessor : accessors.getAccessor; + type = getTypeAnnotationFromAccessor(anotherAccessor); + if (type) { + accessorWithTypeAnnotation = anotherAccessor; + } + } + writeTypeAtLocation(node, type, getAccessorDeclarationTypeVisibilityError); } write(";"); writeLine(); } - function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { + function getTypeAnnotationFromAccessor(accessor: AccessorDeclaration): TypeNode { + if (accessor) { + return accessor.kind === SyntaxKind.GetAccessor ? + accessor.type : // Getter - return type + accessor.parameters[0].type; // Setter parameter type + } + } + + function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { var diagnosticMessage: DiagnosticMessage; - if (node.kind === SyntaxKind.SetAccessor) { + if (accessorWithTypeAnnotation.kind === SyntaxKind.SetAccessor) { // Setters have to have type named and cannot infer it so, the type should always be named - if (node.parent.flags & NodeFlags.Static) { + if (accessorWithTypeAnnotation.parent.flags & NodeFlags.Static) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; @@ -3148,13 +3288,13 @@ module ts { } return { diagnosticMessage, - errorNode: node.parameters[0], + errorNode: accessorWithTypeAnnotation.parameters[0], // TODO(jfreeman): Investigate why we are passing node.name instead of node.parameters[0].name - typeName: node.name + typeName: accessorWithTypeAnnotation.name }; } else { - if (node.flags & NodeFlags.Static) { + if (accessorWithTypeAnnotation.flags & NodeFlags.Static) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -3170,7 +3310,7 @@ module ts { } return { diagnosticMessage, - errorNode: node.name, + errorNode: accessorWithTypeAnnotation.name, typeName: undefined }; } @@ -3183,16 +3323,21 @@ module ts { if ((node.kind !== SyntaxKind.FunctionDeclaration || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - emitDeclarationFlags(node); + if (node.kind === SyntaxKind.FunctionDeclaration) { + emitModuleElementDeclarationFlags(node); + } + else if (node.kind === SyntaxKind.Method) { + emitClassMemberDeclarationFlags(node); + } if (node.kind === SyntaxKind.FunctionDeclaration) { write("function "); - emitSourceTextOfNode(node.name); + writeTextOfNode(node.name); } else if (node.kind === SyntaxKind.Constructor) { write("constructor"); } else { - emitSourceTextOfNode(node.name); + writeTextOfNode(node.name); if (node.flags & NodeFlags.QuestionMark) { write("?"); } @@ -3201,16 +3346,15 @@ module ts { } } - function emitConstructSignatureDeclaration(node: SignatureDeclaration) { + function emitSignatureDeclarationWithJsDocComments(node: SignatureDeclaration) { emitJsDocComments(node); - write("new "); emitSignatureDeclaration(node); } function emitSignatureDeclaration(node: SignatureDeclaration) { - if (node.kind === SyntaxKind.CallSignature || node.kind === SyntaxKind.IndexSignature) { - // Only index and call signatures are emitted directly, so emit their js doc comments, rest will do that in their own functions - emitJsDocComments(node); + // Construct signature or constructor type write new Signature + if (node.kind === SyntaxKind.ConstructSignature || node.kind === SyntaxKind.ConstructorType) { + write("new "); } emitTypeParameters(node.typeParameters); if (node.kind === SyntaxKind.IndexSignature) { @@ -3220,6 +3364,9 @@ module ts { write("("); } + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; + // Parameters emitCommaList(node.parameters, emitParameterDeclaration); @@ -3231,15 +3378,26 @@ module ts { } // If this is not a constructor and is not private, emit the return type - if (node.kind !== SyntaxKind.Constructor && !(node.flags & NodeFlags.Private)) { - write(": "); - getSymbolVisibilityDiagnosticMessage = getReturnTypeVisibilityError; - resolver.writeReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); + var isFunctionTypeOrConstructorType = node.kind === SyntaxKind.FunctionType || node.kind === SyntaxKind.ConstructorType; + if (isFunctionTypeOrConstructorType || node.parent.kind === SyntaxKind.TypeLiteral) { + // Emit type literal signature return type only if specified + if (node.type) { + write(isFunctionTypeOrConstructorType ? " => " : ": "); + emitType(node.type); + } + } + else if (node.kind !== SyntaxKind.Constructor && !(node.flags & NodeFlags.Private)) { + writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } - write(";"); - writeLine(); - function getReturnTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { + enclosingDeclaration = prevEnclosingDeclaration; + + if (!isFunctionTypeOrConstructorType) { + write(";"); + writeLine(); + } + + function getReturnTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { var diagnosticMessage: DiagnosticMessage; switch (node.kind) { case SyntaxKind.ConstructSignature: @@ -3311,19 +3469,22 @@ module ts { if (node.flags & NodeFlags.Rest) { write("..."); } - emitSourceTextOfNode(node.name); + writeTextOfNode(node.name); if (node.initializer || (node.flags & NodeFlags.QuestionMark)) { write("?"); } decreaseIndent(); - if (!(node.parent.flags & NodeFlags.Private)) { - write(": "); - getSymbolVisibilityDiagnosticMessage = getParameterDeclarationTypeVisibilityError; - resolver.writeTypeAtLocation(node, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); + if (node.parent.kind === SyntaxKind.FunctionType || + node.parent.kind === SyntaxKind.ConstructorType || + node.parent.parent.kind === SyntaxKind.TypeLiteral) { + emitTypeOfVariableDeclarationFromTypeLiteral(node); + } + else if (!(node.parent.flags & NodeFlags.Private)) { + writeTypeAtLocation(node, node.type, getParameterDeclarationTypeVisibilityError); } - function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { + function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { var diagnosticMessage: DiagnosticMessage; switch (node.parent.kind) { case SyntaxKind.Constructor: @@ -3398,10 +3559,9 @@ module ts { case SyntaxKind.Method: return emitFunctionDeclaration(node); case SyntaxKind.ConstructSignature: - return emitConstructSignatureDeclaration(node); case SyntaxKind.CallSignature: case SyntaxKind.IndexSignature: - return emitSignatureDeclaration(node); + return emitSignatureDeclarationWithJsDocComments(node); case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: return emitAccessorDeclaration(node); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 9b05f98b8f7..c848d817ff1 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -828,11 +828,15 @@ module ts { CannotBeNamed } - export interface SymbolAccessiblityResult { + export interface SymbolVisibilityResult { accessibility: SymbolAccessibility; - errorSymbolName?: string // Optional symbol name that results in error - errorModuleName?: string // If the symbol is not visible from module, module's name aliasesToMakeVisible?: ImportDeclaration[]; // aliases that need to have this symbol visible + errorSymbolName?: string; // Optional symbol name that results in error + errorNode?: Node; // optional node that results in error + } + + export interface SymbolAccessiblityResult extends SymbolVisibilityResult { + errorModuleName?: string // If the symbol is not visible from module, module's name } export interface EmitResolver { @@ -850,7 +854,7 @@ module ts { writeTypeAtLocation(location: Node, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; - isImportDeclarationEntityNameReferenceDeclarationVisibile(entityName: EntityName): SymbolAccessiblityResult; + isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult; // Returns the constant value this property access resolves to, or 'undefined' for a non-constant getConstantValue(node: PropertyAccess | IndexedAccess): number; isEmitBlocked(sourceFile?: SourceFile): boolean; diff --git a/src/services/services.ts b/src/services/services.ts index 5611d1060e3..948073f3fe0 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -715,12 +715,12 @@ module ts { public filename: string; public text: string; - // These methods will have their implementation overridden with the implementation the + // These methods will have their implementation provided by the implementation the // compiler actually exports off of SourceFile. - public getLineAndCharacterFromPosition(position: number): { line: number; character: number } { return null; } - public getPositionFromLineAndCharacter(line: number, character: number): number { return -1; } - public getLineStarts(): number[] { return undefined; } - public getSyntacticDiagnostics(): Diagnostic[] { return undefined; } + public getLineAndCharacterFromPosition: (position: number) => LineAndCharacter; + public getPositionFromLineAndCharacter: (line: number, character: number) => number; + public getLineStarts: () => number[]; + public getSyntacticDiagnostics: () => Diagnostic[]; public amdDependencies: string[]; public amdModuleName: string; @@ -890,9 +890,6 @@ module ts { getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; - // Obsolete. Use getSignatureHelpItems instead. - getSignatureAtPosition(fileName: string, position: number): SignatureInfo; - getRenameInfo(fileName: string, position: number): RenameInfo; findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; @@ -917,41 +914,6 @@ module ts { dispose(): void; } - export interface SignatureInfo { - actual: ActualSignatureInfo; - formal: FormalSignatureItemInfo[]; // Formal signatures - activeFormal: number; // Index of the "best match" formal signature - } - - export interface FormalSignatureItemInfo { - signatureInfo: string; - typeParameters: FormalTypeParameterInfo[]; - parameters: FormalParameterInfo[]; // Array of parameters - docComment: string; // Help for the signature - } - - export interface FormalTypeParameterInfo { - name: string; // Type parameter name - docComment: string; // Comments that contain help for the parameter - minChar: number; // minChar for parameter info in the formal signature info string - limChar: number; // lim char for parameter info in the formal signature info string - } - - export interface FormalParameterInfo { - name: string; // Parameter name - isVariable: boolean; // true if parameter is var args - docComment: string; // Comments that contain help for the parameter - minChar: number; // minChar for parameter info in the formal signature info string - limChar: number; // lim char for parameter info in the formal signature info string - } - - export interface ActualSignatureInfo { - parameterMinChar: number; - parameterLimChar: number; - currentParameterIsTypeParameter: boolean; // current parameter is a type argument or a normal argument - currentParameter: number; // Index of active parameter in "parameters" or "typeParamters" array - } - export interface ClassifiedSpan { textSpan: TextSpan; classificationType: string; // ClassificationTypeNames @@ -4795,68 +4757,6 @@ module ts { return SignatureHelp.getSignatureHelpItems(sourceFile, position, typeInfoResolver, cancellationToken); } - function getSignatureAtPosition(filename: string, position: number): SignatureInfo { - var signatureHelpItems = getSignatureHelpItems(filename, position); - - if (!signatureHelpItems) { - return undefined; - } - - var currentArgumentState = { argumentIndex: signatureHelpItems.argumentIndex, argumentCount: signatureHelpItems.argumentCount }; - - var formalSignatures: FormalSignatureItemInfo[] = []; - forEach(signatureHelpItems.items, signature => { - var signatureInfoString = displayPartsToString(signature.prefixDisplayParts); - - var parameters: FormalParameterInfo[] = []; - if (signature.parameters) { - for (var i = 0, n = signature.parameters.length; i < n; i++) { - var parameter = signature.parameters[i]; - - // add the parameter to the string - if (i) { - signatureInfoString += displayPartsToString(signature.separatorDisplayParts); - } - - var start = signatureInfoString.length; - signatureInfoString += displayPartsToString(parameter.displayParts); - var end = signatureInfoString.length; - - // add the parameter to the list - parameters.push({ - name: parameter.name, - isVariable: i === n - 1 && signature.isVariadic, - docComment: displayPartsToString(parameter.documentation), - minChar: start, - limChar: end - }); - } - } - - signatureInfoString += displayPartsToString(signature.suffixDisplayParts); - - formalSignatures.push({ - signatureInfo: signatureInfoString, - docComment: displayPartsToString(signature.documentation), - parameters: parameters, - typeParameters: [], - }); - }); - - var actualSignature: ActualSignatureInfo = { - parameterMinChar: signatureHelpItems.applicableSpan.start(), - parameterLimChar: signatureHelpItems.applicableSpan.end(), - currentParameterIsTypeParameter: false, - currentParameter: currentArgumentState.argumentIndex - }; - - return { - actual: actualSignature, - formal: formalSignatures, - activeFormal: 0 - }; - } - /// Syntactic features function getCurrentSourceFile(filename: string): SourceFile { filename = normalizeSlashes(filename); @@ -5483,7 +5383,6 @@ module ts { getFormattingEditsForDocument, getFormattingEditsAfterKeystroke, getEmitOutput, - getSignatureAtPosition, }; } diff --git a/src/services/shims.ts b/src/services/shims.ts index a355ddafab2..f7dd1b6cfd4 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -98,9 +98,6 @@ module ts { getSignatureHelpItems(fileName: string, position: number): string; - // Obsolete. Use getSignatureHelpItems instead. - getSignatureAtPosition(fileName: string, position: number): string; - /** * Returns a JSON-encoded value of the type: * { canRename: boolean, localizedErrorMessage: string, displayName: string, fullDisplayName: string, kind: string, kindModifiers: string, triggerSpan: { start; length } } @@ -609,14 +606,6 @@ module ts { }); } - public getSignatureAtPosition(fileName: string, position: number): string { - return this.forwardJSONCall( - "getSignatureAtPosition('" + fileName + "', " + position + ")", - () => { - return this.languageService.getSignatureAtPosition(fileName, position); - }); - } - /// GOTO DEFINITION /** diff --git a/src/services/syntax/incrementalParser.ts b/src/services/syntax/incrementalParser.ts index b234b77e03f..be0b26cf302 100644 --- a/src/services/syntax/incrementalParser.ts +++ b/src/services/syntax/incrementalParser.ts @@ -592,6 +592,7 @@ module TypeScript.IncrementalParser { text: text, fileName: fileName, languageVersion: languageVersion, + absolutePosition: absolutePosition, currentNode: currentNode, currentToken: currentToken, currentContextualToken: currentContextualToken, diff --git a/src/services/syntax/parser.ts b/src/services/syntax/parser.ts index 80c813ca162..b1b197cd1ea 100644 --- a/src/services/syntax/parser.ts +++ b/src/services/syntax/parser.ts @@ -45,6 +45,9 @@ module TypeScript.Parser { // but can affect the diagnostics produced while parsing. languageVersion: ts.ScriptTarget; + // The place in the source text that we're currently pointing at. + absolutePosition(): number; + // The current syntax node the source is pointing at. Only available in incremental settings. // The source can point at a node if that node doesn't intersect any of the text changes in // the file, and doesn't contain certain unacceptable constructs. For example, if the node @@ -541,13 +544,32 @@ module TypeScript.Parser { return eatToken(SyntaxKind.SemicolonToken); } + function createEmptyToken(kind: SyntaxKind): ISyntaxToken { + // The position of the empty token we're creating is not necessarily the position that + // the parser is at now. This is because we may have seen some existing missing tokens + // before finally deciding we needed a missing token. For example, if you have: + // + // Foo(a, # + // + // We will need to create a empty token for the missing ")". However, we will have + // skipped the "#" token, and thus will be right after the "#". Because the "#" token + // will actually become *skipped* trivia on the *next* token we see, the close paren + // should not be considered to be after #, and should instead be after the ",". + // + // So, if we have any skipped tokens, then the position of the empty token should be + // the position of the first skipped token we have. Otherwise it's just at the position + // of the parser. + var fullStart = _skippedTokens ? _skippedTokens[0].fullStart() : source.absolutePosition(); + return Syntax.emptyToken(kind, fullStart); + } + function createMissingToken(expectedKind: SyntaxKind, actual: ISyntaxToken, diagnosticCode?: string): ISyntaxToken { var diagnostic = getExpectedTokenDiagnostic(expectedKind, actual, diagnosticCode); addDiagnostic(diagnostic); // The missing token will be at the full start of the current token. That way empty tokens // will always be between real tokens and not inside an actual token. - return Syntax.emptyToken(expectedKind); + return createEmptyToken(expectedKind); } function getExpectedTokenDiagnostic(expectedKind: SyntaxKind, actual?: ISyntaxToken, diagnosticCode?: string): Diagnostic { @@ -2871,7 +2893,7 @@ module TypeScript.Parser { addDiagnostic(diagnostic); return new ArgumentListSyntax(parseNodeData, typeArgumentList, - Syntax.emptyToken(SyntaxKind.OpenParenToken), [], Syntax.emptyToken(SyntaxKind.CloseParenToken)); + createEmptyToken(SyntaxKind.OpenParenToken), [], createEmptyToken(SyntaxKind.CloseParenToken)); } else { Debug.assert(token0.kind === SyntaxKind.OpenParenToken); @@ -2931,7 +2953,7 @@ module TypeScript.Parser { DiagnosticCode.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead, undefined); addDiagnostic(diagnostic); - return Syntax.emptyToken(SyntaxKind.IdentifierName); + return createEmptyToken(SyntaxKind.IdentifierName); } else { return allowInAnd(parseExpression); @@ -3086,7 +3108,7 @@ module TypeScript.Parser { else { var diagnostic = getExpectedTokenDiagnostic(SyntaxKind.CloseBraceToken); addDiagnostic(diagnostic); - token = Syntax.emptyToken(SyntaxKind.TemplateEndToken); + token = createEmptyToken(SyntaxKind.TemplateEndToken); } return new TemplateClauseSyntax(parseNodeData, expression, token); @@ -4219,7 +4241,7 @@ module TypeScript.Parser { // consume the '}' just fine. So ASI doesn't apply. if (allowAutomaticSemicolonInsertion && canEatAutomaticSemicolon(/*allowWithoutNewline:*/ false)) { - var semicolonToken = eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false) || Syntax.emptyToken(SyntaxKind.SemicolonToken); + var semicolonToken = eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false) || createEmptyToken(SyntaxKind.SemicolonToken); nodesAndSeparators.push(semicolonToken); // Debug.assert(items.length % 2 === 0); continue; diff --git a/src/services/syntax/syntaxToken.ts b/src/services/syntax/syntaxToken.ts index 6b6854cd08e..9ddbc3a800c 100644 --- a/src/services/syntax/syntaxToken.ts +++ b/src/services/syntax/syntaxToken.ts @@ -290,8 +290,8 @@ module TypeScript.Syntax { return new RealizedToken(token.fullStart(), token.kind, token.isKeywordConvertedToIdentifier(), leadingTrivia, token.text()); } - export function emptyToken(kind: SyntaxKind): ISyntaxToken { - return new EmptyToken(kind); + export function emptyToken(kind: SyntaxKind, fullStart: number): ISyntaxToken { + return new EmptyToken(kind, fullStart); } class EmptyToken implements ISyntaxToken { @@ -300,17 +300,17 @@ module TypeScript.Syntax { public parent: ISyntaxElement; public childCount: number; - constructor(public kind: SyntaxKind) { + constructor(public kind: SyntaxKind, private _fullStart: number) { } public setFullStart(fullStart: number): void { - // An empty token is always at the -1 position. + this._fullStart = fullStart; } public childAt(index: number): ISyntaxElement { throw Errors.invalidOperation() } public clone(): ISyntaxToken { - return new EmptyToken(this.kind); + return new EmptyToken(this.kind, this._fullStart); } // Empty tokens are never incrementally reusable. @@ -321,75 +321,7 @@ module TypeScript.Syntax { } public fullWidth() { return 0; } - - private position(): number { - // It's hard for us to tell the position of an empty token at the eact time we create - // it. For example, we may have: - // - // a / finally - // - // There will be a missing token detected after the forward slash, so it would be - // tempting to set its position as the full-end of hte slash token. However, - // immediately after that, the 'finally' token will be skipped and will be attached - // as skipped text to the forward slash. This means the 'full-end' of the forward - // slash will change, and thus the empty token will now appear to be embedded inside - // another token. This violates are rule that all tokens must only touch at the end, - // and makes enforcing invariants much harder. - // - // To address this we create the empty token with no known position, and then we - // determine what it's position should be based on where it lies in the tree. - // Specifically, we find the previous non-zero-width syntax element, and we consider - // the full-start of this token to be at the full-end of that element. - - var previousElement = this.previousNonZeroWidthElement(); - return !previousElement ? 0 : fullStart(previousElement) + fullWidth(previousElement); - } - - private previousNonZeroWidthElement(): ISyntaxElement { - var current: ISyntaxElement = this; - while (true) { - var parent = current.parent; - if (parent === undefined) { - Debug.assert(current.kind === SyntaxKind.SourceUnit, "We had a node without a parent that was not the root node!"); - - // We walked all the way to the top, and never found a previous element. This - // can happen with code like: - // - // / b; - // - // We will have an empty identifier token as the first token in the tree. In - // this case, return undefined so that the position of the empty token will be - // considered to be 0. - return undefined; - } - - // Ok. We have a parent. First, find out which slot we're at in the parent. - for (var i = 0, n = childCount(parent); i < n; i++) { - if (childAt(parent, i) === current) { - break; - } - } - - Debug.assert(i !== n, "Could not find current element in parent's child list!"); - - // Walk backward from this element, looking for a non-zero-width sibling. - for (var j = i - 1; j >= 0; j--) { - var sibling = childAt(parent, j); - if (sibling && fullWidth(sibling) > 0) { - return sibling; - } - } - - // We couldn't find a non-zero-width sibling. We were either the first element, or - // all preceding elements are empty. So, move up to our parent so we we can find - // its preceding sibling. - current = current.parent; - } - } - - public fullStart(): number { - return this.position(); - } + public fullStart(): number { return this._fullStart; } public text() { return ""; } public fullText(): string { return ""; } diff --git a/tests/baselines/reference/aliasInaccessibleModule.errors.txt b/tests/baselines/reference/aliasInaccessibleModule.errors.txt index 9967979442a..3a9c64e50ab 100644 --- a/tests/baselines/reference/aliasInaccessibleModule.errors.txt +++ b/tests/baselines/reference/aliasInaccessibleModule.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/aliasInaccessibleModule.ts(4,5): error TS4000: Import declaration 'X' is using private name 'N'. +tests/cases/compiler/aliasInaccessibleModule.ts(4,23): error TS4000: Import declaration 'X' is using private name 'N'. ==== tests/cases/compiler/aliasInaccessibleModule.ts (1 errors) ==== @@ -6,6 +6,6 @@ tests/cases/compiler/aliasInaccessibleModule.ts(4,5): error TS4000: Import decla module N { } export import X = N; - ~~~~~~~~~~~~~~~~~~~~ + ~ !!! error TS4000: Import declaration 'X' is using private name 'N'. } \ No newline at end of file diff --git a/tests/baselines/reference/aliasInaccessibleModule2.errors.txt b/tests/baselines/reference/aliasInaccessibleModule2.errors.txt index ffeb4ff86dd..03a37147aba 100644 --- a/tests/baselines/reference/aliasInaccessibleModule2.errors.txt +++ b/tests/baselines/reference/aliasInaccessibleModule2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/aliasInaccessibleModule2.ts(7,5): error TS4000: Import declaration 'R' is using private name 'N'. +tests/cases/compiler/aliasInaccessibleModule2.ts(7,16): error TS4000: Import declaration 'R' is using private name 'N'. ==== tests/cases/compiler/aliasInaccessibleModule2.ts (1 errors) ==== @@ -9,7 +9,7 @@ tests/cases/compiler/aliasInaccessibleModule2.ts(7,5): error TS4000: Import decl } import R = N; - ~~~~~~~~~~~~~ + ~ !!! error TS4000: Import declaration 'R' is using private name 'N'. export import X = R; } \ No newline at end of file diff --git a/tests/baselines/reference/commentsInterface.js b/tests/baselines/reference/commentsInterface.js index 1951137b048..bff79a02aa5 100644 --- a/tests/baselines/reference/commentsInterface.js +++ b/tests/baselines/reference/commentsInterface.js @@ -116,7 +116,7 @@ interface i2 { /** this is x*/ x: number; /** this is foo*/ - foo: (b: number) => string; + foo: (/**param help*/ b: number) => string; /** this is indexer*/ [/**string param*/ i: string]: any; /**new method*/ @@ -152,7 +152,7 @@ interface i3 { /** Function i3 f*/ f(/**number parameter*/ a: number): string; /** i3 l*/ - l: (b: number) => string; + l: (/**comment i3 l b*/ b: number) => string; nc_x: number; nc_f(a: number): string; nc_l: (b: number) => string; diff --git a/tests/baselines/reference/constructorTypeWithTypeParameters.js b/tests/baselines/reference/constructorTypeWithTypeParameters.js index 195536d5b15..9b93d54ba89 100644 --- a/tests/baselines/reference/constructorTypeWithTypeParameters.js +++ b/tests/baselines/reference/constructorTypeWithTypeParameters.js @@ -12,6 +12,10 @@ var anotherVar; //// [constructorTypeWithTypeParameters.d.ts] -declare var X: new () => number; -declare var Y: new () => number; +declare var X: { + new (): number; +}; +declare var Y: { + new (): number; +}; declare var anotherVar: new () => number; diff --git a/tests/baselines/reference/declFileForInterfaceWithRestParams.js b/tests/baselines/reference/declFileForInterfaceWithRestParams.js index b2da71ba208..8979f7df6da 100644 --- a/tests/baselines/reference/declFileForInterfaceWithRestParams.js +++ b/tests/baselines/reference/declFileForInterfaceWithRestParams.js @@ -11,7 +11,7 @@ interface I { //// [declFileForInterfaceWithRestParams.d.ts] interface I { - foo(...x: any[]): any[]; - foo2(a: number, ...x: any[]): any[]; - foo3(b: string, ...x: string[]): string[]; + foo(...x: any[]): typeof x; + foo2(a: number, ...x: any[]): typeof x; + foo3(b: string, ...x: string[]): typeof x; } diff --git a/tests/baselines/reference/declFileGenericType.js b/tests/baselines/reference/declFileGenericType.js index ef8d6d453af..3c8120e8db9 100644 --- a/tests/baselines/reference/declFileGenericType.js +++ b/tests/baselines/reference/declFileGenericType.js @@ -120,9 +120,9 @@ export declare module C { class B { } function F(x: T): A; - function F2(x: T): A; - function F3(x: T): A[]; - function F4>(x: T): A[]; + function F2(x: T): C.A; + function F3(x: T): C.A[]; + function F4>(x: T): Array>; function F5(): T; function F6>(x: T): T; class D { diff --git a/tests/baselines/reference/declFileGenericType2.js b/tests/baselines/reference/declFileGenericType2.js index 0e0381cd87d..db1399e64d3 100644 --- a/tests/baselines/reference/declFileGenericType2.js +++ b/tests/baselines/reference/declFileGenericType2.js @@ -97,16 +97,16 @@ declare module templa.mvc { } } declare module templa.mvc { - interface IController { + interface IController { } } declare module templa.mvc { - class AbstractController implements IController { + class AbstractController implements mvc.IController { } } declare module templa.mvc.composite { - interface ICompositeControllerModel extends IModel { - getControllers(): IController[]; + interface ICompositeControllerModel extends mvc.IModel { + getControllers(): mvc.IController[]; } } declare module templa.dom.mvc { @@ -119,7 +119,7 @@ declare module templa.dom.mvc { } } declare module templa.dom.mvc.composite { - class AbstractCompositeElementController extends AbstractElementController { + class AbstractCompositeElementController extends templa.dom.mvc.AbstractElementController { _controllers: templa.mvc.IController[]; constructor(); } diff --git a/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.js b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.js index 5ff631c6aad..2d071c80de9 100644 --- a/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.js +++ b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.js @@ -32,8 +32,12 @@ var f6 = function () { //// [declFileRestParametersOfFunctionAndFunctionType.d.ts] declare function f1(...args: any[]): void; -declare function f2(x: (...args: any[]) => void): void; -declare function f3(x: (...args: any[]) => void): void; -declare function f4 void>(): void; -declare function f5 void>(): void; +declare function f2(x: (...args) => void): void; +declare function f3(x: { + (...args): void; +}): void; +declare function f4 void>(): void; +declare function f5(): void; declare var f6: () => any[]; diff --git a/tests/baselines/reference/declFileTypeAnnotationArrayType.js b/tests/baselines/reference/declFileTypeAnnotationArrayType.js new file mode 100644 index 00000000000..0a9d04d6bc7 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationArrayType.js @@ -0,0 +1,137 @@ +//// [declFileTypeAnnotationArrayType.ts] + +class c { +} +module m { + export class c { + } + export class g { + } +} +class g { +} + +// Just the name +function foo(): c[] { + return [new c()]; +} +function foo2() { + return [new c()]; +} + +// Qualified name +function foo3(): m.c[] { + return [new m.c()]; +} +function foo4() { + return m.c; +} + +// Just the name with type arguments +function foo5(): g[] { + return [new g()]; +} +function foo6() { + return [new g()]; +} + +// Qualified name with type arguments +function foo7(): m.g[] { + return [new m.g()]; +} +function foo8() { + return [new m.g()]; +} + +// Array of function types +function foo9(): (()=>c)[] { + return [() => new c()]; +} +function foo10() { + return [() => new c()]; +} + +//// [declFileTypeAnnotationArrayType.js] +var c = (function () { + function c() { + } + return c; +})(); +var m; +(function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; + var g = (function () { + function g() { + } + return g; + })(); + m.g = g; +})(m || (m = {})); +var g = (function () { + function g() { + } + return g; +})(); +// Just the name +function foo() { + return [new c()]; +} +function foo2() { + return [new c()]; +} +// Qualified name +function foo3() { + return [new m.c()]; +} +function foo4() { + return m.c; +} +// Just the name with type arguments +function foo5() { + return [new g()]; +} +function foo6() { + return [new g()]; +} +// Qualified name with type arguments +function foo7() { + return [new m.g()]; +} +function foo8() { + return [new m.g()]; +} +// Array of function types +function foo9() { + return [function () { return new c(); }]; +} +function foo10() { + return [function () { return new c(); }]; +} + + +//// [declFileTypeAnnotationArrayType.d.ts] +declare class c { +} +declare module m { + class c { + } + class g { + } +} +declare class g { +} +declare function foo(): c[]; +declare function foo2(): c[]; +declare function foo3(): m.c[]; +declare function foo4(): typeof m.c; +declare function foo5(): g[]; +declare function foo6(): g[]; +declare function foo7(): m.g[]; +declare function foo8(): m.g[]; +declare function foo9(): (() => c)[]; +declare function foo10(): (() => c)[]; diff --git a/tests/baselines/reference/declFileTypeAnnotationArrayType.types b/tests/baselines/reference/declFileTypeAnnotationArrayType.types new file mode 100644 index 00000000000..860d13af47c --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationArrayType.types @@ -0,0 +1,125 @@ +=== tests/cases/compiler/declFileTypeAnnotationArrayType.ts === + +class c { +>c : c +} +module m { +>m : typeof m + + export class c { +>c : c + } + export class g { +>g : g +>T : T + } +} +class g { +>g : g +>T : T +} + +// Just the name +function foo(): c[] { +>foo : () => c[] +>c : c + + return [new c()]; +>[new c()] : c[] +>new c() : c +>c : typeof c +} +function foo2() { +>foo2 : () => c[] + + return [new c()]; +>[new c()] : c[] +>new c() : c +>c : typeof c +} + +// Qualified name +function foo3(): m.c[] { +>foo3 : () => m.c[] +>m : unknown +>c : m.c + + return [new m.c()]; +>[new m.c()] : m.c[] +>new m.c() : m.c +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c +} +function foo4() { +>foo4 : () => typeof m.c + + return m.c; +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c +} + +// Just the name with type arguments +function foo5(): g[] { +>foo5 : () => g[] +>g : g + + return [new g()]; +>[new g()] : g[] +>new g() : g +>g : typeof g +} +function foo6() { +>foo6 : () => g[] + + return [new g()]; +>[new g()] : g[] +>new g() : g +>g : typeof g +} + +// Qualified name with type arguments +function foo7(): m.g[] { +>foo7 : () => m.g[] +>m : unknown +>g : m.g + + return [new m.g()]; +>[new m.g()] : m.g[] +>new m.g() : m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +} +function foo8() { +>foo8 : () => m.g[] + + return [new m.g()]; +>[new m.g()] : m.g[] +>new m.g() : m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +} + +// Array of function types +function foo9(): (()=>c)[] { +>foo9 : () => (() => c)[] +>c : c + + return [() => new c()]; +>[() => new c()] : (() => c)[] +>() => new c() : () => c +>new c() : c +>c : typeof c +} +function foo10() { +>foo10 : () => (() => c)[] + + return [() => new c()]; +>[() => new c()] : (() => c)[] +>() => new c() : () => c +>new c() : c +>c : typeof c +} diff --git a/tests/baselines/reference/declFileTypeAnnotationBuiltInType.js b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.js new file mode 100644 index 00000000000..fc877ab4b32 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.js @@ -0,0 +1,91 @@ +//// [declFileTypeAnnotationBuiltInType.ts] + +// string +function foo(): string { + return ""; +} +function foo2() { + return ""; +} + +// number +function foo3(): number { + return 10; +} +function foo4() { + return 10; +} + +// boolean +function foo5(): boolean { + return true; +} +function foo6() { + return false; +} + +// void +function foo7(): void { + return; +} +function foo8() { + return; +} + +// any +function foo9(): any { + return undefined; +} +function foo10() { + return undefined; +} + +//// [declFileTypeAnnotationBuiltInType.js] +// string +function foo() { + return ""; +} +function foo2() { + return ""; +} +// number +function foo3() { + return 10; +} +function foo4() { + return 10; +} +// boolean +function foo5() { + return true; +} +function foo6() { + return false; +} +// void +function foo7() { + return; +} +function foo8() { + return; +} +// any +function foo9() { + return undefined; +} +function foo10() { + return undefined; +} + + +//// [declFileTypeAnnotationBuiltInType.d.ts] +declare function foo(): string; +declare function foo2(): string; +declare function foo3(): number; +declare function foo4(): number; +declare function foo5(): boolean; +declare function foo6(): boolean; +declare function foo7(): void; +declare function foo8(): void; +declare function foo9(): any; +declare function foo10(): any; diff --git a/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types new file mode 100644 index 00000000000..ce4f5654a89 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types @@ -0,0 +1,63 @@ +=== tests/cases/compiler/declFileTypeAnnotationBuiltInType.ts === + +// string +function foo(): string { +>foo : () => string + + return ""; +} +function foo2() { +>foo2 : () => string + + return ""; +} + +// number +function foo3(): number { +>foo3 : () => number + + return 10; +} +function foo4() { +>foo4 : () => number + + return 10; +} + +// boolean +function foo5(): boolean { +>foo5 : () => boolean + + return true; +} +function foo6() { +>foo6 : () => boolean + + return false; +} + +// void +function foo7(): void { +>foo7 : () => void + + return; +} +function foo8() { +>foo8 : () => void + + return; +} + +// any +function foo9(): any { +>foo9 : () => any + + return undefined; +>undefined : undefined +} +function foo10() { +>foo10 : () => any + + return undefined; +>undefined : undefined +} diff --git a/tests/baselines/reference/declFileTypeAnnotationParenType.js b/tests/baselines/reference/declFileTypeAnnotationParenType.js new file mode 100644 index 00000000000..c61517c7339 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationParenType.js @@ -0,0 +1,32 @@ +//// [declFileTypeAnnotationParenType.ts] + +class c { + private p: string; +} + +var x: (() => c)[] = [() => new c()]; +var y = [() => new c()]; + +var k: (() => c) | string = (() => new c()) || ""; +var l = (() => new c()) || ""; + +//// [declFileTypeAnnotationParenType.js] +var c = (function () { + function c() { + } + return c; +})(); +var x = [function () { return new c(); }]; +var y = [function () { return new c(); }]; +var k = (function () { return new c(); }) || ""; +var l = (function () { return new c(); }) || ""; + + +//// [declFileTypeAnnotationParenType.d.ts] +declare class c { + private p; +} +declare var x: (() => c)[]; +declare var y: (() => c)[]; +declare var k: (() => c) | string; +declare var l: string | (() => c); diff --git a/tests/baselines/reference/declFileTypeAnnotationParenType.types b/tests/baselines/reference/declFileTypeAnnotationParenType.types new file mode 100644 index 00000000000..c904f1b3e5a --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationParenType.types @@ -0,0 +1,41 @@ +=== tests/cases/compiler/declFileTypeAnnotationParenType.ts === + +class c { +>c : c + + private p: string; +>p : string +} + +var x: (() => c)[] = [() => new c()]; +>x : (() => c)[] +>c : c +>[() => new c()] : (() => c)[] +>() => new c() : () => c +>new c() : c +>c : typeof c + +var y = [() => new c()]; +>y : (() => c)[] +>[() => new c()] : (() => c)[] +>() => new c() : () => c +>new c() : c +>c : typeof c + +var k: (() => c) | string = (() => new c()) || ""; +>k : string | (() => c) +>c : c +>(() => new c()) || "" : string | (() => c) +>(() => new c()) : () => c +>() => new c() : () => c +>new c() : c +>c : typeof c + +var l = (() => new c()) || ""; +>l : string | (() => c) +>(() => new c()) || "" : string | (() => c) +>(() => new c()) : () => c +>() => new c() : () => c +>new c() : c +>c : typeof c + diff --git a/tests/baselines/reference/declFileTypeAnnotationStringLiteral.js b/tests/baselines/reference/declFileTypeAnnotationStringLiteral.js new file mode 100644 index 00000000000..faa76cc869c --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationStringLiteral.js @@ -0,0 +1,26 @@ +//// [declFileTypeAnnotationStringLiteral.ts] + +function foo(a: "hello"): number; +function foo(a: "name"): string; +function foo(a: string): string | number; +function foo(a: string): string | number { + if (a === "hello") { + return a.length; + } + + return a; +} + +//// [declFileTypeAnnotationStringLiteral.js] +function foo(a) { + if (a === "hello") { + return a.length; + } + return a; +} + + +//// [declFileTypeAnnotationStringLiteral.d.ts] +declare function foo(a: "hello"): number; +declare function foo(a: "name"): string; +declare function foo(a: string): string | number; diff --git a/tests/baselines/reference/declFileTypeAnnotationStringLiteral.types b/tests/baselines/reference/declFileTypeAnnotationStringLiteral.types new file mode 100644 index 00000000000..d50d95f988b --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationStringLiteral.types @@ -0,0 +1,31 @@ +=== tests/cases/compiler/declFileTypeAnnotationStringLiteral.ts === + +function foo(a: "hello"): number; +>foo : { (a: "hello"): number; (a: "name"): string; (a: string): string | number; } +>a : "hello" + +function foo(a: "name"): string; +>foo : { (a: "hello"): number; (a: "name"): string; (a: string): string | number; } +>a : "name" + +function foo(a: string): string | number; +>foo : { (a: "hello"): number; (a: "name"): string; (a: string): string | number; } +>a : string + +function foo(a: string): string | number { +>foo : { (a: "hello"): number; (a: "name"): string; (a: string): string | number; } +>a : string + + if (a === "hello") { +>a === "hello" : boolean +>a : string + + return a.length; +>a.length : number +>a : string +>length : number + } + + return a; +>a : string +} diff --git a/tests/baselines/reference/declFileTypeAnnotationTupleType.js b/tests/baselines/reference/declFileTypeAnnotationTupleType.js new file mode 100644 index 00000000000..91d44c2b07f --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTupleType.js @@ -0,0 +1,68 @@ +//// [declFileTypeAnnotationTupleType.ts] + +class c { +} +module m { + export class c { + } + export class g { + } +} +class g { +} + +// Just the name +var k: [c, m.c] = [new c(), new m.c()]; +var l = k; + +var x: [g, m.g, () => c] = [new g(), new m.g(), () => new c()]; +var y = x; + +//// [declFileTypeAnnotationTupleType.js] +var c = (function () { + function c() { + } + return c; +})(); +var m; +(function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; + var g = (function () { + function g() { + } + return g; + })(); + m.g = g; +})(m || (m = {})); +var g = (function () { + function g() { + } + return g; +})(); +// Just the name +var k = [new c(), new m.c()]; +var l = k; +var x = [new g(), new m.g(), function () { return new c(); }]; +var y = x; + + +//// [declFileTypeAnnotationTupleType.d.ts] +declare class c { +} +declare module m { + class c { + } + class g { + } +} +declare class g { +} +declare var k: [c, m.c]; +declare var l: [c, m.c]; +declare var x: [g, m.g, () => c]; +declare var y: [g, m.g, () => c]; diff --git a/tests/baselines/reference/declFileTypeAnnotationTupleType.types b/tests/baselines/reference/declFileTypeAnnotationTupleType.types new file mode 100644 index 00000000000..88cf5a0c743 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTupleType.types @@ -0,0 +1,60 @@ +=== tests/cases/compiler/declFileTypeAnnotationTupleType.ts === + +class c { +>c : c +} +module m { +>m : typeof m + + export class c { +>c : c + } + export class g { +>g : g +>T : T + } +} +class g { +>g : g +>T : T +} + +// Just the name +var k: [c, m.c] = [new c(), new m.c()]; +>k : [c, m.c] +>c : c +>m : unknown +>c : m.c +>[new c(), new m.c()] : [c, m.c] +>new c() : c +>c : typeof c +>new m.c() : m.c +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c + +var l = k; +>l : [c, m.c] +>k : [c, m.c] + +var x: [g, m.g, () => c] = [new g(), new m.g(), () => new c()]; +>x : [g, m.g, () => c] +>g : g +>m : unknown +>g : m.g +>c : c +>[new g(), new m.g(), () => new c()] : [g, m.g, () => c] +>new g() : g +>g : typeof g +>new m.g() : m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +>() => new c() : () => c +>new c() : c +>c : typeof c + +var y = x; +>y : [g, m.g, () => c] +>x : [g, m.g, () => c] + diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeAlias.js b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.js new file mode 100644 index 00000000000..494603e286a --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.js @@ -0,0 +1,93 @@ +//// [declFileTypeAnnotationTypeAlias.ts] + +module M { + export type Value = string | number | boolean; + export var x: Value; + + export class c { + } + + export type C = c; + + export module m { + export class c { + } + } + + export type MC = m.c; + + export type fc = () => c; +} + +interface Window { + someMethod(); +} + +module M { + export type W = Window | string; + export module N { + export class Window { } + export var p: W; + } +} + +//// [declFileTypeAnnotationTypeAlias.js] +var M; +(function (M) { + M.x; + var c = (function () { + function c() { + } + return c; + })(); + M.c = c; + var m; + (function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; + })(m = M.m || (M.m = {})); +})(M || (M = {})); +var M; +(function (M) { + var N; + (function (N) { + var Window = (function () { + function Window() { + } + return Window; + })(); + N.Window = Window; + N.p; + })(N = M.N || (M.N = {})); +})(M || (M = {})); + + +//// [declFileTypeAnnotationTypeAlias.d.ts] +declare module M { + type Value = string | number | boolean; + var x: Value; + class c { + } + type C = c; + module m { + class c { + } + } + type MC = m.c; + type fc = () => c; +} +interface Window { + someMethod(): any; +} +declare module M { + type W = Window | string; + module N { + class Window { + } + var p: W; + } +} diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeAlias.types b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.types new file mode 100644 index 00000000000..aa475068bf0 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.types @@ -0,0 +1,63 @@ +=== tests/cases/compiler/declFileTypeAnnotationTypeAlias.ts === + +module M { +>M : typeof M + + export type Value = string | number | boolean; +>Value : string | number | boolean + + export var x: Value; +>x : string | number | boolean +>Value : string | number | boolean + + export class c { +>c : c + } + + export type C = c; +>C : c +>c : c + + export module m { +>m : typeof m + + export class c { +>c : c + } + } + + export type MC = m.c; +>MC : m.c +>m : unknown +>c : m.c + + export type fc = () => c; +>fc : () => c +>c : c +} + +interface Window { +>Window : Window + + someMethod(); +>someMethod : () => any +} + +module M { +>M : typeof M + + export type W = Window | string; +>W : string | Window +>Window : Window + + export module N { +>N : typeof N + + export class Window { } +>Window : Window + + export var p: W; +>p : string | Window +>W : string | Window + } +} diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.js b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.js new file mode 100644 index 00000000000..5e4a8ea714b --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.js @@ -0,0 +1,92 @@ +//// [declFileTypeAnnotationTypeLiteral.ts] + +class c { +} +class g { +} +module m { + export class c { + } +} + +// Object literal with everything +var x: { + // Call signatures + (a: number): c; + (a: string): g; + + // Construct signatures + new (a: number): c; + new (a: string): m.c; + + // Indexers + [n: number]: c; + [n: string]: c; + + // Properties + a: c; + b: g; + + // methods + m1(): g; + m2(a: string, b?: number, ...c: c[]): string; +}; + + +// Function type +var y: (a: string) => string; + +// constructor type +var z: new (a: string) => m.c; + +//// [declFileTypeAnnotationTypeLiteral.js] +var c = (function () { + function c() { + } + return c; +})(); +var g = (function () { + function g() { + } + return g; +})(); +var m; +(function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; +})(m || (m = {})); +// Object literal with everything +var x; +// Function type +var y; +// constructor type +var z; + + +//// [declFileTypeAnnotationTypeLiteral.d.ts] +declare class c { +} +declare class g { +} +declare module m { + class c { + } +} +declare var x: { + (a: number): c; + (a: string): g; + new (a: number): c; + new (a: string): m.c; + [n: number]: c; + [n: string]: c; + a: c; + b: g; + m1(): g; + m2(a: string, b?: number, ...c: c[]): string; +}; +declare var y: (a: string) => string; +declare var z: new (a: string) => m.c; diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.types b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.types new file mode 100644 index 00000000000..432ee1506fa --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.types @@ -0,0 +1,85 @@ +=== tests/cases/compiler/declFileTypeAnnotationTypeLiteral.ts === + +class c { +>c : c +} +class g { +>g : g +>T : T +} +module m { +>m : typeof m + + export class c { +>c : c + } +} + +// Object literal with everything +var x: { +>x : { (a: number): c; (a: string): g; new (a: number): c; new (a: string): m.c; [x: string]: c; [x: number]: c; a: c; b: g; m1(): g; m2(a: string, b?: number, ...c: c[]): string; } + + // Call signatures + (a: number): c; +>a : number +>c : c + + (a: string): g; +>a : string +>g : g + + // Construct signatures + new (a: number): c; +>a : number +>c : c + + new (a: string): m.c; +>a : string +>m : unknown +>c : m.c + + // Indexers + [n: number]: c; +>n : number +>c : c + + [n: string]: c; +>n : string +>c : c + + // Properties + a: c; +>a : c +>c : c + + b: g; +>b : g +>g : g + + // methods + m1(): g; +>m1 : () => g +>g : g + + m2(a: string, b?: number, ...c: c[]): string; +>m2 : (a: string, b?: number, ...c: c[]) => string +>a : string +>b : number +>c : c[] +>c : c + +}; + + +// Function type +var y: (a: string) => string; +>y : (a: string) => string +>a : string + +// constructor type +var z: new (a: string) => m.c; +>z : new (a: string) => m.c +>a : string +>m : unknown +>c : m.c + diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeQuery.js b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.js new file mode 100644 index 00000000000..28443bc04ad --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.js @@ -0,0 +1,120 @@ +//// [declFileTypeAnnotationTypeQuery.ts] + +class c { +} +module m { + export class c { + } + export class g { + } +} +class g { +} + +// Just the name +function foo(): typeof c { + return c; +} +function foo2() { + return c; +} + +// Qualified name +function foo3(): typeof m.c { + return m.c; +} +function foo4() { + return m.c; +} + +// Just the name with type arguments +function foo5(): typeof g { + return g; +} +function foo6() { + return g; +} + +// Qualified name with type arguments +function foo7(): typeof m.g { + return m.g +} +function foo8() { + return m.g +} + +//// [declFileTypeAnnotationTypeQuery.js] +var c = (function () { + function c() { + } + return c; +})(); +var m; +(function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; + var g = (function () { + function g() { + } + return g; + })(); + m.g = g; +})(m || (m = {})); +var g = (function () { + function g() { + } + return g; +})(); +// Just the name +function foo() { + return c; +} +function foo2() { + return c; +} +// Qualified name +function foo3() { + return m.c; +} +function foo4() { + return m.c; +} +// Just the name with type arguments +function foo5() { + return g; +} +function foo6() { + return g; +} +// Qualified name with type arguments +function foo7() { + return m.g; +} +function foo8() { + return m.g; +} + + +//// [declFileTypeAnnotationTypeQuery.d.ts] +declare class c { +} +declare module m { + class c { + } + class g { + } +} +declare class g { +} +declare function foo(): typeof c; +declare function foo2(): typeof c; +declare function foo3(): typeof m.c; +declare function foo4(): typeof m.c; +declare function foo5(): typeof g; +declare function foo6(): typeof g; +declare function foo7(): typeof m.g; +declare function foo8(): typeof m.g; diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeQuery.types b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.types new file mode 100644 index 00000000000..c7b5c421de1 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.types @@ -0,0 +1,90 @@ +=== tests/cases/compiler/declFileTypeAnnotationTypeQuery.ts === + +class c { +>c : c +} +module m { +>m : typeof m + + export class c { +>c : c + } + export class g { +>g : g +>T : T + } +} +class g { +>g : g +>T : T +} + +// Just the name +function foo(): typeof c { +>foo : () => typeof c +>c : typeof c + + return c; +>c : typeof c +} +function foo2() { +>foo2 : () => typeof c + + return c; +>c : typeof c +} + +// Qualified name +function foo3(): typeof m.c { +>foo3 : () => typeof m.c +>m : typeof m +>c : typeof m.c + + return m.c; +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c +} +function foo4() { +>foo4 : () => typeof m.c + + return m.c; +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c +} + +// Just the name with type arguments +function foo5(): typeof g { +>foo5 : () => typeof g +>g : typeof g + + return g; +>g : typeof g +} +function foo6() { +>foo6 : () => typeof g + + return g; +>g : typeof g +} + +// Qualified name with type arguments +function foo7(): typeof m.g { +>foo7 : () => typeof m.g +>m : typeof m +>g : typeof m.g + + return m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +} +function foo8() { +>foo8 : () => typeof m.g + + return m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +} diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeReference.js b/tests/baselines/reference/declFileTypeAnnotationTypeReference.js new file mode 100644 index 00000000000..3818f38d2c1 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeReference.js @@ -0,0 +1,120 @@ +//// [declFileTypeAnnotationTypeReference.ts] + +class c { +} +module m { + export class c { + } + export class g { + } +} +class g { +} + +// Just the name +function foo(): c { + return new c(); +} +function foo2() { + return new c(); +} + +// Qualified name +function foo3(): m.c { + return new m.c(); +} +function foo4() { + return new m.c(); +} + +// Just the name with type arguments +function foo5(): g { + return new g(); +} +function foo6() { + return new g(); +} + +// Qualified name with type arguments +function foo7(): m.g { + return new m.g(); +} +function foo8() { + return new m.g(); +} + +//// [declFileTypeAnnotationTypeReference.js] +var c = (function () { + function c() { + } + return c; +})(); +var m; +(function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; + var g = (function () { + function g() { + } + return g; + })(); + m.g = g; +})(m || (m = {})); +var g = (function () { + function g() { + } + return g; +})(); +// Just the name +function foo() { + return new c(); +} +function foo2() { + return new c(); +} +// Qualified name +function foo3() { + return new m.c(); +} +function foo4() { + return new m.c(); +} +// Just the name with type arguments +function foo5() { + return new g(); +} +function foo6() { + return new g(); +} +// Qualified name with type arguments +function foo7() { + return new m.g(); +} +function foo8() { + return new m.g(); +} + + +//// [declFileTypeAnnotationTypeReference.d.ts] +declare class c { +} +declare module m { + class c { + } + class g { + } +} +declare class g { +} +declare function foo(): c; +declare function foo2(): c; +declare function foo3(): m.c; +declare function foo4(): m.c; +declare function foo5(): g; +declare function foo6(): g; +declare function foo7(): m.g; +declare function foo8(): m.g; diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeReference.types b/tests/baselines/reference/declFileTypeAnnotationTypeReference.types new file mode 100644 index 00000000000..765c86c3415 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeReference.types @@ -0,0 +1,98 @@ +=== tests/cases/compiler/declFileTypeAnnotationTypeReference.ts === + +class c { +>c : c +} +module m { +>m : typeof m + + export class c { +>c : c + } + export class g { +>g : g +>T : T + } +} +class g { +>g : g +>T : T +} + +// Just the name +function foo(): c { +>foo : () => c +>c : c + + return new c(); +>new c() : c +>c : typeof c +} +function foo2() { +>foo2 : () => c + + return new c(); +>new c() : c +>c : typeof c +} + +// Qualified name +function foo3(): m.c { +>foo3 : () => m.c +>m : unknown +>c : m.c + + return new m.c(); +>new m.c() : m.c +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c +} +function foo4() { +>foo4 : () => m.c + + return new m.c(); +>new m.c() : m.c +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c +} + +// Just the name with type arguments +function foo5(): g { +>foo5 : () => g +>g : g + + return new g(); +>new g() : g +>g : typeof g +} +function foo6() { +>foo6 : () => g + + return new g(); +>new g() : g +>g : typeof g +} + +// Qualified name with type arguments +function foo7(): m.g { +>foo7 : () => m.g +>m : unknown +>g : m.g + + return new m.g(); +>new m.g() : m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +} +function foo8() { +>foo8 : () => m.g + + return new m.g(); +>new m.g() : m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +} diff --git a/tests/baselines/reference/declFileTypeAnnotationUnionType.js b/tests/baselines/reference/declFileTypeAnnotationUnionType.js new file mode 100644 index 00000000000..0a8e256ef28 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationUnionType.js @@ -0,0 +1,76 @@ +//// [declFileTypeAnnotationUnionType.ts] + +class c { + private p: string; +} +module m { + export class c { + private q: string; + } + export class g { + private r: string; + } +} +class g { + private s: string; +} + +// Just the name +var k: c | m.c = new c() || new m.c(); +var l = new c() || new m.c(); + +var x: g | m.g | (() => c) = new g() || new m.g() || (() => new c()); +var y = new g() || new m.g() || (() => new c()); + +//// [declFileTypeAnnotationUnionType.js] +var c = (function () { + function c() { + } + return c; +})(); +var m; +(function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; + var g = (function () { + function g() { + } + return g; + })(); + m.g = g; +})(m || (m = {})); +var g = (function () { + function g() { + } + return g; +})(); +// Just the name +var k = new c() || new m.c(); +var l = new c() || new m.c(); +var x = new g() || new m.g() || (function () { return new c(); }); +var y = new g() || new m.g() || (function () { return new c(); }); + + +//// [declFileTypeAnnotationUnionType.d.ts] +declare class c { + private p; +} +declare module m { + class c { + private q; + } + class g { + private r; + } +} +declare class g { + private s; +} +declare var k: c | m.c; +declare var l: c | m.c; +declare var x: g | m.g | (() => c); +declare var y: g | m.g | (() => c); diff --git a/tests/baselines/reference/declFileTypeAnnotationUnionType.types b/tests/baselines/reference/declFileTypeAnnotationUnionType.types new file mode 100644 index 00000000000..1dce3690bf8 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationUnionType.types @@ -0,0 +1,91 @@ +=== tests/cases/compiler/declFileTypeAnnotationUnionType.ts === + +class c { +>c : c + + private p: string; +>p : string +} +module m { +>m : typeof m + + export class c { +>c : c + + private q: string; +>q : string + } + export class g { +>g : g +>T : T + + private r: string; +>r : string + } +} +class g { +>g : g +>T : T + + private s: string; +>s : string +} + +// Just the name +var k: c | m.c = new c() || new m.c(); +>k : c | m.c +>c : c +>m : unknown +>c : m.c +>new c() || new m.c() : c | m.c +>new c() : c +>c : typeof c +>new m.c() : m.c +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c + +var l = new c() || new m.c(); +>l : c | m.c +>new c() || new m.c() : c | m.c +>new c() : c +>c : typeof c +>new m.c() : m.c +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c + +var x: g | m.g | (() => c) = new g() || new m.g() || (() => new c()); +>x : g | m.g | (() => c) +>g : g +>m : unknown +>g : m.g +>c : c +>new g() || new m.g() || (() => new c()) : g | m.g | (() => c) +>new g() || new m.g() : g | m.g +>new g() : g +>g : typeof g +>new m.g() : m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +>(() => new c()) : () => c +>() => new c() : () => c +>new c() : c +>c : typeof c + +var y = new g() || new m.g() || (() => new c()); +>y : g | m.g | (() => c) +>new g() || new m.g() || (() => new c()) : g | m.g | (() => c) +>new g() || new m.g() : g | m.g +>new g() : g +>g : typeof g +>new m.g() : m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +>(() => new c()) : () => c +>() => new c() : () => c +>new c() : c +>c : typeof c + diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.errors.txt new file mode 100644 index 00000000000..b6130864d8b --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.errors.txt @@ -0,0 +1,133 @@ +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(16,21): error TS4043: Return type of public property getter from exported class has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(21,13): error TS4043: Return type of public property getter from exported class has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(26,25): error TS4037: Parameter 'foo3' of public property setter from exported class has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(33,25): error TS4037: Parameter 'foo4' of public property setter from exported class has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(37,21): error TS4043: Return type of public property getter from exported class has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(72,23): error TS4043: Return type of public property getter from exported class has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(77,13): error TS4042: Return type of public property getter from exported class has or is using name 'm2.public2' from private module 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(82,27): error TS4037: Parameter 'foo113' of public property setter from exported class has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(89,27): error TS4037: Parameter 'foo114' of public property setter from exported class has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(93,23): error TS4043: Return type of public property getter from exported class has or is using private name 'm2'. + + +==== tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts (10 errors) ==== + + module m { + class private1 { + } + + export class public1 { + } + + module m2 { + export class public2 { + } + } + + export class c { + // getter with annotation + get foo1(): private1 { + ~~~~~~~~ +!!! error TS4043: Return type of public property getter from exported class has or is using private name 'private1'. + return; + } + + // getter without annotation + get foo2() { + ~~~~ +!!! error TS4043: Return type of public property getter from exported class has or is using private name 'private1'. + return new private1(); + } + + // setter with annotation + set foo3(param: private1) { + ~~~~~~~~ +!!! error TS4037: Parameter 'foo3' of public property setter from exported class has or is using private name 'private1'. + } + + // Both - getter without annotation, setter with annotation + get foo4() { + return new private1(); + } + set foo4(param: private1) { + ~~~~~~~~ +!!! error TS4037: Parameter 'foo4' of public property setter from exported class has or is using private name 'private1'. + } + + // Both - with annotation + get foo5(): private1 { + ~~~~~~~~ +!!! error TS4043: Return type of public property getter from exported class has or is using private name 'private1'. + return; + } + set foo5(param: private1) { + } + + // getter with annotation + get foo11(): public1 { + return; + } + + // getter without annotation + get foo12() { + return new public1(); + } + + // setter with annotation + set foo13(param: public1) { + } + + // Both - getter without annotation, setter with annotation + get foo14() { + return new public1(); + } + set foo14(param: public1) { + } + + // Both - with annotation + get foo15(): public1 { + return; + } + set foo15(param: public1) { + } + + // getter with annotation + get foo111(): m2.public2 { + ~~ +!!! error TS4043: Return type of public property getter from exported class has or is using private name 'm2'. + return; + } + + // getter without annotation + get foo112() { + ~~~~~~ +!!! error TS4042: Return type of public property getter from exported class has or is using name 'm2.public2' from private module 'm2'. + return new m2.public2(); + } + + // setter with annotation + set foo113(param: m2.public2) { + ~~ +!!! error TS4037: Parameter 'foo113' of public property setter from exported class has or is using private name 'm2'. + } + + // Both - getter without annotation, setter with annotation + get foo114() { + return new m2.public2(); + } + set foo114(param: m2.public2) { + ~~ +!!! error TS4037: Parameter 'foo114' of public property setter from exported class has or is using private name 'm2'. + } + + // Both - with annotation + get foo115(): m2.public2 { + ~~ +!!! error TS4043: Return type of public property getter from exported class has or is using private name 'm2'. + return; + } + set foo115(param: m2.public2) { + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.js new file mode 100644 index 00000000000..f7dc7a18260 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.js @@ -0,0 +1,261 @@ +//// [declFileTypeAnnotationVisibilityErrorAccessors.ts] + +module m { + class private1 { + } + + export class public1 { + } + + module m2 { + export class public2 { + } + } + + export class c { + // getter with annotation + get foo1(): private1 { + return; + } + + // getter without annotation + get foo2() { + return new private1(); + } + + // setter with annotation + set foo3(param: private1) { + } + + // Both - getter without annotation, setter with annotation + get foo4() { + return new private1(); + } + set foo4(param: private1) { + } + + // Both - with annotation + get foo5(): private1 { + return; + } + set foo5(param: private1) { + } + + // getter with annotation + get foo11(): public1 { + return; + } + + // getter without annotation + get foo12() { + return new public1(); + } + + // setter with annotation + set foo13(param: public1) { + } + + // Both - getter without annotation, setter with annotation + get foo14() { + return new public1(); + } + set foo14(param: public1) { + } + + // Both - with annotation + get foo15(): public1 { + return; + } + set foo15(param: public1) { + } + + // getter with annotation + get foo111(): m2.public2 { + return; + } + + // getter without annotation + get foo112() { + return new m2.public2(); + } + + // setter with annotation + set foo113(param: m2.public2) { + } + + // Both - getter without annotation, setter with annotation + get foo114() { + return new m2.public2(); + } + set foo114(param: m2.public2) { + } + + // Both - with annotation + get foo115(): m2.public2 { + return; + } + set foo115(param: m2.public2) { + } + } +} + + +//// [declFileTypeAnnotationVisibilityErrorAccessors.js] +var m; +(function (m) { + var private1 = (function () { + function private1() { + } + return private1; + })(); + var public1 = (function () { + function public1() { + } + return public1; + })(); + m.public1 = public1; + var m2; + (function (m2) { + var public2 = (function () { + function public2() { + } + return public2; + })(); + m2.public2 = public2; + })(m2 || (m2 = {})); + var c = (function () { + function c() { + } + Object.defineProperty(c.prototype, "foo1", { + // getter with annotation + get: function () { + return; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo2", { + // getter without annotation + get: function () { + return new private1(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo3", { + // setter with annotation + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo4", { + // Both - getter without annotation, setter with annotation + get: function () { + return new private1(); + }, + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo5", { + // Both - with annotation + get: function () { + return; + }, + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo11", { + // getter with annotation + get: function () { + return; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo12", { + // getter without annotation + get: function () { + return new public1(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo13", { + // setter with annotation + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo14", { + // Both - getter without annotation, setter with annotation + get: function () { + return new public1(); + }, + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo15", { + // Both - with annotation + get: function () { + return; + }, + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo111", { + // getter with annotation + get: function () { + return; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo112", { + // getter without annotation + get: function () { + return new m2.public2(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo113", { + // setter with annotation + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo114", { + // Both - getter without annotation, setter with annotation + get: function () { + return new m2.public2(); + }, + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo115", { + // Both - with annotation + get: function () { + return; + }, + set: function (param) { + }, + enumerable: true, + configurable: true + }); + return c; + })(); + m.c = c; +})(m || (m = {})); diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.errors.txt new file mode 100644 index 00000000000..7dbe3617de9 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.errors.txt @@ -0,0 +1,60 @@ +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts(15,34): error TS4078: Parameter 'param' of exported function has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts(17,26): error TS4078: Parameter 'param' of exported function has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts(40,35): error TS4078: Parameter 'param' of exported function has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts(42,28): error TS4077: Parameter 'param' of exported function has or is using name 'm2.public2' from private module 'm2'. + + +==== tests/cases/compiler/declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts (4 errors) ==== + + module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + function foo1(param: private1) { + } + function foo2(param = new private1()) { + } + + export function foo3(param : private1) { + ~~~~~~~~ +!!! error TS4078: Parameter 'param' of exported function has or is using private name 'private1'. + } + export function foo4(param = new private1()) { + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4078: Parameter 'param' of exported function has or is using private name 'private1'. + } + + function foo11(param: public1) { + } + function foo12(param = new public1()) { + } + + export function foo13(param: public1) { + } + export function foo14(param = new public1()) { + } + + module m2 { + export class public2 { + } + } + + function foo111(param: m2.public2) { + } + function foo112(param = new m2.public2()) { + } + + export function foo113(param: m2.public2) { + ~~ +!!! error TS4078: Parameter 'param' of exported function has or is using private name 'm2'. + } + export function foo114(param = new m2.public2()) { + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4077: Parameter 'param' of exported function has or is using name 'm2.public2' from private module 'm2'. + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.js new file mode 100644 index 00000000000..4f66f0c8c7f --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.js @@ -0,0 +1,108 @@ +//// [declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts] + +module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + function foo1(param: private1) { + } + function foo2(param = new private1()) { + } + + export function foo3(param : private1) { + } + export function foo4(param = new private1()) { + } + + function foo11(param: public1) { + } + function foo12(param = new public1()) { + } + + export function foo13(param: public1) { + } + export function foo14(param = new public1()) { + } + + module m2 { + export class public2 { + } + } + + function foo111(param: m2.public2) { + } + function foo112(param = new m2.public2()) { + } + + export function foo113(param: m2.public2) { + } + export function foo114(param = new m2.public2()) { + } +} + + +//// [declFileTypeAnnotationVisibilityErrorParameterOfFunction.js] +var m; +(function (m) { + var private1 = (function () { + function private1() { + } + return private1; + })(); + var public1 = (function () { + function public1() { + } + return public1; + })(); + m.public1 = public1; + // Directly using names from this module + function foo1(param) { + } + function foo2(param) { + if (param === void 0) { param = new private1(); } + } + function foo3(param) { + } + m.foo3 = foo3; + function foo4(param) { + if (param === void 0) { param = new private1(); } + } + m.foo4 = foo4; + function foo11(param) { + } + function foo12(param) { + if (param === void 0) { param = new public1(); } + } + function foo13(param) { + } + m.foo13 = foo13; + function foo14(param) { + if (param === void 0) { param = new public1(); } + } + m.foo14 = foo14; + var m2; + (function (m2) { + var public2 = (function () { + function public2() { + } + return public2; + })(); + m2.public2 = public2; + })(m2 || (m2 = {})); + function foo111(param) { + } + function foo112(param) { + if (param === void 0) { param = new m2.public2(); } + } + function foo113(param) { + } + m.foo113 = foo113; + function foo114(param) { + if (param === void 0) { param = new m2.public2(); } + } + m.foo114 = foo114; +})(m || (m = {})); diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.errors.txt new file mode 100644 index 00000000000..449af75bf61 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.errors.txt @@ -0,0 +1,72 @@ +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts(17,29): error TS4060: Return type of exported function has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts(20,21): error TS4060: Return type of exported function has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts(50,31): error TS4060: Return type of exported function has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts(53,21): error TS4059: Return type of exported function has or is using name 'm2.public2' from private module 'm2'. + + +==== tests/cases/compiler/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts (4 errors) ==== + + module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + function foo1(): private1 { + return; + } + function foo2() { + return new private1(); + } + + export function foo3(): private1 { + ~~~~~~~~ +!!! error TS4060: Return type of exported function has or is using private name 'private1'. + return; + } + export function foo4() { + ~~~~ +!!! error TS4060: Return type of exported function has or is using private name 'private1'. + return new private1(); + } + + function foo11(): public1 { + return; + } + function foo12() { + return new public1(); + } + + export function foo13(): public1 { + return; + } + export function foo14() { + return new public1(); + } + + module m2 { + export class public2 { + } + } + + function foo111(): m2.public2 { + return; + } + function foo112() { + return new m2.public2(); + } + + export function foo113(): m2.public2 { + ~~ +!!! error TS4060: Return type of exported function has or is using private name 'm2'. + return; + } + export function foo114() { + ~~~~~~ +!!! error TS4059: Return type of exported function has or is using name 'm2.public2' from private module 'm2'. + return new m2.public2(); + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.js new file mode 100644 index 00000000000..e12d9ebca63 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.js @@ -0,0 +1,126 @@ +//// [declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts] + +module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + function foo1(): private1 { + return; + } + function foo2() { + return new private1(); + } + + export function foo3(): private1 { + return; + } + export function foo4() { + return new private1(); + } + + function foo11(): public1 { + return; + } + function foo12() { + return new public1(); + } + + export function foo13(): public1 { + return; + } + export function foo14() { + return new public1(); + } + + module m2 { + export class public2 { + } + } + + function foo111(): m2.public2 { + return; + } + function foo112() { + return new m2.public2(); + } + + export function foo113(): m2.public2 { + return; + } + export function foo114() { + return new m2.public2(); + } +} + + +//// [declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.js] +var m; +(function (m) { + var private1 = (function () { + function private1() { + } + return private1; + })(); + var public1 = (function () { + function public1() { + } + return public1; + })(); + m.public1 = public1; + // Directly using names from this module + function foo1() { + return; + } + function foo2() { + return new private1(); + } + function foo3() { + return; + } + m.foo3 = foo3; + function foo4() { + return new private1(); + } + m.foo4 = foo4; + function foo11() { + return; + } + function foo12() { + return new public1(); + } + function foo13() { + return; + } + m.foo13 = foo13; + function foo14() { + return new public1(); + } + m.foo14 = foo14; + var m2; + (function (m2) { + var public2 = (function () { + function public2() { + } + return public2; + })(); + m2.public2 = public2; + })(m2 || (m2 = {})); + function foo111() { + return; + } + function foo112() { + return new m2.public2(); + } + function foo113() { + return; + } + m.foo113 = foo113; + function foo114() { + return new m2.public2(); + } + m.foo114 = foo114; +})(m || (m = {})); diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.errors.txt new file mode 100644 index 00000000000..a9fd72ae569 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.errors.txt @@ -0,0 +1,56 @@ +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts(10,23): error TS4025: Exported variable 'p' has or is using private name 'W'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts(33,22): error TS4081: Exported type alias 't2' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts(36,23): error TS4081: Exported type alias 't12' has or is using private name 'public1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts(39,24): error TS4081: Exported type alias 't112' has or is using private name 'm3'. + + +==== tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts (4 errors) ==== + + interface Window { + someMethod(); + } + + module M { + type W = Window | string; + export module N { + export class Window { } + export var p: W; // Should report error that W is private + ~ +!!! error TS4025: Exported variable 'p' has or is using private name 'W'. + } + } + + module M1 { + export type W = Window | string; + export module N { + export class Window { } + export var p: W; // No error + } + } + + module M2 { + class private1 { + } + class public1 { + } + module m3 { + export class public1 { + } + } + + type t1 = private1; + export type t2 = private1; // error + ~~~~~~~~ +!!! error TS4081: Exported type alias 't2' has or is using private name 'private1'. + + type t11 = public1; + export type t12 = public1; + ~~~~~~~ +!!! error TS4081: Exported type alias 't12' has or is using private name 'public1'. + + type t111 = m3.public1; + export type t112 = m3.public1; // error + ~~ +!!! error TS4081: Exported type alias 't112' has or is using private name 'm3'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.js new file mode 100644 index 00000000000..ec653c84dc9 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.js @@ -0,0 +1,92 @@ +//// [declFileTypeAnnotationVisibilityErrorTypeAlias.ts] + +interface Window { + someMethod(); +} + +module M { + type W = Window | string; + export module N { + export class Window { } + export var p: W; // Should report error that W is private + } +} + +module M1 { + export type W = Window | string; + export module N { + export class Window { } + export var p: W; // No error + } +} + +module M2 { + class private1 { + } + class public1 { + } + module m3 { + export class public1 { + } + } + + type t1 = private1; + export type t2 = private1; // error + + type t11 = public1; + export type t12 = public1; + + type t111 = m3.public1; + export type t112 = m3.public1; // error +} + + +//// [declFileTypeAnnotationVisibilityErrorTypeAlias.js] +var M; +(function (M) { + var N; + (function (N) { + var Window = (function () { + function Window() { + } + return Window; + })(); + N.Window = Window; + N.p; // Should report error that W is private + })(N = M.N || (M.N = {})); +})(M || (M = {})); +var M1; +(function (M1) { + var N; + (function (N) { + var Window = (function () { + function Window() { + } + return Window; + })(); + N.Window = Window; + N.p; // No error + })(N = M1.N || (M1.N = {})); +})(M1 || (M1 = {})); +var M2; +(function (M2) { + var private1 = (function () { + function private1() { + } + return private1; + })(); + var public1 = (function () { + function public1() { + } + return public1; + })(); + var m3; + (function (m3) { + var public1 = (function () { + function public1() { + } + return public1; + })(); + m3.public1 = public1; + })(m3 || (m3 = {})); +})(M2 || (M2 = {})); diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.errors.txt new file mode 100644 index 00000000000..8cba0d12464 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.errors.txt @@ -0,0 +1,91 @@ +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(11,12): error TS4025: Exported variable 'x' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(12,12): error TS4025: Exported variable 'x' has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(13,13): error TS4025: Exported variable 'x' has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(14,19): error TS4025: Exported variable 'x' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(15,22): error TS4025: Exported variable 'x' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(16,22): error TS4025: Exported variable 'x' has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(18,16): error TS4024: Exported variable 'x2' has or is using name 'm2.public1' from private module 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(18,16): error TS4025: Exported variable 'x2' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(25,16): error TS4024: Exported variable 'x3' has or is using name 'm2.public1' from private module 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(25,16): error TS4025: Exported variable 'x3' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(28,23): error TS4025: Exported variable 'y' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(28,36): error TS4025: Exported variable 'y' has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(29,16): error TS4024: Exported variable 'y2' has or is using name 'm2.public1' from private module 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(29,16): error TS4025: Exported variable 'y2' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(32,27): error TS4025: Exported variable 'z' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(32,40): error TS4025: Exported variable 'z' has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(33,16): error TS4024: Exported variable 'z2' has or is using name 'm2.public1' from private module 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(33,16): error TS4025: Exported variable 'z2' has or is using private name 'private1'. + + +==== tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts (18 errors) ==== + + module m { + class private1 { + } + module m2 { + export class public1 { + } + } + + export var x: { + x: private1; + ~~~~~~~~ +!!! error TS4025: Exported variable 'x' has or is using private name 'private1'. + y: m2.public1; + ~~ +!!! error TS4025: Exported variable 'x' has or is using private name 'm2'. + (): m2.public1[]; + ~~ +!!! error TS4025: Exported variable 'x' has or is using private name 'm2'. + method(): private1; + ~~~~~~~~ +!!! error TS4025: Exported variable 'x' has or is using private name 'private1'. + [n: number]: private1; + ~~~~~~~~ +!!! error TS4025: Exported variable 'x' has or is using private name 'private1'. + [s: string]: m2.public1; + ~~ +!!! error TS4025: Exported variable 'x' has or is using private name 'm2'. + }; + export var x2 = { + ~~ +!!! error TS4024: Exported variable 'x2' has or is using name 'm2.public1' from private module 'm2'. + ~~ +!!! error TS4025: Exported variable 'x2' has or is using private name 'private1'. + x: new private1(), + y: new m2.public1(), + method() { + return new private1(); + } + }; + export var x3 = x; + ~~ +!!! error TS4024: Exported variable 'x3' has or is using name 'm2.public1' from private module 'm2'. + ~~ +!!! error TS4025: Exported variable 'x3' has or is using private name 'private1'. + + // Function type + export var y: (a: private1) => m2.public1; + ~~~~~~~~ +!!! error TS4025: Exported variable 'y' has or is using private name 'private1'. + ~~ +!!! error TS4025: Exported variable 'y' has or is using private name 'm2'. + export var y2 = y; + ~~ +!!! error TS4024: Exported variable 'y2' has or is using name 'm2.public1' from private module 'm2'. + ~~ +!!! error TS4025: Exported variable 'y2' has or is using private name 'private1'. + + // constructor type + export var z: new (a: private1) => m2.public1; + ~~~~~~~~ +!!! error TS4025: Exported variable 'z' has or is using private name 'private1'. + ~~ +!!! error TS4025: Exported variable 'z' has or is using private name 'm2'. + export var z2 = z; + ~~ +!!! error TS4024: Exported variable 'z2' has or is using name 'm2.public1' from private module 'm2'. + ~~ +!!! error TS4025: Exported variable 'z2' has or is using private name 'private1'. + } \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.js new file mode 100644 index 00000000000..f6bd1689e60 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.js @@ -0,0 +1,69 @@ +//// [declFileTypeAnnotationVisibilityErrorTypeLiteral.ts] + +module m { + class private1 { + } + module m2 { + export class public1 { + } + } + + export var x: { + x: private1; + y: m2.public1; + (): m2.public1[]; + method(): private1; + [n: number]: private1; + [s: string]: m2.public1; + }; + export var x2 = { + x: new private1(), + y: new m2.public1(), + method() { + return new private1(); + } + }; + export var x3 = x; + + // Function type + export var y: (a: private1) => m2.public1; + export var y2 = y; + + // constructor type + export var z: new (a: private1) => m2.public1; + export var z2 = z; +} + +//// [declFileTypeAnnotationVisibilityErrorTypeLiteral.js] +var m; +(function (m) { + var private1 = (function () { + function private1() { + } + return private1; + })(); + var m2; + (function (m2) { + var public1 = (function () { + function public1() { + } + return public1; + })(); + m2.public1 = public1; + })(m2 || (m2 = {})); + m.x; + m.x2 = { + x: new private1(), + y: new m2.public1(), + method: function () { + return new private1(); + } + }; + m.x3 = m.x; + // Function type + m.y; + m.y2 = m.y; + // constructor type + m.z; + m.z2 = m.z; +})(m || (m = {})); diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.errors.txt new file mode 100644 index 00000000000..33771b85dd4 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.errors.txt @@ -0,0 +1,48 @@ +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts(13,19): error TS4025: Exported variable 'k' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts(14,16): error TS4025: Exported variable 'l' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts(30,20): error TS4025: Exported variable 'k3' has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts(31,16): error TS4024: Exported variable 'l3' has or is using name 'm2.public2' from private module 'm2'. + + +==== tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts (4 errors) ==== + + module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + var x: private1; + var y = new private1(); + + export var k: private1; + ~~~~~~~~ +!!! error TS4025: Exported variable 'k' has or is using private name 'private1'. + export var l = new private1(); + ~ +!!! error TS4025: Exported variable 'l' has or is using private name 'private1'. + + var x2: public1; + var y2 = new public1(); + + export var k2: public1; + export var l2 = new public1(); + + module m2 { + export class public2 { + } + } + + var x3: m2.public2; + var y3 = new m2.public2(); + + export var k3: m2.public2; + ~~ +!!! error TS4025: Exported variable 'k3' has or is using private name 'm2'. + export var l3 = new m2.public2(); + ~~ +!!! error TS4024: Exported variable 'l3' has or is using name 'm2.public2' from private module 'm2'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.js new file mode 100644 index 00000000000..a097ac159db --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.js @@ -0,0 +1,72 @@ +//// [declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts] + +module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + var x: private1; + var y = new private1(); + + export var k: private1; + export var l = new private1(); + + var x2: public1; + var y2 = new public1(); + + export var k2: public1; + export var l2 = new public1(); + + module m2 { + export class public2 { + } + } + + var x3: m2.public2; + var y3 = new m2.public2(); + + export var k3: m2.public2; + export var l3 = new m2.public2(); +} + + +//// [declFileTypeAnnotationVisibilityErrorVariableDeclaration.js] +var m; +(function (m) { + var private1 = (function () { + function private1() { + } + return private1; + })(); + var public1 = (function () { + function public1() { + } + return public1; + })(); + m.public1 = public1; + // Directly using names from this module + var x; + var y = new private1(); + m.k; + m.l = new private1(); + var x2; + var y2 = new public1(); + m.k2; + m.l2 = new public1(); + var m2; + (function (m2) { + var public2 = (function () { + function public2() { + } + return public2; + })(); + m2.public2 = public2; + })(m2 || (m2 = {})); + var x3; + var y3 = new m2.public2(); + m.k3; + m.l3 = new m2.public2(); +})(m || (m = {})); diff --git a/tests/baselines/reference/declFileTypeofFunction.js b/tests/baselines/reference/declFileTypeofFunction.js index ea876e6dad8..2af519f411d 100644 --- a/tests/baselines/reference/declFileTypeofFunction.js +++ b/tests/baselines/reference/declFileTypeofFunction.js @@ -68,7 +68,7 @@ declare function f(n: typeof f): string; declare function f(n: typeof g): string; declare function g(n: typeof g): number; declare function g(n: typeof f): number; -declare var b: () => any; +declare var b: () => typeof b; declare function b1(): typeof b1; declare function foo(): typeof foo; declare var foo1: typeof foo; diff --git a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js index 0bcbf2fff68..7da7dd8716a 100644 --- a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js +++ b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js @@ -78,7 +78,7 @@ declare module X.Y.base { } } declare module X.Y.base.Z { - class W extends base.W { + class W extends X.Y.base.W { value: boolean; } } diff --git a/tests/baselines/reference/declInput-2.errors.txt b/tests/baselines/reference/declInput-2.errors.txt index ed0be8f64e5..f151f3e7122 100644 --- a/tests/baselines/reference/declInput-2.errors.txt +++ b/tests/baselines/reference/declInput-2.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/declInput-2.ts(10,9): error TS4031: Public property 'm22' of exported class has or is using private name 'C'. -tests/cases/compiler/declInput-2.ts(13,9): error TS4031: Public property 'm25' of exported class has or is using private name 'I2'. -tests/cases/compiler/declInput-2.ts(16,16): error TS4055: Return type of public method from exported class has or is using private name 'I2'. -tests/cases/compiler/declInput-2.ts(18,21): error TS4073: Parameter 'i' of public method from exported class has or is using private name 'I2'. -tests/cases/compiler/declInput-2.ts(19,16): error TS4055: Return type of public method from exported class has or is using private name 'C'. +tests/cases/compiler/declInput-2.ts(10,21): error TS4031: Public property 'm22' of exported class has or is using private name 'C'. +tests/cases/compiler/declInput-2.ts(13,21): error TS4031: Public property 'm25' of exported class has or is using private name 'I2'. +tests/cases/compiler/declInput-2.ts(16,24): error TS4055: Return type of public method from exported class has or is using private name 'I2'. +tests/cases/compiler/declInput-2.ts(18,23): error TS4073: Parameter 'i' of public method from exported class has or is using private name 'I2'. +tests/cases/compiler/declInput-2.ts(19,21): error TS4055: Return type of public method from exported class has or is using private name 'C'. ==== tests/cases/compiler/declInput-2.ts (5 errors) ==== @@ -16,24 +16,24 @@ tests/cases/compiler/declInput-2.ts(19,16): error TS4055: Return type of public public m1: number; public m2: string; public m22: C; // don't generate - ~~~~~~~~~~~~~~ + ~ !!! error TS4031: Public property 'm22' of exported class has or is using private name 'C'. public m23: E; public m24: I1; public m25: I2; // don't generate - ~~~~~~~~~~~~~~~ + ~~ !!! error TS4031: Public property 'm25' of exported class has or is using private name 'I2'. public m232(): E { return null;} public m242(): I1 { return null; } public m252(): I2 { return null; } // don't generate - ~~~~ + ~~ !!! error TS4055: Return type of public method from exported class has or is using private name 'I2'. public m26(i:I1) {} public m262(i:I2) {} - ~~~~ + ~~ !!! error TS4073: Parameter 'i' of public method from exported class has or is using private name 'I2'. public m3():C { return new C(); } - ~~ + ~ !!! error TS4055: Return type of public method from exported class has or is using private name 'C'. } } \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmit_nameConflicts.js b/tests/baselines/reference/declarationEmit_nameConflicts.js index ab2e5fce42a..161224659f1 100644 --- a/tests/baselines/reference/declarationEmit_nameConflicts.js +++ b/tests/baselines/reference/declarationEmit_nameConflicts.js @@ -184,7 +184,7 @@ export declare module M.Q { interface I { } } - interface b extends M.C { + interface b extends M.b { } interface I extends M.c.I { } diff --git a/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.js b/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.js index f58b1047b8f..a959e52bdae 100644 --- a/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.js +++ b/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.js @@ -11,4 +11,6 @@ function foo(args) { //// [functionDeclarationWithArgumentOfTypeFunctionTypeArray.d.ts] -declare function foo(args: ((x: any) => number)[]): number; +declare function foo(args: { + (x): number; +}[]): number; diff --git a/tests/baselines/reference/privacyAccessorDeclFile.errors.txt b/tests/baselines/reference/privacyAccessorDeclFile.errors.txt index 59c460d4800..debb5808493 100644 --- a/tests/baselines/reference/privacyAccessorDeclFile.errors.txt +++ b/tests/baselines/reference/privacyAccessorDeclFile.errors.txt @@ -1,39 +1,39 @@ -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(253,20): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(259,13): error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(253,44): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(259,31): error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(265,20): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(271,13): error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(361,41): error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(365,28): error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(405,20): error TS4039: Return type of public static property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(408,13): error TS4042: Return type of public property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(361,48): error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(365,35): error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(405,44): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(408,31): error TS4043: Return type of public property getter from exported class has or is using private name 'privateModule'. tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(411,20): error TS4039: Return type of public static property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(414,13): error TS4042: Return type of public property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(420,41): error TS4036: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(422,28): error TS4036: Parameter 'myPublicMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(9,16): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(15,9): error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(420,48): error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(422,35): error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(9,40): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(15,27): error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(21,16): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(27,9): error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(117,37): error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(121,24): error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(161,16): error TS4039: Return type of public static property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(164,9): error TS4042: Return type of public property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(117,44): error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(121,31): error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(161,40): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(164,27): error TS4043: Return type of public property getter from exported class has or is using private name 'privateModule'. tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(167,16): error TS4039: Return type of public static property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(170,9): error TS4042: Return type of public property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(176,37): error TS4036: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(178,24): error TS4036: Parameter 'myPublicMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(211,20): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(217,13): error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(176,44): error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(178,31): error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(211,44): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(217,31): error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(223,20): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(229,13): error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(319,41): error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(323,28): error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(363,20): error TS4039: Return type of public static property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(366,13): error TS4042: Return type of public property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(319,48): error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(323,35): error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(363,44): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(366,31): error TS4043: Return type of public property getter from exported class has or is using private name 'privateModule'. tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(369,20): error TS4039: Return type of public static property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(372,13): error TS4042: Return type of public property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(378,41): error TS4036: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS4036: Parameter 'myPublicMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(378,48): error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,35): error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts (24 errors) ==== @@ -46,7 +46,7 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS export class publicClassWithWithPrivateGetAccessorTypes { static get myPublicStaticMethod(): privateClass { // Error - ~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. return null; } @@ -54,7 +54,7 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS return null; } get myPublicMethod(): privateClass { // Error - ~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. return null; } @@ -162,13 +162,13 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS export class publicClassWithWithPrivateSetAccessorTypes { static set myPublicStaticMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateClass'. } private static set myPrivateStaticMethod(param: privateClass) { } set myPublicMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateClass'. } private set myPrivateMethod(param: privateClass) { @@ -210,13 +210,13 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS export class publicClassWithPrivateModuleGetAccessorTypes { static get myPublicStaticMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS4039: Return type of public static property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4040: Return type of public static property getter from exported class has or is using private name 'privateModule'. return null; } get myPublicMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~ -!!! error TS4042: Return type of public property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4043: Return type of public property getter from exported class has or is using private name 'privateModule'. return null; } static get myPublicStaticMethod1() { // Error @@ -233,12 +233,12 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS export class publicClassWithPrivateModuleSetAccessorTypes { static set myPublicStaticMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4036: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateModule'. } set myPublicMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4036: Parameter 'myPublicMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateModule'. } } @@ -272,7 +272,7 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS } export class publicClassWithWithPrivateGetAccessorTypes { static get myPublicStaticMethod(): privateClass { // Error - ~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. return null; } @@ -280,7 +280,7 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS return null; } get myPublicMethod(): privateClass { // Error - ~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. return null; } @@ -388,13 +388,13 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS export class publicClassWithWithPrivateSetAccessorTypes { static set myPublicStaticMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateClass'. } private static set myPrivateStaticMethod(param: privateClass) { } set myPublicMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateClass'. } private set myPrivateMethod(param: privateClass) { @@ -436,13 +436,13 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS export class publicClassWithPrivateModuleGetAccessorTypes { static get myPublicStaticMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS4039: Return type of public static property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4040: Return type of public static property getter from exported class has or is using private name 'privateModule'. return null; } get myPublicMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~ -!!! error TS4042: Return type of public property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4043: Return type of public property getter from exported class has or is using private name 'privateModule'. return null; } static get myPublicStaticMethod1() { // Error @@ -459,12 +459,12 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS export class publicClassWithPrivateModuleSetAccessorTypes { static set myPublicStaticMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4036: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateModule'. } set myPublicMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4036: Parameter 'myPublicMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateModule'. } } @@ -948,7 +948,7 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS export class publicClassWithWithPrivateGetAccessorTypes { static get myPublicStaticMethod(): privateClass { // Error - ~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. return null; } @@ -956,7 +956,7 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS return null; } get myPublicMethod(): privateClass { // Error - ~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. return null; } @@ -1064,13 +1064,13 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS export class publicClassWithWithPrivateSetAccessorTypes { static set myPublicStaticMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateClass'. } private static set myPrivateStaticMethod(param: privateClass) { } set myPublicMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateClass'. } private set myPrivateMethod(param: privateClass) { @@ -1112,13 +1112,13 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS export class publicClassWithPrivateModuleGetAccessorTypes { static get myPublicStaticMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS4039: Return type of public static property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4040: Return type of public static property getter from exported class has or is using private name 'privateModule'. return null; } get myPublicMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~ -!!! error TS4042: Return type of public property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4043: Return type of public property getter from exported class has or is using private name 'privateModule'. return null; } static get myPublicStaticMethod1() { // Error @@ -1135,12 +1135,12 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS export class publicClassWithPrivateModuleSetAccessorTypes { static set myPublicStaticMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4036: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateModule'. } set myPublicMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4036: Parameter 'myPublicMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateModule'. } } diff --git a/tests/baselines/reference/privacyCheckTypeOfFunction.errors.txt b/tests/baselines/reference/privacyCheckTypeOfFunction.errors.txt index 5f2a0adc9e0..88801e06dfd 100644 --- a/tests/baselines/reference/privacyCheckTypeOfFunction.errors.txt +++ b/tests/baselines/reference/privacyCheckTypeOfFunction.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/privacyCheckTypeOfFunction.ts(3,12): error TS4025: Exported variable 'x' has or is using private name 'foo'. +tests/cases/compiler/privacyCheckTypeOfFunction.ts(3,22): error TS4025: Exported variable 'x' has or is using private name 'foo'. tests/cases/compiler/privacyCheckTypeOfFunction.ts(4,12): error TS4025: Exported variable 'b' has or is using private name 'foo'. @@ -6,7 +6,7 @@ tests/cases/compiler/privacyCheckTypeOfFunction.ts(4,12): error TS4025: Exported function foo() { } export var x: typeof foo; - ~ + ~~~ !!! error TS4025: Exported variable 'x' has or is using private name 'foo'. export var b = foo; ~ diff --git a/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleError.errors.txt b/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleError.errors.txt index fa8de5499db..e8accf360dc 100644 --- a/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleError.errors.txt +++ b/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleError.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/privacyCheckTypeOfInvisibleModuleError.ts(6,16): error TS4025: Exported variable 'f' has or is using private name 'Inner'. +tests/cases/compiler/privacyCheckTypeOfInvisibleModuleError.ts(6,26): error TS4025: Exported variable 'f' has or is using private name 'Inner'. ==== tests/cases/compiler/privacyCheckTypeOfInvisibleModuleError.ts (1 errors) ==== @@ -8,7 +8,7 @@ tests/cases/compiler/privacyCheckTypeOfInvisibleModuleError.ts(6,16): error TS40 } export var f: typeof Inner; - ~ + ~~~~~ !!! error TS4025: Exported variable 'f' has or is using private name 'Inner'. } \ No newline at end of file diff --git a/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleNoError.errors.txt b/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleNoError.errors.txt index 917e4e62e83..bbc8954cff1 100644 --- a/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleNoError.errors.txt +++ b/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleNoError.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/privacyCheckTypeOfInvisibleModuleNoError.ts(6,16): error TS4025: Exported variable 'f' has or is using private name 'Inner'. +tests/cases/compiler/privacyCheckTypeOfInvisibleModuleNoError.ts(6,26): error TS4025: Exported variable 'f' has or is using private name 'Inner'. ==== tests/cases/compiler/privacyCheckTypeOfInvisibleModuleNoError.ts (1 errors) ==== @@ -8,7 +8,7 @@ tests/cases/compiler/privacyCheckTypeOfInvisibleModuleNoError.ts(6,16): error TS } export var f: typeof Inner; // Since we dont unwind inner any more, it is error here - ~ + ~~~~~ !!! error TS4025: Exported variable 'f' has or is using private name 'Inner'. } \ No newline at end of file diff --git a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt index 4ec739d6ce6..f3c21baed3c 100644 --- a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt +++ b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/privacyClassExtendsClauseDeclFile_GlobalFile.ts(16,67): error TS4020: Extends clause of exported class 'publicClassExtendingPrivateClassInModule' has or is using private name 'privateClassInPublicModule'. tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(17,67): error TS4020: Extends clause of exported class 'publicClassExtendingPrivateClassInModule' has or is using private name 'privateClassInPublicModule'. -tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(22,69): error TS4018: Extends clause of exported class 'publicClassExtendingFromPrivateModuleClass' has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. +tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(22,69): error TS4020: Extends clause of exported class 'publicClassExtendingFromPrivateModuleClass' has or is using private name 'privateModule'. tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(64,55): error TS4020: Extends clause of exported class 'publicClassExtendingPrivateClass' has or is using private name 'privateClass'. -tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(69,65): error TS4018: Extends clause of exported class 'publicClassExtendingFromPrivateModuleClass' has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. +tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(69,65): error TS4020: Extends clause of exported class 'publicClassExtendingFromPrivateModuleClass' has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts (4 errors) ==== @@ -30,8 +30,8 @@ tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(69,65): class privateClassExtendingFromPrivateModuleClass extends privateModule.publicClassInPrivateModule { } export class publicClassExtendingFromPrivateModuleClass extends privateModule.publicClassInPrivateModule { // Should error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4018: Extends clause of exported class 'publicClassExtendingFromPrivateModuleClass' has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4020: Extends clause of exported class 'publicClassExtendingFromPrivateModuleClass' has or is using private name 'privateModule'. } } @@ -81,8 +81,8 @@ tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(69,65): class privateClassExtendingFromPrivateModuleClass extends privateModule.publicClassInPrivateModule { } export class publicClassExtendingFromPrivateModuleClass extends privateModule.publicClassInPrivateModule { // Should error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4018: Extends clause of exported class 'publicClassExtendingFromPrivateModuleClass' has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4020: Extends clause of exported class 'publicClassExtendingFromPrivateModuleClass' has or is using private name 'privateModule'. } ==== tests/cases/compiler/privacyClassExtendsClauseDeclFile_GlobalFile.ts (1 errors) ==== diff --git a/tests/baselines/reference/privacyClassImplementsClauseDeclFile.errors.txt b/tests/baselines/reference/privacyClassImplementsClauseDeclFile.errors.txt index 07a1c6a357b..2681ee0e20e 100644 --- a/tests/baselines/reference/privacyClassImplementsClauseDeclFile.errors.txt +++ b/tests/baselines/reference/privacyClassImplementsClauseDeclFile.errors.txt @@ -1,9 +1,9 @@ tests/cases/compiler/privacyClassImplementsClauseDeclFile_GlobalFile.ts(14,77): error TS4019: Implements clause of exported class 'publicClassImplementingPrivateInterfaceInModule' has or is using private name 'privateInterfaceInPublicModule'. tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(15,77): error TS4019: Implements clause of exported class 'publicClassImplementingPrivateInterfaceInModule' has or is using private name 'privateInterfaceInPublicModule'. -tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(20,79): error TS4017: Implements clause of exported class 'publicClassImplementingFromPrivateModuleInterface' has or is using name 'privateModule.publicInterfaceInPrivateModule' from private module 'privateModule'. +tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(20,79): error TS4019: Implements clause of exported class 'publicClassImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(23,78): error TS4019: Implements clause of exported class 'publicClassImplementingPrivateAndPublicInterface' has or is using private name 'privateInterfaceInPublicModule'. tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(63,65): error TS4019: Implements clause of exported class 'publicClassImplementingPrivateInterface' has or is using private name 'privateInterface'. -tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(68,75): error TS4017: Implements clause of exported class 'publicClassImplementingFromPrivateModuleInterface' has or is using name 'privateModule.publicInterfaceInPrivateModule' from private module 'privateModule'. +tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(68,75): error TS4019: Implements clause of exported class 'publicClassImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts (5 errors) ==== @@ -29,8 +29,8 @@ tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(68,7 class privateClassImplementingFromPrivateModuleInterface implements privateModule.publicInterfaceInPrivateModule { } export class publicClassImplementingFromPrivateModuleInterface implements privateModule.publicInterfaceInPrivateModule { // Should error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4017: Implements clause of exported class 'publicClassImplementingFromPrivateModuleInterface' has or is using name 'privateModule.publicInterfaceInPrivateModule' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4019: Implements clause of exported class 'publicClassImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. } export class publicClassImplementingPrivateAndPublicInterface implements privateInterfaceInPublicModule, publicInterfaceInPublicModule { // Should error @@ -83,8 +83,8 @@ tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(68,7 class privateClassImplementingFromPrivateModuleInterface implements privateModule.publicInterfaceInPrivateModule { } export class publicClassImplementingFromPrivateModuleInterface implements privateModule.publicInterfaceInPrivateModule { // Should error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4017: Implements clause of exported class 'publicClassImplementingFromPrivateModuleInterface' has or is using name 'privateModule.publicInterfaceInPrivateModule' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4019: Implements clause of exported class 'publicClassImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. } ==== tests/cases/compiler/privacyClassImplementsClauseDeclFile_GlobalFile.ts (1 errors) ==== diff --git a/tests/baselines/reference/privacyFunctionParameterDeclFile.errors.txt b/tests/baselines/reference/privacyFunctionParameterDeclFile.errors.txt index ce0ff604570..0e88e08e645 100644 --- a/tests/baselines/reference/privacyFunctionParameterDeclFile.errors.txt +++ b/tests/baselines/reference/privacyFunctionParameterDeclFile.errors.txt @@ -1,63 +1,63 @@ -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(164,14): error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(165,10): error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(166,18): error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(188,37): error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(192,24): error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(196,21): error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(196,42): error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(196,72): error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(239,60): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(248,75): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(254,14): error TS4064: Parameter 'param' of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(255,10): error TS4066: Parameter 'param' of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(256,18): error TS4074: Parameter 'param' of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(259,37): error TS4069: Parameter 'param' of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(261,24): error TS4072: Parameter 'param' of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(263,21): error TS4062: Parameter 'param' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(263,55): error TS4062: Parameter 'param1' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(263,98): error TS4062: Parameter 'param2' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(266,67): error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(268,82): error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(9,10): error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(10,6): error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(11,14): error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(33,33): error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(37,20): error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(41,17): error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(41,38): error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(41,68): error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(84,56): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(93,71): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(99,10): error TS4064: Parameter 'param' of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(100,6): error TS4066: Parameter 'param' of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(101,14): error TS4074: Parameter 'param' of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(104,33): error TS4069: Parameter 'param' of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(106,20): error TS4072: Parameter 'param' of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(108,17): error TS4062: Parameter 'param' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(108,51): error TS4062: Parameter 'param1' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(108,94): error TS4062: Parameter 'param2' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(111,63): error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(113,78): error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(141,14): error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(142,10): error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(143,18): error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(165,37): error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(169,24): error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(173,21): error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(173,42): error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(173,72): error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(216,60): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(225,75): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(231,14): error TS4064: Parameter 'param' of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(232,10): error TS4066: Parameter 'param' of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(233,18): error TS4074: Parameter 'param' of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(236,37): error TS4069: Parameter 'param' of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(238,24): error TS4072: Parameter 'param' of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(240,21): error TS4062: Parameter 'param' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(240,55): error TS4062: Parameter 'param1' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(240,98): error TS4062: Parameter 'param2' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(243,67): error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(164,21): error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(165,17): error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(166,25): error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(188,44): error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(192,31): error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(196,28): error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(196,58): error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(196,87): error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(239,67): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(248,82): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(254,21): error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(255,17): error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(256,25): error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(259,44): error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(261,31): error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(263,28): error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(263,71): error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(263,113): error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(266,74): error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(268,89): error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(9,17): error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(10,13): error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(11,21): error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(33,40): error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(37,27): error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(41,24): error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(41,54): error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(41,83): error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(84,63): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(93,78): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(99,17): error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(100,13): error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(101,21): error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(104,40): error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(106,27): error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(108,24): error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(108,67): error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(108,109): error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(111,70): error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(113,85): error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(141,21): error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(142,17): error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(143,25): error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(165,44): error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(169,31): error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(173,28): error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(173,58): error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(173,87): error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(216,67): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(225,82): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(231,21): error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(232,17): error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(233,25): error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(236,44): error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(238,31): error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(240,28): error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(240,71): error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(240,113): error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(243,74): error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,89): error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts (40 errors) ==== @@ -70,13 +70,13 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): export interface publicInterfaceWithPrivateParmeterTypes { new (param: privateClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateClass'. (param: privateClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateClass'. myMethod(param: privateClass): void; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateClass'. } @@ -100,23 +100,23 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): export class publicClassWithWithPrivateParmeterTypes { static myPublicStaticMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateClass'. } private static myPrivateStaticMethod(param: privateClass) { } myPublicMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateClass'. } private myPrivateMethod(param: privateClass) { } constructor(param: privateClass, private param1: privateClass, public param2: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateClass'. } } @@ -161,7 +161,7 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): } export function publicFunctionWithPrivateParmeterTypes(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. } export function publicFunctionWithPublicParmeterTypes(param: publicClass) { @@ -172,7 +172,7 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): } export declare function publicAmbientFunctionWithPrivateParmeterTypes(param: privateClass): void; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. export declare function publicAmbientFunctionWithPublicParmeterTypes(param: publicClass): void; declare function privateAmbientFunctionWithPrivateParmeterTypes(param: privateClass): void; @@ -180,40 +180,40 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): export interface publicInterfaceWithPrivateModuleParameterTypes { new (param: privateModule.publicClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4064: Parameter 'param' of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateModule'. (param: privateModule.publicClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4066: Parameter 'param' of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateModule'. myMethod(param: privateModule.publicClass): void; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4074: Parameter 'param' of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModuleParameterTypes { static myPublicStaticMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4069: Parameter 'param' of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateModule'. } myPublicMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4072: Parameter 'param' of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateModule'. } constructor(param: privateModule.publicClass, private param1: privateModule.publicClass, public param2: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4062: Parameter 'param' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4062: Parameter 'param1' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4062: Parameter 'param2' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateModule'. } } export function publicFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. } export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass): void; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModuleParameterTypes { new (param: privateModule.publicClass): publicClass; @@ -242,13 +242,13 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): export interface publicInterfaceWithPrivateParmeterTypes { new (param: privateClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateClass'. (param: privateClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateClass'. myMethod(param: privateClass): void; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateClass'. } @@ -272,23 +272,23 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): export class publicClassWithWithPrivateParmeterTypes { static myPublicStaticMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateClass'. } private static myPrivateStaticMethod(param: privateClass) { } myPublicMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateClass'. } private myPrivateMethod(param: privateClass) { } constructor(param: privateClass, private param1: privateClass, public param2: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateClass'. } } @@ -333,7 +333,7 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): } export function publicFunctionWithPrivateParmeterTypes(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. } export function publicFunctionWithPublicParmeterTypes(param: publicClass) { @@ -344,7 +344,7 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): } export declare function publicAmbientFunctionWithPrivateParmeterTypes(param: privateClass): void; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. export declare function publicAmbientFunctionWithPublicParmeterTypes(param: publicClass): void; declare function privateAmbientFunctionWithPrivateParmeterTypes(param: privateClass): void; @@ -352,40 +352,40 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): export interface publicInterfaceWithPrivateModuleParameterTypes { new (param: privateModule.publicClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4064: Parameter 'param' of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateModule'. (param: privateModule.publicClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4066: Parameter 'param' of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateModule'. myMethod(param: privateModule.publicClass): void; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4074: Parameter 'param' of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModuleParameterTypes { static myPublicStaticMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4069: Parameter 'param' of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateModule'. } myPublicMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4072: Parameter 'param' of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateModule'. } constructor(param: privateModule.publicClass, private param1: privateModule.publicClass, public param2: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4062: Parameter 'param' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4062: Parameter 'param1' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4062: Parameter 'param2' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateModule'. } } export function publicFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. } export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass): void; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModuleParameterTypes { new (param: privateModule.publicClass): publicClass; @@ -703,13 +703,13 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): export interface publicInterfaceWithPrivateParmeterTypes { new (param: privateClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateClass'. (param: privateClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateClass'. myMethod(param: privateClass): void; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateClass'. } @@ -733,23 +733,23 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): export class publicClassWithWithPrivateParmeterTypes { static myPublicStaticMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateClass'. } private static myPrivateStaticMethod(param: privateClass) { } myPublicMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateClass'. } private myPrivateMethod(param: privateClass) { } constructor(param: privateClass, private param1: privateClass, public param2: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateClass'. } } @@ -794,7 +794,7 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): } export function publicFunctionWithPrivateParmeterTypes(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. } export function publicFunctionWithPublicParmeterTypes(param: publicClass) { @@ -805,7 +805,7 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): } export declare function publicAmbientFunctionWithPrivateParmeterTypes(param: privateClass): void; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. export declare function publicAmbientFunctionWithPublicParmeterTypes(param: publicClass): void; declare function privateAmbientFunctionWithPrivateParmeterTypes(param: privateClass): void; @@ -813,40 +813,40 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): export interface publicInterfaceWithPrivateModuleParameterTypes { new (param: privateModule.publicClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4064: Parameter 'param' of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateModule'. (param: privateModule.publicClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4066: Parameter 'param' of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateModule'. myMethod(param: privateModule.publicClass): void; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4074: Parameter 'param' of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModuleParameterTypes { static myPublicStaticMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4069: Parameter 'param' of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateModule'. } myPublicMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4072: Parameter 'param' of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateModule'. } constructor(param: privateModule.publicClass, private param1: privateModule.publicClass, public param2: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4062: Parameter 'param' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4062: Parameter 'param1' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4062: Parameter 'param2' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateModule'. } } export function publicFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. } export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass): void; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModuleParameterTypes { new (param: privateModule.publicClass): publicClass; diff --git a/tests/baselines/reference/privacyFunctionReturnTypeDeclFile.errors.txt b/tests/baselines/reference/privacyFunctionReturnTypeDeclFile.errors.txt index 2efd3d3323a..0156c7241f7 100644 --- a/tests/baselines/reference/privacyFunctionReturnTypeDeclFile.errors.txt +++ b/tests/baselines/reference/privacyFunctionReturnTypeDeclFile.errors.txt @@ -1,69 +1,69 @@ -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(281,9): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(282,9): error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(283,9): error TS4049: Return type of index signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(284,9): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(309,16): error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(315,9): error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(281,17): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(282,13): error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(283,22): error TS4049: Return type of index signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(284,21): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(309,40): error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(315,27): error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(321,16): error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(327,9): error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(416,21): error TS4060: Return type of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(416,63): error TS4060: Return type of exported function has or is using private name 'privateClass'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(428,21): error TS4060: Return type of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(441,29): error TS4060: Return type of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(447,9): error TS4044: Return type of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(448,9): error TS4046: Return type of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(449,9): error TS4048: Return type of index signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(450,9): error TS4056: Return type of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(453,16): error TS4051: Return type of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(456,9): error TS4054: Return type of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(441,78): error TS4060: Return type of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(447,17): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(448,13): error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(449,22): error TS4049: Return type of index signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(450,21): error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(453,40): error TS4052: Return type of public static method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(456,27): error TS4055: Return type of public method from exported class has or is using private name 'privateModule'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(459,16): error TS4051: Return type of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(462,9): error TS4054: Return type of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(466,21): error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(466,70): error TS4060: Return type of exported function has or is using private name 'privateModule'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(469,21): error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(472,29): error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(9,5): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(10,5): error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(11,5): error TS4049: Return type of index signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(12,5): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(37,12): error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(43,5): error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(472,85): error TS4060: Return type of exported function has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(9,13): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(10,9): error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(11,18): error TS4049: Return type of index signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(12,17): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(37,36): error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(43,23): error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(49,12): error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(55,5): error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(144,17): error TS4060: Return type of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(144,59): error TS4060: Return type of exported function has or is using private name 'privateClass'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(156,17): error TS4060: Return type of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(169,25): error TS4060: Return type of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(175,5): error TS4044: Return type of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(176,5): error TS4046: Return type of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(177,5): error TS4048: Return type of index signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(178,5): error TS4056: Return type of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(181,12): error TS4051: Return type of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(184,5): error TS4054: Return type of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(169,74): error TS4060: Return type of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(175,13): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(176,9): error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(177,18): error TS4049: Return type of index signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(178,17): error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(181,36): error TS4052: Return type of public static method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(184,23): error TS4055: Return type of public method from exported class has or is using private name 'privateModule'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(187,12): error TS4051: Return type of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(190,5): error TS4054: Return type of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(194,17): error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(194,66): error TS4060: Return type of exported function has or is using private name 'privateModule'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(197,17): error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(200,25): error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(238,9): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(239,9): error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(240,9): error TS4049: Return type of index signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(241,9): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(266,16): error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(272,9): error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(200,81): error TS4060: Return type of exported function has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(238,17): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(239,13): error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(240,22): error TS4049: Return type of index signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(241,21): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(266,40): error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(272,27): error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(278,16): error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(284,9): error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(373,21): error TS4060: Return type of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(373,63): error TS4060: Return type of exported function has or is using private name 'privateClass'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(385,21): error TS4060: Return type of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(398,29): error TS4060: Return type of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(404,9): error TS4044: Return type of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(405,9): error TS4046: Return type of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(406,9): error TS4048: Return type of index signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(407,9): error TS4056: Return type of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(410,16): error TS4051: Return type of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(413,9): error TS4054: Return type of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(398,78): error TS4060: Return type of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(404,17): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(405,13): error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(406,22): error TS4049: Return type of index signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(407,21): error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(410,40): error TS4052: Return type of public static method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(413,27): error TS4055: Return type of public method from exported class has or is using private name 'privateModule'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(416,16): error TS4051: Return type of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(419,9): error TS4054: Return type of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(423,21): error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(423,70): error TS4060: Return type of exported function has or is using private name 'privateModule'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(426,21): error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29): error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,85): error TS4060: Return type of exported function has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts (44 errors) ==== @@ -76,16 +76,16 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) export interface publicInterfaceWithPrivateParmeterTypes { new (): privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. (): privateClass; // Error - ~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. [x: number]: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4049: Return type of index signature from exported interface has or is using private name 'privateClass'. myMethod(): privateClass; // Error - ~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. } @@ -112,7 +112,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) export class publicClassWithWithPrivateParmeterTypes { static myPublicStaticMethod(): privateClass { // Error - ~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. return null; } @@ -120,7 +120,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) return null; } myPublicMethod(): privateClass { // Error - ~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. return null; } @@ -227,7 +227,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) } export function publicFunctionWithPrivateParmeterTypes(): privateClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4060: Return type of exported function has or is using private name 'privateClass'. return null; } @@ -256,7 +256,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) } export declare function publicAmbientFunctionWithPrivateParmeterTypes(): privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4060: Return type of exported function has or is using private name 'privateClass'. export declare function publicAmbientFunctionWithPublicParmeterTypes(): publicClass; declare function privateAmbientFunctionWithPrivateParmeterTypes(): privateClass; @@ -264,27 +264,27 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) export interface publicInterfaceWithPrivateModuleParameterTypes { new (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4044: Return type of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4046: Return type of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. [x: number]: privateModule.publicClass // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4048: Return type of index signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4049: Return type of index signature from exported interface has or is using private name 'privateModule'. myMethod(): privateModule.publicClass; // Error - ~~~~~~~~ -!!! error TS4056: Return type of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModuleParameterTypes { static myPublicStaticMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS4051: Return type of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4052: Return type of public static method from exported class has or is using private name 'privateModule'. return null; } myPublicMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~ -!!! error TS4054: Return type of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4055: Return type of public method from exported class has or is using private name 'privateModule'. return null; } static myPublicStaticMethod1() { // Error @@ -299,8 +299,8 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) } } export function publicFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4060: Return type of exported function has or is using private name 'privateModule'. return null; } export function publicFunctionWithPrivateModuleParameterTypes1() { // Error @@ -309,8 +309,8 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) return new privateModule.publicClass(); } export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4060: Return type of exported function has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModuleParameterTypes { new (): privateModule.publicClass; @@ -349,16 +349,16 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) export interface publicInterfaceWithPrivateParmeterTypes { new (): privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. (): privateClass; // Error - ~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. [x: number]: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4049: Return type of index signature from exported interface has or is using private name 'privateClass'. myMethod(): privateClass; // Error - ~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. } @@ -385,7 +385,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) export class publicClassWithWithPrivateParmeterTypes { static myPublicStaticMethod(): privateClass { // Error - ~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. return null; } @@ -393,7 +393,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) return null; } myPublicMethod(): privateClass { // Error - ~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. return null; } @@ -500,7 +500,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) } export function publicFunctionWithPrivateParmeterTypes(): privateClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4060: Return type of exported function has or is using private name 'privateClass'. return null; } @@ -529,7 +529,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) } export declare function publicAmbientFunctionWithPrivateParmeterTypes(): privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4060: Return type of exported function has or is using private name 'privateClass'. export declare function publicAmbientFunctionWithPublicParmeterTypes(): publicClass; declare function privateAmbientFunctionWithPrivateParmeterTypes(): privateClass; @@ -537,27 +537,27 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) export interface publicInterfaceWithPrivateModuleParameterTypes { new (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4044: Return type of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4046: Return type of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. [x: number]: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4048: Return type of index signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4049: Return type of index signature from exported interface has or is using private name 'privateModule'. myMethod(): privateModule.publicClass; // Error - ~~~~~~~~ -!!! error TS4056: Return type of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModuleParameterTypes { static myPublicStaticMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS4051: Return type of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4052: Return type of public static method from exported class has or is using private name 'privateModule'. return null; } myPublicMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~ -!!! error TS4054: Return type of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4055: Return type of public method from exported class has or is using private name 'privateModule'. return null; } static myPublicStaticMethod1() { // Error @@ -572,8 +572,8 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) } } export function publicFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4060: Return type of exported function has or is using private name 'privateModule'. return null; } export function publicFunctionWithPrivateModuleParameterTypes1() { // Error @@ -582,8 +582,8 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) return new privateModule.publicClass(); } export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4060: Return type of exported function has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModuleParameterTypes { new (): privateModule.publicClass; @@ -1126,16 +1126,16 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) export interface publicInterfaceWithPrivateParmeterTypes { new (): privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. (): privateClass; // Error - ~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. [x: number]: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4049: Return type of index signature from exported interface has or is using private name 'privateClass'. myMethod(): privateClass; // Error - ~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. } @@ -1162,7 +1162,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) export class publicClassWithWithPrivateParmeterTypes { static myPublicStaticMethod(): privateClass { // Error - ~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. return null; } @@ -1170,7 +1170,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) return null; } myPublicMethod(): privateClass { // Error - ~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. return null; } @@ -1277,7 +1277,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) } export function publicFunctionWithPrivateParmeterTypes(): privateClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4060: Return type of exported function has or is using private name 'privateClass'. return null; } @@ -1306,7 +1306,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) } export declare function publicAmbientFunctionWithPrivateParmeterTypes(): privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4060: Return type of exported function has or is using private name 'privateClass'. export declare function publicAmbientFunctionWithPublicParmeterTypes(): publicClass; declare function privateAmbientFunctionWithPrivateParmeterTypes(): privateClass; @@ -1314,27 +1314,27 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) export interface publicInterfaceWithPrivateModuleParameterTypes { new (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4044: Return type of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4046: Return type of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. [x: number]: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4048: Return type of index signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4049: Return type of index signature from exported interface has or is using private name 'privateModule'. myMethod(): privateModule.publicClass; // Error - ~~~~~~~~ -!!! error TS4056: Return type of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModuleParameterTypes { static myPublicStaticMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS4051: Return type of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4052: Return type of public static method from exported class has or is using private name 'privateModule'. return null; } myPublicMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~ -!!! error TS4054: Return type of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4055: Return type of public method from exported class has or is using private name 'privateModule'. return null; } static myPublicStaticMethod1() { // Error @@ -1349,8 +1349,8 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) } } export function publicFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4060: Return type of exported function has or is using private name 'privateModule'. return null; } export function publicFunctionWithPrivateModuleParameterTypes1() { // Error @@ -1359,8 +1359,8 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) return new privateModule.publicClass(); } export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4060: Return type of exported function has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModuleParameterTypes { new (): privateModule.publicClass; diff --git a/tests/baselines/reference/privacyGloImport.errors.txt b/tests/baselines/reference/privacyGloImport.errors.txt index b5578216980..933af3315a7 100644 --- a/tests/baselines/reference/privacyGloImport.errors.txt +++ b/tests/baselines/reference/privacyGloImport.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/privacyGloImport.ts(49,5): error TS4000: Import declaration 'm1_im2_private' is using private name 'm1_M2_private'. -tests/cases/compiler/privacyGloImport.ts(80,5): error TS4000: Import declaration 'm1_im2_public' is using private name 'm1_M2_private'. +tests/cases/compiler/privacyGloImport.ts(49,29): error TS4000: Import declaration 'm1_im2_private' is using private name 'm1_M2_private'. +tests/cases/compiler/privacyGloImport.ts(80,35): error TS4000: Import declaration 'm1_im2_public' is using private name 'm1_M2_private'. ==== tests/cases/compiler/privacyGloImport.ts (2 errors) ==== @@ -52,7 +52,7 @@ tests/cases/compiler/privacyGloImport.ts(80,5): error TS4000: Import declaration import m1_im2_private = m1_M2_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4000: Import declaration 'm1_im2_private' is using private name 'm1_M2_private'. export var m1_im2_private_v1_public = m1_im2_private.c1; export var m1_im2_private_v2_public = new m1_im2_private.c1(); @@ -85,7 +85,7 @@ tests/cases/compiler/privacyGloImport.ts(80,5): error TS4000: Import declaration export import m1_im1_public = m1_M1_public; export import m1_im2_public = m1_M2_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4000: Import declaration 'm1_im2_public' is using private name 'm1_M2_private'. //export import m1_im3_public = require("m1_M3_public"); //export import m1_im4_public = require("m1_M4_private"); diff --git a/tests/baselines/reference/privacyImport.errors.txt b/tests/baselines/reference/privacyImport.errors.txt index 931bbf13ff0..d5cb61d99b5 100644 --- a/tests/baselines/reference/privacyImport.errors.txt +++ b/tests/baselines/reference/privacyImport.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/privacyImport.ts(49,5): error TS4000: Import declaration 'm1_im2_private' is using private name 'm1_M2_private'. -tests/cases/compiler/privacyImport.ts(80,5): error TS4000: Import declaration 'm1_im2_public' is using private name 'm1_M2_private'. +tests/cases/compiler/privacyImport.ts(49,29): error TS4000: Import declaration 'm1_im2_private' is using private name 'm1_M2_private'. +tests/cases/compiler/privacyImport.ts(80,35): error TS4000: Import declaration 'm1_im2_public' is using private name 'm1_M2_private'. ==== tests/cases/compiler/privacyImport.ts (2 errors) ==== @@ -52,7 +52,7 @@ tests/cases/compiler/privacyImport.ts(80,5): error TS4000: Import declaration 'm import m1_im2_private = m1_M2_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4000: Import declaration 'm1_im2_private' is using private name 'm1_M2_private'. export var m1_im2_private_v1_public = m1_im2_private.c1; export var m1_im2_private_v2_public = new m1_im2_private.c1(); @@ -85,7 +85,7 @@ tests/cases/compiler/privacyImport.ts(80,5): error TS4000: Import declaration 'm export import m1_im1_public = m1_M1_public; export import m1_im2_public = m1_M2_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4000: Import declaration 'm1_im2_public' is using private name 'm1_M2_private'. //export import m1_im3_public = require("m1_M3_public"); //export import m1_im4_public = require("m1_M4_private"); diff --git a/tests/baselines/reference/privacyInterfaceExtendsClauseDeclFile.errors.txt b/tests/baselines/reference/privacyInterfaceExtendsClauseDeclFile.errors.txt index 64cbd76763f..41c53ffd19b 100644 --- a/tests/baselines/reference/privacyInterfaceExtendsClauseDeclFile.errors.txt +++ b/tests/baselines/reference/privacyInterfaceExtendsClauseDeclFile.errors.txt @@ -1,9 +1,9 @@ tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_GlobalFile.ts(14,82): error TS4022: Extends clause of exported interface 'publicInterfaceImplementingPrivateInterfaceInModule' has or is using private name 'privateInterfaceInPublicModule'. tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(15,82): error TS4022: Extends clause of exported interface 'publicInterfaceImplementingPrivateInterfaceInModule' has or is using private name 'privateInterfaceInPublicModule'. -tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(20,84): error TS4021: Extends clause of exported interface 'publicInterfaceImplementingFromPrivateModuleInterface' has or is using name 'privateModule.publicInterfaceInPrivateModule' from private module 'privateModule'. +tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(20,84): error TS4022: Extends clause of exported interface 'publicInterfaceImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(23,83): error TS4022: Extends clause of exported interface 'publicInterfaceImplementingPrivateAndPublicInterface' has or is using private name 'privateInterfaceInPublicModule'. tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(63,70): error TS4022: Extends clause of exported interface 'publicInterfaceImplementingPrivateInterface' has or is using private name 'privateInterface'. -tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(68,80): error TS4021: Extends clause of exported interface 'publicInterfaceImplementingFromPrivateModuleInterface' has or is using name 'privateModule.publicInterfaceInPrivateModule' from private module 'privateModule'. +tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(68,80): error TS4022: Extends clause of exported interface 'publicInterfaceImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts (5 errors) ==== @@ -29,8 +29,8 @@ tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(68, interface privateInterfaceImplementingFromPrivateModuleInterface extends privateModule.publicInterfaceInPrivateModule { } export interface publicInterfaceImplementingFromPrivateModuleInterface extends privateModule.publicInterfaceInPrivateModule { // Should error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4021: Extends clause of exported interface 'publicInterfaceImplementingFromPrivateModuleInterface' has or is using name 'privateModule.publicInterfaceInPrivateModule' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4022: Extends clause of exported interface 'publicInterfaceImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. } export interface publicInterfaceImplementingPrivateAndPublicInterface extends privateInterfaceInPublicModule, publicInterfaceInPublicModule { // Should error @@ -83,8 +83,8 @@ tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(68, interface privateInterfaceImplementingFromPrivateModuleInterface extends privateModule.publicInterfaceInPrivateModule { } export interface publicInterfaceImplementingFromPrivateModuleInterface extends privateModule.publicInterfaceInPrivateModule { // Should error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4021: Extends clause of exported interface 'publicInterfaceImplementingFromPrivateModuleInterface' has or is using name 'privateModule.publicInterfaceInPrivateModule' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4022: Extends clause of exported interface 'publicInterfaceImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. } ==== tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_GlobalFile.ts (1 errors) ==== diff --git a/tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.errors.txt b/tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.errors.txt index 77eef3f32a5..45dbc77e7a0 100644 --- a/tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.errors.txt +++ b/tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(51,5): error TS4000: Import declaration 'im_public_c_private' is using private name 'm_private'. -tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(52,5): error TS4000: Import declaration 'im_public_e_private' is using private name 'm_private'. -tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(53,5): error TS4000: Import declaration 'im_public_f_private' is using private name 'm_private'. -tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(54,5): error TS4000: Import declaration 'im_public_v_private' is using private name 'm_private'. -tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(55,5): error TS4000: Import declaration 'im_public_i_private' is using private name 'm_private'. -tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(56,5): error TS4000: Import declaration 'im_public_mi_private' is using private name 'm_private'. -tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(57,5): error TS4000: Import declaration 'im_public_mu_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(51,41): error TS4000: Import declaration 'im_public_c_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(52,41): error TS4000: Import declaration 'im_public_e_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(53,41): error TS4000: Import declaration 'im_public_f_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(54,41): error TS4000: Import declaration 'im_public_v_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(55,41): error TS4000: Import declaration 'im_public_i_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(56,42): error TS4000: Import declaration 'im_public_mi_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(57,42): error TS4000: Import declaration 'im_public_mu_private' is using private name 'm_private'. ==== tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts (7 errors) ==== @@ -59,25 +59,25 @@ tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(57,5): err export module import_public { // Privacy errors - importing private elements export import im_public_c_private = m_private.c_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_c_private' is using private name 'm_private'. export import im_public_e_private = m_private.e_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_e_private' is using private name 'm_private'. export import im_public_f_private = m_private.f_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_f_private' is using private name 'm_private'. export import im_public_v_private = m_private.v_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_v_private' is using private name 'm_private'. export import im_public_i_private = m_private.i_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_i_private' is using private name 'm_private'. export import im_public_mi_private = m_private.mi_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_mi_private' is using private name 'm_private'. export import im_public_mu_private = m_private.mu_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_mu_private' is using private name 'm_private'. // Usage of privacy error imports diff --git a/tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.errors.txt b/tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.errors.txt index c5b18127129..12fd1927660 100644 --- a/tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.errors.txt +++ b/tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts(51,5): error TS4000: Import declaration 'im_private_c_private' is using private name 'm_private'. -tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts(52,5): error TS4000: Import declaration 'im_private_e_private' is using private name 'm_private'. -tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts(55,5): error TS4000: Import declaration 'im_private_i_private' is using private name 'm_private'. -tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts(56,5): error TS4000: Import declaration 'im_private_mi_private' is using private name 'm_private'. -tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts(57,5): error TS4000: Import declaration 'im_private_mu_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts(51,35): error TS4000: Import declaration 'im_private_c_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts(52,35): error TS4000: Import declaration 'im_private_e_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts(55,35): error TS4000: Import declaration 'im_private_i_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts(56,36): error TS4000: Import declaration 'im_private_mi_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts(57,36): error TS4000: Import declaration 'im_private_mu_private' is using private name 'm_private'. ==== tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts (5 errors) ==== @@ -57,21 +57,21 @@ tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts(57,5): export module import_public { // No Privacy errors - importing private elements import im_private_c_private = m_private.c_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_c_private' is using private name 'm_private'. import im_private_e_private = m_private.e_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_e_private' is using private name 'm_private'. import im_private_f_private = m_private.f_private; import im_private_v_private = m_private.v_private; import im_private_i_private = m_private.i_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_i_private' is using private name 'm_private'. import im_private_mi_private = m_private.mi_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_mi_private' is using private name 'm_private'. import im_private_mu_private = m_private.mu_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_mu_private' is using private name 'm_private'. // Usage of above decls diff --git a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.errors.txt b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.errors.txt index e601feabe91..d3715af1d54 100644 --- a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.errors.txt +++ b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(50,1): error TS4000: Import declaration 'im_public_c_private' is using private name 'm_private'. -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(51,1): error TS4000: Import declaration 'im_public_e_private' is using private name 'm_private'. -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(52,1): error TS4000: Import declaration 'im_public_f_private' is using private name 'm_private'. -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(53,1): error TS4000: Import declaration 'im_public_v_private' is using private name 'm_private'. -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(54,1): error TS4000: Import declaration 'im_public_i_private' is using private name 'm_private'. -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(55,1): error TS4000: Import declaration 'im_public_mi_private' is using private name 'm_private'. -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(56,1): error TS4000: Import declaration 'im_public_mu_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(50,37): error TS4000: Import declaration 'im_public_c_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(51,37): error TS4000: Import declaration 'im_public_e_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(52,37): error TS4000: Import declaration 'im_public_f_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(53,37): error TS4000: Import declaration 'im_public_v_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(54,37): error TS4000: Import declaration 'im_public_i_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(55,38): error TS4000: Import declaration 'im_public_mi_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(56,38): error TS4000: Import declaration 'im_public_mu_private' is using private name 'm_private'. ==== tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts (7 errors) ==== @@ -58,25 +58,25 @@ tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(56,1): // Privacy errors - importing private elements export import im_public_c_private = m_private.c_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_c_private' is using private name 'm_private'. export import im_public_e_private = m_private.e_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_e_private' is using private name 'm_private'. export import im_public_f_private = m_private.f_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_f_private' is using private name 'm_private'. export import im_public_v_private = m_private.v_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_v_private' is using private name 'm_private'. export import im_public_i_private = m_private.i_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_i_private' is using private name 'm_private'. export import im_public_mi_private = m_private.mi_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_mi_private' is using private name 'm_private'. export import im_public_mu_private = m_private.mu_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_mu_private' is using private name 'm_private'. // Usage of privacy error imports diff --git a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.errors.txt b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.errors.txt index 739f2fafaea..1fbf8f7bac9 100644 --- a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.errors.txt +++ b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts(51,1): error TS4000: Import declaration 'im_private_c_private' is using private name 'm_private'. -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts(52,1): error TS4000: Import declaration 'im_private_e_private' is using private name 'm_private'. -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts(55,1): error TS4000: Import declaration 'im_private_i_private' is using private name 'm_private'. -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts(56,1): error TS4000: Import declaration 'im_private_mi_private' is using private name 'm_private'. -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts(57,1): error TS4000: Import declaration 'im_private_mu_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts(51,31): error TS4000: Import declaration 'im_private_c_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts(52,31): error TS4000: Import declaration 'im_private_e_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts(55,31): error TS4000: Import declaration 'im_private_i_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts(56,32): error TS4000: Import declaration 'im_private_mi_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts(57,32): error TS4000: Import declaration 'im_private_mu_private' is using private name 'm_private'. ==== tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts (5 errors) ==== @@ -57,21 +57,21 @@ tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts(57,1 // No Privacy errors - importing private elements import im_private_c_private = m_private.c_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_c_private' is using private name 'm_private'. import im_private_e_private = m_private.e_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_e_private' is using private name 'm_private'. import im_private_f_private = m_private.f_private; import im_private_v_private = m_private.v_private; import im_private_i_private = m_private.i_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_i_private' is using private name 'm_private'. import im_private_mi_private = m_private.mi_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_mi_private' is using private name 'm_private'. import im_private_mu_private = m_private.mu_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_mu_private' is using private name 'm_private'. // Usage of above decls diff --git a/tests/baselines/reference/privacyTypeParameterOfFunctionDeclFile.errors.txt b/tests/baselines/reference/privacyTypeParameterOfFunctionDeclFile.errors.txt index eef4c3be375..663025ee722 100644 --- a/tests/baselines/reference/privacyTypeParameterOfFunctionDeclFile.errors.txt +++ b/tests/baselines/reference/privacyTypeParameterOfFunctionDeclFile.errors.txt @@ -1,39 +1,39 @@ -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(8,5): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(8,10): error TS4006: Type parameter 'T' of constructor signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(9,5): error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(9,6): error TS4008: Type parameter 'T' of call signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(10,5): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(10,14): error TS4014: Type parameter 'T' of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(32,33): error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(36,20): error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(75,57): error TS4016: Type parameter 'T' of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(127,5): error TS4044: Return type of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(127,10): error TS4005: Type parameter 'T' of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(128,5): error TS4046: Return type of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(128,6): error TS4007: Type parameter 'T' of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(129,5): error TS4056: Return type of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(129,14): error TS4013: Type parameter 'T' of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(132,33): error TS4009: Type parameter 'T' of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(134,20): error TS4011: Type parameter 'T' of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(137,64): error TS4015: Type parameter 'T' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(164,9): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(164,14): error TS4006: Type parameter 'T' of constructor signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(165,9): error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(165,10): error TS4008: Type parameter 'T' of call signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(166,9): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(166,18): error TS4014: Type parameter 'T' of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(188,37): error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(192,24): error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(231,61): error TS4016: Type parameter 'T' of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(283,9): error TS4044: Return type of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(283,14): error TS4005: Type parameter 'T' of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(284,9): error TS4046: Return type of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(284,10): error TS4007: Type parameter 'T' of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(285,9): error TS4056: Return type of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(285,18): error TS4013: Type parameter 'T' of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(288,37): error TS4009: Type parameter 'T' of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(290,24): error TS4011: Type parameter 'T' of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(293,68): error TS4015: Type parameter 'T' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(8,20): error TS4006: Type parameter 'T' of constructor signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(8,37): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(9,16): error TS4008: Type parameter 'T' of call signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(9,33): error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(10,24): error TS4014: Type parameter 'T' of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(10,41): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(32,43): error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(36,30): error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(75,67): error TS4016: Type parameter 'T' of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(127,20): error TS4006: Type parameter 'T' of constructor signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(127,50): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(128,16): error TS4008: Type parameter 'T' of call signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(128,46): error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(129,24): error TS4014: Type parameter 'T' of method from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(129,54): error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(132,43): error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(134,30): error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(137,74): error TS4016: Type parameter 'T' of exported function has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(164,24): error TS4006: Type parameter 'T' of constructor signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(164,41): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(165,20): error TS4008: Type parameter 'T' of call signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(165,37): error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(166,28): error TS4014: Type parameter 'T' of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(166,45): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(188,47): error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(192,34): error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(231,71): error TS4016: Type parameter 'T' of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(283,24): error TS4006: Type parameter 'T' of constructor signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(283,54): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(284,20): error TS4008: Type parameter 'T' of call signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(284,50): error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(285,28): error TS4014: Type parameter 'T' of method from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(285,58): error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(288,47): error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(290,34): error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(293,78): error TS4016: Type parameter 'T' of exported function has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts (36 errors) ==== @@ -45,20 +45,20 @@ tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(293,68): error TS export interface publicInterfaceWithPrivateTypeParameters { new (): privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4006: Type parameter 'T' of constructor signature from exported interface has or is using private name 'privateClass'. + ~~~~~~~~~~~~ +!!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. (): privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4008: Type parameter 'T' of call signature from exported interface has or is using private name 'privateClass'. + ~~~~~~~~~~~~ +!!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. myMethod(): privateClass; // Error - ~~~~~~~~ -!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4014: Type parameter 'T' of method from exported interface has or is using private name 'privateClass'. + ~~~~~~~~~~~~ +!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. } export interface publicInterfaceWithPublicTypeParameters { @@ -81,13 +81,13 @@ tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(293,68): error TS export class publicClassWithWithPrivateTypeParameters { static myPublicStaticMethod() { // Error - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateClass'. } private static myPrivateStaticMethod() { } myPublicMethod() { // Error - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateClass'. } private myPrivateMethod() { @@ -128,7 +128,7 @@ tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(293,68): error TS } export function publicFunctionWithPrivateTypeParameters() { // Error - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4016: Type parameter 'T' of exported function has or is using private name 'privateClass'. } @@ -182,34 +182,34 @@ tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(293,68): error TS export interface publicInterfaceWithPrivatModuleTypeParameters { new (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4044: Return type of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4005: Type parameter 'T' of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4006: Type parameter 'T' of constructor signature from exported interface has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4046: Return type of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4007: Type parameter 'T' of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4008: Type parameter 'T' of call signature from exported interface has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. myMethod(): privateModule.publicClass; // Error - ~~~~~~~~ -!!! error TS4056: Return type of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4013: Type parameter 'T' of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4014: Type parameter 'T' of method from exported interface has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithWithPrivateModuleTypeParameters { static myPublicStaticMethod() { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4009: Type parameter 'T' of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateModule'. } myPublicMethod() { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4011: Type parameter 'T' of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateModule'. } } export function publicFunctionWithPrivateMopduleTypeParameters() { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4015: Type parameter 'T' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4016: Type parameter 'T' of exported function has or is using private name 'privateModule'. } @@ -237,20 +237,20 @@ tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(293,68): error TS export interface publicInterfaceWithPrivateTypeParameters { new (): privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4006: Type parameter 'T' of constructor signature from exported interface has or is using private name 'privateClass'. + ~~~~~~~~~~~~ +!!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. (): privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4008: Type parameter 'T' of call signature from exported interface has or is using private name 'privateClass'. + ~~~~~~~~~~~~ +!!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. myMethod(): privateClass; // Error - ~~~~~~~~ -!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4014: Type parameter 'T' of method from exported interface has or is using private name 'privateClass'. + ~~~~~~~~~~~~ +!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. } export interface publicInterfaceWithPublicTypeParameters { @@ -273,13 +273,13 @@ tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(293,68): error TS export class publicClassWithWithPrivateTypeParameters { static myPublicStaticMethod() { // Error - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateClass'. } private static myPrivateStaticMethod() { } myPublicMethod() { // Error - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateClass'. } private myPrivateMethod() { @@ -320,7 +320,7 @@ tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(293,68): error TS } export function publicFunctionWithPrivateTypeParameters() { // Error - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4016: Type parameter 'T' of exported function has or is using private name 'privateClass'. } @@ -374,34 +374,34 @@ tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(293,68): error TS export interface publicInterfaceWithPrivatModuleTypeParameters { new (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4044: Return type of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4005: Type parameter 'T' of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4006: Type parameter 'T' of constructor signature from exported interface has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4046: Return type of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4007: Type parameter 'T' of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4008: Type parameter 'T' of call signature from exported interface has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. myMethod(): privateModule.publicClass; // Error - ~~~~~~~~ -!!! error TS4056: Return type of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4013: Type parameter 'T' of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4014: Type parameter 'T' of method from exported interface has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithWithPrivateModuleTypeParameters { static myPublicStaticMethod() { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4009: Type parameter 'T' of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateModule'. } myPublicMethod() { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4011: Type parameter 'T' of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateModule'. } } export function publicFunctionWithPrivateMopduleTypeParameters() { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4015: Type parameter 'T' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4016: Type parameter 'T' of exported function has or is using private name 'privateModule'. } diff --git a/tests/baselines/reference/privacyTypeParametersOfClassDeclFile.errors.txt b/tests/baselines/reference/privacyTypeParametersOfClassDeclFile.errors.txt index bc47d164759..a6ae0fdcc01 100644 --- a/tests/baselines/reference/privacyTypeParametersOfClassDeclFile.errors.txt +++ b/tests/baselines/reference/privacyTypeParametersOfClassDeclFile.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(7,51): error TS4002: Type parameter 'T' of exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(43,61): error TS4001: Type parameter 'T' of exported class has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(62,55): error TS4002: Type parameter 'T' of exported class has or is using private name 'privateClassInPublicModule'. -tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(98,65): error TS4001: Type parameter 'T' of exported class has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. +tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(7,61): error TS4002: Type parameter 'T' of exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(43,71): error TS4002: Type parameter 'T' of exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(62,65): error TS4002: Type parameter 'T' of exported class has or is using private name 'privateClassInPublicModule'. +tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(98,75): error TS4002: Type parameter 'T' of exported class has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts (4 errors) ==== @@ -12,7 +12,7 @@ tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(98,65): error TS400 } export class publicClassWithPrivateTypeParameters { // Error - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4002: Type parameter 'T' of exported class has or is using private name 'privateClass'. myMethod(val: T): T { return val; @@ -50,8 +50,8 @@ tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(98,65): error TS400 } export class publicClassWithTypeParametersFromPrivateModule { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4001: Type parameter 'T' of exported class has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4002: Type parameter 'T' of exported class has or is using private name 'privateModule'. myMethod(val: T): T { return val; } @@ -71,7 +71,7 @@ tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(98,65): error TS400 } export class publicClassWithPrivateTypeParameters { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS4002: Type parameter 'T' of exported class has or is using private name 'privateClassInPublicModule'. myMethod(val: T): T { return val; @@ -109,8 +109,8 @@ tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(98,65): error TS400 } export class publicClassWithTypeParametersFromPrivateModule { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4001: Type parameter 'T' of exported class has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4002: Type parameter 'T' of exported class has or is using private name 'privateModule'. myMethod(val: T): T { return val; } diff --git a/tests/baselines/reference/privacyTypeParametersOfInterfaceDeclFile.errors.txt b/tests/baselines/reference/privacyTypeParametersOfInterfaceDeclFile.errors.txt index f4ea800e792..eb6bb3ea734 100644 --- a/tests/baselines/reference/privacyTypeParametersOfInterfaceDeclFile.errors.txt +++ b/tests/baselines/reference/privacyTypeParametersOfInterfaceDeclFile.errors.txt @@ -1,23 +1,23 @@ -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(13,59): error TS4004: Type parameter 'T' of exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(16,5): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(16,5): error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(17,5): error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(18,5): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(25,5): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(25,5): error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(26,5): error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(27,5): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(60,75): error TS4003: Type parameter 'T' of exported interface has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(79,63): error TS4004: Type parameter 'T' of exported interface has or is using private name 'privateClassInPublicModule'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(82,9): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(82,9): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(83,9): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(84,9): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(91,9): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(91,9): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(92,9): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(93,9): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(125,79): error TS4003: Type parameter 'T' of exported interface has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(13,69): error TS4004: Type parameter 'T' of exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(16,18): error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(16,32): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(17,18): error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(18,31): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(25,18): error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(25,32): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(26,18): error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(27,31): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(60,85): error TS4004: Type parameter 'T' of exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(79,73): error TS4004: Type parameter 'T' of exported interface has or is using private name 'privateClassInPublicModule'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(82,22): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(82,50): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(83,22): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(84,49): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(91,22): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(91,50): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(92,22): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(93,49): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(125,89): error TS4004: Type parameter 'T' of exported interface has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts (20 errors) ==== @@ -34,20 +34,20 @@ tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(125,79): error } export interface publicInterfaceWithPrivateTypeParameters { // Error - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4004: Type parameter 'T' of exported interface has or is using private name 'privateClass'. myMethod(val: T): T; myMethod0(): publicClassT; myMethod1(): privateClassT; - ~~~~~~~~~ -!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. - ~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. + ~~~~~~~~~~~~ +!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. myMethod2(): privateClassT; - ~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. myMethod3(): publicClassT; - ~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. myMethod4(): publicClassT; } @@ -56,15 +56,15 @@ tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(125,79): error myMethod(val: T): T; myMethod0(): publicClassT myMethod1(): privateClassT; - ~~~~~~~~~ -!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. - ~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. + ~~~~~~~~~~~~ +!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. myMethod2(): privateClassT; - ~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. myMethod3(): publicClassT; - ~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. myMethod4(): publicClassT; } @@ -99,8 +99,8 @@ tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(125,79): error export interface publicInterfaceWithPrivateModuleTypeParameterConstraints { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4003: Type parameter 'T' of exported interface has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4004: Type parameter 'T' of exported interface has or is using private name 'privateModule'. } interface privateInterfaceWithPrivateModuleTypeParameterConstraints { // Error @@ -120,20 +120,20 @@ tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(125,79): error } export interface publicInterfaceWithPrivateTypeParameters { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS4004: Type parameter 'T' of exported interface has or is using private name 'privateClassInPublicModule'. myMethod(val: T): T; myMethod0(): publicClassInPublicModuleT; myMethod1(): privateClassInPublicModuleT; - ~~~~~~~~~ -!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. - ~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. myMethod2(): privateClassInPublicModuleT; - ~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. myMethod3(): publicClassInPublicModuleT; - ~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. myMethod4(): publicClassInPublicModuleT; } @@ -142,15 +142,15 @@ tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(125,79): error myMethod(val: T): T; myMethod0(): publicClassInPublicModuleT myMethod1(): privateClassInPublicModuleT; - ~~~~~~~~~ -!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. - ~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. myMethod2(): privateClassInPublicModuleT; - ~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. myMethod3(): publicClassInPublicModuleT; - ~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. myMethod4(): publicClassInPublicModuleT; } @@ -184,8 +184,8 @@ tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(125,79): error } export interface publicInterfaceWithPrivateModuleTypeParameterConstraints { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4003: Type parameter 'T' of exported interface has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4004: Type parameter 'T' of exported interface has or is using private name 'privateModule'. } interface privateInterfaceWithPrivateModuleTypeParameterConstraints { // Error diff --git a/tests/baselines/reference/privacyVarDeclFile.errors.txt b/tests/baselines/reference/privacyVarDeclFile.errors.txt index 03e5f951a9d..6ae5373e0c7 100644 --- a/tests/baselines/reference/privacyVarDeclFile.errors.txt +++ b/tests/baselines/reference/privacyVarDeclFile.errors.txt @@ -1,33 +1,33 @@ -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(105,9): error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(121,9): error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(123,9): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(148,16): error TS4025: Exported variable 'publicVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(153,24): error TS4025: Exported variable 'publicAmbientVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(159,9): error TS4032: Property 'myProperty' of exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(162,9): error TS4027: Public static property 'myPublicStaticProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(163,9): error TS4030: Public property 'myPublicProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(165,16): error TS4024: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(166,24): error TS4024: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(9,5): error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(25,5): error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(27,5): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(52,12): error TS4025: Exported variable 'publicVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(57,20): error TS4025: Exported variable 'publicAmbientVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(63,5): error TS4032: Property 'myProperty' of exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(66,5): error TS4027: Public static property 'myPublicStaticProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(67,5): error TS4030: Public property 'myPublicProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(69,12): error TS4024: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(70,20): error TS4024: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(90,9): error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(106,9): error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(108,9): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(133,16): error TS4025: Exported variable 'publicVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(138,24): error TS4025: Exported variable 'publicAmbientVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(144,9): error TS4032: Property 'myProperty' of exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(147,9): error TS4027: Public static property 'myPublicStaticProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(148,9): error TS4030: Public property 'myPublicProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(150,16): error TS4024: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(105,21): error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(121,40): error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(123,27): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(148,51): error TS4025: Exported variable 'publicVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(153,66): error TS4025: Exported variable 'publicAmbientVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(159,21): error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(162,40): error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(163,27): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(165,57): error TS4025: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(166,72): error TS4025: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(9,17): error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(25,36): error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(27,23): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(52,47): error TS4025: Exported variable 'publicVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(57,62): error TS4025: Exported variable 'publicAmbientVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(63,17): error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(66,36): error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(67,23): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(69,53): error TS4025: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(70,68): error TS4025: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(90,21): error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(106,40): error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(108,27): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(133,51): error TS4025: Exported variable 'publicVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(138,66): error TS4025: Exported variable 'publicAmbientVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(144,21): error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(147,40): error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(148,27): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(150,57): error TS4025: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,72): error TS4025: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyVarDeclFile_externalModule.ts (20 errors) ==== @@ -40,7 +40,7 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: export interface publicInterfaceWithPrivatePropertyTypes { myProperty: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateClass'. } @@ -58,11 +58,11 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: export class publicClassWithWithPrivatePropertyTypes { static myPublicStaticProperty: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateClass'. private static myPrivateStaticProperty: privateClass; myPublicProperty: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateClass'. private myPrivateProperty: privateClass; } @@ -89,14 +89,14 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: } export var publicVarWithPrivatePropertyTypes: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4025: Exported variable 'publicVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. export var publicVarWithPublicPropertyTypes: publicClass; var privateVarWithPrivatePropertyTypes: privateClass; var privateVarWithPublicPropertyTypes: publicClass; export declare var publicAmbientVarWithPrivatePropertyTypes: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4025: Exported variable 'publicAmbientVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. export declare var publicAmbientVarWithPublicPropertyTypes: publicClass; declare var privateAmbientVarWithPrivatePropertyTypes: privateClass; @@ -104,23 +104,23 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: export interface publicInterfaceWithPrivateModulePropertyTypes { myProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4032: Property 'myProperty' of exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModulePropertyTypes { static myPublicStaticProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4027: Public static property 'myPublicStaticProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateModule'. myPublicProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4030: Public property 'myPublicProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateModule'. } export var publicVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4024: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4025: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. export declare var publicAmbientVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4024: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4025: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModulePropertyTypes { myProperty: privateModule.publicClass; @@ -141,7 +141,7 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: export interface publicInterfaceWithPrivatePropertyTypes { myProperty: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateClass'. } @@ -159,11 +159,11 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: export class publicClassWithWithPrivatePropertyTypes { static myPublicStaticProperty: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateClass'. private static myPrivateStaticProperty: privateClass; myPublicProperty: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateClass'. private myPrivateProperty: privateClass; } @@ -190,14 +190,14 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: } export var publicVarWithPrivatePropertyTypes: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4025: Exported variable 'publicVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. export var publicVarWithPublicPropertyTypes: publicClass; var privateVarWithPrivatePropertyTypes: privateClass; var privateVarWithPublicPropertyTypes: publicClass; export declare var publicAmbientVarWithPrivatePropertyTypes: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4025: Exported variable 'publicAmbientVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. export declare var publicAmbientVarWithPublicPropertyTypes: publicClass; declare var privateAmbientVarWithPrivatePropertyTypes: privateClass; @@ -205,23 +205,23 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: export interface publicInterfaceWithPrivateModulePropertyTypes { myProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4032: Property 'myProperty' of exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModulePropertyTypes { static myPublicStaticProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4027: Public static property 'myPublicStaticProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateModule'. myPublicProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4030: Public property 'myPublicProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateModule'. } export var publicVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4024: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4025: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. export declare var publicAmbientVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4024: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4025: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModulePropertyTypes { myProperty: privateModule.publicClass; @@ -422,7 +422,7 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: export interface publicInterfaceWithPrivatePropertyTypes { myProperty: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateClass'. } @@ -440,11 +440,11 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: export class publicClassWithWithPrivatePropertyTypes { static myPublicStaticProperty: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateClass'. private static myPrivateStaticProperty: privateClass; myPublicProperty: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateClass'. private myPrivateProperty: privateClass; } @@ -471,14 +471,14 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: } export var publicVarWithPrivatePropertyTypes: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4025: Exported variable 'publicVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. export var publicVarWithPublicPropertyTypes: publicClass; var privateVarWithPrivatePropertyTypes: privateClass; var privateVarWithPublicPropertyTypes: publicClass; export declare var publicAmbientVarWithPrivatePropertyTypes: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4025: Exported variable 'publicAmbientVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. export declare var publicAmbientVarWithPublicPropertyTypes: publicClass; declare var privateAmbientVarWithPrivatePropertyTypes: privateClass; @@ -486,23 +486,23 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: export interface publicInterfaceWithPrivateModulePropertyTypes { myProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4032: Property 'myProperty' of exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModulePropertyTypes { static myPublicStaticProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4027: Public static property 'myPublicStaticProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateModule'. myPublicProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4030: Public property 'myPublicProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateModule'. } export var publicVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4024: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4025: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. export declare var publicAmbientVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4024: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4025: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModulePropertyTypes { myProperty: privateModule.publicClass; diff --git a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js index b514fb088e9..608090e8722 100644 --- a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js +++ b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js @@ -7510,7 +7510,7 @@ declare module julianae { declare module ruatanica { class hector { humulis(): julianae.steerii; - eurycerus(): panamensis.linulus, lavali.wilsoni>; + eurycerus(): panamensis.linulus, lavali.wilsoni>; } } declare module Lanthanum { @@ -7648,7 +7648,7 @@ declare module quasiater { crassicaudatus(): samarensis.cahirinus; mulatta(): argurus.oreas; ansorgei(): rendalli.moojeni, gabriellae.echinatus>; - Copper(): argurus.netscheri; + Copper(): argurus.netscheri; } } declare module ruatanica { @@ -7769,10 +7769,10 @@ declare module lutreolus { culionensis(): argurus.dauricus; scrofa(): petrophilus.sodyi; fernandoni(): quasiater.carolinensis; - Tin(): sagitta.leptoceros>; - marmorata(): panamensis.setulosus>; + Tin(): sagitta.leptoceros>; + marmorata(): panamensis.setulosus>; tavaratra(): Lanthanum.nitidus; - peregrina(): daubentonii.nesiotes; + peregrina(): daubentonii.nesiotes; frontalis(): macrorhinos.marmosurus>, samarensis.pallidus>; cuniculus(): patas.uralensis; magdalenae(): julianae.gerbillus>; @@ -7789,9 +7789,9 @@ declare module argurus { darienensis(): trivirgatus.oconnelli; hardwickii(): macrorhinos.daphaenodon; albifrons(): rionegrensis.veraecrucis; - jacobitus(): caurinus.johorensis>>; - guentheri(): rendalli.moojeni; - mahomet(): imperfecta.ciliolabrum; + jacobitus(): caurinus.johorensis>>; + guentheri(): rendalli.moojeni; + mahomet(): imperfecta.ciliolabrum; misionensis(): macrorhinos.marmosurus, gabriellae.echinatus>; } } @@ -7799,7 +7799,7 @@ declare module nigra { class dolichurus { solomonis(): panglima.abidi, argurus.netscheri, julianae.oralis>>>; alfredi(): caurinus.psilurus; - morrisi(): ruatanica.hector, quasiater.wattsi>>>; + morrisi(): ruatanica.hector, quasiater.wattsi>>>; lekaguli(): Lanthanum.nitidus; dimissus(): imperfecta.subspinosus; phaeotis(): julianae.sumatrana; @@ -7847,7 +7847,7 @@ declare module minutus { rusticus(): dogramacii.aurata; latona(): daubentonii.nesiotes; famulus(): patas.uralensis; - flaviceps(): inez>; + flaviceps(): minutus.inez>; paradoxolophus(): nigra.dolichurus>; Osmium(): lavali.wilsoni; vulgaris(): Lanthanum.nitidus; @@ -7858,12 +7858,12 @@ declare module minutus { } declare module caurinus { class mahaganus extends panglima.fundatus { - martiniquensis(): ruatanica.hector>>; + martiniquensis(): ruatanica.hector>>; devius(): samarensis.pelurus, trivirgatus.falconeri>>; masalai(): argurus.oreas; - kathleenae(): nigra.dolichurus; + kathleenae(): nigra.dolichurus; simulus(): gabriellae.echinatus; - nigrovittatus(): mahaganus>>; + nigrovittatus(): caurinus.mahaganus>>; senegalensis(): gabriellae.klossii, dammermani.melanops>; acticola(): argurus.luctuosa; } @@ -7875,7 +7875,7 @@ declare module macrorhinos { } declare module howi { class angulatus extends sagitta.stolzmanni { - pennatus(): marcanoi; + pennatus(): howi.marcanoi; } } declare module daubentonii { @@ -7923,13 +7923,13 @@ declare module panamensis { } declare module nigra { class gracilis { - weddellii(): dolichurus; + weddellii(): nigra.dolichurus; echinothrix(): Lanthanum.nitidus, argurus.oreas>; garridoi(): dogramacii.koepckeae; - rouxii(): gracilis, thalia>; + rouxii(): nigra.gracilis, nigra.thalia>; aurita(): sagitta.stolzmanni; geoffrensis(): rionegrensis.caniventer; - theresa(): macrorhinos.marmosurus, argurus.luctuosa>, dolichurus>; + theresa(): macrorhinos.marmosurus, argurus.luctuosa>, nigra.dolichurus>; melanocarpus(): julianae.albidens, julianae.sumatrana>; dubiaquercus(): dogramacii.robustulus; pectoralis(): julianae.sumatrana; @@ -7985,7 +7985,7 @@ declare module samarensis { } } declare module sagitta { - class leptoceros extends caurinus.johorensis> { + class leptoceros extends caurinus.johorensis> { victus(): rionegrensis.caniventer; hoplomyoides(): panglima.fundatus, nigra.gracilis>; gratiosus(): lavali.lepturus; @@ -8025,7 +8025,7 @@ declare module argurus { leucoptera(): petrophilus.rosalia; ochraventer(): sagitta.walkeri; tephromelas(): Lanthanum.jugularis; - cracens(): gilbertii; + cracens(): argurus.gilbertii; jamaicensis(): nigra.thalia>; gymnocaudus(): dogramacii.aurata; mayori(): sagitta.stolzmanni; @@ -8038,9 +8038,9 @@ declare module argurus { fagani(): trivirgatus.oconnelli; papuanus(): panglima.fundatus; timidus(): dammermani.melanops; - nghetinhensis(): gabriellae.klossii; + nghetinhensis(): gabriellae.klossii; barbei(): samarensis.cahirinus; - univittatus(): peninsulae; + univittatus(): argurus.peninsulae; } } declare module daubentonii { @@ -8085,7 +8085,7 @@ declare module provocax { declare module sagitta { class sicarius { Chlorine(): samarensis.cahirinus, dogramacii.robustulus>; - simulator(): macrorhinos.marmosurus, macrorhinos.marmosurus, gabriellae.echinatus>, stolzmanni>>; + simulator(): macrorhinos.marmosurus, macrorhinos.marmosurus, gabriellae.echinatus>, sagitta.stolzmanni>>; } } declare module howi { @@ -8096,7 +8096,7 @@ declare module howi { martinsi(): dogramacii.aurata; beatrix(): imperfecta.ciliolabrum, gabriellae.echinatus>, dogramacii.aurata>, imperfecta.ciliolabrum>>; griseoventer(): argurus.oreas; - zerda(): quasiater.wattsi, coludo>>; + zerda(): quasiater.wattsi, howi.coludo>>; yucatanicus(): julianae.nudicaudus; nigrita(): argurus.peninsulae; jouvenetae(): argurus.dauricus; @@ -8110,9 +8110,9 @@ declare module argurus { class gilbertii { nasutus(): lavali.lepturus; poecilops(): julianae.steerii; - sondaicus(): samarensis.fuscus; + sondaicus(): samarensis.fuscus; auriventer(): petrophilus.rosalia; - cherriei(): ruatanica.Praseodymium; + cherriei(): ruatanica.Praseodymium; lindberghi(): minutus.inez; pipistrellus(): quasiater.carolinensis; paranus(): lutreolus.punicus; @@ -8132,12 +8132,12 @@ declare module lutreolus { lar(): caurinus.mahaganus; erica(): dogramacii.koepckeae; trichura(): macrorhinos.konganensis; - lemniscatus(): panglima.fundatus; + lemniscatus(): panglima.fundatus; aspalax(): panamensis.linulus; marshalli(): julianae.nudicaudus; Zinc(): julianae.galapagoensis; - monochromos(): howi.coludo; - purinus(): ruatanica.hector; + monochromos(): howi.coludo; + purinus(): ruatanica.hector; ischyrus(): lavali.lepturus; tenuis(): macrorhinos.daphaenodon; Helium(): julianae.acariensis; @@ -8165,8 +8165,8 @@ declare module sagitta { dorsalis(): petrophilus.sodyi; fimbriatus(): provocax.melanoleuca; sara(): nigra.gracilis; - epimelas(): stolzmanni; - pittieri(): samarensis.fuscus; + epimelas(): sagitta.stolzmanni; + pittieri(): samarensis.fuscus; } } declare module nigra { @@ -8264,7 +8264,7 @@ declare module minutus { } declare module lutreolus { class foina { - tarfayensis(): punicus; + tarfayensis(): lutreolus.punicus; Promethium(): samarensis.pelurus; salinae(): gabriellae.klossii; kerri(): howi.coludo; @@ -8276,7 +8276,7 @@ declare module lutreolus { layardi(): julianae.albidens; bishopi(): dogramacii.aurata; apodemoides(): caurinus.psilurus; - argentiventer(): trivirgatus.mixtus; + argentiventer(): trivirgatus.mixtus; } } declare module lutreolus { @@ -8284,7 +8284,7 @@ declare module lutreolus { antinorii(): petrophilus.sodyi; voi(): caurinus.johorensis; mussoi(): quasiater.carolinensis; - truncatus(): trivirgatus.lotor; + truncatus(): trivirgatus.lotor; achates(): provocax.melanoleuca; praedatrix(): howi.angulatus; mzabi(): quasiater.wattsi, minutus.inez>; @@ -8321,8 +8321,8 @@ declare module sagitta { } } declare module dammermani { - class melanops extends minutus.inez { - blarina(): melanops; + class melanops extends minutus.inez { + blarina(): dammermani.melanops; harwoodi(): rionegrensis.veraecrucis, lavali.wilsoni>; ashaninka(): julianae.nudicaudus; wiedii(): julianae.steerii; @@ -8339,14 +8339,14 @@ declare module dammermani { } declare module argurus { class peninsulae extends patas.uralensis { - aitkeni(): trivirgatus.mixtus, panglima.amphibius>; + aitkeni(): trivirgatus.mixtus, panglima.amphibius>; novaeangliae(): lavali.xanthognathus; olallae(): julianae.sumatrana; anselli(): dogramacii.aurata; timminsi(): macrorhinos.konganensis; sordidus(): rendalli.moojeni; telfordi(): trivirgatus.oconnelli; - cavernarum(): minutus.inez; + cavernarum(): minutus.inez; } } declare module argurus { @@ -8354,21 +8354,21 @@ declare module argurus { gravis(): nigra.caucasica, dogramacii.kaiseri>; ruschii(): imperfecta.lasiurus>; tricuspidatus(): lavali.wilsoni; - fernandezi(): dammermani.siberu, panglima.abidi>; + fernandezi(): dammermani.siberu, panglima.abidi>; colletti(): samarensis.pallidus; microbullatus(): lutreolus.schlegeli; eburneae(): chrysaeolus.sarasinorum; - tatei(): pygmaea>; + tatei(): argurus.pygmaea>; millardi(): sagitta.walkeri; pruinosus(): trivirgatus.falconeri; - delator(): netscheri; + delator(): argurus.netscheri; nyikae(): trivirgatus.tumidifrons, petrophilus.minutilla>, julianae.acariensis>; ruemmleri(): panglima.amphibius, gabriellae.echinatus>, dogramacii.aurata>, imperfecta.ciliolabrum>; } } declare module ruatanica { - class Praseodymium extends hector { - clara(): panglima.amphibius, argurus.dauricus>; + class Praseodymium extends ruatanica.hector { + clara(): panglima.amphibius, argurus.dauricus>; spectabilis(): petrophilus.sodyi; kamensis(): trivirgatus.lotor, lavali.lepturus>; ruddi(): lutreolus.foina; @@ -8416,7 +8416,7 @@ declare module petrophilus { } declare module caurinus { class psilurus extends lutreolus.punicus { - socialis(): panglima.amphibius; + socialis(): panglima.amphibius; lundi(): petrophilus.sodyi; araeum(): imperfecta.ciliolabrum; calamianensis(): julianae.gerbillus; diff --git a/tests/baselines/reference/typeofUndefined.js b/tests/baselines/reference/typeofUndefined.js index f21bc529f9e..5d9d4681eb9 100644 --- a/tests/baselines/reference/typeofUndefined.js +++ b/tests/baselines/reference/typeofUndefined.js @@ -9,5 +9,5 @@ var x; // shouldn't be an error since type is the same as the first declaration //// [typeofUndefined.d.ts] -declare var x: any; +declare var x: typeof undefined; declare var x: any; diff --git a/tests/baselines/reference/vardecl.js b/tests/baselines/reference/vardecl.js index 5ce8e095020..3ff8f4e8ab3 100644 --- a/tests/baselines/reference/vardecl.js +++ b/tests/baselines/reference/vardecl.js @@ -191,7 +191,7 @@ declare var complicatedArrayVar: { y: string; }[]; declare var n1: { - [x: string]: number; + [s: string]: number; }; declare var c: { new?(): any; @@ -212,8 +212,12 @@ declare var d2: { x: number; }; }; -declare var n2: () => void; -declare var n4: (() => void)[]; +declare var n2: { + (): void; +}; +declare var n4: { + (): void; +}[]; declare var d4: { foo(n: string, x: { x: number; diff --git a/tests/cases/compiler/declFileTypeAnnotationArrayType.ts b/tests/cases/compiler/declFileTypeAnnotationArrayType.ts new file mode 100644 index 00000000000..4bb99032a60 --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationArrayType.ts @@ -0,0 +1,53 @@ +// @target: ES5 +// @declaration: true + +class c { +} +module m { + export class c { + } + export class g { + } +} +class g { +} + +// Just the name +function foo(): c[] { + return [new c()]; +} +function foo2() { + return [new c()]; +} + +// Qualified name +function foo3(): m.c[] { + return [new m.c()]; +} +function foo4() { + return m.c; +} + +// Just the name with type arguments +function foo5(): g[] { + return [new g()]; +} +function foo6() { + return [new g()]; +} + +// Qualified name with type arguments +function foo7(): m.g[] { + return [new m.g()]; +} +function foo8() { + return [new m.g()]; +} + +// Array of function types +function foo9(): (()=>c)[] { + return [() => new c()]; +} +function foo10() { + return [() => new c()]; +} \ No newline at end of file diff --git a/tests/cases/compiler/declFileTypeAnnotationBuiltInType.ts b/tests/cases/compiler/declFileTypeAnnotationBuiltInType.ts new file mode 100644 index 00000000000..3b234476579 --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationBuiltInType.ts @@ -0,0 +1,42 @@ +// @target: ES5 +// @declaration: true + +// string +function foo(): string { + return ""; +} +function foo2() { + return ""; +} + +// number +function foo3(): number { + return 10; +} +function foo4() { + return 10; +} + +// boolean +function foo5(): boolean { + return true; +} +function foo6() { + return false; +} + +// void +function foo7(): void { + return; +} +function foo8() { + return; +} + +// any +function foo9(): any { + return undefined; +} +function foo10() { + return undefined; +} \ No newline at end of file diff --git a/tests/cases/compiler/declFileTypeAnnotationParenType.ts b/tests/cases/compiler/declFileTypeAnnotationParenType.ts new file mode 100644 index 00000000000..3ac20836c77 --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationParenType.ts @@ -0,0 +1,12 @@ +// @target: ES5 +// @declaration: true + +class c { + private p: string; +} + +var x: (() => c)[] = [() => new c()]; +var y = [() => new c()]; + +var k: (() => c) | string = (() => new c()) || ""; +var l = (() => new c()) || ""; \ No newline at end of file diff --git a/tests/cases/compiler/declFileTypeAnnotationStringLiteral.ts b/tests/cases/compiler/declFileTypeAnnotationStringLiteral.ts new file mode 100644 index 00000000000..0cdd27fd626 --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationStringLiteral.ts @@ -0,0 +1,13 @@ +// @target: ES5 +// @declaration: true + +function foo(a: "hello"): number; +function foo(a: "name"): string; +function foo(a: string): string | number; +function foo(a: string): string | number { + if (a === "hello") { + return a.length; + } + + return a; +} \ No newline at end of file diff --git a/tests/cases/compiler/declFileTypeAnnotationTupleType.ts b/tests/cases/compiler/declFileTypeAnnotationTupleType.ts new file mode 100644 index 00000000000..aafbfd02eae --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationTupleType.ts @@ -0,0 +1,20 @@ +// @target: ES5 +// @declaration: true + +class c { +} +module m { + export class c { + } + export class g { + } +} +class g { +} + +// Just the name +var k: [c, m.c] = [new c(), new m.c()]; +var l = k; + +var x: [g, m.g, () => c] = [new g(), new m.g(), () => new c()]; +var y = x; \ No newline at end of file diff --git a/tests/cases/compiler/declFileTypeAnnotationTypeAlias.ts b/tests/cases/compiler/declFileTypeAnnotationTypeAlias.ts new file mode 100644 index 00000000000..447921f3f4a --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationTypeAlias.ts @@ -0,0 +1,34 @@ +// @target: ES5 +// @module: commonjs +// @declaration: true + +module M { + export type Value = string | number | boolean; + export var x: Value; + + export class c { + } + + export type C = c; + + export module m { + export class c { + } + } + + export type MC = m.c; + + export type fc = () => c; +} + +interface Window { + someMethod(); +} + +module M { + export type W = Window | string; + export module N { + export class Window { } + export var p: W; + } +} \ No newline at end of file diff --git a/tests/cases/compiler/declFileTypeAnnotationTypeLiteral.ts b/tests/cases/compiler/declFileTypeAnnotationTypeLiteral.ts new file mode 100644 index 00000000000..e41495b68de --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationTypeLiteral.ts @@ -0,0 +1,41 @@ +// @target: ES5 +// @declaration: true + +class c { +} +class g { +} +module m { + export class c { + } +} + +// Object literal with everything +var x: { + // Call signatures + (a: number): c; + (a: string): g; + + // Construct signatures + new (a: number): c; + new (a: string): m.c; + + // Indexers + [n: number]: c; + [n: string]: c; + + // Properties + a: c; + b: g; + + // methods + m1(): g; + m2(a: string, b?: number, ...c: c[]): string; +}; + + +// Function type +var y: (a: string) => string; + +// constructor type +var z: new (a: string) => m.c; \ No newline at end of file diff --git a/tests/cases/compiler/declFileTypeAnnotationTypeQuery.ts b/tests/cases/compiler/declFileTypeAnnotationTypeQuery.ts new file mode 100644 index 00000000000..d3cde6a1faa --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationTypeQuery.ts @@ -0,0 +1,45 @@ +// @target: ES5 +// @declaration: true + +class c { +} +module m { + export class c { + } + export class g { + } +} +class g { +} + +// Just the name +function foo(): typeof c { + return c; +} +function foo2() { + return c; +} + +// Qualified name +function foo3(): typeof m.c { + return m.c; +} +function foo4() { + return m.c; +} + +// Just the name with type arguments +function foo5(): typeof g { + return g; +} +function foo6() { + return g; +} + +// Qualified name with type arguments +function foo7(): typeof m.g { + return m.g +} +function foo8() { + return m.g +} \ No newline at end of file diff --git a/tests/cases/compiler/declFileTypeAnnotationTypeReference.ts b/tests/cases/compiler/declFileTypeAnnotationTypeReference.ts new file mode 100644 index 00000000000..e20ecff32f0 --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationTypeReference.ts @@ -0,0 +1,45 @@ +// @target: ES5 +// @declaration: true + +class c { +} +module m { + export class c { + } + export class g { + } +} +class g { +} + +// Just the name +function foo(): c { + return new c(); +} +function foo2() { + return new c(); +} + +// Qualified name +function foo3(): m.c { + return new m.c(); +} +function foo4() { + return new m.c(); +} + +// Just the name with type arguments +function foo5(): g { + return new g(); +} +function foo6() { + return new g(); +} + +// Qualified name with type arguments +function foo7(): m.g { + return new m.g(); +} +function foo8() { + return new m.g(); +} \ No newline at end of file diff --git a/tests/cases/compiler/declFileTypeAnnotationUnionType.ts b/tests/cases/compiler/declFileTypeAnnotationUnionType.ts new file mode 100644 index 00000000000..4a973834915 --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationUnionType.ts @@ -0,0 +1,24 @@ +// @target: ES5 +// @declaration: true + +class c { + private p: string; +} +module m { + export class c { + private q: string; + } + export class g { + private r: string; + } +} +class g { + private s: string; +} + +// Just the name +var k: c | m.c = new c() || new m.c(); +var l = new c() || new m.c(); + +var x: g | m.g | (() => c) = new g() || new m.g() || (() => new c()); +var y = new g() || new m.g() || (() => new c()); \ No newline at end of file diff --git a/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts new file mode 100644 index 00000000000..8dced33083b --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts @@ -0,0 +1,102 @@ +// @target: ES5 +// @module: commonjs +// @declaration: true + +module m { + class private1 { + } + + export class public1 { + } + + module m2 { + export class public2 { + } + } + + export class c { + // getter with annotation + get foo1(): private1 { + return; + } + + // getter without annotation + get foo2() { + return new private1(); + } + + // setter with annotation + set foo3(param: private1) { + } + + // Both - getter without annotation, setter with annotation + get foo4() { + return new private1(); + } + set foo4(param: private1) { + } + + // Both - with annotation + get foo5(): private1 { + return; + } + set foo5(param: private1) { + } + + // getter with annotation + get foo11(): public1 { + return; + } + + // getter without annotation + get foo12() { + return new public1(); + } + + // setter with annotation + set foo13(param: public1) { + } + + // Both - getter without annotation, setter with annotation + get foo14() { + return new public1(); + } + set foo14(param: public1) { + } + + // Both - with annotation + get foo15(): public1 { + return; + } + set foo15(param: public1) { + } + + // getter with annotation + get foo111(): m2.public2 { + return; + } + + // getter without annotation + get foo112() { + return new m2.public2(); + } + + // setter with annotation + set foo113(param: m2.public2) { + } + + // Both - getter without annotation, setter with annotation + get foo114() { + return new m2.public2(); + } + set foo114(param: m2.public2) { + } + + // Both - with annotation + get foo115(): m2.public2 { + return; + } + set foo115(param: m2.public2) { + } + } +} diff --git a/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts new file mode 100644 index 00000000000..8ae9d5bcf3f --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts @@ -0,0 +1,47 @@ +// @target: ES5 +// @module: commonjs +// @declaration: true + +module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + function foo1(param: private1) { + } + function foo2(param = new private1()) { + } + + export function foo3(param : private1) { + } + export function foo4(param = new private1()) { + } + + function foo11(param: public1) { + } + function foo12(param = new public1()) { + } + + export function foo13(param: public1) { + } + export function foo14(param = new public1()) { + } + + module m2 { + export class public2 { + } + } + + function foo111(param: m2.public2) { + } + function foo112(param = new m2.public2()) { + } + + export function foo113(param: m2.public2) { + } + export function foo114(param = new m2.public2()) { + } +} diff --git a/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts new file mode 100644 index 00000000000..880cba6d0cb --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts @@ -0,0 +1,59 @@ +// @target: ES5 +// @module: commonjs +// @declaration: true + +module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + function foo1(): private1 { + return; + } + function foo2() { + return new private1(); + } + + export function foo3(): private1 { + return; + } + export function foo4() { + return new private1(); + } + + function foo11(): public1 { + return; + } + function foo12() { + return new public1(); + } + + export function foo13(): public1 { + return; + } + export function foo14() { + return new public1(); + } + + module m2 { + export class public2 { + } + } + + function foo111(): m2.public2 { + return; + } + function foo112() { + return new m2.public2(); + } + + export function foo113(): m2.public2 { + return; + } + export function foo114() { + return new m2.public2(); + } +} diff --git a/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts new file mode 100644 index 00000000000..6431dffd20f --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts @@ -0,0 +1,43 @@ +// @target: ES5 +// @module: commonjs +// @declaration: true + +interface Window { + someMethod(); +} + +module M { + type W = Window | string; + export module N { + export class Window { } + export var p: W; // Should report error that W is private + } +} + +module M1 { + export type W = Window | string; + export module N { + export class Window { } + export var p: W; // No error + } +} + +module M2 { + class private1 { + } + class public1 { + } + module m3 { + export class public1 { + } + } + + type t1 = private1; + export type t2 = private1; // error + + type t11 = public1; + export type t12 = public1; + + type t111 = m3.public1; + export type t112 = m3.public1; // error +} diff --git a/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts new file mode 100644 index 00000000000..65af116c193 --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts @@ -0,0 +1,37 @@ +// @target: ES5 +// @module: commonjs +// @declaration: true + +module m { + class private1 { + } + module m2 { + export class public1 { + } + } + + export var x: { + x: private1; + y: m2.public1; + (): m2.public1[]; + method(): private1; + [n: number]: private1; + [s: string]: m2.public1; + }; + export var x2 = { + x: new private1(), + y: new m2.public1(), + method() { + return new private1(); + } + }; + export var x3 = x; + + // Function type + export var y: (a: private1) => m2.public1; + export var y2 = y; + + // constructor type + export var z: new (a: private1) => m2.public1; + export var z2 = z; +} \ No newline at end of file diff --git a/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts new file mode 100644 index 00000000000..fa2558f5a15 --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts @@ -0,0 +1,35 @@ +// @target: ES5 +// @module: commonjs +// @declaration: true + +module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + var x: private1; + var y = new private1(); + + export var k: private1; + export var l = new private1(); + + var x2: public1; + var y2 = new public1(); + + export var k2: public1; + export var l2 = new public1(); + + module m2 { + export class public2 { + } + } + + var x3: m2.public2; + var y3 = new m2.public2(); + + export var k3: m2.public2; + export var l3 = new m2.public2(); +}