[MonoTouch] Expressions? One Hurdle Down and More After It
Tim Scott
tscott at lunaversesoftware.com
Wed Oct 28 23:09:33 EDT 2009
Thanks for the suggestion, Jb. Indeed, 1.2 corrects this issue. However,
my app did not get much father before it blew up again.
Straight away I got this error:
Attempting to JIT compile method
'Catnap.Maps.Impl.EntityMap`
1<Lunaverse.BillIt.Core.Model.TimeEntry>:Property<bool>
(System.Linq.Expressions.Expression`
1<System.Func`2<Lunaverse.BillIt.Core.Model.TimeEntry, bool>>)' while
running with --aot-only.
at Lunaverse.BillIt.Core.PersistenceConfigurator.Configure
(System.String connectionString) [0x00000]
at BillIt.UI.Application.InitializeDatabase () [0x00000]
at BillIt.UI.Application.Main (System.String[] args) [0x00000]
The line in my code where it blew up is:
Map.Entity<TimeEntry>().Property(x => x.Billed)
It might not be very clear what this does. Here is the method signature is:
EntityMap<T>.Property<TProperty>(Expression<Func<T, TProperty>> property)
Billed is a bool property of TimeEntry.
The section of code where the trouble occurs calls the same Property method
several times with various values for TProperty. I decided to move things
around and see which ones failed and which ones passed. Here are the other
errors I was able to produce:
------------------
Attempting to JIT compile method
'Catnap.Maps.Impl.EntityMap`
1<Lunaverse.BillIt.Core.Model.TimeEntry>:Property<System.Decimal>
(System.Linq.Expressions.Expression`
1<System.Func`2<Lunaverse.BillIt.Core.Model.TimeEntry,
System.Decimal>>)' while running with --aot-only.
------------------
Attempting to JIT compile method
'Catnap.Maps.Impl.EntityMap`
1<Lunaverse.BillIt.Core.Model.TimeEntry>
:Property<System.Nullable`1<System.DateTime>>
(System.Linq.Expressions.Expression`
1<System.Func`2<Lunaverse.BillIt.Core.Model.TimeEntry,
System.Nullable`1<System.DateTime>>>)' while running with --aot-only.
-------------------
Attempting to JIT compile method
'Catnap.Maps.Impl.EntityMap`
1<L
unaverse.BillIt.Core.Model.NavigationState>
:Property<System.Nullable`1<int>>
(System.Linq.Expressions.Expression`
1<System.Func`2<Lunaverse.BillIt.Core.Model.NavigationState,
System.Nullable`1<int>>>)' while running with --aot-only.
-------------------
So the types that I have seen to fail are:
int?
decimal
bool
DateTime?
On the other had, it seems to work fine if the type string or a complex
type.
This is a bug (or bugs) in Monotouch, yes? I guess the team MT just has to
work through these as they come up? Let me know if there is anything I can
do to expedite. I would be happy to submit a ticket or whatever will help.
On 10/28/09 9:15 AM, "Jb Evain" <jb at nurv.fr> wrote:
> Hey,
>
> On 10/27/09, Tim Scott <tscott at lunaversesoftware.com> wrote:
>> This code does not seem to be doing any JIT compiling. Should this be
>> supported by MT? If so I will submit a defect ticket. Thanks.
>
> The issue is the one described here:
>
> http://monotouch.net/Documentation/Troubleshoot
>
> It's the #16. You can apply the workaround in your own code to make it
> work. MonoTouch 1.2 should fix a few of those cases also.
More information about the MonoTouch
mailing list