linq - c# FsCheck cannot convert lambda expression -
i'm trying c# fscheck generator generate series of commands initialized random strings. came following solution:
public gen<command<a,b>> next(b value) { var gen1 = arb.default.string().generator; var gen2 = gen.two(gen1); var gen3 = gen2.select((command<a,b>)(s => new derivedcommand(s.item1,s.item2))) //derivedcommand extends command<a,b> return gen.oneof(gen3); }
however, vs cannot build code:
cannot convert lambda expression type command<a,b> because not delegate type
i have searched solutions error message, nothing found helped. using system.linq , system.data.entity. suggestions resolving issue appreciated.
you're trying cast (s => new derivedcommand(s.item1,s.item2))
, lambda expression, (command<a,b>)
, (i assume) class.
you need like:
var gen3 = gen2.select(s => (command<a,b>)(new derivedcommand(s.item1,s.item2)));
Comments
Post a Comment