﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
3996	Unexpected silent conversion of several AutoIt types when used as keys in maps	anonymous		"(this applies to all versions from 3.3.15.0 to 3.3.16.1)
In maps, when we use a float, a pointer, or a keyword (any of default/null/true/false) as a key, then the following unexpected (i.e. this behaviour is undocumented) conversion happens: 

 - floats become ints; eg float '''3.14159''' becomes int '''3'''
 - pointers/handles become ints as well: '''Ptr(0xCAFE)''' becomes int '''51966'''
 - '''true''' becomes int '''1'''; 
 - any other keyword (default/null/false), and in fact any other type - funcs, maps(!), arrays(!!), dllstructs(!!!), even ur mom(untested...), - all that becomes int '''0'''

What would be the most best, is to allow these additional sensible types to be used as keys. The additional sensible types are of course pointers/handles (i use them all the time when working with windows and GUIs as keys in a map; super useful!), floats, and (in my opinion) keywords.

And at the very least, this should be documented in the helpfile.
Thank you for consideration! :)

PS. Well well well.. while researching this bug, i found even more unexpected things!
the following snippet works perfectly fine in 3.3.15.0 and 3.3.15.1, but starting from 3.3.15.2 to 3.3.16.1 AutoIt completely crashes on it!

{{{#!autoit
Global $m[], $p1 = ptr(0xCAFE), $p2 = ptr(0xCAFEBABE)
ConsoleWrite('setting Ptr('&$p1&') to 2357' & @CRLF)
$m[$p1] = 2357
ConsoleWrite('retrieving: '&$m[$p1] & @CRLF)
ConsoleWrite('setting Ptr('&$p2&') to 777' & @CRLF)
$m[$p2] = 777
ConsoleWrite('retrieving: '&$m[$p2] & @CRLF)
ConsoleWrite('-----now do the same, but via MapKeys in  For..in..next  loop---------' & @CRLF)
for $key in MapKeys($m)
  ConsoleWrite('key '&VarGetType($key)&' : '& $key & @CRLF)
  ConsoleWrite('data '&VarGetType($m[$key]) &' : '& $m[$key] & @CRLF)
next
}}}
"	Bug	closed		AutoIt	3.3.15.0	None	No Bug		
