@@ -906,7 +906,7 @@ module ts {
906906 // Get qualified name
907907 if ( enclosingDeclaration &&
908908 // Properties/methods/Signatures/Constructors/TypeParameters do not need qualification
909- ! ( symbol . flags & SymbolFlags . PropertyOrAccessor & SymbolFlags . Signature & SymbolFlags . Constructor & SymbolFlags . Method & SymbolFlags . TypeParameter ) ) {
909+ ! ( symbol . flags & ( SymbolFlags . PropertyOrAccessor | SymbolFlags . Signature | SymbolFlags . Constructor | SymbolFlags . Method | SymbolFlags . TypeParameter ) ) ) {
910910 var symbolName : string ;
911911 while ( symbol ) {
912912 var isFirstName = ! symbolName ;
@@ -2236,13 +2236,12 @@ module ts {
22362236 return emptyObjectType ;
22372237 }
22382238 var type = getDeclaredTypeOfSymbol ( symbol ) ;
2239- var name = symbol . name ;
22402239 if ( ! ( type . flags & TypeFlags . ObjectType ) ) {
2241- error ( getTypeDeclaration ( symbol ) , Diagnostics . Global_type_0_must_be_a_class_or_interface_type , name ) ;
2240+ error ( getTypeDeclaration ( symbol ) , Diagnostics . Global_type_0_must_be_a_class_or_interface_type , symbol . name ) ;
22422241 return emptyObjectType ;
22432242 }
22442243 if ( ( ( < InterfaceType > type ) . typeParameters ? ( < InterfaceType > type ) . typeParameters . length : 0 ) !== arity ) {
2245- error ( getTypeDeclaration ( symbol ) , Diagnostics . Global_type_0_must_have_1_type_parameter_s , name , arity ) ;
2244+ error ( getTypeDeclaration ( symbol ) , Diagnostics . Global_type_0_must_have_1_type_parameter_s , symbol . name , arity ) ;
22462245 return emptyObjectType ;
22472246 }
22482247 return < ObjectType > type ;
@@ -3545,7 +3544,8 @@ module ts {
35453544 return false ;
35463545 }
35473546
3548- function checkSuperExpression ( node : Node , isCallExpression : boolean ) : Type {
3547+ function checkSuperExpression ( node : Node ) : Type {
3548+ var isCallExpression = node . parent . kind === SyntaxKind . CallExpression && ( < CallExpression > node . parent ) . func === node ;
35493549 var enclosingClass = < ClassDeclaration > getAncestor ( node , SyntaxKind . ClassDeclaration ) ;
35503550 var baseClass : Type ;
35513551 if ( enclosingClass && enclosingClass . baseType ) {
@@ -4179,7 +4179,7 @@ module ts {
41794179
41804180 function resolveCallExpression ( node : CallExpression ) : Signature {
41814181 if ( node . func . kind === SyntaxKind . SuperKeyword ) {
4182- var superType = checkSuperExpression ( node . func , true ) ;
4182+ var superType = checkSuperExpression ( node . func ) ;
41834183 if ( superType !== unknownType ) {
41844184 return resolveCall ( node , getSignaturesOfType ( superType , SignatureKind . Construct ) ) ;
41854185 }
@@ -4827,7 +4827,7 @@ module ts {
48274827 case SyntaxKind . ThisKeyword :
48284828 return checkThisExpression ( node ) ;
48294829 case SyntaxKind . SuperKeyword :
4830- return checkSuperExpression ( node , false ) ;
4830+ return checkSuperExpression ( node ) ;
48314831 case SyntaxKind . NullKeyword :
48324832 return nullType ;
48334833 case SyntaxKind . TrueKeyword :
@@ -6681,6 +6681,7 @@ module ts {
66816681 case SyntaxKind . Parameter :
66826682 case SyntaxKind . Property :
66836683 case SyntaxKind . EnumMember :
6684+ case SyntaxKind . PropertyAssignment :
66846685 return ( < VariableDeclaration > parent ) . initializer === node ;
66856686 case SyntaxKind . ExpressionStatement :
66866687 case SyntaxKind . IfStatement :
@@ -6810,6 +6811,11 @@ module ts {
68106811 /*all meanings*/ SymbolFlags . Value | SymbolFlags . Type | SymbolFlags . Namespace | SymbolFlags . Import ) ;
68116812 }
68126813
6814+ if ( isInRightSideOfImportOrExportAssignment ( entityName ) ) {
6815+ // Since we already checked for ExportAssignment, this really could only be an Import
6816+ return getSymbolOfPartOfRightHandSideOfImport ( entityName ) ;
6817+ }
6818+
68136819 if ( isRightSideOfQualifiedNameOrPropertyAccess ( entityName ) ) {
68146820 entityName = entityName . parent ;
68156821 }
@@ -6920,11 +6926,7 @@ module ts {
69206926 }
69216927
69226928 if ( isInRightSideOfImportOrExportAssignment ( node ) ) {
6923- var symbol : Symbol ;
6924- symbol = node . parent . kind === SyntaxKind . ExportAssignment
6925- ? getSymbolInfo ( node )
6926- : getSymbolOfPartOfRightHandSideOfImport ( node ) ;
6927-
6929+ var symbol = getSymbolInfo ( node ) ;
69286930 var declaredType = getDeclaredTypeOfSymbol ( symbol ) ;
69296931 return declaredType !== unknownType ? declaredType : getTypeOfSymbol ( symbol ) ;
69306932 }
0 commit comments