diff --git a/test/com/google/javascript/jscomp/TypeInferenceTest.java b/test/com/google/javascript/jscomp/TypeInferenceTest.java
index <HASH>..<HASH> 100644
--- a/test/com/google/javascript/jscomp/TypeInferenceTest.java
+++ b/test/com/google/javascript/jscomp/TypeInferenceTest.java
@@ -928,6 +928,23 @@ public final class TypeInferenceTest extends TestCase {
     verify("x", NUMBER_TYPE);
   }
 
+  public void testFunctionDeclarationHasBlockScope() {
+    inFunction(
+        lines(
+            "BLOCK_SCOPE: {",
+            "  BEFORE_DEFINITION: f;",
+            "  function f() {}",
+            "  AFTER_DEFINITION: f;",
+            "}",
+            "AFTER_BLOCK: f;"));
+    // A block-scoped function declaration is hoisted to the beginning of its block, so it is always
+    // defined within the block.
+    assertScopeEnclosing("BEFORE_DEFINITION").declares("f").onScopeLabeled("BLOCK_SCOPE");
+    assertTypeOfExpression("BEFORE_DEFINITION").toStringIsEqualTo("function(): undefined");
+    assertTypeOfExpression("AFTER_DEFINITION").toStringIsEqualTo("function(): undefined");
+    assertScopeEnclosing("AFTER_BLOCK").doesNotDeclare("f");
+  }
+
   public void testHook() {
     assuming("x", createNullableType(OBJECT_TYPE));
     inFunction("var y = x ? x : {};");
Add unit test verifying that type inference correctly scopes function declarations

-------------
Created by MOE: <URL>