@@ -92,7 +92,8 @@ module ts {
9292 getContextualType : getContextualType ,
9393 getFullyQualifiedName : getFullyQualifiedName ,
9494 getResolvedSignature : getResolvedSignature ,
95- getEnumMemberValue : getEnumMemberValue
95+ getEnumMemberValue : getEnumMemberValue ,
96+ getUnionTypesOfUnionProperty : getUnionTypesOfUnionProperty
9697 } ;
9798
9899 var undefinedSymbol = createSymbol ( SymbolFlags . Property | SymbolFlags . Transient , "undefined" ) ;
@@ -1750,6 +1751,10 @@ module ts {
17501751 return links . type ;
17511752 }
17521753
1754+ function getUnionTypesOfUnionProperty ( symbol : Symbol ) : Type [ ] {
1755+ return ( symbol . flags & SymbolFlags . UnionProperty ) ? getSymbolLinks ( symbol ) . unionType . types : undefined ;
1756+ }
1757+
17531758 function getTypeOfSymbol ( symbol : Symbol ) : Type {
17541759 if ( symbol . flags & ( SymbolFlags . Variable | SymbolFlags . Property ) ) {
17551760 return getTypeOfVariableOrParameterOrProperty ( symbol ) ;
@@ -3583,7 +3588,8 @@ module ts {
35833588 }
35843589
35853590 function getBestCommonType ( types : Type [ ] , contextualType ?: Type ) : Type {
3586- return contextualType && isSupertypeOfEach ( contextualType , types ) ? contextualType : getUnionType ( types ) ; }
3591+ return contextualType && isSupertypeOfEach ( contextualType , types ) ? contextualType : getUnionType ( types ) ;
3592+ }
35873593
35883594 function isTypeOfObjectLiteral ( type : Type ) : boolean {
35893595 return ( type . flags & TypeFlags . Anonymous ) && type . symbol && ( type . symbol . flags & SymbolFlags . ObjectLiteral ) ? true : false ;
0 commit comments