test/com/google/javascript/jscomp/DisambiguatePropertiesTest.java
/**
   * Tests that the type based version skips renaming on types that have a mismatch, and the type
   * tightened version continues to work as normal.
   */
Tests that the type based version skips renaming on types that have a mismatch, and the type
tightened version continues to work as normal.
Tests that the type based version skips renaming on types that have a mismatch and the type tightened version continues to work as normal .
@Test
  public void testMismatchInvalidation() {
    String js = ""
        + "/** @constructor */ function Foo() {}\n"
        + "Foo.prototype.a = 0;\n"
        + "/** @constructor */ function Bar() {}\n"
        + "Bar.prototype.a = 0;\n"
        + "/** @type {Foo} */\n"
        + "var F = new Bar;\n"
        + "F.a = 0;";
    testSets("", js, js, "{}", TypeValidator.TYPE_MISMATCH_WARNING,
        lines(
            "initializing variable",
            "found   : Bar",
            "required: (Foo|null)"));
  }
@ Test public void testMismatchInvalidation ( ) { String js = "" + "/** @constructor */ function Foo() {}\n" + "Foo.prototype.a = 0;\n" + "/** @constructor */ function Bar() {}\n" + "Bar.prototype.a = 0;\n" + "/** @type {Foo} */\n" + "var F = new Bar;\n" + "F.a = 0;" ; testSets ( "" , js , js , "{}" , TypeValidator . TYPE_MISMATCH_WARNING , lines ( "initializing variable" , "found   : Bar" , "required: (Foo|null)" ) ) ; }
Tests that the type based version skips renaming on types that have a mismatch, and the type
 tightened version continues to work as normal.
Tests that the type based version skips renaming on types that have a mismatch and the type tightened version continues to work as normal .