mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Record the initializer type as soon as we have a solution, before it is applied, and get the type from the constriant system instead of from the final type checked expression. Note that the coerceToMaterializable() was unnecessary, since we always coerce the value to an rvalue type with coerceToType(). Eventually coerceToMaterializable() should go away. This is mostly NFC, except using the result of simplifyType() rather than the type of the final expression changes some diagnostics where it appears we were previously losing sugar. Also this accidentally fixes a crasher. Unfortunately the underlying issue is still there (applying a solution has bugs with opened existentials "leaking" out) -- this merely masks the problem by getting the initializer type directly from the constriant system.
4.5 KiB
4.5 KiB