Enhancement
In addition to instanceOf, a function is missing at type level (instead of instance level) that can check whether a given type is assignment-compatible with another.
The evaluation of $givenType.isCompatible($expectedType) returns true if a value of type $givenType could be assigned to an attribute of type $expectedType.
Test
TestSearchExpression.testIsCompatible()