killme2008 / aviatorscript

A high performance scripting language hosted on the JVM.
http://fnil.net/aviator/
4.66k stars 853 forks source link

开启高精度时,long函数异常 #87

Closed hug3id closed 5 years ago

hug3id commented 6 years ago

版本:4.0.0RC 代码: AviatorEvaluator.setOption(Options.ALWAYS_PARSE_FLOATING_POINT_NUMBER_INTO_DECIMAL, true); System.out.println(AviatorEvaluator.execute("long(1.2)"));

抛出异常: Exception in thread "main" com.googlecode.aviator.exception.ExpressionRuntimeException: Execute expression error at com.googlecode.aviator.ClassExpression.execute(ClassExpression.java:79) at com.googlecode.aviator.AviatorEvaluatorInstance.execute(AviatorEvaluatorInstance.java:686) at com.googlecode.aviator.AviatorEvaluator.execute(AviatorEvaluator.java:428) at com.googlecode.aviator.AviatorEvaluator.execute(AviatorEvaluator.java:440) at com.googlecode.aviator.AviatorEvaluator.execute(AviatorEvaluator.java:461) at Test.main(Test.java:7) Caused by: java.lang.ClassCastException: Could not cast com.googlecode.aviator.runtime.type.AviatorDecimal@6f75e721 to long at com.googlecode.aviator.runtime.function.system.LongFunction.call(LongFunction.java:41) at Script_1542591851733_0/305623748.execute0(Unknown Source) at com.googlecode.aviator.ClassExpression.execute(ClassExpression.java:71) ... 5 more

killme2008 commented 6 years ago

收到,是个 bug,争取这周发个小版本。

killme2008 commented 5 years ago

已在 4.1.0 中修复