Can someone help me sort out this compiler error?
I have a class like this
public class Test {
public delegate void TestAction<T>(T arg);
public delegate void TestActionCaller<T1, T2>(T1 arg, TestAction<T2> action);
public static void Call<T1,T2>(TestActionCaller<T1,T2> actioncaller) {
actioncaller(default(T1), arg => { });
}
}
Then I have the following code
public class TestCaller {
static TestCaller() {
Test.Call<int, int>((arg,action)=>action(arg));
}
}
This works fine.
But if I move the TestCaller to another assembly (exactly the same code as above) I get a compiler error "Delegate 'TestAction' does not take '1' arguments."