Implement matching against result type instead of `OpTree` node type for `Optional`