Skip to content

Commit

Permalink
Some more covariance syntax possibilities found. Still not ideal.
Browse files Browse the repository at this point in the history
  • Loading branch information
thygrrr committed Nov 2, 2024
1 parent 3c4704f commit ce1c720
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fennecs.tests/Conceptual/CovariantRunners.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ public void CanRunCovariantAction()
runner.For(delegate(ref DerivedClass t) { WriteRef(ref t);});
//runner.For((BaseClass t) => WriteCovariant(t)); // ambiguous, can't compile
//runner.For(delegate(BaseClass t) { WriteCovariant(t);}); // ambiguous, can't compile
runner.For((t) => WriteRef(ref t));

// ReSharper disable once ConvertClosureToMethodGroup
// ReSharper disable once RedundantLambdaSignatureParentheses
runner.For((t) => WriteCovariant(t));
}

private void WriteCovariant(BaseClass t)
Expand Down

0 comments on commit ce1c720

Please sign in to comment.