来源:http://www.verydemo.com/demo_c89_i73346.html
JavaFX
编译器编译重载
方法的一处BUG
直接看测试代码吧,一共2个类:BugTest.fx和A.fx,SDK版本是1.2.3。
BugTest里实现了3个带输入参数的重载
方法,第一个
方法的参数是自定义类型A,
A被声明为mixin,后2个的参数是原始类型。只有在第一个
方法被注释的情况下该类才可以被
编译通过,否则
编译器会抛出异常:
An exception has occurred in the OpenJavafx compiler. Please file a bug at the Openjfx-compiler issues home (https://openjfx-compiler.dev.java.net/Issues) after checking for duplicates. Include the following diagnostic in your report and, if possible, the source code which triggered this problem. Thank you.
java.lang.ClassCastException: com.sun.tools.javac.code.Symbol$ClassSymbol
at com.sun.tools.javafx.code.JavafxTypes.asSuper(JavafxTypes.java:202)
at com.sun.tools.javac.code.Types.isSubtypeUnchecked(Types.java:305)
at com.sun.tools.javafx.comp.JavafxResolve.argumentsAcceptable(JavafxResolve.java:421)
at com.sun.tools.javafx.comp.JavafxResolve.rawInstantiate(JavafxResolve.java:387)
at com.sun.tools.javafx.comp.JavafxResolve.selectBest(JavafxResolve.java:711)
at com.sun.tools.javafx.comp.JavafxResolve.findMemberWithoutAccessChecks(JavafxResolve.j…………………………………………………………………………