-
Notifications
You must be signed in to change notification settings - Fork 863
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
嵌套lambda参数的bug #134
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
版本:4.1.2
Map<String, Object> env = new HashMap<>(2);
env.put("v", 3);
AviatorEvaluator.execute("func=lambda(v)->v+2 end;func2=lambda(v)->func(v) end;print(func(1));print(func2(1))", env);
结果输出:35
执行代码如下:
func=lambda(v)->v+2 end;
func2=lambda(v)->func(v) end;
print(func(1)); // 输出 3,正确
print(func2(1)) // 输出 5,错误,应该是3
跟踪输出如下:
[Aviator TRACE] Func : func(<Long, 1>)
[Aviator TRACE] <JavaType, 1, Long> + <Long, 2> => <Long, 3>
[Aviator TRACE] Result : 3
[Aviator TRACE] Func : print(<JavaType, 3, Long>)
[Aviator TRACE] Func : func2(<Long, 1>)
[Aviator TRACE] Func : func(<JavaType, 1, Long>)
[Aviator TRACE] <JavaType, 3, Integer> + <Long, 2> => <Long, 5>
[Aviator TRACE] Result : 5
[Aviator TRACE] Result : 5
[Aviator TRACE] Func : print(<JavaType, 5, Long>)
[Aviator TRACE] Result : null
The text was updated successfully, but these errors were encountered: