Skip to content

Commit

Permalink
fixed files form Closure #17
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurieux committed Mar 7, 2017
1 parent e9b0a0c commit d19c9f5
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1288,8 +1288,12 @@ private JSType getDeclaredType(String sourceName, JSDocInfo info,
if (info.isConstant()) {
JSType knownType = null;
if (rValue != null) {
if (rValue.getJSType() != null && !rValue.getJSType().isUnknownType()) {
JSDocInfo rValueInfo = rValue.getJSDocInfo();
if (rValueInfo != null && rValueInfo.hasType()) {
// If rValue has a type-cast, we use the type in the type-cast.
return rValueInfo.getType().evaluate(scope, typeRegistry);
} else if (rValue.getJSType() != null
&& !rValue.getJSType().isUnknownType()) {
// If rValue's type was already computed during scope creation,
// then we can safely use that.
return rValue.getJSType();
Expand Down

0 comments on commit d19c9f5

Please sign in to comment.