The non-generic type 'Maybe' cannot be used with type arguments
Options
public static class Maybe
{
public static Maybe<T> ToMaybe<T>(this T value)
{
return new Maybe<T>(value);
}
public static Maybe<T> Empty<T>()
{
return new Maybe<T>();
}
}
yields 'The non-generic type 'Maybe' cannot be used with type arguments' even though System.Collections.Generic is referenced in Query Properties. What am I doing wrong ? Implementation of Maybe has been omitted - it works.
Comments
-
I suspect that you need to force LINQPad to define both as top-level types. Add the following to the start of your query:
#define NONEST -
That works. Thanks.