mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This was blocked by some type-checker issues: First, we weren't registering a constraint restriction when tail-recursing in matchTypes (as opposed to when creating a disjunction because multiple conversions applied). Do so, and move the set of constraint restrictions to the constraint system in order to make this simpler. A large amount of similar solver state is already there, and of course solving the system already prospectively modifies the constraint graph. Second, only set up a potential existential conversion when working with concrete types. Without this, we would fail to typecheck conversions to optional protocol types, but not optional class/struct/whatever types. It's not clear whether whether we should ever really be considering conversions when either of the types is non-concrete. I believe it was the second fix which removed a need for a ! in the NewArray test case. Swift SVN r14637
72 KiB
72 KiB