[IronPython] Failing to find overload match when object is None

Michael Foord fuzzyman at voidspace.org.uk
Sat Apr 18 15:21:28 CEST 2009

Hello guys,

I saw a message on Twitter yesterday:

    Finding IronPython mildly annoying, with errors like: "TypeError: 
Multiple targets could match: AddFile(str), AddFile(FileInfo)"

Needless to say the problem was that he was passing in None - which 
could match any of the overloads that take reference types. This has 
bitten me before. Would it be possible to make the error message more 
helpful where a match can't be found because an object passed in is None.

As this code path would only be exercised if an exception is about to be 
raised it shouldn't need to slow down the normal cases of overload 



More information about the Ironpython-users mailing list