mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'master' into classifiedQuickInfo
This commit is contained in:
commit
89eff5608d
158 files changed
+2475
-533
No files matched your search
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -226,7 +226,7 @@ module ts {
|
||||
function bindConstructorDeclaration(node: ConstructorDeclaration) {
|
||||
bindDeclaration(node, SymbolFlags.Constructor, 0);
|
||||
forEach(node.parameters, p => {
|
||||
if (p.flags & (NodeFlags.Public | NodeFlags.Private)) {
|
||||
if (p.flags & (NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected)) {
|
||||
bindDeclaration(p, SymbolFlags.Property, SymbolFlags.PropertyExcludes);
|
||||
}
|
||||
});
|
||||
|
||||
+121
-74
@@ -1470,8 +1470,8 @@ module ts {
|
||||
|
||||
case SyntaxKind.Property:
|
||||
case SyntaxKind.Method:
|
||||
if (node.flags & NodeFlags.Private) {
|
||||
// Private properties/methods are not visible
|
||||
if (node.flags & (NodeFlags.Private | NodeFlags.Protected)) {
|
||||
// Private/protected properties/methods are not visible
|
||||
return false;
|
||||
}
|
||||
// Public properties/methods are visible if its parents are visible, so let it fall into next case statement
|
||||
@@ -2896,22 +2896,19 @@ module ts {
|
||||
}
|
||||
|
||||
function isPropertyIdenticalToRecursive(sourceProp: Symbol, targetProp: Symbol, reportErrors: boolean, relate: (source: Type, target: Type, reportErrors: boolean) => boolean): boolean {
|
||||
Debug.assert(sourceProp);
|
||||
if (!targetProp) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Two members are considered identical when
|
||||
// - they are public properties with identical names, optionality, and types,
|
||||
// - they are private properties originating in the same declaration and having identical types
|
||||
var sourcePropIsPrivate = getDeclarationFlagsFromSymbol(sourceProp) & NodeFlags.Private;
|
||||
var targetPropIsPrivate = getDeclarationFlagsFromSymbol(targetProp) & NodeFlags.Private;
|
||||
if (sourcePropIsPrivate !== targetPropIsPrivate) {
|
||||
// - they are private or protected properties originating in the same declaration and having identical types
|
||||
if (sourceProp === targetProp) {
|
||||
return true;
|
||||
}
|
||||
var sourcePropAccessibility = getDeclarationFlagsFromSymbol(sourceProp) & (NodeFlags.Private | NodeFlags.Protected);
|
||||
var targetPropAccessibility = getDeclarationFlagsFromSymbol(targetProp) & (NodeFlags.Private | NodeFlags.Protected);
|
||||
if (sourcePropAccessibility !== targetPropAccessibility) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sourcePropIsPrivate) {
|
||||
return (getTargetSymbol(sourceProp).parent === getTargetSymbol(targetProp).parent) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors);
|
||||
if (sourcePropAccessibility) {
|
||||
return getTargetSymbol(sourceProp) === getTargetSymbol(targetProp) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors);
|
||||
}
|
||||
else {
|
||||
return isOptionalProperty(sourceProp) === isOptionalProperty(targetProp) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors);
|
||||
@@ -2937,8 +2934,8 @@ module ts {
|
||||
}
|
||||
return result;
|
||||
|
||||
function reportError(message: DiagnosticMessage, arg0?: string, arg1?: string): void {
|
||||
errorInfo = chainDiagnosticMessages(errorInfo, message, arg0, arg1);
|
||||
function reportError(message: DiagnosticMessage, arg0?: string, arg1?: string, arg2?: string): void {
|
||||
errorInfo = chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2);
|
||||
}
|
||||
|
||||
function isRelatedTo(source: Type, target: Type, reportErrors: boolean): boolean {
|
||||
@@ -3110,25 +3107,18 @@ module ts {
|
||||
}
|
||||
|
||||
function propertiesAreIdenticalTo(source: ObjectType, target: ObjectType, reportErrors: boolean): boolean {
|
||||
if (source === target) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var sourceProperties = getPropertiesOfType(source);
|
||||
var targetProperties = getPropertiesOfType(target);
|
||||
if (sourceProperties.length !== targetProperties.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var i = 0, len = sourceProperties.length; i < len; ++i) {
|
||||
var sourceProp = sourceProperties[i];
|
||||
var targetProp = getPropertyOfType(target, sourceProp.name);
|
||||
|
||||
if (!isPropertyIdenticalToRecursive(sourceProp, targetProp, reportErrors, isRelatedTo)) {
|
||||
if (!targetProp || !isPropertyIdenticalToRecursive(sourceProp, targetProp, reportErrors, isRelatedTo)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3137,50 +3127,72 @@ module ts {
|
||||
for (var i = 0; i < properties.length; i++) {
|
||||
var targetProp = properties[i];
|
||||
var sourceProp = getPropertyOfApparentType(source, targetProp.name);
|
||||
if (sourceProp === targetProp) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var targetPropIsOptional = isOptionalProperty(targetProp);
|
||||
if (!sourceProp) {
|
||||
if (!targetPropIsOptional) {
|
||||
if (reportErrors) {
|
||||
reportError(Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (sourceProp !== targetProp) {
|
||||
if (targetProp.flags & SymbolFlags.Prototype) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (getDeclarationFlagsFromSymbol(sourceProp) & NodeFlags.Private || getDeclarationFlagsFromSymbol(targetProp) & NodeFlags.Private) {
|
||||
if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) {
|
||||
if (sourceProp !== targetProp) {
|
||||
if (!sourceProp) {
|
||||
if (!isOptionalProperty(targetProp)) {
|
||||
if (reportErrors) {
|
||||
reportError(Diagnostics.Private_property_0_cannot_be_reimplemented, symbolToString(targetProp));
|
||||
reportError(Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors)) {
|
||||
if (reportErrors) {
|
||||
reportError(Diagnostics.Types_of_property_0_are_incompatible_Colon, symbolToString(targetProp));
|
||||
else if (!(targetProp.flags & SymbolFlags.Prototype)) {
|
||||
var sourceFlags = getDeclarationFlagsFromSymbol(sourceProp);
|
||||
var targetFlags = getDeclarationFlagsFromSymbol(targetProp);
|
||||
if (sourceFlags & NodeFlags.Private || targetFlags & NodeFlags.Private) {
|
||||
if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) {
|
||||
if (reportErrors) {
|
||||
if (sourceFlags & NodeFlags.Private && targetFlags & NodeFlags.Private) {
|
||||
reportError(Diagnostics.Types_have_separate_declarations_of_a_private_property_0, symbolToString(targetProp));
|
||||
}
|
||||
else {
|
||||
reportError(Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp),
|
||||
typeToString(sourceFlags & NodeFlags.Private ? source : target),
|
||||
typeToString(sourceFlags & NodeFlags.Private ? target : source));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else if (isOptionalProperty(sourceProp) && !targetPropIsOptional) {
|
||||
// TypeScript 1.0 spec (April 2014): 3.8.3
|
||||
// S is a subtype of a type T, and T is a supertype of S if ...
|
||||
// S' and T are object types and, for each member M in T..
|
||||
// M is a property and S' contains a property N where
|
||||
// if M is a required property, N is also a required property
|
||||
// (M - property in T)
|
||||
// (N - property in S)
|
||||
if (reportErrors) {
|
||||
reportError(Diagnostics.Required_property_0_cannot_be_reimplemented_with_optional_property_in_1, targetProp.name, typeToString(source));
|
||||
else if (targetFlags & NodeFlags.Protected) {
|
||||
var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & SymbolFlags.Class;
|
||||
var sourceClass = sourceDeclaredInClass ? <InterfaceType>getDeclaredTypeOfSymbol(sourceProp.parent) : undefined;
|
||||
var targetClass = <InterfaceType>getDeclaredTypeOfSymbol(targetProp.parent);
|
||||
if (!sourceClass || !hasBaseType(sourceClass, targetClass)) {
|
||||
if (reportErrors) {
|
||||
reportError(Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2,
|
||||
symbolToString(targetProp), typeToString(sourceClass || source), typeToString(targetClass));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (sourceFlags & NodeFlags.Protected) {
|
||||
if (reportErrors) {
|
||||
reportError(Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2,
|
||||
symbolToString(targetProp), typeToString(source), typeToString(target));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (!isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors)) {
|
||||
if (reportErrors) {
|
||||
reportError(Diagnostics.Types_of_property_0_are_incompatible_Colon, symbolToString(targetProp));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (isOptionalProperty(sourceProp) && !isOptionalProperty(targetProp)) {
|
||||
// TypeScript 1.0 spec (April 2014): 3.8.3
|
||||
// S is a subtype of a type T, and T is a supertype of S if ...
|
||||
// S' and T are object types and, for each member M in T..
|
||||
// M is a property and S' contains a property N where
|
||||
// if M is a required property, N is also a required property
|
||||
// (M - property in T)
|
||||
// (N - property in S)
|
||||
if (reportErrors) {
|
||||
reportError(Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2,
|
||||
symbolToString(targetProp), typeToString(source), typeToString(target));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4158,6 +4170,44 @@ module ts {
|
||||
return s.valueDeclaration ? s.valueDeclaration.flags : s.flags & SymbolFlags.Prototype ? NodeFlags.Public | NodeFlags.Static : 0;
|
||||
}
|
||||
|
||||
function checkClassPropertyAccess(node: PropertyAccess, type: Type, prop: Symbol) {
|
||||
var flags = getDeclarationFlagsFromSymbol(prop);
|
||||
// Public properties are always accessible
|
||||
if (!(flags & (NodeFlags.Private | NodeFlags.Protected))) {
|
||||
return;
|
||||
}
|
||||
// Property is known to be private or protected at this point
|
||||
// Get the declaring and enclosing class instance types
|
||||
var enclosingClassDeclaration = getAncestor(node, SyntaxKind.ClassDeclaration);
|
||||
var enclosingClass = enclosingClassDeclaration ? <InterfaceType>getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined;
|
||||
var declaringClass = <InterfaceType>getDeclaredTypeOfSymbol(prop.parent);
|
||||
// Private property is accessible if declaring and enclosing class are the same
|
||||
if (flags & NodeFlags.Private) {
|
||||
if (declaringClass !== enclosingClass) {
|
||||
error(node, Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(declaringClass));
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Property is known to be protected at this point
|
||||
// All protected properties of a supertype are accessible in a super access
|
||||
if (node.left.kind === SyntaxKind.SuperKeyword) {
|
||||
return;
|
||||
}
|
||||
// A protected property is accessible in the declaring class and classes derived from it
|
||||
if (!enclosingClass || !hasBaseType(enclosingClass, declaringClass)) {
|
||||
error(node, Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(declaringClass));
|
||||
return;
|
||||
}
|
||||
// No further restrictions for static properties
|
||||
if (flags & NodeFlags.Static) {
|
||||
return;
|
||||
}
|
||||
// An instance property must be accessed through an instance of the enclosing class
|
||||
if (!(getTargetType(type).flags & (TypeFlags.Class | TypeFlags.Interface) && hasBaseType(<InterfaceType>type, enclosingClass))) {
|
||||
error(node, Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1, symbolToString(prop), typeToString(enclosingClass));
|
||||
}
|
||||
}
|
||||
|
||||
function checkPropertyAccess(node: PropertyAccess) {
|
||||
var type = checkExpression(node.left);
|
||||
if (type === unknownType) return type;
|
||||
@@ -4176,7 +4226,6 @@ module ts {
|
||||
}
|
||||
getNodeLinks(node).resolvedSymbol = prop;
|
||||
if (prop.parent && prop.parent.flags & SymbolFlags.Class) {
|
||||
|
||||
// TS 1.0 spec (April 2014): 4.8.2
|
||||
// - In a constructor, instance member function, instance member accessor, or
|
||||
// instance member variable initializer where this references a derived class instance,
|
||||
@@ -4185,13 +4234,10 @@ module ts {
|
||||
// where this references the constructor function object of a derived class,
|
||||
// a super property access is permitted and must specify a public static member function of the base class.
|
||||
if (node.left.kind === SyntaxKind.SuperKeyword && getDeclarationKindFromSymbol(prop) !== SyntaxKind.Method) {
|
||||
error(node.right, Diagnostics.Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword);
|
||||
error(node.right, Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword);
|
||||
}
|
||||
else if (getDeclarationFlagsFromSymbol(prop) & NodeFlags.Private) {
|
||||
var classDeclaration = getAncestor(node, SyntaxKind.ClassDeclaration);
|
||||
if (!classDeclaration || !contains(prop.parent.declarations, classDeclaration)) {
|
||||
error(node, Diagnostics.Property_0_is_inaccessible, getFullyQualifiedName(prop));
|
||||
}
|
||||
else {
|
||||
checkClassPropertyAccess(node, type, prop);
|
||||
}
|
||||
}
|
||||
return getTypeOfSymbol(prop);
|
||||
@@ -5147,7 +5193,8 @@ module ts {
|
||||
if (fullTypeCheck) {
|
||||
checkCollisionWithIndexVariableInGeneratedCode(parameterDeclaration, parameterDeclaration.name);
|
||||
|
||||
if (parameterDeclaration.flags & (NodeFlags.Public | NodeFlags.Private) && !(parameterDeclaration.parent.kind === SyntaxKind.Constructor && (<ConstructorDeclaration>parameterDeclaration.parent).body)) {
|
||||
if (parameterDeclaration.flags & (NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected) &&
|
||||
!(parameterDeclaration.parent.kind === SyntaxKind.Constructor && (<ConstructorDeclaration>parameterDeclaration.parent).body)) {
|
||||
error(parameterDeclaration, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);
|
||||
}
|
||||
if (parameterDeclaration.flags & NodeFlags.Rest) {
|
||||
@@ -5340,7 +5387,7 @@ module ts {
|
||||
// or the containing class declares instance member variables with initializers.
|
||||
var superCallShouldBeFirst =
|
||||
forEach((<ClassDeclaration>node.parent).members, isInstancePropertyWithInitializer) ||
|
||||
forEach(node.parameters, p => p.flags & (NodeFlags.Public | NodeFlags.Private));
|
||||
forEach(node.parameters, p => p.flags & (NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected));
|
||||
|
||||
if (superCallShouldBeFirst) {
|
||||
var statements = (<Block>node.body).statements;
|
||||
@@ -5517,8 +5564,8 @@ module ts {
|
||||
else if (deviation & NodeFlags.Ambient) {
|
||||
error(o.name, Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient);
|
||||
}
|
||||
else if (deviation & NodeFlags.Private) {
|
||||
error(o.name, Diagnostics.Overload_signatures_must_all_be_public_or_private);
|
||||
else if (deviation & (NodeFlags.Private | NodeFlags.Protected)) {
|
||||
error(o.name, Diagnostics.Overload_signatures_must_all_be_public_private_or_protected);
|
||||
}
|
||||
else if (deviation & NodeFlags.QuestionMark) {
|
||||
error(o.name, Diagnostics.Overload_signatures_must_all_be_optional_or_required);
|
||||
@@ -5527,7 +5574,7 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
var flagsToCheck: NodeFlags = NodeFlags.Export | NodeFlags.Ambient | NodeFlags.Private | NodeFlags.QuestionMark;
|
||||
var flagsToCheck: NodeFlags = NodeFlags.Export | NodeFlags.Ambient | NodeFlags.Private | NodeFlags.Protected | NodeFlags.QuestionMark;
|
||||
var someNodeFlags: NodeFlags = 0;
|
||||
var allNodeFlags = flagsToCheck;
|
||||
var hasOverloads = false;
|
||||
@@ -6307,7 +6354,7 @@ module ts {
|
||||
}
|
||||
|
||||
function getTargetSymbol(s: Symbol) {
|
||||
// if symbol is instantiated it's flags are not copied from the 'target'
|
||||
// if symbol is instantiated its flags are not copied from the 'target'
|
||||
// so we'll need to get back original 'target' symbol to work with correct set of flags
|
||||
return s.flags & SymbolFlags.Instantiated ? getSymbolLinks(s).target : s;
|
||||
}
|
||||
|
||||
@@ -138,9 +138,9 @@ module ts {
|
||||
Type_0_is_not_assignable_to_type_1_Colon: { code: 2322, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}':" },
|
||||
Type_0_is_not_assignable_to_type_1: { code: 2323, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}'." },
|
||||
Property_0_is_missing_in_type_1: { code: 2324, category: DiagnosticCategory.Error, key: "Property '{0}' is missing in type '{1}'." },
|
||||
Private_property_0_cannot_be_reimplemented: { code: 2325, category: DiagnosticCategory.Error, key: "Private property '{0}' cannot be reimplemented." },
|
||||
Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: DiagnosticCategory.Error, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." },
|
||||
Types_of_property_0_are_incompatible_Colon: { code: 2326, category: DiagnosticCategory.Error, key: "Types of property '{0}' are incompatible:" },
|
||||
Required_property_0_cannot_be_reimplemented_with_optional_property_in_1: { code: 2327, category: DiagnosticCategory.Error, key: "Required property '{0}' cannot be reimplemented with optional property in '{1}'." },
|
||||
Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: DiagnosticCategory.Error, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." },
|
||||
Types_of_parameters_0_and_1_are_incompatible_Colon: { code: 2328, category: DiagnosticCategory.Error, key: "Types of parameters '{0}' and '{1}' are incompatible:" },
|
||||
Index_signature_is_missing_in_type_0: { code: 2329, category: DiagnosticCategory.Error, key: "Index signature is missing in type '{0}'." },
|
||||
Index_signatures_are_incompatible_Colon: { code: 2330, category: DiagnosticCategory.Error, key: "Index signatures are incompatible:" },
|
||||
@@ -153,8 +153,8 @@ module ts {
|
||||
Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: DiagnosticCategory.Error, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" },
|
||||
super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: DiagnosticCategory.Error, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" },
|
||||
Property_0_does_not_exist_on_type_1: { code: 2339, category: DiagnosticCategory.Error, key: "Property '{0}' does not exist on type '{1}'." },
|
||||
Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: DiagnosticCategory.Error, key: "Only public methods of the base class are accessible via the 'super' keyword" },
|
||||
Property_0_is_inaccessible: { code: 2341, category: DiagnosticCategory.Error, key: "Property '{0}' is inaccessible." },
|
||||
Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: DiagnosticCategory.Error, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" },
|
||||
Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: DiagnosticCategory.Error, key: "Property '{0}' is private and only accessible within class '{1}'." },
|
||||
An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 2342, category: DiagnosticCategory.Error, key: "An index expression argument must be of type 'string', 'number', or 'any'." },
|
||||
Type_0_does_not_satisfy_the_constraint_1_Colon: { code: 2343, category: DiagnosticCategory.Error, key: "Type '{0}' does not satisfy the constraint '{1}':" },
|
||||
Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: DiagnosticCategory.Error, key: "Type '{0}' does not satisfy the constraint '{1}'." },
|
||||
@@ -198,7 +198,7 @@ module ts {
|
||||
Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: DiagnosticCategory.Error, key: "Specialized overload signature is not assignable to any non-specialized signature." },
|
||||
Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: DiagnosticCategory.Error, key: "Overload signatures must all be exported or not exported." },
|
||||
Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: DiagnosticCategory.Error, key: "Overload signatures must all be ambient or non-ambient." },
|
||||
Overload_signatures_must_all_be_public_or_private: { code: 2385, category: DiagnosticCategory.Error, key: "Overload signatures must all be public or private." },
|
||||
Overload_signatures_must_all_be_public_private_or_protected: { code: 2385, category: DiagnosticCategory.Error, key: "Overload signatures must all be public, private or protected." },
|
||||
Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: DiagnosticCategory.Error, key: "Overload signatures must all be optional or required." },
|
||||
Function_overload_must_be_static: { code: 2387, category: DiagnosticCategory.Error, key: "Function overload must be static." },
|
||||
Function_overload_must_not_be_static: { code: 2388, category: DiagnosticCategory.Error, key: "Function overload must not be static." },
|
||||
@@ -255,6 +255,11 @@ module ts {
|
||||
Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: DiagnosticCategory.Error, key: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name." },
|
||||
Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: DiagnosticCategory.Error, key: "Import declaration conflicts with local declaration of '{0}'" },
|
||||
Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: { code: 2441, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." },
|
||||
Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: DiagnosticCategory.Error, key: "Types have separate declarations of a private property '{0}'." },
|
||||
Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: DiagnosticCategory.Error, key: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." },
|
||||
Property_0_is_protected_in_type_1_but_public_in_type_2: { code: 2444, category: DiagnosticCategory.Error, key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." },
|
||||
Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: DiagnosticCategory.Error, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." },
|
||||
Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: DiagnosticCategory.Error, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." },
|
||||
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}'." },
|
||||
|
||||
@@ -544,7 +544,7 @@
|
||||
"category": "Error",
|
||||
"code": 2324
|
||||
},
|
||||
"Private property '{0}' cannot be reimplemented.": {
|
||||
"Property '{0}' is private in type '{1}' but not in type '{2}'.": {
|
||||
"category": "Error",
|
||||
"code": 2325
|
||||
},
|
||||
@@ -552,7 +552,7 @@
|
||||
"category": "Error",
|
||||
"code": 2326
|
||||
},
|
||||
"Required property '{0}' cannot be reimplemented with optional property in '{1}'.": {
|
||||
"Property '{0}' is optional in type '{1}' but required in type '{2}'.": {
|
||||
"category": "Error",
|
||||
"code": 2327
|
||||
},
|
||||
@@ -604,11 +604,11 @@
|
||||
"category": "Error",
|
||||
"code": 2339
|
||||
},
|
||||
"Only public methods of the base class are accessible via the 'super' keyword": {
|
||||
"Only public and protected methods of the base class are accessible via the 'super' keyword": {
|
||||
"category": "Error",
|
||||
"code": 2340
|
||||
},
|
||||
"Property '{0}' is inaccessible.": {
|
||||
"Property '{0}' is private and only accessible within class '{1}'.": {
|
||||
"category": "Error",
|
||||
"code": 2341
|
||||
},
|
||||
@@ -784,7 +784,7 @@
|
||||
"category": "Error",
|
||||
"code": 2384
|
||||
},
|
||||
"Overload signatures must all be public or private.": {
|
||||
"Overload signatures must all be public, private or protected.": {
|
||||
"category": "Error",
|
||||
"code": 2385
|
||||
},
|
||||
@@ -1012,7 +1012,26 @@
|
||||
"category": "Error",
|
||||
"code": 2441
|
||||
},
|
||||
|
||||
"Types have separate declarations of a private property '{0}'.": {
|
||||
"category": "Error",
|
||||
"code": 2442
|
||||
},
|
||||
"Property '{0}' is protected but type '{1}' is not a class derived from '{2}'.": {
|
||||
"category": "Error",
|
||||
"code": 2443
|
||||
},
|
||||
"Property '{0}' is protected in type '{1}' but public in type '{2}'.": {
|
||||
"category": "Error",
|
||||
"code": 2444
|
||||
},
|
||||
"Property '{0}' is protected and only accessible within class '{1}' and its subclasses.": {
|
||||
"category": "Error",
|
||||
"code": 2445
|
||||
},
|
||||
"Property '{0}' is protected and only accessible through an instance of class '{1}'.": {
|
||||
"category": "Error",
|
||||
"code": 2446
|
||||
},
|
||||
|
||||
"Import declaration '{0}' is using private name '{1}'.": {
|
||||
"category": "Error",
|
||||
|
||||
@@ -2370,12 +2370,18 @@ module ts {
|
||||
if (node.flags & NodeFlags.Private) {
|
||||
write("private ");
|
||||
}
|
||||
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
|
||||
|
||||
@@ -656,6 +656,7 @@ module ts {
|
||||
switch (token) {
|
||||
case SyntaxKind.PublicKeyword:
|
||||
case SyntaxKind.PrivateKeyword:
|
||||
case SyntaxKind.ProtectedKeyword:
|
||||
case SyntaxKind.StaticKeyword:
|
||||
case SyntaxKind.ExportKeyword:
|
||||
case SyntaxKind.DeclareKeyword:
|
||||
@@ -2981,6 +2982,7 @@ module ts {
|
||||
}
|
||||
case SyntaxKind.PublicKeyword:
|
||||
case SyntaxKind.PrivateKeyword:
|
||||
case SyntaxKind.ProtectedKeyword:
|
||||
case SyntaxKind.StaticKeyword:
|
||||
// When followed by an identifier or keyword, these do not start a statement but
|
||||
// might instead be following type members
|
||||
@@ -3299,6 +3301,8 @@ module ts {
|
||||
var lastDeclareModifierLength: number;
|
||||
var lastPrivateModifierStart: number;
|
||||
var lastPrivateModifierLength: number;
|
||||
var lastProtectedModifierStart: number;
|
||||
var lastProtectedModifierLength: number;
|
||||
|
||||
while (true) {
|
||||
var modifierStart = scanner.getTokenPos();
|
||||
@@ -3338,6 +3342,21 @@ module ts {
|
||||
flags |= NodeFlags.Private;
|
||||
break;
|
||||
|
||||
case SyntaxKind.ProtectedKeyword:
|
||||
if (flags & NodeFlags.Public || flags & NodeFlags.Private || flags & NodeFlags.Protected) {
|
||||
grammarErrorAtPos(modifierStart, modifierLength, Diagnostics.Accessibility_modifier_already_seen);
|
||||
}
|
||||
else if (flags & NodeFlags.Static) {
|
||||
grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_must_precede_1_modifier, "protected", "static");
|
||||
}
|
||||
else if (context === ModifierContext.ModuleElements || context === ModifierContext.SourceElements) {
|
||||
grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_module_element, "protected");
|
||||
}
|
||||
lastProtectedModifierStart = modifierStart;
|
||||
lastProtectedModifierLength = modifierLength;
|
||||
flags |= NodeFlags.Protected;
|
||||
break;
|
||||
|
||||
case SyntaxKind.StaticKeyword:
|
||||
if (flags & NodeFlags.Static) {
|
||||
grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_already_seen, "static");
|
||||
@@ -3395,6 +3414,9 @@ module ts {
|
||||
else if (token === SyntaxKind.ConstructorKeyword && flags & NodeFlags.Private) {
|
||||
grammarErrorAtPos(lastPrivateModifierStart, lastPrivateModifierLength, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private");
|
||||
}
|
||||
else if (token === SyntaxKind.ConstructorKeyword && flags & NodeFlags.Protected) {
|
||||
grammarErrorAtPos(lastProtectedModifierStart, lastProtectedModifierLength, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "protected");
|
||||
}
|
||||
else if (token === SyntaxKind.ImportKeyword) {
|
||||
if (flags & NodeFlags.Ambient) {
|
||||
grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare");
|
||||
@@ -3671,6 +3693,7 @@ module ts {
|
||||
case SyntaxKind.DeclareKeyword:
|
||||
case SyntaxKind.PublicKeyword:
|
||||
case SyntaxKind.PrivateKeyword:
|
||||
case SyntaxKind.ProtectedKeyword:
|
||||
case SyntaxKind.StaticKeyword:
|
||||
// Check for modifier on source element
|
||||
return lookAhead(() => { nextToken(); return isDeclaration(); });
|
||||
|
||||
@@ -238,13 +238,14 @@ module ts {
|
||||
Rest = 0x00000008, // Parameter
|
||||
Public = 0x00000010, // Property/Method
|
||||
Private = 0x00000020, // Property/Method
|
||||
Static = 0x00000040, // Property/Method
|
||||
MultiLine = 0x00000080, // Multi-line array or object literal
|
||||
Synthetic = 0x00000100, // Synthetic node (for full fidelity)
|
||||
DeclarationFile = 0x00000200, // Node is a .d.ts file
|
||||
Protected = 0x00000040, // Property/Method
|
||||
Static = 0x00000080, // Property/Method
|
||||
MultiLine = 0x00000100, // Multi-line array or object literal
|
||||
Synthetic = 0x00000200, // Synthetic node (for full fidelity)
|
||||
DeclarationFile = 0x00000400, // Node is a .d.ts file
|
||||
|
||||
Modifier = Export | Ambient | Public | Private | Static,
|
||||
AccessibilityModifier = Public | Private
|
||||
Modifier = Export | Ambient | Public | Private | Protected | Static,
|
||||
AccessibilityModifier = Public | Private | Protected
|
||||
}
|
||||
|
||||
export interface Node extends TextRange {
|
||||
|
||||
@@ -42,6 +42,10 @@ module TypeScript {
|
||||
walker.walk(preAst.typeArguments);
|
||||
}
|
||||
|
||||
function walkTupleTypeChildren(preAst: TupleTypeSyntax, walker: AstWalker): void {
|
||||
walker.walk(preAst.types);
|
||||
}
|
||||
|
||||
function walkTypeOfExpressionChildren(preAst: TypeOfExpressionSyntax, walker: AstWalker): void {
|
||||
walker.walk(preAst.expression);
|
||||
}
|
||||
@@ -561,6 +565,7 @@ module TypeScript {
|
||||
childrenWalkers[SyntaxKind.TriviaList] = null;
|
||||
childrenWalkers[SyntaxKind.TrueKeyword] = null;
|
||||
childrenWalkers[SyntaxKind.TryStatement] = walkTryStatementChildren;
|
||||
childrenWalkers[SyntaxKind.TupleType] = walkTupleTypeChildren;
|
||||
childrenWalkers[SyntaxKind.TypeAnnotation] = walkTypeAnnotationChildren;
|
||||
childrenWalkers[SyntaxKind.TypeArgumentList] = walkTypeArgumentListChildren;
|
||||
childrenWalkers[SyntaxKind.TypeOfExpression] = walkTypeOfExpressionChildren;
|
||||
|
||||
@@ -42,6 +42,10 @@ module TypeScript {
|
||||
return this.defaultVisit(node);
|
||||
}
|
||||
|
||||
public visitTupleType(node: TupleTypeSyntax): any {
|
||||
return this.defaultVisit(node);
|
||||
}
|
||||
|
||||
public visitInterfaceDeclaration(node: InterfaceDeclarationSyntax): any {
|
||||
return this.defaultVisit(node);
|
||||
}
|
||||
|
||||
@@ -1048,6 +1048,7 @@ module TypeScript.Parser {
|
||||
case SyntaxKind.ExportKeyword:
|
||||
case SyntaxKind.PublicKeyword:
|
||||
case SyntaxKind.PrivateKeyword:
|
||||
case SyntaxKind.ProtectedKeyword:
|
||||
case SyntaxKind.StaticKeyword:
|
||||
case SyntaxKind.DeclareKeyword:
|
||||
return true;
|
||||
@@ -1434,6 +1435,19 @@ module TypeScript.Parser {
|
||||
return new syntaxFactory.ObjectTypeSyntax(parseNodeData, openBraceToken, typeMembers, eatToken(SyntaxKind.CloseBraceToken));
|
||||
}
|
||||
|
||||
function parseTupleType(currentToken: ISyntaxToken): TupleTypeSyntax {
|
||||
var openBracket = consumeToken(currentToken);
|
||||
|
||||
var types = Syntax.emptySeparatedList<ITypeSyntax>();
|
||||
if (openBracket.fullWidth() > 0) {
|
||||
var skippedTokens: ISyntaxToken[] = getArray();
|
||||
types = parseSeparatedSyntaxList<ITypeSyntax>(ListParsingState.TupleType_Types, skippedTokens);
|
||||
openBracket = addSkippedTokensAfterToken(openBracket, skippedTokens);
|
||||
}
|
||||
|
||||
return new syntaxFactory.TupleTypeSyntax(parseNodeData, openBracket, types, eatToken(SyntaxKind.CloseBracketToken));
|
||||
}
|
||||
|
||||
function isTypeMember(inErrorRecovery: boolean): boolean {
|
||||
if (SyntaxUtilities.isTypeMember(currentNode())) {
|
||||
return true;
|
||||
@@ -1663,6 +1677,7 @@ module TypeScript.Parser {
|
||||
// ERROR RECOVERY
|
||||
case SyntaxKind.PublicKeyword:
|
||||
case SyntaxKind.PrivateKeyword:
|
||||
case SyntaxKind.ProtectedKeyword:
|
||||
case SyntaxKind.StaticKeyword:
|
||||
// None of the above are actually keywords. And they might show up in a real
|
||||
// statement (i.e. "public();"). However, if we see 'public <identifier>' then
|
||||
@@ -1731,6 +1746,7 @@ module TypeScript.Parser {
|
||||
// ERROR RECOVERY
|
||||
case SyntaxKind.PublicKeyword:
|
||||
case SyntaxKind.PrivateKeyword:
|
||||
case SyntaxKind.ProtectedKeyword:
|
||||
case SyntaxKind.StaticKeyword:
|
||||
// None of the above are actually keywords. And they might show up in a real
|
||||
// statement (i.e. "public();"). However, if we see 'public <identifier>' then
|
||||
@@ -3133,7 +3149,7 @@ module TypeScript.Parser {
|
||||
token2 = peekToken(2);
|
||||
token2Kind = token2.kind();
|
||||
|
||||
if (token1Kind === SyntaxKind.PublicKeyword || token1Kind === SyntaxKind.PrivateKeyword) {
|
||||
if (SyntaxFacts.isAccessibilityModifier(token1Kind)) {
|
||||
if (isIdentifier(token2)) {
|
||||
// "(public id" or "(function id". Definitely an arrow function. Could never
|
||||
// be a parenthesized expression. Note: this will be an *illegal* arrow
|
||||
@@ -3557,11 +3573,12 @@ module TypeScript.Parser {
|
||||
|
||||
return consumeToken(_currentToken);
|
||||
case SyntaxKind.OpenParenToken:
|
||||
case SyntaxKind.LessThanToken: return tryParseFunctionType();
|
||||
case SyntaxKind.VoidKeyword: return consumeToken(_currentToken);
|
||||
case SyntaxKind.OpenBraceToken: return parseObjectType();
|
||||
case SyntaxKind.NewKeyword: return parseConstructorType();
|
||||
case SyntaxKind.TypeOfKeyword: return parseTypeQuery(_currentToken);
|
||||
case SyntaxKind.LessThanToken: return tryParseFunctionType();
|
||||
case SyntaxKind.VoidKeyword: return consumeToken(_currentToken);
|
||||
case SyntaxKind.OpenBraceToken: return parseObjectType();
|
||||
case SyntaxKind.NewKeyword: return parseConstructorType();
|
||||
case SyntaxKind.TypeOfKeyword: return parseTypeQuery(_currentToken);
|
||||
case SyntaxKind.OpenBracketToken: return parseTupleType(_currentToken);
|
||||
}
|
||||
|
||||
return tryParseNameOrGenericType();
|
||||
@@ -3973,6 +3990,7 @@ module TypeScript.Parser {
|
||||
case ListParsingState.IndexSignature_Parameters: return isExpectedIndexSignature_ParametersTerminator();
|
||||
case ListParsingState.TypeArgumentList_Types: return isExpectedTypeArgumentList_TypesTerminator();
|
||||
case ListParsingState.TypeParameterList_TypeParameters: return isExpectedTypeParameterList_TypeParametersTerminator();
|
||||
case ListParsingState.TupleType_Types: return isExpectedTupleType_TypesTerminator();
|
||||
default:
|
||||
throw Errors.invalidOperation();
|
||||
}
|
||||
@@ -4019,6 +4037,17 @@ module TypeScript.Parser {
|
||||
return false;
|
||||
}
|
||||
|
||||
function isExpectedTupleType_TypesTerminator(): boolean {
|
||||
var token = currentToken();
|
||||
var tokenKind = token.kind();
|
||||
if (tokenKind === SyntaxKind.CloseBracketToken) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// TODO: add more cases as necessary for error tolerance.
|
||||
return false;
|
||||
}
|
||||
|
||||
function isExpectedTypeParameterList_TypeParametersTerminator(): boolean {
|
||||
var tokenKind = currentToken().kind();
|
||||
if (tokenKind === SyntaxKind.GreaterThanToken) {
|
||||
@@ -4187,6 +4216,7 @@ module TypeScript.Parser {
|
||||
case ListParsingState.IndexSignature_Parameters: return isParameter();
|
||||
case ListParsingState.TypeArgumentList_Types: return isType();
|
||||
case ListParsingState.TypeParameterList_TypeParameters: return isTypeParameter();
|
||||
case ListParsingState.TupleType_Types: return isType();
|
||||
default: throw Errors.invalidOperation();
|
||||
}
|
||||
}
|
||||
@@ -4230,6 +4260,7 @@ module TypeScript.Parser {
|
||||
case ListParsingState.IndexSignature_Parameters: return tryParseParameter();
|
||||
case ListParsingState.TypeArgumentList_Types: return tryParseType();
|
||||
case ListParsingState.TypeParameterList_TypeParameters: return tryParseTypeParameter();
|
||||
case ListParsingState.TupleType_Types: return tryParseType();
|
||||
default: throw Errors.invalidOperation();
|
||||
}
|
||||
}
|
||||
@@ -4254,6 +4285,7 @@ module TypeScript.Parser {
|
||||
case ListParsingState.IndexSignature_Parameters: return getLocalizedText(DiagnosticCode.parameter, null);
|
||||
case ListParsingState.TypeArgumentList_Types: return getLocalizedText(DiagnosticCode.type, null);
|
||||
case ListParsingState.TypeParameterList_TypeParameters: return getLocalizedText(DiagnosticCode.type_parameter, null);
|
||||
case ListParsingState.TupleType_Types: return getLocalizedText(DiagnosticCode.type, null);
|
||||
case ListParsingState.ArrayLiteralExpression_AssignmentExpressions: return getLocalizedText(DiagnosticCode.expression, null);
|
||||
default: throw Errors.invalidOperation();
|
||||
}
|
||||
@@ -4376,9 +4408,10 @@ module TypeScript.Parser {
|
||||
IndexSignature_Parameters = 18,
|
||||
TypeArgumentList_Types = 19,
|
||||
TypeParameterList_TypeParameters = 20,
|
||||
TupleType_Types = 21,
|
||||
|
||||
FirstListParsingState = SourceUnit_ModuleElements,
|
||||
LastListParsingState = TypeParameterList_TypeParameters,
|
||||
LastListParsingState = TupleType_Types,
|
||||
}
|
||||
|
||||
// We keep the parser around as a singleton. This is because calling createParser is actually
|
||||
|
||||
@@ -421,6 +421,12 @@ module TypeScript.PrettyPrinter {
|
||||
this.appendToken(node.greaterThanToken);
|
||||
}
|
||||
|
||||
public visitTupleType(node: TupleTypeSyntax): void {
|
||||
this.appendToken(node.openBracketToken);
|
||||
this.appendSeparatorSpaceList(node.types);
|
||||
this.appendToken(node.closeBracketToken);
|
||||
}
|
||||
|
||||
public visitConstructorType(node: ConstructorTypeSyntax): void {
|
||||
this.appendToken(node.newKeyword);
|
||||
this.ensureSpace();
|
||||
|
||||
@@ -26,4 +26,15 @@ module TypeScript.SyntaxFacts {
|
||||
var tokenKind = token.kind();
|
||||
return tokenKind === SyntaxKind.IdentifierName || SyntaxFacts.isAnyKeyword(tokenKind);
|
||||
}
|
||||
|
||||
export function isAccessibilityModifier(kind: SyntaxKind): boolean {
|
||||
switch (kind) {
|
||||
case SyntaxKind.PublicKeyword:
|
||||
case SyntaxKind.PrivateKeyword:
|
||||
case SyntaxKind.ProtectedKeyword:
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -354,6 +354,17 @@ var definitions:ITypeDefinition[] = [
|
||||
],
|
||||
isTypeScriptSpecific: true
|
||||
},
|
||||
<any> {
|
||||
name: 'TupleTypeSyntax',
|
||||
baseType: 'ISyntaxNode',
|
||||
interfaces: ['ITypeSyntax'],
|
||||
children: [
|
||||
<any>{ name: 'openBracketToken', isToken: true, excludeFromAST: true },
|
||||
<any>{ name: 'types', isSeparatedList: true, elementType: 'ITypeSyntax' },
|
||||
<any>{ name: 'closeBracketToken', isToken: true, excludeFromAST: true }
|
||||
],
|
||||
isTypeScriptSpecific: true
|
||||
},
|
||||
<any>{
|
||||
name: 'TypeAnnotationSyntax',
|
||||
baseType: 'ISyntaxNode',
|
||||
|
||||
@@ -158,6 +158,7 @@ module TypeScript {
|
||||
ConstructorType,
|
||||
GenericType,
|
||||
TypeQuery,
|
||||
TupleType,
|
||||
|
||||
// Module elements.
|
||||
InterfaceDeclaration,
|
||||
|
||||
@@ -108,6 +108,17 @@ module TypeScript.Syntax.Abstract {
|
||||
name.parent = this;
|
||||
}
|
||||
}
|
||||
export class TupleTypeSyntax extends SyntaxNode implements ITypeSyntax {
|
||||
public openBracketToken: ISyntaxToken;
|
||||
public types: ITypeSyntax[];
|
||||
public closeBracketToken: ISyntaxToken;
|
||||
public _typeBrand: any;
|
||||
constructor(data: number, openBracketToken: ISyntaxToken, types: ITypeSyntax[], closeBracketToken: ISyntaxToken) {
|
||||
super(data);
|
||||
this.types = types,
|
||||
!isShared(types) && (types.parent = this);
|
||||
}
|
||||
}
|
||||
export class InterfaceDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax {
|
||||
public modifiers: ISyntaxToken[];
|
||||
public interfaceKeyword: ISyntaxToken;
|
||||
@@ -1190,5 +1201,5 @@ module TypeScript.Syntax.Abstract {
|
||||
}
|
||||
}
|
||||
|
||||
(<any>SourceUnitSyntax).prototype.__kind = SyntaxKind.SourceUnit, (<any>QualifiedNameSyntax).prototype.__kind = SyntaxKind.QualifiedName, (<any>ObjectTypeSyntax).prototype.__kind = SyntaxKind.ObjectType, (<any>FunctionTypeSyntax).prototype.__kind = SyntaxKind.FunctionType, (<any>ArrayTypeSyntax).prototype.__kind = SyntaxKind.ArrayType, (<any>ConstructorTypeSyntax).prototype.__kind = SyntaxKind.ConstructorType, (<any>GenericTypeSyntax).prototype.__kind = SyntaxKind.GenericType, (<any>TypeQuerySyntax).prototype.__kind = SyntaxKind.TypeQuery, (<any>InterfaceDeclarationSyntax).prototype.__kind = SyntaxKind.InterfaceDeclaration, (<any>FunctionDeclarationSyntax).prototype.__kind = SyntaxKind.FunctionDeclaration, (<any>ModuleDeclarationSyntax).prototype.__kind = SyntaxKind.ModuleDeclaration, (<any>ClassDeclarationSyntax).prototype.__kind = SyntaxKind.ClassDeclaration, (<any>EnumDeclarationSyntax).prototype.__kind = SyntaxKind.EnumDeclaration, (<any>ImportDeclarationSyntax).prototype.__kind = SyntaxKind.ImportDeclaration, (<any>ExportAssignmentSyntax).prototype.__kind = SyntaxKind.ExportAssignment, (<any>MemberFunctionDeclarationSyntax).prototype.__kind = SyntaxKind.MemberFunctionDeclaration, (<any>MemberVariableDeclarationSyntax).prototype.__kind = SyntaxKind.MemberVariableDeclaration, (<any>ConstructorDeclarationSyntax).prototype.__kind = SyntaxKind.ConstructorDeclaration, (<any>IndexMemberDeclarationSyntax).prototype.__kind = SyntaxKind.IndexMemberDeclaration, (<any>GetAccessorSyntax).prototype.__kind = SyntaxKind.GetAccessor, (<any>SetAccessorSyntax).prototype.__kind = SyntaxKind.SetAccessor, (<any>PropertySignatureSyntax).prototype.__kind = SyntaxKind.PropertySignature, (<any>CallSignatureSyntax).prototype.__kind = SyntaxKind.CallSignature, (<any>ConstructSignatureSyntax).prototype.__kind = SyntaxKind.ConstructSignature, (<any>IndexSignatureSyntax).prototype.__kind = SyntaxKind.IndexSignature, (<any>MethodSignatureSyntax).prototype.__kind = SyntaxKind.MethodSignature, (<any>BlockSyntax).prototype.__kind = SyntaxKind.Block, (<any>IfStatementSyntax).prototype.__kind = SyntaxKind.IfStatement, (<any>VariableStatementSyntax).prototype.__kind = SyntaxKind.VariableStatement, (<any>ExpressionStatementSyntax).prototype.__kind = SyntaxKind.ExpressionStatement, (<any>ReturnStatementSyntax).prototype.__kind = SyntaxKind.ReturnStatement, (<any>SwitchStatementSyntax).prototype.__kind = SyntaxKind.SwitchStatement, (<any>BreakStatementSyntax).prototype.__kind = SyntaxKind.BreakStatement, (<any>ContinueStatementSyntax).prototype.__kind = SyntaxKind.ContinueStatement, (<any>ForStatementSyntax).prototype.__kind = SyntaxKind.ForStatement, (<any>ForInStatementSyntax).prototype.__kind = SyntaxKind.ForInStatement, (<any>EmptyStatementSyntax).prototype.__kind = SyntaxKind.EmptyStatement, (<any>ThrowStatementSyntax).prototype.__kind = SyntaxKind.ThrowStatement, (<any>WhileStatementSyntax).prototype.__kind = SyntaxKind.WhileStatement, (<any>TryStatementSyntax).prototype.__kind = SyntaxKind.TryStatement, (<any>LabeledStatementSyntax).prototype.__kind = SyntaxKind.LabeledStatement, (<any>DoStatementSyntax).prototype.__kind = SyntaxKind.DoStatement, (<any>DebuggerStatementSyntax).prototype.__kind = SyntaxKind.DebuggerStatement, (<any>WithStatementSyntax).prototype.__kind = SyntaxKind.WithStatement, (<any>DeleteExpressionSyntax).prototype.__kind = SyntaxKind.DeleteExpression, (<any>TypeOfExpressionSyntax).prototype.__kind = SyntaxKind.TypeOfExpression, (<any>VoidExpressionSyntax).prototype.__kind = SyntaxKind.VoidExpression, (<any>ConditionalExpressionSyntax).prototype.__kind = SyntaxKind.ConditionalExpression, (<any>MemberAccessExpressionSyntax).prototype.__kind = SyntaxKind.MemberAccessExpression, (<any>InvocationExpressionSyntax).prototype.__kind = SyntaxKind.InvocationExpression, (<any>ArrayLiteralExpressionSyntax).prototype.__kind = SyntaxKind.ArrayLiteralExpression, (<any>ObjectLiteralExpressionSyntax).prototype.__kind = SyntaxKind.ObjectLiteralExpression, (<any>ObjectCreationExpressionSyntax).prototype.__kind = SyntaxKind.ObjectCreationExpression, (<any>ParenthesizedExpressionSyntax).prototype.__kind = SyntaxKind.ParenthesizedExpression, (<any>ParenthesizedArrowFunctionExpressionSyntax).prototype.__kind = SyntaxKind.ParenthesizedArrowFunctionExpression, (<any>SimpleArrowFunctionExpressionSyntax).prototype.__kind = SyntaxKind.SimpleArrowFunctionExpression, (<any>CastExpressionSyntax).prototype.__kind = SyntaxKind.CastExpression, (<any>ElementAccessExpressionSyntax).prototype.__kind = SyntaxKind.ElementAccessExpression, (<any>FunctionExpressionSyntax).prototype.__kind = SyntaxKind.FunctionExpression, (<any>OmittedExpressionSyntax).prototype.__kind = SyntaxKind.OmittedExpression, (<any>VariableDeclarationSyntax).prototype.__kind = SyntaxKind.VariableDeclaration, (<any>VariableDeclaratorSyntax).prototype.__kind = SyntaxKind.VariableDeclarator, (<any>ArgumentListSyntax).prototype.__kind = SyntaxKind.ArgumentList, (<any>ParameterListLine truncated
|
||||
(<any>SourceUnitSyntax).prototype.__kind = SyntaxKind.SourceUnit, (<any>QualifiedNameSyntax).prototype.__kind = SyntaxKind.QualifiedName, (<any>ObjectTypeSyntax).prototype.__kind = SyntaxKind.ObjectType, (<any>FunctionTypeSyntax).prototype.__kind = SyntaxKind.FunctionType, (<any>ArrayTypeSyntax).prototype.__kind = SyntaxKind.ArrayType, (<any>ConstructorTypeSyntax).prototype.__kind = SyntaxKind.ConstructorType, (<any>GenericTypeSyntax).prototype.__kind = SyntaxKind.GenericType, (<any>TypeQuerySyntax).prototype.__kind = SyntaxKind.TypeQuery, (<any>TupleTypeSyntax).prototype.__kind = SyntaxKind.TupleType, (<any>InterfaceDeclarationSyntax).prototype.__kind = SyntaxKind.InterfaceDeclaration, (<any>FunctionDeclarationSyntax).prototype.__kind = SyntaxKind.FunctionDeclaration, (<any>ModuleDeclarationSyntax).prototype.__kind = SyntaxKind.ModuleDeclaration, (<any>ClassDeclarationSyntax).prototype.__kind = SyntaxKind.ClassDeclaration, (<any>EnumDeclarationSyntax).prototype.__kind = SyntaxKind.EnumDeclaration, (<any>ImportDeclarationSyntax).prototype.__kind = SyntaxKind.ImportDeclaration, (<any>ExportAssignmentSyntax).prototype.__kind = SyntaxKind.ExportAssignment, (<any>MemberFunctionDeclarationSyntax).prototype.__kind = SyntaxKind.MemberFunctionDeclaration, (<any>MemberVariableDeclarationSyntax).prototype.__kind = SyntaxKind.MemberVariableDeclaration, (<any>ConstructorDeclarationSyntax).prototype.__kind = SyntaxKind.ConstructorDeclaration, (<any>IndexMemberDeclarationSyntax).prototype.__kind = SyntaxKind.IndexMemberDeclaration, (<any>GetAccessorSyntax).prototype.__kind = SyntaxKind.GetAccessor, (<any>SetAccessorSyntax).prototype.__kind = SyntaxKind.SetAccessor, (<any>PropertySignatureSyntax).prototype.__kind = SyntaxKind.PropertySignature, (<any>CallSignatureSyntax).prototype.__kind = SyntaxKind.CallSignature, (<any>ConstructSignatureSyntax).prototype.__kind = SyntaxKind.ConstructSignature, (<any>IndexSignatureSyntax).prototype.__kind = SyntaxKind.IndexSignature, (<any>MethodSignatureSyntax).prototype.__kind = SyntaxKind.MethodSignature, (<any>BlockSyntax).prototype.__kind = SyntaxKind.Block, (<any>IfStatementSyntax).prototype.__kind = SyntaxKind.IfStatement, (<any>VariableStatementSyntax).prototype.__kind = SyntaxKind.VariableStatement, (<any>ExpressionStatementSyntax).prototype.__kind = SyntaxKind.ExpressionStatement, (<any>ReturnStatementSyntax).prototype.__kind = SyntaxKind.ReturnStatement, (<any>SwitchStatementSyntax).prototype.__kind = SyntaxKind.SwitchStatement, (<any>BreakStatementSyntax).prototype.__kind = SyntaxKind.BreakStatement, (<any>ContinueStatementSyntax).prototype.__kind = SyntaxKind.ContinueStatement, (<any>ForStatementSyntax).prototype.__kind = SyntaxKind.ForStatement, (<any>ForInStatementSyntax).prototype.__kind = SyntaxKind.ForInStatement, (<any>EmptyStatementSyntax).prototype.__kind = SyntaxKind.EmptyStatement, (<any>ThrowStatementSyntax).prototype.__kind = SyntaxKind.ThrowStatement, (<any>WhileStatementSyntax).prototype.__kind = SyntaxKind.WhileStatement, (<any>TryStatementSyntax).prototype.__kind = SyntaxKind.TryStatement, (<any>LabeledStatementSyntax).prototype.__kind = SyntaxKind.LabeledStatement, (<any>DoStatementSyntax).prototype.__kind = SyntaxKind.DoStatement, (<any>DebuggerStatementSyntax).prototype.__kind = SyntaxKind.DebuggerStatement, (<any>WithStatementSyntax).prototype.__kind = SyntaxKind.WithStatement, (<any>DeleteExpressionSyntax).prototype.__kind = SyntaxKind.DeleteExpression, (<any>TypeOfExpressionSyntax).prototype.__kind = SyntaxKind.TypeOfExpression, (<any>VoidExpressionSyntax).prototype.__kind = SyntaxKind.VoidExpression, (<any>ConditionalExpressionSyntax).prototype.__kind = SyntaxKind.ConditionalExpression, (<any>MemberAccessExpressionSyntax).prototype.__kind = SyntaxKind.MemberAccessExpression, (<any>InvocationExpressionSyntax).prototype.__kind = SyntaxKind.InvocationExpression, (<any>ArrayLiteralExpressionSyntax).prototype.__kind = SyntaxKind.ArrayLiteralExpression, (<any>ObjectLiteralExpressionSyntax).prototype.__kind = SyntaxKind.ObjectLiteralExpression, (<any>ObjectCreationExpressionSyntax).prototype.__kind = SyntaxKind.ObjectCreationExpression, (<any>ParenthesizedExpressionSyntax).prototype.__kind = SyntaxKind.ParenthesizedExpression, (<any>ParenthesizedArrowFunctionExpressionSyntax).prototype.__kind = SyntaxKind.ParenthesizedArrowFunctionExpression, (<any>SimpleArrowFunctionExpressionSyntax).prototype.__kind = SyntaxKind.SimpleArrowFunctionExpression, (<any>CastExpressionSyntax).prototype.__kind = SyntaxKind.CastExpression, (<any>ElementAccessExpressionSyntax).prototype.__kind = SyntaxKind.ElementAccessExpression, (<any>FunctionExpressionSyntax).prototype.__kind = SyntaxKind.FunctionExpression, (<any>OmittedExpressionSyntax).prototype.__kind = SyntaxKind.OmittedExpression, (<any>VariableDeclarationSyntax).prototype.__kind = SyntaxKind.VariableDeclaration, (<any>VariableDeclaratorSyntax).prototype.__kind = SyntaxKind.VariableDeclarator, (<any>ArgumentListSyntax)Line truncated
|
||||
}
|
||||
@@ -126,6 +126,21 @@ module TypeScript.Syntax.Concrete {
|
||||
name.parent = this;
|
||||
}
|
||||
}
|
||||
export class TupleTypeSyntax extends SyntaxNode implements ITypeSyntax {
|
||||
public openBracketToken: ISyntaxToken;
|
||||
public types: ITypeSyntax[];
|
||||
public closeBracketToken: ISyntaxToken;
|
||||
public _typeBrand: any;
|
||||
constructor(data: number, openBracketToken: ISyntaxToken, types: ITypeSyntax[], closeBracketToken: ISyntaxToken) {
|
||||
super(data);
|
||||
this.openBracketToken = openBracketToken,
|
||||
this.types = types,
|
||||
this.closeBracketToken = closeBracketToken,
|
||||
openBracketToken.parent = this,
|
||||
!isShared(types) && (types.parent = this),
|
||||
closeBracketToken.parent = this;
|
||||
}
|
||||
}
|
||||
export class InterfaceDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax {
|
||||
public modifiers: ISyntaxToken[];
|
||||
public interfaceKeyword: ISyntaxToken;
|
||||
@@ -1420,5 +1435,5 @@ module TypeScript.Syntax.Concrete {
|
||||
}
|
||||
}
|
||||
|
||||
(<any>SourceUnitSyntax).prototype.__kind = SyntaxKind.SourceUnit, (<any>QualifiedNameSyntax).prototype.__kind = SyntaxKind.QualifiedName, (<any>ObjectTypeSyntax).prototype.__kind = SyntaxKind.ObjectType, (<any>FunctionTypeSyntax).prototype.__kind = SyntaxKind.FunctionType, (<any>ArrayTypeSyntax).prototype.__kind = SyntaxKind.ArrayType, (<any>ConstructorTypeSyntax).prototype.__kind = SyntaxKind.ConstructorType, (<any>GenericTypeSyntax).prototype.__kind = SyntaxKind.GenericType, (<any>TypeQuerySyntax).prototype.__kind = SyntaxKind.TypeQuery, (<any>InterfaceDeclarationSyntax).prototype.__kind = SyntaxKind.InterfaceDeclaration, (<any>FunctionDeclarationSyntax).prototype.__kind = SyntaxKind.FunctionDeclaration, (<any>ModuleDeclarationSyntax).prototype.__kind = SyntaxKind.ModuleDeclaration, (<any>ClassDeclarationSyntax).prototype.__kind = SyntaxKind.ClassDeclaration, (<any>EnumDeclarationSyntax).prototype.__kind = SyntaxKind.EnumDeclaration, (<any>ImportDeclarationSyntax).prototype.__kind = SyntaxKind.ImportDeclaration, (<any>ExportAssignmentSyntax).prototype.__kind = SyntaxKind.ExportAssignment, (<any>MemberFunctionDeclarationSyntax).prototype.__kind = SyntaxKind.MemberFunctionDeclaration, (<any>MemberVariableDeclarationSyntax).prototype.__kind = SyntaxKind.MemberVariableDeclaration, (<any>ConstructorDeclarationSyntax).prototype.__kind = SyntaxKind.ConstructorDeclaration, (<any>IndexMemberDeclarationSyntax).prototype.__kind = SyntaxKind.IndexMemberDeclaration, (<any>GetAccessorSyntax).prototype.__kind = SyntaxKind.GetAccessor, (<any>SetAccessorSyntax).prototype.__kind = SyntaxKind.SetAccessor, (<any>PropertySignatureSyntax).prototype.__kind = SyntaxKind.PropertySignature, (<any>CallSignatureSyntax).prototype.__kind = SyntaxKind.CallSignature, (<any>ConstructSignatureSyntax).prototype.__kind = SyntaxKind.ConstructSignature, (<any>IndexSignatureSyntax).prototype.__kind = SyntaxKind.IndexSignature, (<any>MethodSignatureSyntax).prototype.__kind = SyntaxKind.MethodSignature, (<any>BlockSyntax).prototype.__kind = SyntaxKind.Block, (<any>IfStatementSyntax).prototype.__kind = SyntaxKind.IfStatement, (<any>VariableStatementSyntax).prototype.__kind = SyntaxKind.VariableStatement, (<any>ExpressionStatementSyntax).prototype.__kind = SyntaxKind.ExpressionStatement, (<any>ReturnStatementSyntax).prototype.__kind = SyntaxKind.ReturnStatement, (<any>SwitchStatementSyntax).prototype.__kind = SyntaxKind.SwitchStatement, (<any>BreakStatementSyntax).prototype.__kind = SyntaxKind.BreakStatement, (<any>ContinueStatementSyntax).prototype.__kind = SyntaxKind.ContinueStatement, (<any>ForStatementSyntax).prototype.__kind = SyntaxKind.ForStatement, (<any>ForInStatementSyntax).prototype.__kind = SyntaxKind.ForInStatement, (<any>EmptyStatementSyntax).prototype.__kind = SyntaxKind.EmptyStatement, (<any>ThrowStatementSyntax).prototype.__kind = SyntaxKind.ThrowStatement, (<any>WhileStatementSyntax).prototype.__kind = SyntaxKind.WhileStatement, (<any>TryStatementSyntax).prototype.__kind = SyntaxKind.TryStatement, (<any>LabeledStatementSyntax).prototype.__kind = SyntaxKind.LabeledStatement, (<any>DoStatementSyntax).prototype.__kind = SyntaxKind.DoStatement, (<any>DebuggerStatementSyntax).prototype.__kind = SyntaxKind.DebuggerStatement, (<any>WithStatementSyntax).prototype.__kind = SyntaxKind.WithStatement, (<any>DeleteExpressionSyntax).prototype.__kind = SyntaxKind.DeleteExpression, (<any>TypeOfExpressionSyntax).prototype.__kind = SyntaxKind.TypeOfExpression, (<any>VoidExpressionSyntax).prototype.__kind = SyntaxKind.VoidExpression, (<any>ConditionalExpressionSyntax).prototype.__kind = SyntaxKind.ConditionalExpression, (<any>MemberAccessExpressionSyntax).prototype.__kind = SyntaxKind.MemberAccessExpression, (<any>InvocationExpressionSyntax).prototype.__kind = SyntaxKind.InvocationExpression, (<any>ArrayLiteralExpressionSyntax).prototype.__kind = SyntaxKind.ArrayLiteralExpression, (<any>ObjectLiteralExpressionSyntax).prototype.__kind = SyntaxKind.ObjectLiteralExpression, (<any>ObjectCreationExpressionSyntax).prototype.__kind = SyntaxKind.ObjectCreationExpression, (<any>ParenthesizedExpressionSyntax).prototype.__kind = SyntaxKind.ParenthesizedExpression, (<any>ParenthesizedArrowFunctionExpressionSyntax).prototype.__kind = SyntaxKind.ParenthesizedArrowFunctionExpression, (<any>SimpleArrowFunctionExpressionSyntax).prototype.__kind = SyntaxKind.SimpleArrowFunctionExpression, (<any>CastExpressionSyntax).prototype.__kind = SyntaxKind.CastExpression, (<any>ElementAccessExpressionSyntax).prototype.__kind = SyntaxKind.ElementAccessExpression, (<any>FunctionExpressionSyntax).prototype.__kind = SyntaxKind.FunctionExpression, (<any>OmittedExpressionSyntax).prototype.__kind = SyntaxKind.OmittedExpression, (<any>VariableDeclarationSyntax).prototype.__kind = SyntaxKind.VariableDeclaration, (<any>VariableDeclaratorSyntax).prototype.__kind = SyntaxKind.VariableDeclarator, (<any>ArgumentListSyntax).prototype.__kind = SyntaxKind.ArgumentList, (<any>ParameterListLine truncated
|
||||
(<any>SourceUnitSyntax).prototype.__kind = SyntaxKind.SourceUnit, (<any>QualifiedNameSyntax).prototype.__kind = SyntaxKind.QualifiedName, (<any>ObjectTypeSyntax).prototype.__kind = SyntaxKind.ObjectType, (<any>FunctionTypeSyntax).prototype.__kind = SyntaxKind.FunctionType, (<any>ArrayTypeSyntax).prototype.__kind = SyntaxKind.ArrayType, (<any>ConstructorTypeSyntax).prototype.__kind = SyntaxKind.ConstructorType, (<any>GenericTypeSyntax).prototype.__kind = SyntaxKind.GenericType, (<any>TypeQuerySyntax).prototype.__kind = SyntaxKind.TypeQuery, (<any>TupleTypeSyntax).prototype.__kind = SyntaxKind.TupleType, (<any>InterfaceDeclarationSyntax).prototype.__kind = SyntaxKind.InterfaceDeclaration, (<any>FunctionDeclarationSyntax).prototype.__kind = SyntaxKind.FunctionDeclaration, (<any>ModuleDeclarationSyntax).prototype.__kind = SyntaxKind.ModuleDeclaration, (<any>ClassDeclarationSyntax).prototype.__kind = SyntaxKind.ClassDeclaration, (<any>EnumDeclarationSyntax).prototype.__kind = SyntaxKind.EnumDeclaration, (<any>ImportDeclarationSyntax).prototype.__kind = SyntaxKind.ImportDeclaration, (<any>ExportAssignmentSyntax).prototype.__kind = SyntaxKind.ExportAssignment, (<any>MemberFunctionDeclarationSyntax).prototype.__kind = SyntaxKind.MemberFunctionDeclaration, (<any>MemberVariableDeclarationSyntax).prototype.__kind = SyntaxKind.MemberVariableDeclaration, (<any>ConstructorDeclarationSyntax).prototype.__kind = SyntaxKind.ConstructorDeclaration, (<any>IndexMemberDeclarationSyntax).prototype.__kind = SyntaxKind.IndexMemberDeclaration, (<any>GetAccessorSyntax).prototype.__kind = SyntaxKind.GetAccessor, (<any>SetAccessorSyntax).prototype.__kind = SyntaxKind.SetAccessor, (<any>PropertySignatureSyntax).prototype.__kind = SyntaxKind.PropertySignature, (<any>CallSignatureSyntax).prototype.__kind = SyntaxKind.CallSignature, (<any>ConstructSignatureSyntax).prototype.__kind = SyntaxKind.ConstructSignature, (<any>IndexSignatureSyntax).prototype.__kind = SyntaxKind.IndexSignature, (<any>MethodSignatureSyntax).prototype.__kind = SyntaxKind.MethodSignature, (<any>BlockSyntax).prototype.__kind = SyntaxKind.Block, (<any>IfStatementSyntax).prototype.__kind = SyntaxKind.IfStatement, (<any>VariableStatementSyntax).prototype.__kind = SyntaxKind.VariableStatement, (<any>ExpressionStatementSyntax).prototype.__kind = SyntaxKind.ExpressionStatement, (<any>ReturnStatementSyntax).prototype.__kind = SyntaxKind.ReturnStatement, (<any>SwitchStatementSyntax).prototype.__kind = SyntaxKind.SwitchStatement, (<any>BreakStatementSyntax).prototype.__kind = SyntaxKind.BreakStatement, (<any>ContinueStatementSyntax).prototype.__kind = SyntaxKind.ContinueStatement, (<any>ForStatementSyntax).prototype.__kind = SyntaxKind.ForStatement, (<any>ForInStatementSyntax).prototype.__kind = SyntaxKind.ForInStatement, (<any>EmptyStatementSyntax).prototype.__kind = SyntaxKind.EmptyStatement, (<any>ThrowStatementSyntax).prototype.__kind = SyntaxKind.ThrowStatement, (<any>WhileStatementSyntax).prototype.__kind = SyntaxKind.WhileStatement, (<any>TryStatementSyntax).prototype.__kind = SyntaxKind.TryStatement, (<any>LabeledStatementSyntax).prototype.__kind = SyntaxKind.LabeledStatement, (<any>DoStatementSyntax).prototype.__kind = SyntaxKind.DoStatement, (<any>DebuggerStatementSyntax).prototype.__kind = SyntaxKind.DebuggerStatement, (<any>WithStatementSyntax).prototype.__kind = SyntaxKind.WithStatement, (<any>DeleteExpressionSyntax).prototype.__kind = SyntaxKind.DeleteExpression, (<any>TypeOfExpressionSyntax).prototype.__kind = SyntaxKind.TypeOfExpression, (<any>VoidExpressionSyntax).prototype.__kind = SyntaxKind.VoidExpression, (<any>ConditionalExpressionSyntax).prototype.__kind = SyntaxKind.ConditionalExpression, (<any>MemberAccessExpressionSyntax).prototype.__kind = SyntaxKind.MemberAccessExpression, (<any>InvocationExpressionSyntax).prototype.__kind = SyntaxKind.InvocationExpression, (<any>ArrayLiteralExpressionSyntax).prototype.__kind = SyntaxKind.ArrayLiteralExpression, (<any>ObjectLiteralExpressionSyntax).prototype.__kind = SyntaxKind.ObjectLiteralExpression, (<any>ObjectCreationExpressionSyntax).prototype.__kind = SyntaxKind.ObjectCreationExpression, (<any>ParenthesizedExpressionSyntax).prototype.__kind = SyntaxKind.ParenthesizedExpression, (<any>ParenthesizedArrowFunctionExpressionSyntax).prototype.__kind = SyntaxKind.ParenthesizedArrowFunctionExpression, (<any>SimpleArrowFunctionExpressionSyntax).prototype.__kind = SyntaxKind.SimpleArrowFunctionExpression, (<any>CastExpressionSyntax).prototype.__kind = SyntaxKind.CastExpression, (<any>ElementAccessExpressionSyntax).prototype.__kind = SyntaxKind.ElementAccessExpression, (<any>FunctionExpressionSyntax).prototype.__kind = SyntaxKind.FunctionExpression, (<any>OmittedExpressionSyntax).prototype.__kind = SyntaxKind.OmittedExpression, (<any>VariableDeclarationSyntax).prototype.__kind = SyntaxKind.VariableDeclaration, (<any>VariableDeclaratorSyntax).prototype.__kind = SyntaxKind.VariableDeclarator, (<any>ArgumentListSyntax)Line truncated
|
||||
}
|
||||
@@ -42,6 +42,11 @@ module TypeScript {
|
||||
typeOfKeyword: ISyntaxToken;
|
||||
name: INameSyntax;
|
||||
}
|
||||
export interface TupleTypeSyntax extends ISyntaxNode, ITypeSyntax {
|
||||
openBracketToken: ISyntaxToken;
|
||||
types: ITypeSyntax[];
|
||||
closeBracketToken: ISyntaxToken;
|
||||
}
|
||||
export interface InterfaceDeclarationSyntax extends ISyntaxNode, IModuleElementSyntax {
|
||||
modifiers: ISyntaxToken[];
|
||||
interfaceKeyword: ISyntaxToken;
|
||||
@@ -478,7 +483,7 @@ module TypeScript {
|
||||
moduleName: INameSyntax;
|
||||
}
|
||||
|
||||
export var nodeMetadata: string[][] = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],["moduleElements","endOfFileToken"],["left","dotToken","right"],["openBraceToken","typeMembers","closeBraceToken"],["typeParameterList","parameterList","equalsGreaterThanToken","type"],["type","openBracketToken","closeBracketToken"],["newKeyword","typeParameterList","parameterList","equalsGreaterThanToken","type"],["name","typeArgumentList"],["typeOfKeyword","name"],["modifiers","interfaceKeyword","identifier","typeParameterList","heritageClauses","body"],["modifiers","functionKeyword","identifier","callSignature","block","semicolonToken"],["modifiers","moduleKeyword","name","stringLiteral","openBraceToken","moduleElements","closeBraceToken"],["modifiers","classKeyword","identifier","typeParameterList","heritageClauses","openBraceToken","classElements","closeBraceToken"],["modifiers","enumKeyword","identifier","openBraceToken","enumElements","closeBraceToken"],["modifiers","importKeyword","identifier","equalsToken","moduleReference","semicolonToken"],["exportKeyword","equalsToken","identifier","semicolonToken"],["modifiers","propertyName","callSignature","block","semicolonToken"],["modifiers","variableDeclarator","semicolonToken"],["modifiers","constructorKeyword","callSignature","block","semicolonToken"],["modifiers","indexSignature","semicolonToken"],["modifiers","getKeyword","propertyName","callSignature","block"],["modifiers","setKeyword","propertyName","callSignature","block"],["propertyName","questionToken","typeAnnotation"],["typeParameterList","parameterList","typeAnnotation"],["newKeyword","callSignature"],["openBracketToken","parameters","closeBracketToken","typeAnnotation"],["propertyName","questionToken","callSignature"],["openBraceToken","statements","closeBraceToken"],["ifKeyword","openParenToken","condition","closeParenToken","statement","elseClause"],["modifiers","variableDeclaration","semicolonToken"],["expression","semicolonToken"],["returnKeyword","expression","semicolonToken"],["switchKeyword","openParenToken","expression","closeParenToken","openBraceToken","switchClauses","closeBraceToken"],["breakKeyword","identifier","semicolonToken"],["continueKeyword","identifier","semicolonToken"],["forKeyword","openParenToken","variableDeclaration","initializer","firstSemicolonToken","condition","secondSemicolonToken","incrementor","closeParenToken","statement"],["forKeyword","openParenToken","variableDeclaration","left","inKeyword","expression","closeParenToken","statement"],["semicolonToken"],["throwKeyword","expression","semicolonToken"],["whileKeyword","openParenToken","condition","closeParenToken","statement"],["tryKeyword","block","catchClause","finallyClause"],["identifier","colonToken","statement"],["doKeyword","statement","whileKeyword","openParenToken","condition","closeParenToken","semicolonToken"],["debuggerKeyword","semicolonToken"],["withKeyword","openParenToken","condition","closeParenToken","statement"],["operatorToken","operand"],["operatorToken","operand"],["operatorToken","operand"],["operatorToken","operand"],["operatorToken","operand"],["operatorToken","operand"],["deleteKeyword","expression"],["typeOfKeyword","expression"],["voidKeyword","expression"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["condition","questionToken","whenTrue","colonToken","whenFalse"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["operand","operatorToken"],["operand","operatorToken"],["expression","dotToken","name"],["expression","argumentList"],["openBracketToken","expressions","closeBracketToken"],["openBraceToken","propertyALine truncated
|
||||
export var nodeMetadata: string[][] = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],["moduleElements","endOfFileToken"],["left","dotToken","right"],["openBraceToken","typeMembers","closeBraceToken"],["typeParameterList","parameterList","equalsGreaterThanToken","type"],["type","openBracketToken","closeBracketToken"],["newKeyword","typeParameterList","parameterList","equalsGreaterThanToken","type"],["name","typeArgumentList"],["typeOfKeyword","name"],["openBracketToken","types","closeBracketToken"],["modifiers","interfaceKeyword","identifier","typeParameterList","heritageClauses","body"],["modifiers","functionKeyword","identifier","callSignature","block","semicolonToken"],["modifiers","moduleKeyword","name","stringLiteral","openBraceToken","moduleElements","closeBraceToken"],["modifiers","classKeyword","identifier","typeParameterList","heritageClauses","openBraceToken","classElements","closeBraceToken"],["modifiers","enumKeyword","identifier","openBraceToken","enumElements","closeBraceToken"],["modifiers","importKeyword","identifier","equalsToken","moduleReference","semicolonToken"],["exportKeyword","equalsToken","identifier","semicolonToken"],["modifiers","propertyName","callSignature","block","semicolonToken"],["modifiers","variableDeclarator","semicolonToken"],["modifiers","constructorKeyword","callSignature","block","semicolonToken"],["modifiers","indexSignature","semicolonToken"],["modifiers","getKeyword","propertyName","callSignature","block"],["modifiers","setKeyword","propertyName","callSignature","block"],["propertyName","questionToken","typeAnnotation"],["typeParameterList","parameterList","typeAnnotation"],["newKeyword","callSignature"],["openBracketToken","parameters","closeBracketToken","typeAnnotation"],["propertyName","questionToken","callSignature"],["openBraceToken","statements","closeBraceToken"],["ifKeyword","openParenToken","condition","closeParenToken","statement","elseClause"],["modifiers","variableDeclaration","semicolonToken"],["expression","semicolonToken"],["returnKeyword","expression","semicolonToken"],["switchKeyword","openParenToken","expression","closeParenToken","openBraceToken","switchClauses","closeBraceToken"],["breakKeyword","identifier","semicolonToken"],["continueKeyword","identifier","semicolonToken"],["forKeyword","openParenToken","variableDeclaration","initializer","firstSemicolonToken","condition","secondSemicolonToken","incrementor","closeParenToken","statement"],["forKeyword","openParenToken","variableDeclaration","left","inKeyword","expression","closeParenToken","statement"],["semicolonToken"],["throwKeyword","expression","semicolonToken"],["whileKeyword","openParenToken","condition","closeParenToken","statement"],["tryKeyword","block","catchClause","finallyClause"],["identifier","colonToken","statement"],["doKeyword","statement","whileKeyword","openParenToken","condition","closeParenToken","semicolonToken"],["debuggerKeyword","semicolonToken"],["withKeyword","openParenToken","condition","closeParenToken","statement"],["operatorToken","operand"],["operatorToken","operand"],["operatorToken","operand"],["operatorToken","operand"],["operatorToken","operand"],["operatorToken","operand"],["deleteKeyword","expression"],["typeOfKeyword","expression"],["voidKeyword","expression"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["condition","questionToken","whenTrue","colonToken","whenFalse"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["operand","operatorToken"],["operand","operatorToken"],["expression","dotToken","name"],["expression","argumentList"],["openBracketToken","expressions",Line truncated
|
||||
|
||||
export module Syntax {
|
||||
export interface ISyntaxFactory {
|
||||
@@ -491,6 +496,7 @@ module TypeScript {
|
||||
ConstructorTypeSyntax: { new(data: number, newKeyword: ISyntaxToken, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax): ConstructorTypeSyntax };
|
||||
GenericTypeSyntax: { new(data: number, name: INameSyntax, typeArgumentList: TypeArgumentListSyntax): GenericTypeSyntax };
|
||||
TypeQuerySyntax: { new(data: number, typeOfKeyword: ISyntaxToken, name: INameSyntax): TypeQuerySyntax };
|
||||
TupleTypeSyntax: { new(data: number, openBracketToken: ISyntaxToken, types: ITypeSyntax[], closeBracketToken: ISyntaxToken): TupleTypeSyntax };
|
||||
InterfaceDeclarationSyntax: { new(data: number, modifiers: ISyntaxToken[], interfaceKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: HeritageClauseSyntax[], body: ObjectTypeSyntax): InterfaceDeclarationSyntax };
|
||||
FunctionDeclarationSyntax: { new(data: number, modifiers: ISyntaxToken[], functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken): FunctionDeclarationSyntax };
|
||||
ModuleDeclarationSyntax: { new(data: number, modifiers: ISyntaxToken[], moduleKeyword: ISyntaxToken, name: INameSyntax, stringLiteral: ISyntaxToken, openBraceToken: ISyntaxToken, moduleElements: IModuleElementSyntax[], closeBraceToken: ISyntaxToken): ModuleDeclarationSyntax };
|
||||
|
||||
@@ -84,6 +84,7 @@ module TypeScript {
|
||||
private cacheSyntaxTreeInfo(): void {
|
||||
// If we're not keeping around the syntax tree, store the diagnostics and line
|
||||
// map so they don't have to be recomputed.
|
||||
var sourceUnit = this.sourceUnit();
|
||||
var firstToken = firstSyntaxTreeToken(this);
|
||||
var leadingTrivia = firstToken.leadingTrivia(this.text);
|
||||
|
||||
@@ -238,7 +239,7 @@ module TypeScript {
|
||||
}
|
||||
|
||||
private checkParameterAccessibilityModifier(parameterList: ParameterListSyntax, modifier: ISyntaxToken, modifierIndex: number): boolean {
|
||||
if (modifier.kind() !== SyntaxKind.PublicKeyword && modifier.kind() !== SyntaxKind.PrivateKeyword) {
|
||||
if (!SyntaxFacts.isAccessibilityModifier(modifier.kind())) {
|
||||
this.pushDiagnostic(modifier, DiagnosticCode._0_modifier_cannot_appear_on_a_parameter, [modifier.text()]);
|
||||
return true;
|
||||
}
|
||||
@@ -320,6 +321,15 @@ module TypeScript {
|
||||
super.visitTypeArgumentList(node);
|
||||
}
|
||||
|
||||
public visitTupleType(node: TupleTypeSyntax): void {
|
||||
if (this.checkForTrailingComma(node.types) ||
|
||||
this.checkForAtLeastOneElement(node, node.types, node.openBracketToken, getLocalizedText(DiagnosticCode.type, null))) {
|
||||
return
|
||||
}
|
||||
|
||||
super.visitTupleType(node);
|
||||
}
|
||||
|
||||
public visitTypeParameterList(node: TypeParameterListSyntax): void {
|
||||
if (this.checkForTrailingComma(node.typeParameters) ||
|
||||
this.checkForAtLeastOneElement(node, node.typeParameters, node.lessThanToken, getLocalizedText(DiagnosticCode.type_parameter, null))) {
|
||||
@@ -514,9 +524,7 @@ module TypeScript {
|
||||
|
||||
for (var i = 0, n = list.length; i < n; i++) {
|
||||
var modifier = list[i];
|
||||
if (modifier.kind() === SyntaxKind.PublicKeyword ||
|
||||
modifier.kind() === SyntaxKind.PrivateKeyword) {
|
||||
|
||||
if (SyntaxFacts.isAccessibilityModifier(modifier.kind())) {
|
||||
if (seenAccessibilityModifier) {
|
||||
this.pushDiagnostic(modifier, DiagnosticCode.Accessibility_modifier_already_seen);
|
||||
return true;
|
||||
@@ -751,8 +759,7 @@ module TypeScript {
|
||||
|
||||
for (var i = 0, n = modifiers.length; i < n; i++) {
|
||||
var modifier = modifiers[i];
|
||||
if (modifier.kind() === SyntaxKind.PublicKeyword ||
|
||||
modifier.kind() === SyntaxKind.PrivateKeyword ||
|
||||
if (SyntaxFacts.isAccessibilityModifier(modifier.kind()) ||
|
||||
modifier.kind() === SyntaxKind.StaticKeyword) {
|
||||
this.pushDiagnostic(modifier, DiagnosticCode._0_modifier_cannot_appear_on_a_module_element, [modifier.text()]);
|
||||
return true;
|
||||
|
||||
@@ -13,6 +13,7 @@ module TypeScript {
|
||||
case SyntaxKind.ConstructorType: return visitor.visitConstructorType(<ConstructorTypeSyntax>element);
|
||||
case SyntaxKind.GenericType: return visitor.visitGenericType(<GenericTypeSyntax>element);
|
||||
case SyntaxKind.TypeQuery: return visitor.visitTypeQuery(<TypeQuerySyntax>element);
|
||||
case SyntaxKind.TupleType: return visitor.visitTupleType(<TupleTypeSyntax>element);
|
||||
case SyntaxKind.InterfaceDeclaration: return visitor.visitInterfaceDeclaration(<InterfaceDeclarationSyntax>element);
|
||||
case SyntaxKind.FunctionDeclaration: return visitor.visitFunctionDeclaration(<FunctionDeclarationSyntax>element);
|
||||
case SyntaxKind.ModuleDeclaration: return visitor.visitModuleDeclaration(<ModuleDeclarationSyntax>element);
|
||||
@@ -109,6 +110,7 @@ module TypeScript {
|
||||
visitConstructorType(node: ConstructorTypeSyntax): any;
|
||||
visitGenericType(node: GenericTypeSyntax): any;
|
||||
visitTypeQuery(node: TypeQuerySyntax): any;
|
||||
visitTupleType(node: TupleTypeSyntax): any;
|
||||
visitInterfaceDeclaration(node: InterfaceDeclarationSyntax): any;
|
||||
visitFunctionDeclaration(node: FunctionDeclarationSyntax): any;
|
||||
visitModuleDeclaration(node: ModuleDeclarationSyntax): any;
|
||||
|
||||
@@ -103,6 +103,12 @@ module TypeScript {
|
||||
this.visitNodeOrToken(node.name);
|
||||
}
|
||||
|
||||
public visitTupleType(node: TupleTypeSyntax): void {
|
||||
this.visitToken(node.openBracketToken);
|
||||
this.visitSeparatedList(node.types);
|
||||
this.visitToken(node.closeBracketToken);
|
||||
}
|
||||
|
||||
public visitInterfaceDeclaration(node: InterfaceDeclarationSyntax): void {
|
||||
this.visitList(node.modifiers);
|
||||
this.visitToken(node.interfaceKeyword);
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts(11,16): error TS2341: Property 'clodule.sfn' is inaccessible.
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts(11,16): error TS2341: Property 'sfn' is private and only accessible within class 'clodule<T>'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts (1 errors) ====
|
||||
@@ -14,7 +14,7 @@ tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMer
|
||||
export function fn<T>(x: T, y: T): number {
|
||||
return clodule.sfn('a');
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2341: Property 'clodule.sfn' is inaccessible.
|
||||
!!! error TS2341: Property 'sfn' is private and only accessible within class 'clodule<T>'.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
tests/cases/conformance/parser/ecmascript5/Protected/Protected1.ts(1,1): error TS1044: 'protected' modifier cannot appear on a module element.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/Protected/Protected1.ts (1 errors) ====
|
||||
protected class C {
|
||||
~~~~~~~~~
|
||||
!!! error TS1044: 'protected' modifier cannot appear on a module element.
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
tests/cases/conformance/parser/ecmascript5/Protected/Protected2.ts(1,1): error TS1044: 'protected' modifier cannot appear on a module element.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/Protected/Protected2.ts (1 errors) ====
|
||||
protected module M {
|
||||
~~~~~~~~~
|
||||
!!! error TS1044: 'protected' modifier cannot appear on a module element.
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
tests/cases/conformance/parser/ecmascript5/Protected/Protected3.ts(2,3): error TS1089: 'protected' modifier cannot appear on a constructor declaration.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/Protected/Protected3.ts (1 errors) ====
|
||||
class C {
|
||||
protected constructor() { }
|
||||
~~~~~~~~~
|
||||
!!! error TS1089: 'protected' modifier cannot appear on a constructor declaration.
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
tests/cases/conformance/parser/ecmascript5/Protected/Protected4.ts(2,13): error TS1028: Accessibility modifier already seen.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/Protected/Protected4.ts (1 errors) ====
|
||||
class C {
|
||||
protected public m() { }
|
||||
~~~~~~
|
||||
!!! error TS1028: Accessibility modifier already seen.
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
//// [Protected5.ts]
|
||||
class C {
|
||||
protected static m() { }
|
||||
}
|
||||
|
||||
//// [Protected5.js]
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.m = function () {
|
||||
};
|
||||
return C;
|
||||
})();
|
||||
@@ -0,0 +1,7 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/Protected/Protected5.ts ===
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
protected static m() { }
|
||||
>m : () => void
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
tests/cases/conformance/parser/ecmascript5/Protected/Protected6.ts(2,10): error TS1029: 'protected' modifier must precede 'static' modifier.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/Protected/Protected6.ts (1 errors) ====
|
||||
class C {
|
||||
static protected m() { }
|
||||
~~~~~~~~~
|
||||
!!! error TS1029: 'protected' modifier must precede 'static' modifier.
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
tests/cases/conformance/parser/ecmascript5/Protected/Protected7.ts(2,13): error TS1028: Accessibility modifier already seen.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/Protected/Protected7.ts (1 errors) ====
|
||||
class C {
|
||||
protected private m() { }
|
||||
~~~~~~~
|
||||
!!! error TS1028: Accessibility modifier already seen.
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
//// [Protected8.ts]
|
||||
interface I {
|
||||
protected
|
||||
p
|
||||
}
|
||||
|
||||
//// [Protected8.js]
|
||||
@@ -0,0 +1,10 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/Protected/Protected8.ts ===
|
||||
interface I {
|
||||
>I : I
|
||||
|
||||
protected
|
||||
>protected : any
|
||||
|
||||
p
|
||||
>p : any
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
//// [Protected9.ts]
|
||||
class C {
|
||||
constructor(protected p) { }
|
||||
}
|
||||
|
||||
//// [Protected9.js]
|
||||
var C = (function () {
|
||||
function C(p) {
|
||||
this.p = p;
|
||||
}
|
||||
return C;
|
||||
})();
|
||||
@@ -0,0 +1,7 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/Protected/Protected9.ts ===
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
constructor(protected p) { }
|
||||
>p : any
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
//// [TupleType1.ts]
|
||||
var v: [number]
|
||||
|
||||
//// [TupleType1.js]
|
||||
var v;
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType1.ts ===
|
||||
var v: [number]
|
||||
>v : [number]
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
//// [TupleType2.ts]
|
||||
var v: [number, string]
|
||||
|
||||
//// [TupleType2.js]
|
||||
var v;
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType2.ts ===
|
||||
var v: [number, string]
|
||||
>v : [number, string]
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType3.ts(1,8): error TS1122: A tuple type element list cannot be empty.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType3.ts (1 errors) ====
|
||||
var v: []
|
||||
~~
|
||||
!!! error TS1122: A tuple type element list cannot be empty.
|
||||
@@ -0,0 +1,7 @@
|
||||
tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType4.ts(1,9): error TS1005: ']' expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType4.ts (1 errors) ====
|
||||
var v: [
|
||||
|
||||
!!! error TS1005: ']' expected.
|
||||
@@ -0,0 +1,7 @@
|
||||
tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType5.ts(1,15): error TS1009: Trailing comma not allowed.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType5.ts (1 errors) ====
|
||||
var v: [number,]
|
||||
~
|
||||
!!! error TS1009: Trailing comma not allowed.
|
||||
+48
-48
@@ -1,51 +1,51 @@
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(31,5): error TS2322: Type 'E' is not assignable to type '{ foo: string; }':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(36,5): error TS2322: Type 'E' is not assignable to type 'Base':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Property 'foo' is private in type 'E' but not in type 'Base'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(41,5): error TS2322: Type 'E' is not assignable to type 'I':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Property 'foo' is private in type 'E' but not in type 'I'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(46,5): error TS2322: Type 'E' is not assignable to type 'D':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Property 'foo' is private in type 'E' but not in type 'D'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(48,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'E':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(49,5): error TS2322: Type 'Base' is not assignable to type 'E':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Property 'foo' is private in type 'E' but not in type 'Base'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(50,5): error TS2322: Type 'I' is not assignable to type 'E':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Property 'foo' is private in type 'E' but not in type 'I'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(51,5): error TS2322: Type 'D' is not assignable to type 'E':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Property 'foo' is private in type 'E' but not in type 'D'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(81,5): error TS2322: Type 'Base' is not assignable to type '{ foo: string; }':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(82,5): error TS2322: Type 'I' is not assignable to type '{ foo: string; }':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Property 'foo' is private in type 'I' but not in type '{ foo: string; }'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(84,5): error TS2322: Type 'E' is not assignable to type '{ foo: string; }':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(86,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'Base':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(88,5): error TS2322: Type 'D' is not assignable to type 'Base':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Property 'foo' is private in type 'Base' but not in type 'D'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(89,5): error TS2322: Type 'E' is not assignable to type 'Base':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Types have separate declarations of a private property 'foo'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(92,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'I':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Property 'foo' is private in type 'I' but not in type '{ foo: string; }'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(94,5): error TS2322: Type 'D' is not assignable to type 'I':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Property 'foo' is private in type 'I' but not in type 'D'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(95,5): error TS2322: Type 'E' is not assignable to type 'I':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Types have separate declarations of a private property 'foo'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(99,5): error TS2322: Type 'Base' is not assignable to type 'D':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Property 'foo' is private in type 'Base' but not in type 'D'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(100,5): error TS2322: Type 'I' is not assignable to type 'D':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Property 'foo' is private in type 'I' but not in type 'D'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(101,5): error TS2322: Type 'E' is not assignable to type 'D':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Property 'foo' is private in type 'E' but not in type 'D'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(103,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'E':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(104,5): error TS2322: Type 'Base' is not assignable to type 'E':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Types have separate declarations of a private property 'foo'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(105,5): error TS2322: Type 'I' is not assignable to type 'E':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Types have separate declarations of a private property 'foo'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(106,5): error TS2322: Type 'D' is not assignable to type 'E':
|
||||
Private property 'foo' cannot be reimplemented.
|
||||
Property 'foo' is private in type 'E' but not in type 'D'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts (24 errors) ====
|
||||
@@ -82,7 +82,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
a = e; // error
|
||||
~
|
||||
!!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
|
||||
|
||||
b = a;
|
||||
b = i;
|
||||
@@ -90,7 +90,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
b = e; // error
|
||||
~
|
||||
!!! error TS2322: Type 'E' is not assignable to type 'Base':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'Base'.
|
||||
|
||||
i = a;
|
||||
i = b;
|
||||
@@ -98,7 +98,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
i = e; // error
|
||||
~
|
||||
!!! error TS2322: Type 'E' is not assignable to type 'I':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'I'.
|
||||
|
||||
d = a;
|
||||
d = b;
|
||||
@@ -106,24 +106,24 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
d = e; // error
|
||||
~
|
||||
!!! error TS2322: Type 'E' is not assignable to type 'D':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'.
|
||||
|
||||
e = a; // errror
|
||||
~
|
||||
!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'E':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
|
||||
e = b; // errror
|
||||
~
|
||||
!!! error TS2322: Type 'Base' is not assignable to type 'E':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'Base'.
|
||||
e = i; // errror
|
||||
~
|
||||
!!! error TS2322: Type 'I' is not assignable to type 'E':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'I'.
|
||||
e = d; // errror
|
||||
~
|
||||
!!! error TS2322: Type 'D' is not assignable to type 'E':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'.
|
||||
e = e;
|
||||
|
||||
}
|
||||
@@ -156,77 +156,77 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
a = b; // error
|
||||
~
|
||||
!!! error TS2322: Type 'Base' is not assignable to type '{ foo: string; }':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
|
||||
a = i; // error
|
||||
~
|
||||
!!! error TS2322: Type 'I' is not assignable to type '{ foo: string; }':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Property 'foo' is private in type 'I' but not in type '{ foo: string; }'.
|
||||
a = d;
|
||||
a = e; // error
|
||||
~
|
||||
!!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
|
||||
|
||||
b = a; // error
|
||||
~
|
||||
!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'Base':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
|
||||
b = i;
|
||||
b = d; // error
|
||||
~
|
||||
!!! error TS2322: Type 'D' is not assignable to type 'Base':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Property 'foo' is private in type 'Base' but not in type 'D'.
|
||||
b = e; // error
|
||||
~
|
||||
!!! error TS2322: Type 'E' is not assignable to type 'Base':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Types have separate declarations of a private property 'foo'.
|
||||
b = b;
|
||||
|
||||
i = a; // error
|
||||
~
|
||||
!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'I':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Property 'foo' is private in type 'I' but not in type '{ foo: string; }'.
|
||||
i = b;
|
||||
i = d; // error
|
||||
~
|
||||
!!! error TS2322: Type 'D' is not assignable to type 'I':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Property 'foo' is private in type 'I' but not in type 'D'.
|
||||
i = e; // error
|
||||
~
|
||||
!!! error TS2322: Type 'E' is not assignable to type 'I':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Types have separate declarations of a private property 'foo'.
|
||||
i = i;
|
||||
|
||||
d = a;
|
||||
d = b; // error
|
||||
~
|
||||
!!! error TS2322: Type 'Base' is not assignable to type 'D':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Property 'foo' is private in type 'Base' but not in type 'D'.
|
||||
d = i; // error
|
||||
~
|
||||
!!! error TS2322: Type 'I' is not assignable to type 'D':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Property 'foo' is private in type 'I' but not in type 'D'.
|
||||
d = e; // error
|
||||
~
|
||||
!!! error TS2322: Type 'E' is not assignable to type 'D':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'.
|
||||
|
||||
e = a; // errror
|
||||
~
|
||||
!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'E':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
|
||||
e = b; // errror
|
||||
~
|
||||
!!! error TS2322: Type 'Base' is not assignable to type 'E':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Types have separate declarations of a private property 'foo'.
|
||||
e = i; // errror
|
||||
~
|
||||
!!! error TS2322: Type 'I' is not assignable to type 'E':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Types have separate declarations of a private property 'foo'.
|
||||
e = d; // errror
|
||||
~
|
||||
!!! error TS2322: Type 'D' is not assignable to type 'E':
|
||||
!!! error TS2322: Private property 'foo' cannot be reimplemented.
|
||||
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'.
|
||||
e = e;
|
||||
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(73,5): error TS2322: Type 'D' is not assignable to type 'C':
|
||||
Required property 'opt' cannot be reimplemented with optional property in 'D'.
|
||||
Property 'opt' is optional in type 'D' but required in type 'C'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(74,5): error TS2322: Type 'E' is not assignable to type 'C':
|
||||
Required property 'opt' cannot be reimplemented with optional property in 'E'.
|
||||
Property 'opt' is optional in type 'E' but required in type 'C'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(78,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }':
|
||||
Required property 'opt' cannot be reimplemented with optional property in 'D'.
|
||||
Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(79,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }':
|
||||
Required property 'opt' cannot be reimplemented with optional property in 'E'.
|
||||
Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(83,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }':
|
||||
Required property 'opt' cannot be reimplemented with optional property in 'D'.
|
||||
Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(84,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }':
|
||||
Required property 'opt' cannot be reimplemented with optional property in 'E'.
|
||||
Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts (6 errors) ====
|
||||
@@ -88,33 +88,33 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
c = d; // error
|
||||
~
|
||||
!!! error TS2322: Type 'D' is not assignable to type 'C':
|
||||
!!! error TS2322: Required property 'opt' cannot be reimplemented with optional property in 'D'.
|
||||
!!! error TS2322: Property 'opt' is optional in type 'D' but required in type 'C'.
|
||||
c = e; // error
|
||||
~
|
||||
!!! error TS2322: Type 'E' is not assignable to type 'C':
|
||||
!!! error TS2322: Required property 'opt' cannot be reimplemented with optional property in 'E'.
|
||||
!!! error TS2322: Property 'opt' is optional in type 'E' but required in type 'C'.
|
||||
c = f; // ok
|
||||
c = a; // ok
|
||||
|
||||
a = d; // error
|
||||
~
|
||||
!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }':
|
||||
!!! error TS2322: Required property 'opt' cannot be reimplemented with optional property in 'D'.
|
||||
!!! error TS2322: Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'.
|
||||
a = e; // error
|
||||
~
|
||||
!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }':
|
||||
!!! error TS2322: Required property 'opt' cannot be reimplemented with optional property in 'E'.
|
||||
!!! error TS2322: Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'.
|
||||
a = f; // ok
|
||||
a = c; // ok
|
||||
|
||||
b = d; // error
|
||||
~
|
||||
!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }':
|
||||
!!! error TS2322: Required property 'opt' cannot be reimplemented with optional property in 'D'.
|
||||
!!! error TS2322: Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'.
|
||||
b = e; // error
|
||||
~
|
||||
!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }':
|
||||
!!! error TS2322: Required property 'opt' cannot be reimplemented with optional property in 'E'.
|
||||
!!! error TS2322: Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'.
|
||||
b = f; // ok
|
||||
b = a; // ok
|
||||
b = c; // ok
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/assignmentCompatability10.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithPublicAndOptional<number, string>':
|
||||
Required property 'two' cannot be reimplemented with optional property in 'interfaceWithPublicAndOptional<number, string>'.
|
||||
Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type 'classWithPublicAndOptional<number, string>'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/assignmentCompatability10.ts (1 errors) ====
|
||||
@@ -14,4 +14,4 @@ tests/cases/compiler/assignmentCompatability10.ts(9,1): error TS2322: Type 'inte
|
||||
__test2__.__val__x4 = __test1__.__val__obj4
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithPublicAndOptional<number, string>':
|
||||
!!! error TS2322: Required property 'two' cannot be reimplemented with optional property in 'interfaceWithPublicAndOptional<number, string>'.
|
||||
!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type 'classWithPublicAndOptional<number, string>'.
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/assignmentCompatability13.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: string; }':
|
||||
Required property 'two' cannot be reimplemented with optional property in 'interfaceWithPublicAndOptional<number, string>'.
|
||||
Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type '{ two: string; }'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/assignmentCompatability13.ts (1 errors) ====
|
||||
@@ -14,4 +14,4 @@ tests/cases/compiler/assignmentCompatability13.ts(9,1): error TS2322: Type 'inte
|
||||
__test2__.__val__obj = __test1__.__val__obj4
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: string; }':
|
||||
!!! error TS2322: Required property 'two' cannot be reimplemented with optional property in 'interfaceWithPublicAndOptional<number, string>'.
|
||||
!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type '{ two: string; }'.
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/assignmentCompatability27.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: string; }':
|
||||
Required property 'two' cannot be reimplemented with optional property in 'interfaceWithPublicAndOptional<number, string>'.
|
||||
Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type '{ two: string; }'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/assignmentCompatability27.ts (1 errors) ====
|
||||
@@ -14,4 +14,4 @@ tests/cases/compiler/assignmentCompatability27.ts(9,1): error TS2322: Type 'inte
|
||||
__test2__.__val__aa = __test1__.__val__obj4
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: string; }':
|
||||
!!! error TS2322: Required property 'two' cannot be reimplemented with optional property in 'interfaceWithPublicAndOptional<number, string>'.
|
||||
!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type '{ two: string; }'.
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/assignmentCompatability39.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithTwoPublic<number, string>':
|
||||
Required property 'two' cannot be reimplemented with optional property in 'interfaceWithPublicAndOptional<number, string>'.
|
||||
Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type 'classWithTwoPublic<number, string>'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/assignmentCompatability39.ts (1 errors) ====
|
||||
@@ -14,4 +14,4 @@ tests/cases/compiler/assignmentCompatability39.ts(9,1): error TS2322: Type 'inte
|
||||
__test2__.__val__x2 = __test1__.__val__obj4
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithTwoPublic<number, string>':
|
||||
!!! error TS2322: Required property 'two' cannot be reimplemented with optional property in 'interfaceWithPublicAndOptional<number, string>'.
|
||||
!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type 'classWithTwoPublic<number, string>'.
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/assignmentCompatability40.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithPrivate<number>':
|
||||
Private property 'one' cannot be reimplemented.
|
||||
Property 'one' is private in type 'classWithPrivate<number>' but not in type 'interfaceWithPublicAndOptional<number, string>'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/assignmentCompatability40.ts (1 errors) ====
|
||||
@@ -14,4 +14,4 @@ tests/cases/compiler/assignmentCompatability40.ts(9,1): error TS2322: Type 'inte
|
||||
__test2__.__val__x5 = __test1__.__val__obj4
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithPrivate<number>':
|
||||
!!! error TS2322: Private property 'one' cannot be reimplemented.
|
||||
!!! error TS2322: Property 'one' is private in type 'classWithPrivate<number>' but not in type 'interfaceWithPublicAndOptional<number, string>'.
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/assignmentCompatability41.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithTwoPrivate<number, string>':
|
||||
Private property 'one' cannot be reimplemented.
|
||||
Property 'one' is private in type 'classWithTwoPrivate<number, string>' but not in type 'interfaceWithPublicAndOptional<number, string>'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/assignmentCompatability41.ts (1 errors) ====
|
||||
@@ -14,4 +14,4 @@ tests/cases/compiler/assignmentCompatability41.ts(9,1): error TS2322: Type 'inte
|
||||
__test2__.__val__x6 = __test1__.__val__obj4
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithTwoPrivate<number, string>':
|
||||
!!! error TS2322: Private property 'one' cannot be reimplemented.
|
||||
!!! error TS2322: Property 'one' is private in type 'classWithTwoPrivate<number, string>' but not in type 'interfaceWithPublicAndOptional<number, string>'.
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/assignmentCompatability42.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithPublicPrivate<number, string>':
|
||||
Private property 'two' cannot be reimplemented.
|
||||
Property 'two' is private in type 'classWithPublicPrivate<number, string>' but not in type 'interfaceWithPublicAndOptional<number, string>'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/assignmentCompatability42.ts (1 errors) ====
|
||||
@@ -14,4 +14,4 @@ tests/cases/compiler/assignmentCompatability42.ts(9,1): error TS2322: Type 'inte
|
||||
__test2__.__val__x7 = __test1__.__val__obj4
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'classWithPublicPrivate<number, string>':
|
||||
!!! error TS2322: Private property 'two' cannot be reimplemented.
|
||||
!!! error TS2322: Property 'two' is private in type 'classWithPublicPrivate<number, string>' but not in type 'interfaceWithPublicAndOptional<number, string>'.
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/assignmentCompatability43.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'interfaceTwo<number, string>':
|
||||
Required property 'two' cannot be reimplemented with optional property in 'interfaceWithPublicAndOptional<number, string>'.
|
||||
Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type 'interfaceTwo<number, string>'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/assignmentCompatability43.ts (1 errors) ====
|
||||
@@ -14,4 +14,4 @@ tests/cases/compiler/assignmentCompatability43.ts(9,1): error TS2322: Type 'inte
|
||||
__test2__.__val__obj2 = __test1__.__val__obj4
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'interfaceTwo<number, string>':
|
||||
!!! error TS2322: Required property 'two' cannot be reimplemented with optional property in 'interfaceWithPublicAndOptional<number, string>'.
|
||||
!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type 'interfaceTwo<number, string>'.
|
||||
@@ -1,8 +1,10 @@
|
||||
tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility.ts(6,5): error TS1089: 'private' modifier cannot appear on a constructor declaration.
|
||||
tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility.ts(18,9): error TS1089: 'private' modifier cannot appear on a constructor declaration.
|
||||
tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility.ts(10,5): error TS1089: 'protected' modifier cannot appear on a constructor declaration.
|
||||
tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility.ts(23,9): error TS1089: 'private' modifier cannot appear on a constructor declaration.
|
||||
tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility.ts(27,9): error TS1089: 'protected' modifier cannot appear on a constructor declaration.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility.ts (2 errors) ====
|
||||
==== tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility.ts (4 errors) ====
|
||||
class C {
|
||||
public constructor(public x: number) { }
|
||||
}
|
||||
@@ -13,8 +15,15 @@ tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessib
|
||||
!!! error TS1089: 'private' modifier cannot appear on a constructor declaration.
|
||||
}
|
||||
|
||||
class E {
|
||||
protected constructor(public x: number) { } // error
|
||||
~~~~~~~~~
|
||||
!!! error TS1089: 'protected' modifier cannot appear on a constructor declaration.
|
||||
}
|
||||
|
||||
var c = new C(1);
|
||||
var d = new D(1);
|
||||
var e = new E(1);
|
||||
|
||||
module Generic {
|
||||
class C<T> {
|
||||
@@ -27,7 +36,14 @@ tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessib
|
||||
!!! error TS1089: 'private' modifier cannot appear on a constructor declaration.
|
||||
}
|
||||
|
||||
class E<T> {
|
||||
protected constructor(public x: T) { } // error
|
||||
~~~~~~~~~
|
||||
!!! error TS1089: 'protected' modifier cannot appear on a constructor declaration.
|
||||
}
|
||||
|
||||
var c = new C(1);
|
||||
var d = new D(1);
|
||||
var e = new E(1);
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/classExtendsInterfaceThatExtendsClassWithPrivates1.ts(10,7): error TS2421: Class 'D2' incorrectly implements interface 'I':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Types have separate declarations of a private property 'x'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/classExtendsInterfaceThatExtendsClassWithPrivates1.ts (1 errors) ====
|
||||
@@ -15,7 +15,7 @@ tests/cases/compiler/classExtendsInterfaceThatExtendsClassWithPrivates1.ts(10,7)
|
||||
class D2 implements I {
|
||||
~~
|
||||
!!! error TS2421: Class 'D2' incorrectly implements interface 'I':
|
||||
!!! error TS2421: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2421: Types have separate declarations of a private property 'x'.
|
||||
public foo(x: any) { return x }
|
||||
private x = 3;
|
||||
other(x: any) { return x }
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/compiler/classImplementsClass5.ts(5,7): error TS2421: Class 'C' incorrectly implements interface 'A':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Types have separate declarations of a private property 'x'.
|
||||
tests/cases/compiler/classImplementsClass5.ts(16,1): error TS2322: Type 'C2' is not assignable to type 'C':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Types have separate declarations of a private property 'x'.
|
||||
tests/cases/compiler/classImplementsClass5.ts(17,1): error TS2322: Type 'C' is not assignable to type 'C2':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Types have separate declarations of a private property 'x'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/classImplementsClass5.ts (3 errors) ====
|
||||
@@ -14,7 +14,7 @@ tests/cases/compiler/classImplementsClass5.ts(17,1): error TS2322: Type 'C' is n
|
||||
class C implements A {
|
||||
~
|
||||
!!! error TS2421: Class 'C' incorrectly implements interface 'A':
|
||||
!!! error TS2421: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2421: Types have separate declarations of a private property 'x'.
|
||||
private x = 1;
|
||||
foo() {
|
||||
return 1;
|
||||
@@ -28,8 +28,8 @@ tests/cases/compiler/classImplementsClass5.ts(17,1): error TS2322: Type 'C' is n
|
||||
c = c2;
|
||||
~
|
||||
!!! error TS2322: Type 'C2' is not assignable to type 'C':
|
||||
!!! error TS2322: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2322: Types have separate declarations of a private property 'x'.
|
||||
c2 = c;
|
||||
~~
|
||||
!!! error TS2322: Type 'C' is not assignable to type 'C2':
|
||||
!!! error TS2322: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2322: Types have separate declarations of a private property 'x'.
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classIsSubtypeOfBaseType.ts(11,7): error TS2416: Class 'Derived2' incorrectly extends base class 'Base<{ bar: string; }>':
|
||||
Types of property 'foo' are incompatible:
|
||||
Type '{ bar?: string; }' is not assignable to type '{ bar: string; }':
|
||||
Required property 'bar' cannot be reimplemented with optional property in '{ bar?: string; }'.
|
||||
Property 'bar' is optional in type '{ bar?: string; }' but required in type '{ bar: string; }'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classIsSubtypeOfBaseType.ts (1 errors) ====
|
||||
@@ -20,7 +20,7 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla
|
||||
!!! error TS2416: Class 'Derived2' incorrectly extends base class 'Base<{ bar: string; }>':
|
||||
!!! error TS2416: Types of property 'foo' are incompatible:
|
||||
!!! error TS2416: Type '{ bar?: string; }' is not assignable to type '{ bar: string; }':
|
||||
!!! error TS2416: Required property 'bar' cannot be reimplemented with optional property in '{ bar?: string; }'.
|
||||
!!! error TS2416: Property 'bar' is optional in type '{ bar?: string; }' but required in type '{ bar: string; }'.
|
||||
foo: {
|
||||
bar?: string; // error
|
||||
}
|
||||
|
||||
@@ -2,14 +2,14 @@ tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(4,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(8,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(9,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(15,1): error TS2341: Property 'C.x' is inaccessible.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(16,1): error TS2341: Property 'C.y' is inaccessible.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(17,1): error TS2341: Property 'C.y' is inaccessible.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(18,1): error TS2341: Property 'C.foo' is inaccessible.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(20,1): error TS2341: Property 'C.a' is inaccessible.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(21,1): error TS2341: Property 'C.b' is inaccessible.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(22,1): error TS2341: Property 'C.b' is inaccessible.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(23,1): error TS2341: Property 'C.foo' is inaccessible.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(15,1): error TS2341: Property 'x' is private and only accessible within class 'C'.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(16,1): error TS2341: Property 'y' is private and only accessible within class 'C'.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(17,1): error TS2341: Property 'y' is private and only accessible within class 'C'.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(18,1): error TS2341: Property 'foo' is private and only accessible within class 'C'.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(20,1): error TS2341: Property 'a' is private and only accessible within class 'C'.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(21,1): error TS2341: Property 'b' is private and only accessible within class 'C'.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(22,1): error TS2341: Property 'b' is private and only accessible within class 'C'.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(23,1): error TS2341: Property 'foo' is private and only accessible within class 'C'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts (12 errors) ====
|
||||
@@ -37,26 +37,26 @@ tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(
|
||||
// all errors
|
||||
c.x;
|
||||
~~~
|
||||
!!! error TS2341: Property 'C.x' is inaccessible.
|
||||
!!! error TS2341: Property 'x' is private and only accessible within class 'C'.
|
||||
c.y;
|
||||
~~~
|
||||
!!! error TS2341: Property 'C.y' is inaccessible.
|
||||
!!! error TS2341: Property 'y' is private and only accessible within class 'C'.
|
||||
c.y = 1;
|
||||
~~~
|
||||
!!! error TS2341: Property 'C.y' is inaccessible.
|
||||
!!! error TS2341: Property 'y' is private and only accessible within class 'C'.
|
||||
c.foo();
|
||||
~~~~~
|
||||
!!! error TS2341: Property 'C.foo' is inaccessible.
|
||||
!!! error TS2341: Property 'foo' is private and only accessible within class 'C'.
|
||||
|
||||
C.a;
|
||||
~~~
|
||||
!!! error TS2341: Property 'C.a' is inaccessible.
|
||||
!!! error TS2341: Property 'a' is private and only accessible within class 'C'.
|
||||
C.b();
|
||||
~~~
|
||||
!!! error TS2341: Property 'C.b' is inaccessible.
|
||||
!!! error TS2341: Property 'b' is private and only accessible within class 'C'.
|
||||
C.b = 1;
|
||||
~~~
|
||||
!!! error TS2341: Property 'C.b' is inaccessible.
|
||||
!!! error TS2341: Property 'b' is private and only accessible within class 'C'.
|
||||
C.foo();
|
||||
~~~~~
|
||||
!!! error TS2341: Property 'C.foo' is inaccessible.
|
||||
!!! error TS2341: Property 'foo' is private and only accessible within class 'C'.
|
||||
@@ -0,0 +1,62 @@
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(3,19): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(4,19): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(8,26): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(9,26): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(15,1): error TS2445: Property 'x' is protected and only accessible within class 'C' and its subclasses.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(16,1): error TS2445: Property 'y' is protected and only accessible within class 'C' and its subclasses.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(17,1): error TS2445: Property 'y' is protected and only accessible within class 'C' and its subclasses.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(18,1): error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(20,1): error TS2445: Property 'a' is protected and only accessible within class 'C' and its subclasses.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(21,1): error TS2445: Property 'b' is protected and only accessible within class 'C' and its subclasses.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(22,1): error TS2445: Property 'b' is protected and only accessible within class 'C' and its subclasses.
|
||||
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(23,1): error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts (12 errors) ====
|
||||
class C {
|
||||
protected x: string;
|
||||
protected get y() { return null; }
|
||||
~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
protected set y(x) { }
|
||||
~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
protected foo() { }
|
||||
|
||||
protected static a: string;
|
||||
protected static get b() { return null; }
|
||||
~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
protected static set b(x) { }
|
||||
~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
protected static foo() { }
|
||||
}
|
||||
|
||||
var c: C;
|
||||
// all errors
|
||||
c.x;
|
||||
~~~
|
||||
!!! error TS2445: Property 'x' is protected and only accessible within class 'C' and its subclasses.
|
||||
c.y;
|
||||
~~~
|
||||
!!! error TS2445: Property 'y' is protected and only accessible within class 'C' and its subclasses.
|
||||
c.y = 1;
|
||||
~~~
|
||||
!!! error TS2445: Property 'y' is protected and only accessible within class 'C' and its subclasses.
|
||||
c.foo();
|
||||
~~~~~
|
||||
!!! error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses.
|
||||
|
||||
C.a;
|
||||
~~~
|
||||
!!! error TS2445: Property 'a' is protected and only accessible within class 'C' and its subclasses.
|
||||
C.b();
|
||||
~~~
|
||||
!!! error TS2445: Property 'b' is protected and only accessible within class 'C' and its subclasses.
|
||||
C.b = 1;
|
||||
~~~
|
||||
!!! error TS2445: Property 'b' is protected and only accessible within class 'C' and its subclasses.
|
||||
C.foo();
|
||||
~~~~~
|
||||
!!! error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses.
|
||||
@@ -10,9 +10,9 @@ tests/cases/compiler/classUpdateTests.ts(46,17): error TS2311: A class may only
|
||||
tests/cases/compiler/classUpdateTests.ts(47,18): error TS2335: 'super' can only be referenced in a derived class.
|
||||
tests/cases/compiler/classUpdateTests.ts(57,2): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
|
||||
tests/cases/compiler/classUpdateTests.ts(63,7): error TS2416: Class 'L' incorrectly extends base class 'G':
|
||||
Private property 'p1' cannot be reimplemented.
|
||||
Property 'p1' is private in type 'L' but not in type 'G'.
|
||||
tests/cases/compiler/classUpdateTests.ts(69,7): error TS2416: Class 'M' incorrectly extends base class 'G':
|
||||
Private property 'p1' cannot be reimplemented.
|
||||
Property 'p1' is private in type 'M' but not in type 'G'.
|
||||
tests/cases/compiler/classUpdateTests.ts(70,2): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
|
||||
tests/cases/compiler/classUpdateTests.ts(105,15): error TS2339: Property 'p1' does not exist on type 'Q'.
|
||||
tests/cases/compiler/classUpdateTests.ts(111,16): error TS2339: Property 'p1' does not exist on type 'R'.
|
||||
@@ -97,7 +97,7 @@ tests/cases/compiler/classUpdateTests.ts(111,16): error TS2339: Property 'p1' do
|
||||
class L extends G {
|
||||
~
|
||||
!!! error TS2416: Class 'L' incorrectly extends base class 'G':
|
||||
!!! error TS2416: Private property 'p1' cannot be reimplemented.
|
||||
!!! error TS2416: Property 'p1' is private in type 'L' but not in type 'G'.
|
||||
constructor(private p1:number) {
|
||||
super(); // NO ERROR
|
||||
}
|
||||
@@ -106,7 +106,7 @@ tests/cases/compiler/classUpdateTests.ts(111,16): error TS2339: Property 'p1' do
|
||||
class M extends G {
|
||||
~
|
||||
!!! error TS2416: Class 'M' incorrectly extends base class 'G':
|
||||
!!! error TS2416: Private property 'p1' cannot be reimplemented.
|
||||
!!! error TS2416: Property 'p1' is private in type 'M' but not in type 'G'.
|
||||
constructor(private p1:number) { // ERROR
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
var i = 0;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
tests/cases/conformance/types/members/classWithPrivateProperty.ts(15,18): error TS2341: Property 'C.x' is inaccessible.
|
||||
tests/cases/conformance/types/members/classWithPrivateProperty.ts(16,18): error TS2341: Property 'C.a' is inaccessible.
|
||||
tests/cases/conformance/types/members/classWithPrivateProperty.ts(17,18): error TS2341: Property 'C.b' is inaccessible.
|
||||
tests/cases/conformance/types/members/classWithPrivateProperty.ts(18,18): error TS2341: Property 'C.c' is inaccessible.
|
||||
tests/cases/conformance/types/members/classWithPrivateProperty.ts(19,18): error TS2341: Property 'C.d' is inaccessible.
|
||||
tests/cases/conformance/types/members/classWithPrivateProperty.ts(20,18): error TS2341: Property 'C.e' is inaccessible.
|
||||
tests/cases/conformance/types/members/classWithPrivateProperty.ts(21,18): error TS2341: Property 'C.f' is inaccessible.
|
||||
tests/cases/conformance/types/members/classWithPrivateProperty.ts(22,18): error TS2341: Property 'C.g' is inaccessible.
|
||||
tests/cases/conformance/types/members/classWithPrivateProperty.ts(15,18): error TS2341: Property 'x' is private and only accessible within class 'C'.
|
||||
tests/cases/conformance/types/members/classWithPrivateProperty.ts(16,18): error TS2341: Property 'a' is private and only accessible within class 'C'.
|
||||
tests/cases/conformance/types/members/classWithPrivateProperty.ts(17,18): error TS2341: Property 'b' is private and only accessible within class 'C'.
|
||||
tests/cases/conformance/types/members/classWithPrivateProperty.ts(18,18): error TS2341: Property 'c' is private and only accessible within class 'C'.
|
||||
tests/cases/conformance/types/members/classWithPrivateProperty.ts(19,18): error TS2341: Property 'd' is private and only accessible within class 'C'.
|
||||
tests/cases/conformance/types/members/classWithPrivateProperty.ts(20,18): error TS2341: Property 'e' is private and only accessible within class 'C'.
|
||||
tests/cases/conformance/types/members/classWithPrivateProperty.ts(21,18): error TS2341: Property 'f' is private and only accessible within class 'C'.
|
||||
tests/cases/conformance/types/members/classWithPrivateProperty.ts(22,18): error TS2341: Property 'g' is private and only accessible within class 'C'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/members/classWithPrivateProperty.ts (8 errors) ====
|
||||
@@ -25,25 +25,25 @@ tests/cases/conformance/types/members/classWithPrivateProperty.ts(22,18): error
|
||||
var c = new C();
|
||||
var r1: string = c.x;
|
||||
~~~
|
||||
!!! error TS2341: Property 'C.x' is inaccessible.
|
||||
!!! error TS2341: Property 'x' is private and only accessible within class 'C'.
|
||||
var r2: string = c.a;
|
||||
~~~
|
||||
!!! error TS2341: Property 'C.a' is inaccessible.
|
||||
!!! error TS2341: Property 'a' is private and only accessible within class 'C'.
|
||||
var r3: string = c.b;
|
||||
~~~
|
||||
!!! error TS2341: Property 'C.b' is inaccessible.
|
||||
!!! error TS2341: Property 'b' is private and only accessible within class 'C'.
|
||||
var r4: string = c.c();
|
||||
~~~
|
||||
!!! error TS2341: Property 'C.c' is inaccessible.
|
||||
!!! error TS2341: Property 'c' is private and only accessible within class 'C'.
|
||||
var r5: string = c.d();
|
||||
~~~
|
||||
!!! error TS2341: Property 'C.d' is inaccessible.
|
||||
!!! error TS2341: Property 'd' is private and only accessible within class 'C'.
|
||||
var r6: string = C.e;
|
||||
~~~
|
||||
!!! error TS2341: Property 'C.e' is inaccessible.
|
||||
!!! error TS2341: Property 'e' is private and only accessible within class 'C'.
|
||||
var r7: string = C.f();
|
||||
~~~
|
||||
!!! error TS2341: Property 'C.f' is inaccessible.
|
||||
!!! error TS2341: Property 'f' is private and only accessible within class 'C'.
|
||||
var r8: string = C.g();
|
||||
~~~
|
||||
!!! error TS2341: Property 'C.g' is inaccessible.
|
||||
!!! error TS2341: Property 'g' is private and only accessible within class 'C'.
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/cloduleStaticMembers.ts(6,13): error TS2341: Property 'Clod.x' is inaccessible.
|
||||
tests/cases/compiler/cloduleStaticMembers.ts(6,13): error TS2341: Property 'x' is private and only accessible within class 'Clod'.
|
||||
tests/cases/compiler/cloduleStaticMembers.ts(7,13): error TS2304: Cannot find name 'x'.
|
||||
tests/cases/compiler/cloduleStaticMembers.ts(10,13): error TS2304: Cannot find name 'y'.
|
||||
|
||||
@@ -11,7 +11,7 @@ tests/cases/compiler/cloduleStaticMembers.ts(10,13): error TS2304: Cannot find n
|
||||
module Clod {
|
||||
var p = Clod.x;
|
||||
~~~~~~
|
||||
!!! error TS2341: Property 'Clod.x' is inaccessible.
|
||||
!!! error TS2341: Property 'x' is private and only accessible within class 'Clod'.
|
||||
var q = x;
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'x'.
|
||||
|
||||
@@ -1,30 +1,39 @@
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties.ts(8,10): error TS2341: Property 'C.x' is inaccessible.
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties.ts(17,10): error TS2341: Property 'D.x' is inaccessible.
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties.ts(18,12): error TS2339: Property 'a' does not exist on type 'D<string>'.
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties.ts(8,10): error TS2341: Property 'x' is private and only accessible within class 'C'.
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties.ts(9,10): error TS2445: Property 'z' is protected and only accessible within class 'C' and its subclasses.
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties.ts(18,10): error TS2341: Property 'x' is private and only accessible within class 'D<T>'.
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties.ts(19,12): error TS2339: Property 'a' does not exist on type 'D<string>'.
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties.ts(20,10): error TS2445: Property 'z' is protected and only accessible within class 'D<T>' and its subclasses.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties.ts (3 errors) ====
|
||||
==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties.ts (5 errors) ====
|
||||
class C {
|
||||
y: string;
|
||||
constructor(private x: string) { }
|
||||
constructor(private x: string, protected z: string) { }
|
||||
}
|
||||
|
||||
var c: C;
|
||||
var r = c.y;
|
||||
var r2 = c.x; // error
|
||||
~~~
|
||||
!!! error TS2341: Property 'C.x' is inaccessible.
|
||||
!!! error TS2341: Property 'x' is private and only accessible within class 'C'.
|
||||
var r3 = c.z; // error
|
||||
~~~
|
||||
!!! error TS2445: Property 'z' is protected and only accessible within class 'C' and its subclasses.
|
||||
|
||||
class D<T> {
|
||||
y: T;
|
||||
constructor(a: T, private x: T) { }
|
||||
constructor(a: T, private x: T, protected z: T) { }
|
||||
}
|
||||
|
||||
var d: D<string>;
|
||||
var r = d.y;
|
||||
var r2 = d.x; // error
|
||||
~~~
|
||||
!!! error TS2341: Property 'D.x' is inaccessible.
|
||||
!!! error TS2341: Property 'x' is private and only accessible within class 'D<T>'.
|
||||
var r3 = d.a; // error
|
||||
~
|
||||
!!! error TS2339: Property 'a' does not exist on type 'D<string>'.
|
||||
!!! error TS2339: Property 'a' does not exist on type 'D<string>'.
|
||||
var r4 = d.z; // error
|
||||
~~~
|
||||
!!! error TS2445: Property 'z' is protected and only accessible within class 'D<T>' and its subclasses.
|
||||
|
||||
@@ -1,36 +1,42 @@
|
||||
//// [constructorParameterProperties.ts]
|
||||
class C {
|
||||
y: string;
|
||||
constructor(private x: string) { }
|
||||
constructor(private x: string, protected z: string) { }
|
||||
}
|
||||
|
||||
var c: C;
|
||||
var r = c.y;
|
||||
var r2 = c.x; // error
|
||||
var r3 = c.z; // error
|
||||
|
||||
class D<T> {
|
||||
y: T;
|
||||
constructor(a: T, private x: T) { }
|
||||
constructor(a: T, private x: T, protected z: T) { }
|
||||
}
|
||||
|
||||
var d: D<string>;
|
||||
var r = d.y;
|
||||
var r2 = d.x; // error
|
||||
var r3 = d.a; // error
|
||||
var r3 = d.a; // error
|
||||
var r4 = d.z; // error
|
||||
|
||||
|
||||
//// [constructorParameterProperties.js]
|
||||
var C = (function () {
|
||||
function C(x) {
|
||||
function C(x, z) {
|
||||
this.x = x;
|
||||
this.z = z;
|
||||
}
|
||||
return C;
|
||||
})();
|
||||
var c;
|
||||
var r = c.y;
|
||||
var r2 = c.x; // error
|
||||
var r3 = c.z; // error
|
||||
var D = (function () {
|
||||
function D(a, x) {
|
||||
function D(a, x, z) {
|
||||
this.x = x;
|
||||
this.z = z;
|
||||
}
|
||||
return D;
|
||||
})();
|
||||
@@ -38,3 +44,4 @@ var d;
|
||||
var r = d.y;
|
||||
var r2 = d.x; // error
|
||||
var r3 = d.a; // error
|
||||
var r4 = d.z; // error
|
||||
@@ -1,8 +1,9 @@
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(11,24): error TS2300: Duplicate identifier 'y'.
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(19,25): error TS2300: Duplicate identifier 'y'.
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(27,27): error TS2300: Duplicate identifier 'y'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts (2 errors) ====
|
||||
==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts (3 errors) ====
|
||||
class C {
|
||||
y: number;
|
||||
constructor(y: number) { } // ok
|
||||
@@ -29,4 +30,15 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/co
|
||||
}
|
||||
|
||||
var e: E;
|
||||
var r3 = e.y; // error
|
||||
var r3 = e.y; // error
|
||||
|
||||
class F {
|
||||
y: number;
|
||||
constructor(protected y: number) { } // error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'y'.
|
||||
}
|
||||
|
||||
var f: F;
|
||||
var r4 = f.y; // error
|
||||
|
||||
@@ -21,7 +21,16 @@ class E {
|
||||
}
|
||||
|
||||
var e: E;
|
||||
var r3 = e.y; // error
|
||||
var r3 = e.y; // error
|
||||
|
||||
class F {
|
||||
y: number;
|
||||
constructor(protected y: number) { } // error
|
||||
}
|
||||
|
||||
var f: F;
|
||||
var r4 = f.y; // error
|
||||
|
||||
|
||||
//// [constructorParameterProperties2.js]
|
||||
var C = (function () {
|
||||
@@ -47,3 +56,11 @@ var E = (function () {
|
||||
})();
|
||||
var e;
|
||||
var r3 = e.y; // error
|
||||
var F = (function () {
|
||||
function F(y) {
|
||||
this.y = y;
|
||||
} // error
|
||||
return F;
|
||||
})();
|
||||
var f;
|
||||
var r4 = f.y; // error
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/derivedClassOverridesPrivateFunction1.ts(8,7): error TS2416: Class 'DerivedClass' incorrectly extends base class 'BaseClass':
|
||||
Private property '_init' cannot be reimplemented.
|
||||
Types have separate declarations of a private property '_init'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/derivedClassOverridesPrivateFunction1.ts (1 errors) ====
|
||||
@@ -13,7 +13,7 @@ tests/cases/compiler/derivedClassOverridesPrivateFunction1.ts(8,7): error TS2416
|
||||
class DerivedClass extends BaseClass {
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2416: Class 'DerivedClass' incorrectly extends base class 'BaseClass':
|
||||
!!! error TS2416: Private property '_init' cannot be reimplemented.
|
||||
!!! error TS2416: Types have separate declarations of a private property '_init'.
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPrivates.ts(5,7): error TS2416: Class 'Derived' incorrectly extends base class 'Base':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Types have separate declarations of a private property 'x'.
|
||||
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPrivates.ts(13,7): error TS2418: Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2':
|
||||
Private property 'y' cannot be reimplemented.
|
||||
Types have separate declarations of a private property 'y'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPrivates.ts (2 errors) ====
|
||||
@@ -12,7 +12,7 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOve
|
||||
class Derived extends Base {
|
||||
~~~~~~~
|
||||
!!! error TS2416: Class 'Derived' incorrectly extends base class 'Base':
|
||||
!!! error TS2416: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2416: Types have separate declarations of a private property 'x'.
|
||||
private x: { foo: string; bar: string; }; // error
|
||||
}
|
||||
|
||||
@@ -23,6 +23,6 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOve
|
||||
class Derived2 extends Base2 {
|
||||
~~~~~~~~
|
||||
!!! error TS2418: Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2':
|
||||
!!! error TS2418: Private property 'y' cannot be reimplemented.
|
||||
!!! error TS2418: Types have separate declarations of a private property 'y'.
|
||||
private static y: { foo: string; bar: string; }; // error
|
||||
}
|
||||
+2
-2
@@ -3,7 +3,7 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWit
|
||||
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(18,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(19,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(12,7): error TS2416: Class 'Derived' incorrectly extends base class 'Base':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Property 'x' is private in type 'Derived' but not in type 'Base'.
|
||||
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(22,14): error TS2339: Property 'x' does not exist on type 'typeof Base'.
|
||||
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(23,18): error TS2339: Property 'x' does not exist on type 'typeof Derived'.
|
||||
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(25,15): error TS2339: Property 'fn' does not exist on type 'typeof Base'.
|
||||
@@ -33,7 +33,7 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWit
|
||||
class Derived extends Base {
|
||||
~~~~~~~
|
||||
!!! error TS2416: Class 'Derived' incorrectly extends base class 'Base':
|
||||
!!! error TS2416: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2416: Property 'x' is private in type 'Derived' but not in type 'Base'.
|
||||
private x: string;
|
||||
private fn(): string {
|
||||
return '';
|
||||
|
||||
+10
-10
@@ -3,11 +3,11 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWit
|
||||
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(19,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(20,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(13,7): error TS2418: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(24,10): error TS2341: Property 'Derived.x' is inaccessible.
|
||||
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(27,10): error TS2341: Property 'Derived.fn' is inaccessible.
|
||||
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(32,10): error TS2341: Property 'Derived.a' is inaccessible.
|
||||
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(33,1): error TS2341: Property 'Derived.a' is inaccessible.
|
||||
Property 'x' is private in type 'typeof Derived' but not in type 'typeof Base'.
|
||||
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(24,10): error TS2341: Property 'x' is private and only accessible within class 'Derived'.
|
||||
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(27,10): error TS2341: Property 'fn' is private and only accessible within class 'Derived'.
|
||||
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(32,10): error TS2341: Property 'a' is private and only accessible within class 'Derived'.
|
||||
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(33,1): error TS2341: Property 'a' is private and only accessible within class 'Derived'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts (9 errors) ====
|
||||
@@ -30,7 +30,7 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWit
|
||||
class Derived extends Base {
|
||||
~~~~~~~
|
||||
!!! error TS2418: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base':
|
||||
!!! error TS2418: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2418: Property 'x' is private in type 'typeof Derived' but not in type 'typeof Base'.
|
||||
private static x: string;
|
||||
private static fn(): string {
|
||||
return '';
|
||||
@@ -47,19 +47,19 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWit
|
||||
var r = Base.x; // ok
|
||||
var r2 = Derived.x; // error
|
||||
~~~~~~~~~
|
||||
!!! error TS2341: Property 'Derived.x' is inaccessible.
|
||||
!!! error TS2341: Property 'x' is private and only accessible within class 'Derived'.
|
||||
|
||||
var r3 = Base.fn(); // ok
|
||||
var r4 = Derived.fn(); // error
|
||||
~~~~~~~~~~
|
||||
!!! error TS2341: Property 'Derived.fn' is inaccessible.
|
||||
!!! error TS2341: Property 'fn' is private and only accessible within class 'Derived'.
|
||||
|
||||
var r5 = Base.a; // ok
|
||||
Base.a = 2; // ok
|
||||
|
||||
var r6 = Derived.a; // error
|
||||
~~~~~~~~~
|
||||
!!! error TS2341: Property 'Derived.a' is inaccessible.
|
||||
!!! error TS2341: Property 'a' is private and only accessible within class 'Derived'.
|
||||
Derived.a = 2; // error
|
||||
~~~~~~~~~
|
||||
!!! error TS2341: Property 'Derived.a' is inaccessible.
|
||||
!!! error TS2341: Property 'a' is private and only accessible within class 'Derived'.
|
||||
@@ -15,25 +15,25 @@ tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(21,9): error TS2335: 'super' can only be referenced in a derived class.
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(25,9): error TS2335: 'super' can only be referenced in a derived class.
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(30,9): error TS2335: 'super' can only be referenced in a derived class.
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(57,15): error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(61,23): error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(65,23): error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(69,19): error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(57,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(61,23): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(65,23): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(69,19): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(73,13): error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(76,40): error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(87,15): error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(91,23): error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(95,23): error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(99,19): error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(109,15): error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(110,15): error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(111,9): error TS2341: Property 'SomeBase.privateStaticFunc' is inaccessible.
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(114,15): error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(115,15): error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(116,9): error TS2341: Property 'SomeBase.privateStaticFunc' is inaccessible.
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(120,15): error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(121,15): error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(122,9): error TS2341: Property 'SomeBase.privateStaticFunc' is inaccessible.
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(87,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(91,23): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(95,23): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(99,19): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(109,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(110,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(111,9): error TS2341: Property 'privateStaticFunc' is private and only accessible within class 'SomeBase'.
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(114,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(115,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(116,9): error TS2341: Property 'privateStaticFunc' is private and only accessible within class 'SomeBase'.
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(120,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(121,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(122,9): error TS2341: Property 'privateStaticFunc' is private and only accessible within class 'SomeBase'.
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(127,16): error TS2335: 'super' can only be referenced in a derived class.
|
||||
tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(127,30): error TS2335: 'super' can only be referenced in a derived class.
|
||||
|
||||
@@ -119,13 +119,13 @@ tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess
|
||||
super();
|
||||
super.publicMember = 1;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
}
|
||||
|
||||
fn() {
|
||||
var x = super.publicMember;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
}
|
||||
|
||||
get a() {
|
||||
@@ -133,7 +133,7 @@ tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
var x = super.publicMember;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
return undefined;
|
||||
}
|
||||
set a(n) {
|
||||
@@ -141,7 +141,7 @@ tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
n = super.publicMember;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
}
|
||||
fn2() {
|
||||
function inner() {
|
||||
@@ -165,13 +165,13 @@ tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess
|
||||
super();
|
||||
super.privateMember = 1;
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
}
|
||||
|
||||
fn() {
|
||||
var x = super.privateMember;
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
}
|
||||
|
||||
get a() {
|
||||
@@ -179,7 +179,7 @@ tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
var x = super.privateMember;
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
return undefined;
|
||||
}
|
||||
set a(n) {
|
||||
@@ -187,7 +187,7 @@ tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
n = super.privateMember;
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,26 +199,26 @@ tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess
|
||||
static fn() {
|
||||
super.publicStaticMember = 3;
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
super.privateStaticMember = 3;
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
super.privateStaticFunc();
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2341: Property 'SomeBase.privateStaticFunc' is inaccessible.
|
||||
!!! error TS2341: Property 'privateStaticFunc' is private and only accessible within class 'SomeBase'.
|
||||
}
|
||||
static get a() {
|
||||
~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
super.publicStaticMember = 3;
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
super.privateStaticMember = 3;
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
super.privateStaticFunc();
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2341: Property 'SomeBase.privateStaticFunc' is inaccessible.
|
||||
!!! error TS2341: Property 'privateStaticFunc' is private and only accessible within class 'SomeBase'.
|
||||
return '';
|
||||
}
|
||||
static set a(n) {
|
||||
@@ -226,13 +226,13 @@ tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
super.publicStaticMember = 3;
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
super.privateStaticMember = 3;
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2340: Only public methods of the base class are accessible via the 'super' keyword
|
||||
!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
|
||||
super.privateStaticFunc();
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2341: Property 'SomeBase.privateStaticFunc' is inaccessible.
|
||||
!!! error TS2341: Property 'privateStaticFunc' is private and only accessible within class 'SomeBase'.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ tests/cases/conformance/functions/functionOverloadErrors.ts(2,14): error TS2371:
|
||||
tests/cases/conformance/functions/functionOverloadErrors.ts(44,25): error TS2304: Cannot find name 'Window'.
|
||||
tests/cases/conformance/functions/functionOverloadErrors.ts(50,25): error TS2304: Cannot find name 'Window'.
|
||||
tests/cases/conformance/functions/functionOverloadErrors.ts(51,32): error TS2304: Cannot find name 'window'.
|
||||
tests/cases/conformance/functions/functionOverloadErrors.ts(65,13): error TS2385: Overload signatures must all be public or private.
|
||||
tests/cases/conformance/functions/functionOverloadErrors.ts(68,13): error TS2385: Overload signatures must all be public or private.
|
||||
tests/cases/conformance/functions/functionOverloadErrors.ts(65,13): error TS2385: Overload signatures must all be public, private or protected.
|
||||
tests/cases/conformance/functions/functionOverloadErrors.ts(68,13): error TS2385: Overload signatures must all be public, private or protected.
|
||||
tests/cases/conformance/functions/functionOverloadErrors.ts(75,21): error TS2383: Overload signatures must all be exported or not exported.
|
||||
tests/cases/conformance/functions/functionOverloadErrors.ts(79,14): error TS2383: Overload signatures must all be exported or not exported.
|
||||
tests/cases/conformance/functions/functionOverloadErrors.ts(85,18): error TS2384: Overload signatures must all be ambient or non-ambient.
|
||||
@@ -89,12 +89,12 @@ tests/cases/conformance/functions/functionOverloadErrors.ts(116,19): error TS237
|
||||
public f();
|
||||
private f(s: string);
|
||||
~
|
||||
!!! error TS2385: Overload signatures must all be public or private.
|
||||
!!! error TS2385: Overload signatures must all be public, private or protected.
|
||||
f() { }
|
||||
|
||||
private g(s: string);
|
||||
~
|
||||
!!! error TS2385: Overload signatures must all be public or private.
|
||||
!!! error TS2385: Overload signatures must all be public, private or protected.
|
||||
public g();
|
||||
g() { }
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
tests/cases/compiler/functionOverloads5.ts(2,10): error TS2385: Overload signatures must all be public or private.
|
||||
tests/cases/compiler/functionOverloads5.ts(2,10): error TS2385: Overload signatures must all be public, private or protected.
|
||||
|
||||
|
||||
==== tests/cases/compiler/functionOverloads5.ts (1 errors) ====
|
||||
class baz {
|
||||
public foo();
|
||||
~~~
|
||||
!!! error TS2385: Overload signatures must all be public or private.
|
||||
!!! error TS2385: Overload signatures must all be public, private or protected.
|
||||
private foo(bar?:any){ }
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/i3.ts(6,1): error TS2322: Type 'I3' is not assignable to type '{ one: number; }':
|
||||
Required property 'one' cannot be reimplemented with optional property in 'I3'.
|
||||
Property 'one' is optional in type 'I3' but required in type '{ one: number; }'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/i3.ts (1 errors) ====
|
||||
@@ -11,4 +11,4 @@ tests/cases/compiler/i3.ts(6,1): error TS2322: Type 'I3' is not assignable to ty
|
||||
x = i;
|
||||
~
|
||||
!!! error TS2322: Type 'I3' is not assignable to type '{ one: number; }':
|
||||
!!! error TS2322: Required property 'one' cannot be reimplemented with optional property in 'I3'.
|
||||
!!! error TS2322: Property 'one' is optional in type 'I3' but required in type '{ one: number; }'.
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/implementPublicPropertyAsPrivate.ts(4,7): error TS2421: Class 'C' incorrectly implements interface 'I':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Property 'x' is private in type 'C' but not in type 'I'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/implementPublicPropertyAsPrivate.ts (1 errors) ====
|
||||
@@ -9,6 +9,6 @@ tests/cases/compiler/implementPublicPropertyAsPrivate.ts(4,7): error TS2421: Cla
|
||||
class C implements I {
|
||||
~
|
||||
!!! error TS2421: Class 'C' incorrectly implements interface 'I':
|
||||
!!! error TS2421: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2421: Property 'x' is private in type 'C' but not in type 'I'.
|
||||
private x = 0; // should raise error at class decl
|
||||
}
|
||||
+4
-4
@@ -3,9 +3,9 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInte
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(12,7): error TS2421: Class 'Bar2' incorrectly implements interface 'I':
|
||||
Property 'x' is missing in type 'Bar2'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(16,7): error TS2421: Class 'Bar3' incorrectly implements interface 'I':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Property 'x' is private in type 'I' but not in type 'Bar3'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(21,7): error TS2421: Class 'Bar4' incorrectly implements interface 'I':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Types have separate declarations of a private property 'x'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts (4 errors) ====
|
||||
@@ -33,7 +33,7 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInte
|
||||
class Bar3 implements I { // error
|
||||
~~~~
|
||||
!!! error TS2421: Class 'Bar3' incorrectly implements interface 'I':
|
||||
!!! error TS2421: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2421: Property 'x' is private in type 'I' but not in type 'Bar3'.
|
||||
x: string;
|
||||
y: number;
|
||||
}
|
||||
@@ -41,7 +41,7 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInte
|
||||
class Bar4 implements I { // error
|
||||
~~~~
|
||||
!!! error TS2421: Class 'Bar4' incorrectly implements interface 'I':
|
||||
!!! error TS2421: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2421: Types have separate declarations of a private property 'x'.
|
||||
private x: string;
|
||||
y: number;
|
||||
}
|
||||
+18
-18
@@ -1,29 +1,29 @@
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(13,7): error TS2416: Class 'Bar2' incorrectly extends base class 'Foo':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Property 'x' is private in type 'Foo' but not in type 'Bar2'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(13,7): error TS2421: Class 'Bar2' incorrectly implements interface 'I':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Property 'x' is private in type 'I' but not in type 'Bar2'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(18,7): error TS2416: Class 'Bar3' incorrectly extends base class 'Foo':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Types have separate declarations of a private property 'x'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(18,7): error TS2421: Class 'Bar3' incorrectly implements interface 'I':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Types have separate declarations of a private property 'x'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(42,11): error TS2416: Class 'Bar2' incorrectly extends base class 'Foo':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Property 'x' is private in type 'Foo' but not in type 'Bar2'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(42,11): error TS2421: Class 'Bar2' incorrectly implements interface 'I':
|
||||
Property 'z' is missing in type 'Bar2'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(47,11): error TS2416: Class 'Bar3' incorrectly extends base class 'Foo':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Types have separate declarations of a private property 'x'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(47,11): error TS2421: Class 'Bar3' incorrectly implements interface 'I':
|
||||
Property 'z' is missing in type 'Bar3'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(67,11): error TS2421: Class 'Bar' incorrectly implements interface 'I':
|
||||
Property 'y' is missing in type 'Bar'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(73,14): error TS2341: Property 'Foo.x' is inaccessible.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(73,14): error TS2341: Property 'x' is private and only accessible within class 'Foo'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(74,16): error TS2339: Property 'y' does not exist on type 'Bar'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(76,11): error TS2416: Class 'Bar2' incorrectly extends base class 'Foo':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Property 'x' is private in type 'Foo' but not in type 'Bar2'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(76,11): error TS2421: Class 'Bar2' incorrectly implements interface 'I':
|
||||
Property 'y' is missing in type 'Bar2'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(81,11): error TS2416: Class 'Bar3' incorrectly extends base class 'Foo':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Types have separate declarations of a private property 'x'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(81,11): error TS2421: Class 'Bar3' incorrectly implements interface 'I':
|
||||
Property 'y' is missing in type 'Bar3'.
|
||||
|
||||
@@ -44,10 +44,10 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInte
|
||||
class Bar2 extends Foo implements I { // error
|
||||
~~~~
|
||||
!!! error TS2416: Class 'Bar2' incorrectly extends base class 'Foo':
|
||||
!!! error TS2416: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2416: Property 'x' is private in type 'Foo' but not in type 'Bar2'.
|
||||
~~~~
|
||||
!!! error TS2421: Class 'Bar2' incorrectly implements interface 'I':
|
||||
!!! error TS2421: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2421: Property 'x' is private in type 'I' but not in type 'Bar2'.
|
||||
x: string;
|
||||
y: number;
|
||||
}
|
||||
@@ -55,10 +55,10 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInte
|
||||
class Bar3 extends Foo implements I { // error
|
||||
~~~~
|
||||
!!! error TS2416: Class 'Bar3' incorrectly extends base class 'Foo':
|
||||
!!! error TS2416: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2416: Types have separate declarations of a private property 'x'.
|
||||
~~~~
|
||||
!!! error TS2421: Class 'Bar3' incorrectly implements interface 'I':
|
||||
!!! error TS2421: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2421: Types have separate declarations of a private property 'x'.
|
||||
private x: string;
|
||||
y: number;
|
||||
}
|
||||
@@ -85,7 +85,7 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInte
|
||||
class Bar2 extends Foo implements I { // error
|
||||
~~~~
|
||||
!!! error TS2416: Class 'Bar2' incorrectly extends base class 'Foo':
|
||||
!!! error TS2416: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2416: Property 'x' is private in type 'Foo' but not in type 'Bar2'.
|
||||
~~~~
|
||||
!!! error TS2421: Class 'Bar2' incorrectly implements interface 'I':
|
||||
!!! error TS2421: Property 'z' is missing in type 'Bar2'.
|
||||
@@ -96,7 +96,7 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInte
|
||||
class Bar3 extends Foo implements I { // error
|
||||
~~~~
|
||||
!!! error TS2416: Class 'Bar3' incorrectly extends base class 'Foo':
|
||||
!!! error TS2416: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2416: Types have separate declarations of a private property 'x'.
|
||||
~~~~
|
||||
!!! error TS2421: Class 'Bar3' incorrectly implements interface 'I':
|
||||
!!! error TS2421: Property 'z' is missing in type 'Bar3'.
|
||||
@@ -130,7 +130,7 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInte
|
||||
var r1 = b.z;
|
||||
var r2 = b.x; // error
|
||||
~~~
|
||||
!!! error TS2341: Property 'Foo.x' is inaccessible.
|
||||
!!! error TS2341: Property 'x' is private and only accessible within class 'Foo'.
|
||||
var r3 = b.y; // error
|
||||
~
|
||||
!!! error TS2339: Property 'y' does not exist on type 'Bar'.
|
||||
@@ -138,7 +138,7 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInte
|
||||
class Bar2 extends Foo implements I { // error
|
||||
~~~~
|
||||
!!! error TS2416: Class 'Bar2' incorrectly extends base class 'Foo':
|
||||
!!! error TS2416: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2416: Property 'x' is private in type 'Foo' but not in type 'Bar2'.
|
||||
~~~~
|
||||
!!! error TS2421: Class 'Bar2' incorrectly implements interface 'I':
|
||||
!!! error TS2421: Property 'y' is missing in type 'Bar2'.
|
||||
@@ -149,7 +149,7 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInte
|
||||
class Bar3 extends Foo implements I { // error
|
||||
~~~~
|
||||
!!! error TS2416: Class 'Bar3' incorrectly extends base class 'Foo':
|
||||
!!! error TS2416: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2416: Types have separate declarations of a private property 'x'.
|
||||
~~~~
|
||||
!!! error TS2421: Class 'Bar3' incorrectly implements interface 'I':
|
||||
!!! error TS2421: Property 'y' is missing in type 'Bar3'.
|
||||
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(9,7): error TS2421: Class 'Bar' incorrectly implements interface 'I':
|
||||
Property 'y' is missing in type 'Bar'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(12,7): error TS2421: Class 'Bar2' incorrectly implements interface 'I':
|
||||
Property 'x' is missing in type 'Bar2'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(16,7): error TS2421: Class 'Bar3' incorrectly implements interface 'I':
|
||||
Property 'x' is protected but type 'Bar3' is not a class derived from 'Foo'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(21,7): error TS2421: Class 'Bar4' incorrectly implements interface 'I':
|
||||
Property 'x' is protected but type 'Bar4' is not a class derived from 'Foo'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(26,7): error TS2421: Class 'Bar5' incorrectly implements interface 'I':
|
||||
Property 'y' is missing in type 'Bar5'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(29,7): error TS2421: Class 'Bar6' incorrectly implements interface 'I':
|
||||
Property 'y' is protected in type 'Bar6' but public in type 'I'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts (6 errors) ====
|
||||
class Foo {
|
||||
protected x: string;
|
||||
}
|
||||
|
||||
interface I extends Foo {
|
||||
y: number;
|
||||
}
|
||||
|
||||
class Bar implements I { // error
|
||||
~~~
|
||||
!!! error TS2421: Class 'Bar' incorrectly implements interface 'I':
|
||||
!!! error TS2421: Property 'y' is missing in type 'Bar'.
|
||||
}
|
||||
|
||||
class Bar2 implements I { // error
|
||||
~~~~
|
||||
!!! error TS2421: Class 'Bar2' incorrectly implements interface 'I':
|
||||
!!! error TS2421: Property 'x' is missing in type 'Bar2'.
|
||||
y: number;
|
||||
}
|
||||
|
||||
class Bar3 implements I { // error
|
||||
~~~~
|
||||
!!! error TS2421: Class 'Bar3' incorrectly implements interface 'I':
|
||||
!!! error TS2421: Property 'x' is protected but type 'Bar3' is not a class derived from 'Foo'.
|
||||
x: string;
|
||||
y: number;
|
||||
}
|
||||
|
||||
class Bar4 implements I { // error
|
||||
~~~~
|
||||
!!! error TS2421: Class 'Bar4' incorrectly implements interface 'I':
|
||||
!!! error TS2421: Property 'x' is protected but type 'Bar4' is not a class derived from 'Foo'.
|
||||
protected x: string;
|
||||
y: number;
|
||||
}
|
||||
|
||||
class Bar5 extends Foo implements I { // error
|
||||
~~~~
|
||||
!!! error TS2421: Class 'Bar5' incorrectly implements interface 'I':
|
||||
!!! error TS2421: Property 'y' is missing in type 'Bar5'.
|
||||
}
|
||||
|
||||
class Bar6 extends Foo implements I { // error
|
||||
~~~~
|
||||
!!! error TS2421: Class 'Bar6' incorrectly implements interface 'I':
|
||||
!!! error TS2421: Property 'y' is protected in type 'Bar6' but public in type 'I'.
|
||||
protected y: number;
|
||||
}
|
||||
|
||||
class Bar7 extends Foo implements I {
|
||||
y: number;
|
||||
}
|
||||
|
||||
class Bar8 extends Foo implements I {
|
||||
x: string;
|
||||
y: number;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
//// [implementingAnInterfaceExtendingClassWithProtecteds.ts]
|
||||
class Foo {
|
||||
protected x: string;
|
||||
}
|
||||
|
||||
interface I extends Foo {
|
||||
y: number;
|
||||
}
|
||||
|
||||
class Bar implements I { // error
|
||||
}
|
||||
|
||||
class Bar2 implements I { // error
|
||||
y: number;
|
||||
}
|
||||
|
||||
class Bar3 implements I { // error
|
||||
x: string;
|
||||
y: number;
|
||||
}
|
||||
|
||||
class Bar4 implements I { // error
|
||||
protected x: string;
|
||||
y: number;
|
||||
}
|
||||
|
||||
class Bar5 extends Foo implements I { // error
|
||||
}
|
||||
|
||||
class Bar6 extends Foo implements I { // error
|
||||
protected y: number;
|
||||
}
|
||||
|
||||
class Bar7 extends Foo implements I {
|
||||
y: number;
|
||||
}
|
||||
|
||||
class Bar8 extends Foo implements I {
|
||||
x: string;
|
||||
y: number;
|
||||
}
|
||||
|
||||
|
||||
//// [implementingAnInterfaceExtendingClassWithProtecteds.js]
|
||||
var __extends = this.__extends || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() { this.constructor = d; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
};
|
||||
var Foo = (function () {
|
||||
function Foo() {
|
||||
}
|
||||
return Foo;
|
||||
})();
|
||||
var Bar = (function () {
|
||||
function Bar() {
|
||||
}
|
||||
return Bar;
|
||||
})();
|
||||
var Bar2 = (function () {
|
||||
function Bar2() {
|
||||
}
|
||||
return Bar2;
|
||||
})();
|
||||
var Bar3 = (function () {
|
||||
function Bar3() {
|
||||
}
|
||||
return Bar3;
|
||||
})();
|
||||
var Bar4 = (function () {
|
||||
function Bar4() {
|
||||
}
|
||||
return Bar4;
|
||||
})();
|
||||
var Bar5 = (function (_super) {
|
||||
__extends(Bar5, _super);
|
||||
function Bar5() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return Bar5;
|
||||
})(Foo);
|
||||
var Bar6 = (function (_super) {
|
||||
__extends(Bar6, _super);
|
||||
function Bar6() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return Bar6;
|
||||
})(Foo);
|
||||
var Bar7 = (function (_super) {
|
||||
__extends(Bar7, _super);
|
||||
function Bar7() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return Bar7;
|
||||
})(Foo);
|
||||
var Bar8 = (function (_super) {
|
||||
__extends(Bar8, _super);
|
||||
function Bar8() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return Bar8;
|
||||
})(Foo);
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/inheritanceGrandParentPrivateMemberCollision.ts(7,7): error TS2416: Class 'C' incorrectly extends base class 'B':
|
||||
Private property 'myMethod' cannot be reimplemented.
|
||||
Types have separate declarations of a private property 'myMethod'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/inheritanceGrandParentPrivateMemberCollision.ts (1 errors) ====
|
||||
@@ -12,7 +12,7 @@ tests/cases/compiler/inheritanceGrandParentPrivateMemberCollision.ts(7,7): error
|
||||
class C extends B {
|
||||
~
|
||||
!!! error TS2416: Class 'C' incorrectly extends base class 'B':
|
||||
!!! error TS2416: Private property 'myMethod' cannot be reimplemented.
|
||||
!!! error TS2416: Types have separate declarations of a private property 'myMethod'.
|
||||
private myMethod() { }
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.ts(7,7): error TS2416: Class 'C' incorrectly extends base class 'B':
|
||||
Private property 'myMethod' cannot be reimplemented.
|
||||
Property 'myMethod' is private in type 'B' but not in type 'C'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.ts (1 errors) ====
|
||||
@@ -12,7 +12,7 @@ tests/cases/compiler/inheritanceGrandParentPrivateMemberCollisionWithPublicMembe
|
||||
class C extends B {
|
||||
~
|
||||
!!! error TS2416: Class 'C' incorrectly extends base class 'B':
|
||||
!!! error TS2416: Private property 'myMethod' cannot be reimplemented.
|
||||
!!! error TS2416: Property 'myMethod' is private in type 'B' but not in type 'C'.
|
||||
public myMethod() { }
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.ts(7,7): error TS2416: Class 'C' incorrectly extends base class 'B':
|
||||
Private property 'myMethod' cannot be reimplemented.
|
||||
Property 'myMethod' is private in type 'C' but not in type 'B'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.ts (1 errors) ====
|
||||
@@ -12,7 +12,7 @@ tests/cases/compiler/inheritanceGrandParentPublicMemberCollisionWithPrivateMembe
|
||||
class C extends B {
|
||||
~
|
||||
!!! error TS2416: Class 'C' incorrectly extends base class 'B':
|
||||
!!! error TS2416: Private property 'myMethod' cannot be reimplemented.
|
||||
!!! error TS2416: Property 'myMethod' is private in type 'C' but not in type 'B'.
|
||||
private myMethod() { }
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates.ts(5,11): error TS2429: Interface 'I' incorrectly extends interface 'Foo':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates.ts(15,10): error TS2341: Property 'Foo.x' is inaccessible.
|
||||
Property 'x' is private in type 'Foo' but not in type 'I'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates.ts(15,10): error TS2341: Property 'x' is private and only accessible within class 'Foo'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates.ts (2 errors) ====
|
||||
@@ -11,7 +11,7 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtending
|
||||
interface I extends Foo { // error
|
||||
~
|
||||
!!! error TS2429: Interface 'I' incorrectly extends interface 'Foo':
|
||||
!!! error TS2429: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2429: Property 'x' is private in type 'Foo' but not in type 'I'.
|
||||
x: string;
|
||||
}
|
||||
|
||||
@@ -23,4 +23,4 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtending
|
||||
var r = i.y;
|
||||
var r2 = i.x; // error
|
||||
~~~
|
||||
!!! error TS2341: Property 'Foo.x' is inaccessible.
|
||||
!!! error TS2341: Property 'x' is private and only accessible within class 'Foo'.
|
||||
@@ -1,11 +1,11 @@
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(9,11): error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar':
|
||||
Named properties 'x' of types 'Foo' and 'Bar' are not identical.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(12,11): error TS2429: Interface 'I4' incorrectly extends interface 'Bar':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Property 'x' is private in type 'Bar' but not in type 'I4'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(12,11): error TS2429: Interface 'I4' incorrectly extends interface 'Foo':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(26,10): error TS2341: Property 'Foo.x' is inaccessible.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(27,10): error TS2341: Property 'Baz.y' is inaccessible.
|
||||
Property 'x' is private in type 'Foo' but not in type 'I4'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(26,10): error TS2341: Property 'x' is private and only accessible within class 'Foo'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(27,10): error TS2341: Property 'y' is private and only accessible within class 'Baz'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts (5 errors) ====
|
||||
@@ -26,10 +26,10 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtending
|
||||
interface I4 extends Foo, Bar { // error
|
||||
~~
|
||||
!!! error TS2429: Interface 'I4' incorrectly extends interface 'Bar':
|
||||
!!! error TS2429: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2429: Property 'x' is private in type 'Bar' but not in type 'I4'.
|
||||
~~
|
||||
!!! error TS2429: Interface 'I4' incorrectly extends interface 'Foo':
|
||||
!!! error TS2429: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2429: Property 'x' is private in type 'Foo' but not in type 'I4'.
|
||||
x: string;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtending
|
||||
var r: string = i.z;
|
||||
var r2 = i.x; // error
|
||||
~~~
|
||||
!!! error TS2341: Property 'Foo.x' is inaccessible.
|
||||
!!! error TS2341: Property 'x' is private and only accessible within class 'Foo'.
|
||||
var r3 = i.y; // error
|
||||
~~~
|
||||
!!! error TS2341: Property 'Baz.y' is inaccessible.
|
||||
!!! error TS2341: Property 'y' is private and only accessible within class 'Baz'.
|
||||
@@ -0,0 +1,26 @@
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds.ts(5,11): error TS2429: Interface 'I' incorrectly extends interface 'Foo':
|
||||
Property 'x' is protected but type 'I' is not a class derived from 'Foo'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds.ts(15,10): error TS2445: Property 'x' is protected and only accessible within class 'Foo' and its subclasses.
|
||||
|
||||
|
||||
==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds.ts (2 errors) ====
|
||||
class Foo {
|
||||
protected x: string;
|
||||
}
|
||||
|
||||
interface I extends Foo { // error
|
||||
~
|
||||
!!! error TS2429: Interface 'I' incorrectly extends interface 'Foo':
|
||||
!!! error TS2429: Property 'x' is protected but type 'I' is not a class derived from 'Foo'.
|
||||
x: string;
|
||||
}
|
||||
|
||||
interface I2 extends Foo {
|
||||
y: string;
|
||||
}
|
||||
|
||||
var i: I2;
|
||||
var r = i.y;
|
||||
var r2 = i.x; // error
|
||||
~~~
|
||||
!!! error TS2445: Property 'x' is protected and only accessible within class 'Foo' and its subclasses.
|
||||
@@ -0,0 +1,26 @@
|
||||
//// [interfaceExtendingClassWithProtecteds.ts]
|
||||
class Foo {
|
||||
protected x: string;
|
||||
}
|
||||
|
||||
interface I extends Foo { // error
|
||||
x: string;
|
||||
}
|
||||
|
||||
interface I2 extends Foo {
|
||||
y: string;
|
||||
}
|
||||
|
||||
var i: I2;
|
||||
var r = i.y;
|
||||
var r2 = i.x; // error
|
||||
|
||||
//// [interfaceExtendingClassWithProtecteds.js]
|
||||
var Foo = (function () {
|
||||
function Foo() {
|
||||
}
|
||||
return Foo;
|
||||
})();
|
||||
var i;
|
||||
var r = i.y;
|
||||
var r2 = i.x; // error
|
||||
@@ -0,0 +1,51 @@
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(9,11): error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar':
|
||||
Named properties 'x' of types 'Foo' and 'Bar' are not identical.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(12,11): error TS2429: Interface 'I4' incorrectly extends interface 'Bar':
|
||||
Property 'x' is protected but type 'I4' is not a class derived from 'Bar'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(12,11): error TS2429: Interface 'I4' incorrectly extends interface 'Foo':
|
||||
Property 'x' is protected but type 'I4' is not a class derived from 'Foo'.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(26,10): error TS2445: Property 'x' is protected and only accessible within class 'Foo' and its subclasses.
|
||||
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(27,10): error TS2445: Property 'y' is protected and only accessible within class 'Baz' and its subclasses.
|
||||
|
||||
|
||||
==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts (5 errors) ====
|
||||
class Foo {
|
||||
protected x: string;
|
||||
}
|
||||
|
||||
class Bar {
|
||||
protected x: string;
|
||||
}
|
||||
|
||||
interface I3 extends Foo, Bar { // error
|
||||
~~
|
||||
!!! error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar':
|
||||
!!! error TS2320: Named properties 'x' of types 'Foo' and 'Bar' are not identical.
|
||||
}
|
||||
|
||||
interface I4 extends Foo, Bar { // error
|
||||
~~
|
||||
!!! error TS2429: Interface 'I4' incorrectly extends interface 'Bar':
|
||||
!!! error TS2429: Property 'x' is protected but type 'I4' is not a class derived from 'Bar'.
|
||||
~~
|
||||
!!! error TS2429: Interface 'I4' incorrectly extends interface 'Foo':
|
||||
!!! error TS2429: Property 'x' is protected but type 'I4' is not a class derived from 'Foo'.
|
||||
x: string;
|
||||
}
|
||||
|
||||
class Baz {
|
||||
protected y: string;
|
||||
}
|
||||
|
||||
interface I5 extends Foo, Baz {
|
||||
z: string;
|
||||
}
|
||||
|
||||
var i: I5;
|
||||
var r: string = i.z;
|
||||
var r2 = i.x; // error
|
||||
~~~
|
||||
!!! error TS2445: Property 'x' is protected and only accessible within class 'Foo' and its subclasses.
|
||||
var r3 = i.y; // error
|
||||
~~~
|
||||
!!! error TS2445: Property 'y' is protected and only accessible within class 'Baz' and its subclasses.
|
||||
@@ -0,0 +1,49 @@
|
||||
//// [interfaceExtendingClassWithProtecteds2.ts]
|
||||
class Foo {
|
||||
protected x: string;
|
||||
}
|
||||
|
||||
class Bar {
|
||||
protected x: string;
|
||||
}
|
||||
|
||||
interface I3 extends Foo, Bar { // error
|
||||
}
|
||||
|
||||
interface I4 extends Foo, Bar { // error
|
||||
x: string;
|
||||
}
|
||||
|
||||
class Baz {
|
||||
protected y: string;
|
||||
}
|
||||
|
||||
interface I5 extends Foo, Baz {
|
||||
z: string;
|
||||
}
|
||||
|
||||
var i: I5;
|
||||
var r: string = i.z;
|
||||
var r2 = i.x; // error
|
||||
var r3 = i.y; // error
|
||||
|
||||
//// [interfaceExtendingClassWithProtecteds2.js]
|
||||
var Foo = (function () {
|
||||
function Foo() {
|
||||
}
|
||||
return Foo;
|
||||
})();
|
||||
var Bar = (function () {
|
||||
function Bar() {
|
||||
}
|
||||
return Bar;
|
||||
})();
|
||||
var Baz = (function () {
|
||||
function Baz() {
|
||||
}
|
||||
return Baz;
|
||||
})();
|
||||
var i;
|
||||
var r = i.z;
|
||||
var r2 = i.x; // error
|
||||
var r3 = i.y; // error
|
||||
@@ -1,11 +1,11 @@
|
||||
tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(10,7): error TS2416: Class 'D' incorrectly extends base class 'C':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Types have separate declarations of a private property 'x'.
|
||||
tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(10,7): error TS2421: Class 'D' incorrectly implements interface 'I':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Types have separate declarations of a private property 'x'.
|
||||
tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(18,7): error TS2416: Class 'D2' incorrectly extends base class 'C':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Types have separate declarations of a private property 'x'.
|
||||
tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(18,7): error TS2421: Class 'D2' incorrectly implements interface 'I':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Types have separate declarations of a private property 'x'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts (4 errors) ====
|
||||
@@ -21,10 +21,10 @@ tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(18,7): error TS2421: C
|
||||
class D extends C implements I { // error
|
||||
~
|
||||
!!! error TS2416: Class 'D' incorrectly extends base class 'C':
|
||||
!!! error TS2416: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2416: Types have separate declarations of a private property 'x'.
|
||||
~
|
||||
!!! error TS2421: Class 'D' incorrectly implements interface 'I':
|
||||
!!! error TS2421: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2421: Types have separate declarations of a private property 'x'.
|
||||
public foo(x: any) { return x; }
|
||||
private x = 2;
|
||||
private y = 3;
|
||||
@@ -35,10 +35,10 @@ tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(18,7): error TS2421: C
|
||||
class D2 extends C implements I { // error
|
||||
~~
|
||||
!!! error TS2416: Class 'D2' incorrectly extends base class 'C':
|
||||
!!! error TS2416: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2416: Types have separate declarations of a private property 'x'.
|
||||
~~
|
||||
!!! error TS2421: Class 'D2' incorrectly implements interface 'I':
|
||||
!!! error TS2421: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2421: Types have separate declarations of a private property 'x'.
|
||||
public foo(x: any) { return x; }
|
||||
private x = "";
|
||||
other(x: any) { return x; }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/compiler/interfaceImplementation1.ts(12,7): error TS2421: Class 'C1' incorrectly implements interface 'I1':
|
||||
Private property 'iObj' cannot be reimplemented.
|
||||
Property 'iObj' is private in type 'C1' but not in type 'I1'.
|
||||
tests/cases/compiler/interfaceImplementation1.ts(12,7): error TS2421: Class 'C1' incorrectly implements interface 'I2':
|
||||
Private property 'iFn' cannot be reimplemented.
|
||||
Property 'iFn' is private in type 'C1' but not in type 'I2'.
|
||||
tests/cases/compiler/interfaceImplementation1.ts(34,5): error TS2323: Type '() => C2' is not assignable to type 'I4'.
|
||||
|
||||
|
||||
@@ -20,10 +20,10 @@ tests/cases/compiler/interfaceImplementation1.ts(34,5): error TS2323: Type '() =
|
||||
class C1 implements I1,I2 {
|
||||
~~
|
||||
!!! error TS2421: Class 'C1' incorrectly implements interface 'I1':
|
||||
!!! error TS2421: Private property 'iObj' cannot be reimplemented.
|
||||
!!! error TS2421: Property 'iObj' is private in type 'C1' but not in type 'I1'.
|
||||
~~
|
||||
!!! error TS2421: Class 'C1' incorrectly implements interface 'I2':
|
||||
!!! error TS2421: Private property 'iFn' cannot be reimplemented.
|
||||
!!! error TS2421: Property 'iFn' is private in type 'C1' but not in type 'I2'.
|
||||
private iFn();
|
||||
private iFn(n?:number, s?:string) { }
|
||||
private iAny:any;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/interfaceImplementation6.ts(9,7): error TS2421: Class 'C2' incorrectly implements interface 'I1':
|
||||
Private property 'item' cannot be reimplemented.
|
||||
Property 'item' is private in type 'C2' but not in type 'I1'.
|
||||
tests/cases/compiler/interfaceImplementation6.ts(13,7): error TS2421: Class 'C3' incorrectly implements interface 'I1':
|
||||
Property 'item' is missing in type 'C3'.
|
||||
|
||||
@@ -16,7 +16,7 @@ tests/cases/compiler/interfaceImplementation6.ts(13,7): error TS2421: Class 'C3'
|
||||
class C2 implements I1 {
|
||||
~~
|
||||
!!! error TS2421: Class 'C2' incorrectly implements interface 'I1':
|
||||
!!! error TS2421: Private property 'item' cannot be reimplemented.
|
||||
!!! error TS2421: Property 'item' is private in type 'C2' but not in type 'I1'.
|
||||
private item:number;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/compiler/interfaceImplementation8.ts(12,7): error TS2421: Class 'C2' incorrectly implements interface 'i1':
|
||||
Private property 'name' cannot be reimplemented.
|
||||
Property 'name' is private in type 'C2' but not in type 'i1'.
|
||||
tests/cases/compiler/interfaceImplementation8.ts(21,7): error TS2421: Class 'C5' incorrectly implements interface 'i1':
|
||||
Private property 'name' cannot be reimplemented.
|
||||
Property 'name' is private in type 'C5' but not in type 'i1'.
|
||||
tests/cases/compiler/interfaceImplementation8.ts(22,7): error TS2421: Class 'C6' incorrectly implements interface 'i1':
|
||||
Private property 'name' cannot be reimplemented.
|
||||
Property 'name' is private in type 'C6' but not in type 'i1'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/interfaceImplementation8.ts (3 errors) ====
|
||||
@@ -21,7 +21,7 @@ tests/cases/compiler/interfaceImplementation8.ts(22,7): error TS2421: Class 'C6'
|
||||
class C2 implements i1 {
|
||||
~~
|
||||
!!! error TS2421: Class 'C2' incorrectly implements interface 'i1':
|
||||
!!! error TS2421: Private property 'name' cannot be reimplemented.
|
||||
!!! error TS2421: Property 'name' is private in type 'C2' but not in type 'i1'.
|
||||
private name:string;
|
||||
}
|
||||
|
||||
@@ -33,11 +33,11 @@ tests/cases/compiler/interfaceImplementation8.ts(22,7): error TS2421: Class 'C6'
|
||||
class C5 extends C2 implements i1{ }
|
||||
~~
|
||||
!!! error TS2421: Class 'C5' incorrectly implements interface 'i1':
|
||||
!!! error TS2421: Private property 'name' cannot be reimplemented.
|
||||
!!! error TS2421: Property 'name' is private in type 'C5' but not in type 'i1'.
|
||||
class C6 extends C3 implements i1{ }
|
||||
~~
|
||||
!!! error TS2421: Class 'C6' incorrectly implements interface 'i1':
|
||||
!!! error TS2421: Private property 'name' cannot be reimplemented.
|
||||
!!! error TS2421: Property 'name' is private in type 'C6' but not in type 'i1'.
|
||||
|
||||
/*
|
||||
2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType.ts(5,11): error TS2429: Interface 'Foo' incorrectly extends interface 'Base':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Property 'x' is private in type 'Base' but not in type 'Foo'.
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType.ts(13,11): error TS2429: Interface 'Foo2<T>' incorrectly extends interface 'Base2<T>':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Property 'x' is private in type 'Base2<T>' but not in type 'Foo2<T>'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType.ts (2 errors) ====
|
||||
@@ -12,7 +12,7 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyTh
|
||||
interface Foo extends Base { // error
|
||||
~~~
|
||||
!!! error TS2429: Interface 'Foo' incorrectly extends interface 'Base':
|
||||
!!! error TS2429: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2429: Property 'x' is private in type 'Base' but not in type 'Foo'.
|
||||
x: number;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,6 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyTh
|
||||
interface Foo2<T> extends Base2<T> { // error
|
||||
~~~~
|
||||
!!! error TS2429: Interface 'Foo2<T>' incorrectly extends interface 'Base2<T>':
|
||||
!!! error TS2429: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2429: Property 'x' is private in type 'Base2<T>' but not in type 'Foo2<T>'.
|
||||
x: number;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType2.ts(5,11): error TS2429: Interface 'Foo' incorrectly extends interface 'Base':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Property 'x' is private in type 'Base' but not in type 'Foo'.
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType2.ts(13,11): error TS2429: Interface 'Foo2<T>' incorrectly extends interface 'Base2<T>':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Property 'x' is private in type 'Base2<T>' but not in type 'Foo2<T>'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType2.ts (2 errors) ====
|
||||
@@ -12,7 +12,7 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyTh
|
||||
interface Foo extends Base { // error
|
||||
~~~
|
||||
!!! error TS2429: Interface 'Foo' incorrectly extends interface 'Base':
|
||||
!!! error TS2429: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2429: Property 'x' is private in type 'Base' but not in type 'Foo'.
|
||||
x(): any;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,6 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyTh
|
||||
interface Foo2<T> extends Base2<T> { // error
|
||||
~~~~
|
||||
!!! error TS2429: Interface 'Foo2<T>' incorrectly extends interface 'Base2<T>':
|
||||
!!! error TS2429: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2429: Property 'x' is private in type 'Base2<T>' but not in type 'Foo2<T>'.
|
||||
x(): any;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPrivateOverloads.ts(43,9): error TS2341: Property 'C.foo' is inaccessible.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPrivateOverloads.ts(46,10): error TS2341: Property 'D.foo' is inaccessible.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPrivateOverloads.ts(48,10): error TS2341: Property 'C.foo' is inaccessible.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPrivateOverloads.ts(49,10): error TS2341: Property 'D.bar' is inaccessible.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPrivateOverloads.ts(43,9): error TS2341: Property 'foo' is private and only accessible within class 'C'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPrivateOverloads.ts(46,10): error TS2341: Property 'foo' is private and only accessible within class 'D<T>'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPrivateOverloads.ts(48,10): error TS2341: Property 'foo' is private and only accessible within class 'C'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPrivateOverloads.ts(49,10): error TS2341: Property 'bar' is private and only accessible within class 'D<T>'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPrivateOverloads.ts (4 errors) ====
|
||||
@@ -49,16 +49,16 @@ tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclara
|
||||
var c: C;
|
||||
var r = c.foo(1); // error
|
||||
~~~~~
|
||||
!!! error TS2341: Property 'C.foo' is inaccessible.
|
||||
!!! error TS2341: Property 'foo' is private and only accessible within class 'C'.
|
||||
|
||||
var d: D<number>;
|
||||
var r2 = d.foo(2); // error
|
||||
~~~~~
|
||||
!!! error TS2341: Property 'D.foo' is inaccessible.
|
||||
!!! error TS2341: Property 'foo' is private and only accessible within class 'D<T>'.
|
||||
|
||||
var r3 = C.foo(1); // error
|
||||
~~~~~
|
||||
!!! error TS2341: Property 'C.foo' is inaccessible.
|
||||
!!! error TS2341: Property 'foo' is private and only accessible within class 'C'.
|
||||
var r4 = D.bar(''); // error
|
||||
~~~~~
|
||||
!!! error TS2341: Property 'D.bar' is inaccessible.
|
||||
!!! error TS2341: Property 'bar' is private and only accessible within class 'D<T>'.
|
||||
@@ -1,13 +1,13 @@
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(3,12): error TS2385: Overload signatures must all be public or private.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(7,12): error TS2385: Overload signatures must all be public or private.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(12,19): error TS2385: Overload signatures must all be public or private.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(16,19): error TS2385: Overload signatures must all be public or private.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(23,12): error TS2385: Overload signatures must all be public or private.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(27,12): error TS2385: Overload signatures must all be public or private.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(32,19): error TS2385: Overload signatures must all be public or private.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(36,19): error TS2385: Overload signatures must all be public or private.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(42,9): error TS2341: Property 'C.foo' is inaccessible.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(45,10): error TS2341: Property 'D.foo' is inaccessible.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(3,12): error TS2385: Overload signatures must all be public, private or protected.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(7,12): error TS2385: Overload signatures must all be public, private or protected.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(12,19): error TS2385: Overload signatures must all be public, private or protected.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(16,19): error TS2385: Overload signatures must all be public, private or protected.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(23,12): error TS2385: Overload signatures must all be public, private or protected.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(27,12): error TS2385: Overload signatures must all be public, private or protected.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(32,19): error TS2385: Overload signatures must all be public, private or protected.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(36,19): error TS2385: Overload signatures must all be public, private or protected.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(42,9): error TS2341: Property 'foo' is private and only accessible within class 'C'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(45,10): error TS2341: Property 'foo' is private and only accessible within class 'D<T>'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts (10 errors) ====
|
||||
@@ -15,26 +15,26 @@ tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclara
|
||||
private foo(x: number);
|
||||
public foo(x: number, y: string); // error
|
||||
~~~
|
||||
!!! error TS2385: Overload signatures must all be public or private.
|
||||
!!! error TS2385: Overload signatures must all be public, private or protected.
|
||||
private foo(x: any, y?: any) { }
|
||||
|
||||
private bar(x: 'hi');
|
||||
public bar(x: string); // error
|
||||
~~~
|
||||
!!! error TS2385: Overload signatures must all be public or private.
|
||||
!!! error TS2385: Overload signatures must all be public, private or protected.
|
||||
private bar(x: number, y: string);
|
||||
private bar(x: any, y?: any) { }
|
||||
|
||||
private static foo(x: number);
|
||||
public static foo(x: number, y: string); // error
|
||||
~~~
|
||||
!!! error TS2385: Overload signatures must all be public or private.
|
||||
!!! error TS2385: Overload signatures must all be public, private or protected.
|
||||
private static foo(x: any, y?: any) { }
|
||||
|
||||
private static bar(x: 'hi');
|
||||
public static bar(x: string); // error
|
||||
~~~
|
||||
!!! error TS2385: Overload signatures must all be public or private.
|
||||
!!! error TS2385: Overload signatures must all be public, private or protected.
|
||||
private static bar(x: number, y: string);
|
||||
private static bar(x: any, y?: any) { }
|
||||
}
|
||||
@@ -43,26 +43,26 @@ tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclara
|
||||
private foo(x: number);
|
||||
public foo(x: T, y: T); // error
|
||||
~~~
|
||||
!!! error TS2385: Overload signatures must all be public or private.
|
||||
!!! error TS2385: Overload signatures must all be public, private or protected.
|
||||
private foo(x: any, y?: any) { }
|
||||
|
||||
private bar(x: 'hi');
|
||||
public bar(x: string); // error
|
||||
~~~
|
||||
!!! error TS2385: Overload signatures must all be public or private.
|
||||
!!! error TS2385: Overload signatures must all be public, private or protected.
|
||||
private bar(x: T, y: T);
|
||||
private bar(x: any, y?: any) { }
|
||||
|
||||
private static foo(x: number);
|
||||
public static foo(x: number, y: string); // error
|
||||
~~~
|
||||
!!! error TS2385: Overload signatures must all be public or private.
|
||||
!!! error TS2385: Overload signatures must all be public, private or protected.
|
||||
private static foo(x: any, y?: any) { }
|
||||
|
||||
private static bar(x: 'hi');
|
||||
public static bar(x: string); // error
|
||||
~~~
|
||||
!!! error TS2385: Overload signatures must all be public or private.
|
||||
!!! error TS2385: Overload signatures must all be public, private or protected.
|
||||
private static bar(x: number, y: string);
|
||||
private static bar(x: any, y?: any) { }
|
||||
}
|
||||
@@ -70,9 +70,9 @@ tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclara
|
||||
var c: C;
|
||||
var r = c.foo(1); // error
|
||||
~~~~~
|
||||
!!! error TS2341: Property 'C.foo' is inaccessible.
|
||||
!!! error TS2341: Property 'foo' is private and only accessible within class 'C'.
|
||||
|
||||
var d: D<number>;
|
||||
var r2 = d.foo(2); // error
|
||||
~~~~~
|
||||
!!! error TS2341: Property 'D.foo' is inaccessible.
|
||||
!!! error TS2341: Property 'foo' is private and only accessible within class 'D<T>'.
|
||||
@@ -1,8 +1,8 @@
|
||||
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts(13,7): error TS2421: Class 'D' incorrectly implements interface 'A':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
Types have separate declarations of a private property 'x'.
|
||||
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts(19,7): error TS2421: Class 'E' incorrectly implements interface 'A':
|
||||
Private property 'x' cannot be reimplemented.
|
||||
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts(26,9): error TS2341: Property 'C.x' is inaccessible.
|
||||
Property 'x' is private in type 'A' but not in type 'E'.
|
||||
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts(26,9): error TS2341: Property 'x' is private and only accessible within class 'C'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts (3 errors) ====
|
||||
@@ -21,7 +21,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheri
|
||||
class D implements A { // error
|
||||
~
|
||||
!!! error TS2421: Class 'D' incorrectly implements interface 'A':
|
||||
!!! error TS2421: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2421: Types have separate declarations of a private property 'x'.
|
||||
private x: number;
|
||||
y: string;
|
||||
z: string;
|
||||
@@ -30,7 +30,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheri
|
||||
class E implements A { // error
|
||||
~
|
||||
!!! error TS2421: Class 'E' incorrectly implements interface 'A':
|
||||
!!! error TS2421: Private property 'x' cannot be reimplemented.
|
||||
!!! error TS2421: Property 'x' is private in type 'A' but not in type 'E'.
|
||||
x: number;
|
||||
y: string;
|
||||
z: string;
|
||||
@@ -39,4 +39,4 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheri
|
||||
var a: A;
|
||||
var r = a.x; // error
|
||||
~~~
|
||||
!!! error TS2341: Property 'C.x' is inaccessible.
|
||||
!!! error TS2341: Property 'x' is private and only accessible within class 'C'.
|
||||
@@ -1,11 +1,11 @@
|
||||
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(17,7): error TS2421: Class 'D' incorrectly implements interface 'A':
|
||||
Private property 'w' cannot be reimplemented.
|
||||
Types have separate declarations of a private property 'w'.
|
||||
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(23,7): error TS2416: Class 'E' incorrectly extends base class 'C2':
|
||||
Private property 'w' cannot be reimplemented.
|
||||
Property 'w' is private in type 'C2' but not in type 'E'.
|
||||
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(23,7): error TS2421: Class 'E' incorrectly implements interface 'A':
|
||||
Property 'x' is missing in type 'E'.
|
||||
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(30,9): error TS2341: Property 'C.x' is inaccessible.
|
||||
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(31,10): error TS2341: Property 'C2.w' is inaccessible.
|
||||
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(30,9): error TS2341: Property 'x' is private and only accessible within class 'C'.
|
||||
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(31,10): error TS2341: Property 'w' is private and only accessible within class 'C2'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts (5 errors) ====
|
||||
@@ -28,7 +28,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheri
|
||||
class D extends C implements A { // error
|
||||
~
|
||||
!!! error TS2421: Class 'D' incorrectly implements interface 'A':
|
||||
!!! error TS2421: Private property 'w' cannot be reimplemented.
|
||||
!!! error TS2421: Types have separate declarations of a private property 'w'.
|
||||
private w: number;
|
||||
y: string;
|
||||
z: string;
|
||||
@@ -37,7 +37,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheri
|
||||
class E extends C2 implements A { // error
|
||||
~
|
||||
!!! error TS2416: Class 'E' incorrectly extends base class 'C2':
|
||||
!!! error TS2416: Private property 'w' cannot be reimplemented.
|
||||
!!! error TS2416: Property 'w' is private in type 'C2' but not in type 'E'.
|
||||
~
|
||||
!!! error TS2421: Class 'E' incorrectly implements interface 'A':
|
||||
!!! error TS2421: Property 'x' is missing in type 'E'.
|
||||
@@ -49,7 +49,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheri
|
||||
var a: A;
|
||||
var r = a.x; // error
|
||||
~~~
|
||||
!!! error TS2341: Property 'C.x' is inaccessible.
|
||||
!!! error TS2341: Property 'x' is private and only accessible within class 'C'.
|
||||
var r2 = a.w; // error
|
||||
~~~
|
||||
!!! error TS2341: Property 'C2.w' is inaccessible.
|
||||
!!! error TS2341: Property 'w' is private and only accessible within class 'C2'.
|
||||
@@ -5,7 +5,7 @@ tests/cases/compiler/optionalPropertiesTest.ts(25,5): error TS2322: Type '{}' is
|
||||
tests/cases/compiler/optionalPropertiesTest.ts(26,5): error TS2322: Type '{}' is not assignable to type 'i3':
|
||||
Property 'M' is missing in type '{}'.
|
||||
tests/cases/compiler/optionalPropertiesTest.ts(40,1): error TS2322: Type 'i2' is not assignable to type 'i1':
|
||||
Required property 'M' cannot be reimplemented with optional property in 'i2'.
|
||||
Property 'M' is optional in type 'i2' but required in type 'i1'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/optionalPropertiesTest.ts (4 errors) ====
|
||||
@@ -60,4 +60,4 @@ tests/cases/compiler/optionalPropertiesTest.ts(40,1): error TS2322: Type 'i2' is
|
||||
test10_1 = test10_2;
|
||||
~~~~~~~~
|
||||
!!! error TS2322: Type 'i2' is not assignable to type 'i1':
|
||||
!!! error TS2322: Required property 'M' cannot be reimplemented with optional property in 'i2'.
|
||||
!!! error TS2322: Property 'M' is optional in type 'i2' but required in type 'i1'.
|
||||
Loaded 100 of 158 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user