System.Core different for Xamarin.Android and Xamarin.iOS

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

System.Core different for Xamarin.Android and Xamarin.iOS

Narayan Sainaney

Hi,

I have Xamarin.Android (4.8.01013) and Xamarin.iOS (1.4.2) and we have written a class on Android that inherits from

 

System.Linq.Expressions.ExpressionVisitor in System.Core.dll

 

Unfortunately, the method signature for overriding VisitMethodCall on iOS is:

 

protected virtual void VisitMethodCall(MethodCallExpression methodCall);

 

Whereas the Android version is:

 

protected internal virtual Expression VisitMethodCall(MethodCallExpression node);

 

This suggests that the Android project is linking to a different Mono version for System.Core than the iOS counterpart which makes cross platform development very hard. How do we keep both of these in sync? I have downloaded the beta version of iOS and still no joy.

 

Thanks,

Narayan Sainaney

 

 


_______________________________________________
Monodroid mailing list
[hidden email]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
Reply | Threaded
Open this post in threaded view
|

Re: System.Core different for Xamarin.Android and Xamarin.iOS

Jonathan Pryor-2
On Sep 30, 2013, at 8:00 PM, Narayan Sainaney <[hidden email]> wrote:

> I have Xamarin.Android (4.8.01013) and Xamarin.iOS (1.4.2) and we have written a class on Android that inherits from
>  
> System.Linq.Expressions.ExpressionVisitor in System.Core.dll
>  
> Unfortunately, the method signature for overriding VisitMethodCall on iOS is:
>  
> protected virtual void VisitMethodCall(MethodCallExpression methodCall);
>  
> Whereas the Android version is:
>  
> protected internal virtual Expression VisitMethodCall(MethodCallExpression node);

Xamarin.Android is in the right; it's Xamarin.iOS which is wrong here; I've filed this as:

        https://bugzilla.xamarin.com/show_bug.cgi?id=15089

The reason why Xamarin.Android is right is because we should preserve API compatibility with .NET, and .NET has the Android API:

        http://msdn.microsoft.com/en-us/library/system.linq.expressions.expressionvisitor.visitmethodcall.aspx
        protected internal virtual Expression VisitMethodCall(
                MethodCallExpression node
        )

The reason why Xamarin.Android has the right signature is because we use Microsoft's Apache-2.0-licensed DLR source, which provides ExpressionVisitor:

        https://github.com/mono/mono/blob/ac11abe1/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ExpressionVisitor.cs#L409

 - Jon

_______________________________________________
Monodroid mailing list
[hidden email]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid