Microsoft/TypeScript
在 GitHub 查看TypeChecker#getConstantValue(node) doesn't properly resolve values
Open
#4,217 建立於 2015年8月7日
BugDomain: APIHelp Wanted
描述
Courtesy of @ivogabe from here.
I'm working with the compiler api and I noticed that
TypeChecker#getConstantValue(node)only returns a value if I first callTypeChecker#getSymbolAtLocation(node).nodeis an ElementAccessExpression or a PropertyAccessExpression. Is that a bug or by design?