diff --git a/src/babel/traversal/path/inference/index.js b/src/babel/traversal/path/inference/index.js index ef1fc1aa88..2fa3b3c66f 100644 --- a/src/babel/traversal/path/inference/index.js +++ b/src/babel/traversal/path/inference/index.js @@ -76,6 +76,8 @@ function _isBaseType(baseName: string, type?, soft?): boolean { return t.isAnyTypeAnnotation(type); } else if (baseName === "mixed") { return t.isMixedTypeAnnotation(type); + } else if (baseName === "void") { + return t.isVoidTypeAnnotation(type); } else { if (soft) { return false; @@ -105,6 +107,19 @@ export function couldBeBaseType(name: string): boolean { } } +/** + * Description + */ + +export function baseTypeStrictlyMatches(right: NodePath) { + var left = this.getTypeAnnotation(); + right = right.getTypeAnnotation(); + + if (!t.isAnyTypeAnnotation() && t.isFlowBaseAnnotation(left)) { + return right.type === left.type; + } +} + /** * Description */