Skip to content

Commit 4dd369f

Browse files
author
Arthur Ozga
committed
moved initialization and changed a comment
1 parent a1877ef commit 4dd369f

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

Diff for: src/compiler/checker.ts

+11-8
Original file line numberDiff line numberDiff line change
@@ -7191,7 +7191,7 @@ namespace ts {
71917191
*/
71927192
function checkClassPropertyAccess(node: PropertyAccessExpression | QualifiedName, left: Expression | QualifiedName, type: Type, prop: Symbol): boolean {
71937193
let flags = getDeclarationFlagsFromSymbol(prop);
7194-
let declaringClass: InterfaceType;
7194+
let declaringClass = <InterfaceType>getDeclaredTypeOfSymbol(prop.parent);;
71957195

71967196
if (left.kind === SyntaxKind.SuperKeyword) {
71977197
let errorNode = (<PropertyAccessExpression>node).name ?
@@ -7219,8 +7219,6 @@ namespace ts {
72197219
// cannot simultaneously be private and abstract, so this will trigger an
72207220
// additional error elsewhere.
72217221

7222-
declaringClass = <InterfaceType>getDeclaredTypeOfSymbol(prop.parent);
7223-
72247222
error(errorNode, Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString(prop), typeToString(declaringClass));
72257223
return false;
72267224
}
@@ -7236,7 +7234,6 @@ namespace ts {
72367234
let enclosingClassDeclaration = getContainingClass(node);
72377235

72387236
let enclosingClass = enclosingClassDeclaration ? <InterfaceType>getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined;
7239-
declaringClass = <InterfaceType>getDeclaredTypeOfSymbol(prop.parent);
72407237

72417238
// Private property is accessible if declaring and enclosing class are the same
72427239
if (flags & NodeFlags.Private) {
@@ -8391,7 +8388,7 @@ namespace ts {
83918388

83928389
let expressionType = checkExpression(node.expression);
83938390

8394-
// If ConstructExpr's apparent type(section 3.8.1) is an object type with one or
8391+
// If expressionType's apparent type(section 3.8.1) is an object type with one or
83958392
// more construct signatures, the expression is processed in the same manner as a
83968393
// function call, but using the construct signatures as the initial set of candidate
83978394
// signatures for overload resolution. The result type of the function call becomes
@@ -8402,7 +8399,7 @@ namespace ts {
84028399
return resolveErrorCall(node);
84038400
}
84048401

8405-
// If the expression is of abstract type, then it cannot be instantiated.
8402+
// If the expression is a class of abstract type, then it cannot be instantiated.
84068403
// Note, only class declarations can be declared abstract.
84078404
// In the case of a merged class-module or class-interface declaration,
84088405
// only the class declaration node will have the Abstract flag set.
@@ -8412,7 +8409,7 @@ namespace ts {
84128409
}
84138410

84148411
// TS 1.0 spec: 4.11
8415-
// If ConstructExpr is of type Any, Args can be any argument
8412+
// If expressionType is of type Any, Args can be any argument
84168413
// list and the result of the operation is of type Any.
84178414
if (isTypeAny(expressionType)) {
84188415
if (node.typeArguments) {
@@ -8430,7 +8427,7 @@ namespace ts {
84308427
return resolveCall(node, constructSignatures, candidatesOutArray);
84318428
}
84328429

8433-
// If ConstructExpr's apparent type is an object type with no construct signatures but
8430+
// If expressionType's apparent type is an object type with no construct signatures but
84348431
// one or more call signatures, the expression is processed as a function call. A compile-time
84358432
// error occurs if the result of the function call is not Void. The type of the result of the
84368433
// operation is Any.
@@ -13838,6 +13835,12 @@ namespace ts {
1383813835
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract");
1383913836
}
1384013837
}
13838+
else {
13839+
// mark the constructor abstract for static-side assignability restrictions.
13840+
13841+
// (<ClassDeclaration>node).members.????;
13842+
13843+
}
1384113844

1384213845
flags |= NodeFlags.Abstract;
1384313846
break;

0 commit comments

Comments
 (0)