-
Notifications
You must be signed in to change notification settings - Fork 839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
重载ADD运算符,运算式报错 #466
Labels
Comments
改成 ‘10000’ + ‘20000’ 是可以出来想要的效果,
问题:能否加一个配置项之类的,来决定是否在compile就计算结果,谢谢了 |
关闭优化: AviatorEvaluator.getInstance().setOption(Options.OPTIMIZE_LEVEL, AviatorEvaluator.COMPILE); |
不过这个算是个bug,先开着吧 |
@killme2008 关闭优化 有什么其他方面的性能影响吗,想问一下这个有文档吗?谢谢了 |
目前也只做了常量折叠的优化,理论上对运行时性能有少许影响 所有选项都在文档库有说明 https://www.yuque.com/boyan-avfmj/aviatorscript/yr1oau |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
背景:进行表达式解析的时候,业务场景会出现 A+B的情形, a和b都是具体的业务含义
示例:重写ADD运算符的时候,返回类型为 AviatorRuntimeJavaType.valueOf(Maps.newHashMap())
demo:
public static void main(final String[] args) {
问题:执行过程报错
Exception in thread "main" com.googlecode.aviator.exception.CompileExpressionErrorException: Invalid operand:<JavaType, A_1, {}, java.util.HashMap>
想请教一下,怎么避免这个问题,使得能返回自定义的类型。
(是否有一些配置项之类的,谢谢了)
The text was updated successfully, but these errors were encountered: