Type of conditional expression cannot be determined because there is no implicit conversion between 'lambda expression' and 'lambda expression'
Say whaat? Could someone please explain this compile error to me? This is the code that produces it:
protected override Func<System.IO.Stream> GetStream()
{
return someBool
? () => EmbeddedResourceExtractor.GetFile("SomeFile1.ext")
: () => EmbeddedResourceExtractor.GetFile("SomeFile2.ext");
}
This does not:
protected override Func<System.IO.Stream> GetStream()
{
return () => EmbeddedResourceExtractor.GetFile("SomeFile1.ext");
}
And neither do this:
protected override Func<System.IO.Stream> GetStream()
{
if(someBool)
return () => EmbeddedResourceExtractor.GetFile("SomeFile1.ext");
return () => EmbeddedResourceExtractor.GetFile("SomeFile2.ext");
}