Skip to content
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

The "in" operator doesn't work well with map<any, ...> #306

Closed
dumblob opened this issue Oct 29, 2014 · 1 comment
Closed

The "in" operator doesn't work well with map<any, ...> #306

dumblob opened this issue Oct 29, 2014 · 1 comment

Comments

@dumblob
Copy link

dumblob commented Oct 29, 2014

0$ dao -e 'm={->}; m["a"]=0, m["b"]=5; if ("a" in m) io.writeln(true) else io.writeln(false); io.writeln(m)'
false
{ "a" -> 0, "b" -> 5 }
= none
0$ dao -e 'm={->}; m["a"]=0, m["b"]=5; if ("a" in (map<string, any>)m) io.writeln(true) else io.writeln(false); io.writeln(m)'
true
{ "a" -> 0, "b" -> 5 }
= none
@daokoder
Copy link
Owner

daokoder commented Nov 6, 2014

There was a minor bug in checking the key types before searching the key. Fixed.

@dumblob dumblob closed this as completed Nov 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants