goog.module('cast.CastGenerics$impl');

const j_l_Object = goog.require('java.lang.Object$impl');
const $Util = goog.require('nativebootstrap.Util$impl');

let $1 = goog.forwardDeclare('cast.CastGenerics.$1$impl');
let A = goog.forwardDeclare('cast.CastGenerics.A$impl');
let B = goog.forwardDeclare('cast.CastGenerics.B$impl');
let BaseImplementor = goog.forwardDeclare('cast.CastGenerics.BaseImplementor$impl');
let Container = goog.forwardDeclare('cast.CastGenerics.Container$impl');
let Empty1 = goog.forwardDeclare('cast.CastGenerics.Empty1$impl');
let Empty2 = goog.forwardDeclare('cast.CastGenerics.Empty2$impl');
let Foo = goog.forwardDeclare('cast.CastGenerics.Foo$impl');
let Implementor = goog.forwardDeclare('cast.CastGenerics.Implementor$impl');
let NullMarkedContainer = goog.forwardDeclare('cast.CastGenerics.NullMarkedContainer$impl');
let Enum = goog.forwardDeclare('java.lang.Enum$impl');
let Error = goog.forwardDeclare('java.lang.Error$impl');
let Integer = goog.forwardDeclare('java.lang.Integer$impl');
let Number = goog.forwardDeclare('java.lang.Number$impl');
let j_l_String = goog.forwardDeclare('java.lang.String$impl');
let $Arrays = goog.forwardDeclare('vmbootstrap.Arrays$impl');
let $Casts = goog.forwardDeclare('vmbootstrap.Casts$impl');

/**
 * @template T, E
 */
