jaroslav@1882: /** jaroslav@1882: * Back 2 Browser Bytecode Translator jaroslav@1882: * Copyright (C) 2012-2015 Jaroslav Tulach jaroslav@1882: * jaroslav@1882: * This program is free software: you can redistribute it and/or modify jaroslav@1882: * it under the terms of the GNU General Public License as published by jaroslav@1882: * the Free Software Foundation, version 2 of the License. jaroslav@1882: * jaroslav@1882: * This program is distributed in the hope that it will be useful, jaroslav@1882: * but WITHOUT ANY WARRANTY; without even the implied warranty of jaroslav@1882: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jaroslav@1882: * GNU General Public License for more details. jaroslav@1882: * jaroslav@1882: * You should have received a copy of the GNU General Public License jaroslav@1882: * along with this program. Look for COPYING file in the top folder. jaroslav@1882: * If not, see http://opensource.org/licenses/GPL-2.0. jaroslav@1882: */ jaroslav@1882: package org.apidesign.bck2brwsr.vm8; jaroslav@1882: jaroslav@1882: public class Functions { jaroslav@1882: public interface SimpleOne extends BaseOne { jaroslav@1882: public R invoke(P1 p1, P2 p2, P3 p3, P4 p4); jaroslav@1882: jaroslav@1882: @Override jaroslav@1882: public default R invoke(P1 p1, P2 p2, P3 p3, P4 p4, java.lang.Object ignore) { jaroslav@1882: return invoke(p1, p2, p3, p4); jaroslav@1882: } jaroslav@1882: } jaroslav@1882: jaroslav@1882: public interface BaseOne { jaroslav@1882: public R invoke(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5); jaroslav@1882: } jaroslav@1882: jaroslav@1882: public static BaseOne inner5() { jaroslav@1882: return new BaseOne() { jaroslav@1882: @Override jaroslav@1882: public Integer invoke(Void p1, Void p2, Void p3, Void p4, Object p5) { jaroslav@1882: return 42; jaroslav@1882: } jaroslav@1882: }; jaroslav@1882: } jaroslav@1882: jaroslav@1882: public static BaseOne inner4() { jaroslav@1882: return new SimpleOne() { jaroslav@1882: @Override jaroslav@1882: public Integer invoke(Void p1, Void p2, Void p3, Void p4) { jaroslav@1882: return 42; jaroslav@1882: } jaroslav@1882: }; jaroslav@1882: } jaroslav@1882: public static BaseOne function5() { jaroslav@1882: return (Void p1, Void p2, Void p3, Void p4, Object p5) -> 42; jaroslav@1882: } jaroslav@1882: jaroslav@1882: public static BaseOne function4() { jaroslav@1882: return function4impl(); jaroslav@1882: } jaroslav@1882: jaroslav@1882: private static SimpleOne function4impl() { jaroslav@1886: return (Void p1, Void p2, Void p3, Void p4) -> 42; jaroslav@1882: } jaroslav@1882: }