Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ protected override Expression VisitUnknown(Expression e)
if (e is T mapped)
return VisitGenericExpression(mapped);

if (e is ExtendedExpression extendedExpression && extendedExpression.ExtendedType == ExtendedExpressionType.Marker) {
var marker = (MarkerExpression) e;
var result = Visit(marker.Target);
if (result == marker.Target)
if (e is MarkerExpression { Target: var target } marker) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that it's a not necessary check? It's not obvious

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. MarkerExpression is a sealed type
ExtendedType == ExtendedExpressionType.Marker and is MarkerExpression are equal conditions

var result = Visit(target);
if (result == target)
return result;
return new MarkerExpression(result, marker.MarkerType);
}
Expand Down
Loading