bugfix: [type, at, ...] sometimes gave incorrect results when called on patterns

[type, enclosing, ...] did too.