private void compileJavaInteropBridgeConstructor ( DynamicFunctionSymbol dfs ) { DynamicFunctionSymbol copy = new DynamicFunctionSymbol ( dfs ) ; copy . setValue ( null ) ; copy . setInitializer ( null ) ; ConstructorStatement fs = new ConstructorStatement ( true ) ; fs . setDynamicFunctionSymbol ( copy ) ; fs . setSynthetic ( true ) ; MethodCallExpression expr = new MethodCallExpression ( ) ; expr . setType ( JavaTypes . pVOID ( ) ) ; List < ISymbol > args = dfs . getArgs ( ) ; Expression [ ] exprArgs = new Expression [ args . size ( ) ] ; for ( int i = 0 ; i < args . size ( ) ; i ++ ) { ISymbol arg = args . get ( i ) ; Identifier id = new Identifier ( ) ; id . setSymbol ( arg , dfs . getSymbolTable ( ) ) ; id . setType ( arg . getType ( ) ) ; exprArgs [ i ] = id ; } expr . setArgs ( exprArgs ) ; expr . setFunctionSymbol ( new ThisConstructorFunctionSymbol ( dfs , true ) ) ; MethodCallStatement stmt = new MethodCallStatement ( ) ; stmt . setMethodCall ( expr ) ; stmt . setSynthetic ( true ) ; copy . setValue ( stmt ) ; copy . setDeclFunctionStmt ( fs ) ; int iModifiers = getModifiers ( copy ) ; List < IRSymbol > parameters = new ArrayList <> ( ) ; maybeGetEnumSuperConstructorSymbols ( parameters ) ; for ( ISymbol param : copy . getArgs ( ) ) { parameters . add ( makeParamSymbol ( copy , param ) ) ; } setUpFunctionContext ( copy , true , parameters ) ; FunctionStatementTransformer funcStmtCompiler = new FunctionStatementTransformer ( copy , _context ) ; IRStatement methodBody = funcStmtCompiler . compile ( ) ; IExpression annotationDefault = copy . getAnnotationDefault ( ) ; Object [ ] annotationDefaultValue = null ; if ( annotationDefault != null ) { annotationDefaultValue = new Object [ ] { CompileTimeExpressionParser . convertValueToInfoFriendlyValue ( annotationDefault . evaluate ( ) , getGosuClass ( ) . getTypeInfo ( ) ) } ; } IRMethodStatement methodStatement = new IRMethodStatement ( methodBody , "<init>" , iModifiers , copy . isInternal ( ) , IRTypeConstants . pVOID ( ) , copy . getReturnType ( ) , parameters , copy . getArgTypes ( ) , copy . getType ( ) , annotationDefaultValue ) ; methodStatement . setAnnotations ( getIRAnnotations ( makeAnnotationInfos ( copy . getModifierInfo ( ) . getAnnotations ( ) , getGosuClass ( ) . getTypeInfo ( ) ) ) ) ; _irClass . addMethod ( methodStatement ) ; }
Add constructor so Java can use the Gosu generic class without explicitly passing in type arguments .