fix array type inferrence for file#toArray from being so wonky - fixes #1355

This commit is contained in:
Sebastian McKenzie 2015-05-10 19:35:41 +01:00
parent 19b05b5e61
commit ab59fd08e5
2 changed files with 2 additions and 2 deletions

View File

@ -1048,7 +1048,7 @@ export default class TraversalPath {
var type = typeInfo.annotation;
if (!type) return false;
if (type.inferred && opts.inference === false) {
if (typeInfo.inferred && opts.inference === false) {
return false;
}

View File

@ -397,7 +397,7 @@ export default class Scope {
if (t.isIdentifier(node)) {
var binding = this.getBinding(node.name);
if (binding && binding.isTypeGeneric("Array", { inference: false })) return node;
if (binding && binding.constant && binding.isTypeGeneric("Array")) return node;
}
if (t.isArrayExpression(node)) {