Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 6956 on
GitHub or Developer Community if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
Depending on your perspective this is a missing feature, a feature request, or a bug. If the goal it to reproduce Visual Studio's behaviour it is a bug; otherwise it is more of a missing feature.
The Expression Evaluator does not perform implicit conversions.
For example lets say you had a method:
string foo(uint bar)
If you put in the Expression Evaluator: foo(42)
It returns: Invalid arguments for method `foo': Argument 0: Cannot implicitly convert `System.Int32' to `System.UInt32'
To get the expected behaviour you would need to use: foo(42U).
I acknowledge that this is not a true implicit conversion (an implicit conversion doesn't exist from int to uint) but rather a "common use" conversion that Visual Studio performs on behalf of the programmer. On the other hand, take the second example:
Let's say you have field: XDocument foo;
And you wish to evaluate: foo.Attribute("bar")
It returns: Invalid arguments for method `Attribute: Argument 0: Cannot implicitly convert `System.String' to `System.Xml.Linq.XName'
In this case an implicit conversion *does* existing in the XName class to convert string to XName.
To get the expected behaviour you would need to use: foo.Attribute(new XName("bar")). Now you can see it would start getting annoying, particularly if the expression you are evaluating requires several explicit conversions to be useful.
For what it's worth, I have observed that the behaviour is the same when you inspect expressions by hovering over them.
This appears to be a runtime bug...
Zoltan: the problem appears to be that TypeMirror.IsAssignableFrom (TypeMirror) is returning false when it shouldn't.
For what types IsAssignableFrom () doesn't work ?
System.Uint32 and System.Int32