class CastGenerics extends j_l_Object {
 /** @protected @nodts */
 constructor() {
  super();
  /**@type {?T} @nodts*/
  this.f_field__cast_CastGenerics;
 }
 /** @nodts @template T, E @return {!CastGenerics<T, E>} */
 static $create__() {
  CastGenerics.$clinit();
  let $instance = new CastGenerics();
  $instance.$ctor__cast_CastGenerics__void();
  return $instance;
 }
 /** @nodts */
 $ctor__cast_CastGenerics__void() {
  this.$ctor__java_lang_Object__void();
 }
 /** @nodts @return {T} */
 m_method__java_lang_Object_$pp_cast() {
  return null;
 }
 /** @nodts @template T_1, U */
 static m_testErasureCast__void() {
  CastGenerics.$clinit();
  let str = /**@type {?string}*/ ($Casts.$to((/**@type {!CastGenerics<?string, (Number|number)>}*/ (CastGenerics.$create__())).f_field__cast_CastGenerics, j_l_String));
  str = (/**@type {?string}*/ ($Casts.$to((/**@type {!CastGenerics<?string, (Number|number)>}*/ (CastGenerics.$create__())).m_method__java_lang_Object_$pp_cast(), j_l_String)));
  let /** Container<T_1> */ containerT = null;
  (/**@type {!A}*/ ($Casts.$to(containerT.m_get__java_lang_Object_$pp_cast(), /**@type {Function}*/ (A)))).m_mA__void();
  (/**@type {!B}*/ ($Casts.$to(containerT.m_get__java_lang_Object_$pp_cast(), /**@type {Function}*/ (B)))).m_mB__void();
  let /** Container<U> */ containerU = null;
  (/**@type {!A}*/ ($Casts.$to(containerU.m_get__java_lang_Object_$pp_cast(), /**@type {Function}*/ (A)))).m_mA__void();
  (/**@type {!B}*/ ($Casts.$to(containerU.m_get__java_lang_Object_$pp_cast(), /**@type {Function}*/ (B)))).m_mB__void();
  let /** Container<Array<T_1>> */ containerArrT = null;
  let arrT = /**@type {Array<T_1>}*/ ($Arrays.$castTo(containerArrT.m_get__java_lang_Object_$pp_cast(), /**@type {Function}*/ (A), 1));
  (/**@type {!A}*/ (arrT[0])).m_mA__void();
  (/**@type {!B}*/ ($Casts.$to(arrT[0], /**@type {Function}*/ (B)))).m_mB__void();
  let arrA = /**@type {Array<A>}*/ ($Arrays.$castTo(containerArrT.m_get__java_lang_Object_$pp_cast(), /**@type {Function}*/ (A), 1));
  let arrB = /**@type {Array<B>}*/ ($Arrays.$castTo(containerArrT.m_get__java_lang_Object_$pp_cast(), /**@type {Function}*/ (B), 1));
  let /** Container<Array<U>> */ containerArrU = null;
  let arrU = /**@type {Array<U>}*/ ($Arrays.$castTo(containerArrU.m_get__java_lang_Object_$pp_cast(), /**@type {Function}*/ (A), 1));
  (/**@type {!A}*/ (arrU[0])).m_mA__void();
  (/**@type {!B}*/ ($Casts.$to(arrU[0], /**@type {Function}*/ (B)))).m_mB__void();
  arrA = (/**@type {Array<A>}*/ ($Arrays.$castTo(containerArrU.m_get__java_lang_Object_$pp_cast(), /**@type {Function}*/ (A), 1)));
  arrB = (/**@type {Array<B>}*/ ($Arrays.$castTo(containerArrU.m_get__java_lang_Object_$pp_cast(), /**@type {Function}*/ (B), 1)));
  let /** Container<BaseImplementor> */ containerBase = null;
  (/**@type {BaseImplementor}*/ ($Casts.$to(containerBase.m_get__java_lang_Object_$pp_cast(), BaseImplementor))).m_mA__void();
  (/**@type {BaseImplementor}*/ ($Casts.$to(containerBase.m_get__java_lang_Object_$pp_cast(), BaseImplementor))).m_mB__void();
  let /** Container<Implementor> */ containerImplementor = null;
  (/**@type {Implementor}*/ ($Casts.$to(containerImplementor.m_get__java_lang_Object_$pp_cast(), Implementor))).m_mA__void();
  (/**@type {Implementor}*/ ($Casts.$to(containerImplementor.m_get__java_lang_Object_$pp_cast(), Implementor))).m_mB__void();
  let /** Container<A> */ strictlyA = null;
  let oA = /**@type {A}*/ ($Casts.$to(strictlyA.m_get__java_lang_Object_$pp_cast(), /**@type {Function}*/ (A)));
  let a = /**@type {A}*/ ($Casts.$to(strictlyA.m_get__java_lang_Object_$pp_cast(), /**@type {Function}*/ (A)));
  let /** Container<?> */ extendsA = null;
  oA = extendsA.m_get__java_lang_Object_$pp_cast();
  a = (/**@type {A}*/ ($Casts.$to(extendsA.m_get__java_lang_Object_$pp_cast(), /**@type {Function}*/ (A))));
  let /** Container<?> */ superA = null;
  oA = superA.m_get__java_lang_Object_$pp_cast();
  let /** Container<?string> */ strictlyString = null;
  str = (/**@type {?string}*/ ($Casts.$to(strictlyString.m_get__java_lang_Object_$pp_cast(), j_l_String)));
  let /** Container<?> */ extendsString = null;
  str = (/**@type {?string}*/ ($Casts.$to(extendsString.m_get__java_lang_Object_$pp_cast(), j_l_String)));
  let /** Container<?> */ superString = null;
  oA = superString.m_get__java_lang_Object_$pp_cast();
 }
 /** @nodts */
 static m_testErasureCastInNullMarkedCode__void() {
  CastGenerics.$clinit();
  let container = /**@type {!NullMarkedContainer<string>}*/ (NullMarkedContainer.$create__java_lang_Object('abc'));
  let s = /**@type {?string}*/ ($Casts.$to(container.m_get__java_lang_Object_$pp_cast(), j_l_String));
 }
 /** @nodts */
 static m_testCastToParamterizedType__void() {
  CastGenerics.$clinit();
  let o = Integer.$create__int(1);
  let cc = /**@type {CastGenerics<Error, (Number|number)>}*/ ($Casts.$to(o, CastGenerics));
  cc = (/**@type {CastGenerics}*/ ($Casts.$to(o, CastGenerics)));
 }
 /** @nodts */
 m_testCastToTypeVariable__void() {
  let o = Integer.$create__int(1);
  let e = /**@type {?E}*/ ($Casts.$to(o, Number));
  let t = /**@type {?T}*/ (o);
  let es = /**@type {Array<E>}*/ ($Arrays.$castTo(o, Number, 1));
  let ts = /**@type {Array<T>}*/ ($Arrays.$castTo(o, j_l_Object, 1));
 }
 /** @nodts @template S, V */
 m_testCastToMethodTypeVariable__void() {
  let o = Integer.$create__int(1);
  let s = /**@type {?S}*/ (o);
  let c = /**@type {CastGenerics<S, (Number|number)>}*/ ($Casts.$to(o, CastGenerics));
  c = (/**@type {Array<S>}*/ ($Arrays.$castTo(o, j_l_Object, 1)));
  c = (/**@type {?V}*/ ($Casts.$to(o, Enum)));
 }
 /** @nodts @return {Foo<?string>} */
 m_testCastToRawToGeneric__cast_CastGenerics_Foo__cast_CastGenerics_Foo(/** Foo<*> */ foo) {
  return /**@type {Foo<?string>}*/ (foo);
 }
 /** @nodts @template TT */
 m_outerGenericMethod__void() {}
 /** @nodts @template EE @return {EE} */
 m_method__java_lang_Object__cast_CastGenerics_Empty1(/** * */ o) {
  if (Empty1.$isInstance(o)) {
   return /**@type {?EE}*/ ($Casts.$to($Casts.$to(o, /**@type {Function}*/ (Empty1)), /**@type {Function}*/ (Empty2)));
  }
  return null;
 }
 /** @nodts @template T_1 @return {Foo<T_1>} */
 static m_doSomething__cast_CastGenerics_Foo() {
  CastGenerics.$clinit();
  return /**@type {!$1<T_1>}*/ ($1.$create__());
 }
 /** @nodts */
 static $clinit() {
  CastGenerics.$clinit = () =>{};
  CastGenerics.$loadModules();
  j_l_Object.$clinit();
 }
 /** @nodts @return {boolean} */
 static $isInstance(/** ? */ instance) {
  return instance instanceof CastGenerics;
 }
 
 /** @nodts */
 static $loadModules() {
  $1 = goog.module.get('cast.CastGenerics.$1$impl');
  A = goog.module.get('cast.CastGenerics.A$impl');
  B = goog.module.get('cast.CastGenerics.B$impl');
  BaseImplementor = goog.module.get('cast.CastGenerics.BaseImplementor$impl');
  Empty1 = goog.module.get('cast.CastGenerics.Empty1$impl');
  Empty2 = goog.module.get('cast.CastGenerics.Empty2$impl');
  Implementor = goog.module.get('cast.CastGenerics.Implementor$impl');
  NullMarkedContainer = goog.module.get('cast.CastGenerics.NullMarkedContainer$impl');
  Enum = goog.module.get('java.lang.Enum$impl');
  Integer = goog.module.get('java.lang.Integer$impl');
  Number = goog.module.get('java.lang.Number$impl');
  j_l_String = goog.module.get('java.lang.String$impl');
  $Arrays = goog.module.get('vmbootstrap.Arrays$impl');
  $Casts = goog.module.get('vmbootstrap.Casts$impl');
 }
}
$Util.$setClassMetadata(CastGenerics, 'cast.CastGenerics');

exports = CastGenerics;

//# sourceMappingURL=CastGenerics.js.map
