public static LocalVariable uneraseGenericParameter ( CodeBuilder b , TypeDesc paramType , final int paramIndex ) { b . loadLocal ( b . getParameter ( paramIndex ) ) ; b . checkCast ( paramType ) ; LocalVariable result = b . createLocalVariable ( null , paramType ) ; b . storeLocal ( result ) ; return result ; }
Generate code to create a local variable containing the specified parameter coerced to the specified type . This is useful for re - interpreting erased generics into the more specific genericized type .