fix(compiler): Correctly handles references to static methods (#11013)

Fixes: #10975
This commit is contained in:
Chuck Jazdzewski
2016-08-23 11:58:12 -07:00
committed by Kara
parent 5ddecb18a7
commit 14a30f3ca0
6 changed files with 45 additions and 11 deletions

View File

@ -221,11 +221,12 @@ export class ReflectorHost implements StaticReflectorHost, ImportGenerator {
* @param declarationFile the absolute path of the file where the symbol is declared
* @param name the name of the type.
*/
getStaticSymbol(declarationFile: string, name: string): StaticSymbol {
let key = `"${declarationFile}".${name}`;
getStaticSymbol(declarationFile: string, name: string, members?: string[]): StaticSymbol {
const memberSuffix = members ? `.${ members.join('.')}` : '';
const key = `"${declarationFile}".${name}${memberSuffix}`;
let result = this.typeCache.get(key);
if (!result) {
result = new StaticSymbol(declarationFile, name);
result = new StaticSymbol(declarationFile, name, members);
this.typeCache.set(key, result);
}
return result;