Bug 45063 - Delegate System.Func<TestClass, TetsClassResult> does not take 2 arguments after recent Xamarin update
Summary: Delegate System.Func<TestClass, TetsClassResult> does not take 2 arguments af...
Status: NEEDINFO
Alias: None
Product: Class Libraries
Classification: Mono
Component: General (show other bugs)
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-10-05 14:37 UTC by Rob DeRosa
Modified: 2016-10-05 16:02 UTC (History)
2 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Rob DeRosa 2016-10-05 14:37:04 UTC
Hello,

After the recent Xamarin Studio (Mac OS) update I'm no longer able to build my PCL with Func<Arg1, TResult> class usage. For some reason it starts to complain that this func doesn't take two args:

Error CS1593: Delegate System.Func<TestClass, TetsClassResult> does not take 2arguments (CS1593) (MyPclLib)

If I create a new test project - it works fine with exactly the same code just with a simplified func method body:

public class MyClass
{
public MyClass ()
{
var array = new TestClass [] { new TestClass(), new TestClass() };
var any = array.Select<TestClass, TestClassResult> ((arg1, index) => {
return new TestClassResult (index);
});
}
}

public class TestClass
{
}

public class TestClassResult
{
public TestClassResult(int index)
{
//...
}
}


Even if I simplify my original method it starts to work so I guess after the update Xamarin Studio fails to infer args usage and couldn't much the proper Func<> class, but I couldn't discover how to help it to find it.

Xamarin Studio information:

Xamarin Studio Enterprise
Version 6.1 (build 5441)
Installation UUID: e6dcef46-0a84-444e-bcfd-8be8b1a3b2b1
Runtime:
Mono 4.6.0 (mono-4.6.0-branch/746756c) (64-bit)
GTK+ 2.24.23 (Raleigh theme)

Package version: 406000245

NuGet
Version: 3.4.3.0

Xamarin.Profiler
Not Installed

Apple Developer Tools
Xcode 8.0 (11246)
Build 8A218a

Xamarin.iOS
Version: 10.0.0.6 (Xamarin Enterprise)
Hash: 6c3fee4
Branch: xcode8
Build date: 2016-09-09 13:01:32-0400

Xamarin.Android
Version: 7.0.0.18 (Xamarin Enterprise)
Android SDK: /Users/username/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
4.0.3 (API level 15)
4.1 (API level 16)
4.2 (API level 17)
4.3 (API level 18)
4.4 (API level 19)
4.4.87 (API level 20)
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
7.0 (API level 24)

SDK Tools Version: 25.2.2
SDK Platform Tools Version: 24.0.3
SDK Build Tools Version: 24.0.2

Java SDK: /usr
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:

I have posted a question at SO:
http://stackoverflow.com/questions/39581521/delegate-system-functestclass-tetsclassresult-does-not-take-2-arguments-after

Thanks,
Alexey
Comment 1 Marek Safar 2016-10-05 16:02:55 UTC
Could you attach your project so we can reproduce it locally

Note You need to log in before you can comment on or make changes to this bug.