Pulling across parent type information for complex restrictions of
simple types as well.

Bug fix: was doing an equals check on the wrong thing.