Issue 10953 - Attribute inheritance needs to apply to contracts, too

http://d.puremagic.com/issues/show_bug.cgi?id=10953

The bug was found during the review for #2516.