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 on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 1641 [details]
Getting the standard error when the AOT compiler has missed a method: Attempting to JIT compile method 'ExpressionLibrary.ObservableObject:NotifyOfPropertyChange<bool> (System.Linq.Expressions.Expression`1<System.Func`1<bool>>)' while running with --aot-only.
See the attached sample for a simple reproducing scenario.
Note that if the 2 classes in the library project are moved into the application project everything works fine.
I am not sure if it is also to do with the Expression parameter, that was simply the signature of the method in my code that uncovered this.
Zoltan, this looks like your area.
It looks like something which the AOT compiler should be able to handle, since the method is referenced explicitly in the code.
The method in question is generic virtual, and AOT can't handle that:
protected virtual void NotifyOfPropertyChange<TProperty>(Expression<Func<TProperty>> property)
So this is probably a wontfix.
Sorry, forgot to update this bug, I did re-read that limitations document after posting this bug and realized it was due to the virtual. Removing the virtual keyword does indeed prevent the JIT compiler kicking in and works around this limitation.
Still curious as to why it works when all within the one project?
No idea, maybe the runtime is able to de-virtualize the call etc.