If a typealias is inside a protocol, and things are defined in a certain order,
the NameAliasType for that typealias can be constructed before the parent
protocol has been validated (i.e. before its generic environment exists), in
which case it is missing the necessary substitutions.
Fixes rdar://problem/39636312.