swift
cf905840 - Sema: Apply metatype-to-object conversions even without restriction hints.

Commit
7 years ago
Sema: Apply metatype-to-object conversions even without restriction hints. In some cases, such as when pushing a collection conversion down to per-element conversions, we'll coerce a subtype metatype to AnyObject, as in: ``` func f(_: [AnyObject]) {} f([NSString.self, NSObject.self]) // Type checks as [NSObject.Type] converted to [AnyObject] ``` and only record the restriction kinds used in the indirect steps NSString -> NSObject and NSObject.Type -> AnyObject without recording the jump from NSString.Type to AnyObject. coerceToType ought to apply this subtyping rule even without such a hint, though, since the restriction kind is intended only as an optimization. Fixes rdar://problem/42666956 .
Author
Committer
Parents
Loading