Restricted references should create implicit mappings if necessary

See #1465. Not ready for merge