Skip to content

Extensibility: allow for types not derived from Expression or other types in System.Linq.Expressions #41

@zspitz

Description

@zspitz

Currently, in order to figure out which object is a node while visiting, we use a List<Type> for node types:

public readonly static List<Type> NodeTypes = new List<Type>() {
    typeof(Expression),
    typeof(MemberBinding),
    typeof(ElementInit),
    typeof(SwitchCase),
    typeof(CatchBlock),
    typeof(LabelTarget)
};

and a corresponding List<Type> which includes IEnumerable<> variants of each of these types. This allows visitors to treat non-Expression-derived types (such as SwitchCase or ElementInit) as nodes.

Authors of third-party extension visitors might have similar custom nodes which don't derive from Expression.

Metadata

Metadata

Assignees

No one assigned

    Labels

    extensibilityRelated to extending renderers and using custom types

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions