test/com/google/javascript/jscomp/TypeCheckTest.java
/** test structural interface matching for record types */
test structural interface matching for record types
test structural interface matching for record types
@Test
  public void testStructuralInterfaceMatching33_3() {
    testTypesWithExtraExterns(
        lines(
            EXTERNS_FOR_LONG_MATCHING_CHAIN_RECORD,
            "/** @record */",
            "function I7() {}",
            "/** @type{function(this:C5, C5, C5, I5=): I5} */",
            "I7.prototype.getElement = function(){};",
            "",
            "/** @constructor */",
            "function C7() {}",
            "/** @type{function(this:I5, I5, C5=, I5=): C5} */",
            "C7.prototype.getElement = function(){};"),
        lines(
            "/** @type {{prop: I7, prop2: C7}}*/",
            "var r1;",
            "/** @type {{prop: C7, prop2: C7, prop3: C7}} */",
            "var r2;",
            "r1 = r2;"));
  }
@ Test public void testStructuralInterfaceMatching33_3 ( ) { testTypesWithExtraExterns ( lines ( EXTERNS_FOR_LONG_MATCHING_CHAIN_RECORD , "/** @record */" , "function I7() {}" , "/** @type{function(this:C5, C5, C5, I5=): I5} */" , "I7.prototype.getElement = function(){};" , "" , "/** @constructor */" , "function C7() {}" , "/** @type{function(this:I5, I5, C5=, I5=): C5} */" , "C7.prototype.getElement = function(){};" ) , lines ( "/** @type {{prop: I7, prop2: C7}}*/" , "var r1;" , "/** @type {{prop: C7, prop2: C7, prop3: C7}} */" , "var r2;" , "r1 = r2;" ) ) ; }
test structural interface matching for record types
test structural interface matching for record types
// I5 and C5 shares the same type structure