You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LINQ expression trees do not support tuple literals. One workaround is to use ValueTuple.Create in these expression trees but SA1141 disallows that.
My proposed solution is for SA1141 to ignore ValueTuple.Create in expression trees.
Example with error because of restrictions by the C# compiler:
usingSystem;usingSystem.Linq.Expressions;Expression<Func<(int,int)>>foo=()=>(10,20);// ^^^^^^^^ CS8143: An expression tree may not contain a tuple literal.
Example with error because of SA1141:
usingSystem;usingSystem.Linq.Expressions;Expression<Func<(int,int)>>foo=()=>ValueTuple.Create(10,20);// ^^^^^^^^^^^^^^^^^^^^^^^^^ SA1141: Use tuple syntax
The text was updated successfully, but these errors were encountered:
LINQ expression trees do not support tuple literals. One workaround is to use
ValueTuple.Create
in these expression trees but SA1141 disallows that.My proposed solution is for SA1141 to ignore
ValueTuple.Create
in expression trees.Example with error because of restrictions by the C# compiler:
Example with error because of SA1141:
The text was updated successfully, but these errors were encountered: