mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
CastOptimizer: Fix for opaque archetypes
The fallthrough path of this function assumes failure :(. rdar://50544445
This commit is contained in:
@@ -307,6 +307,10 @@ swift::classifyDynamicCast(ModuleDecl *M,
|
||||
bool isWholeModuleOpts) {
|
||||
if (source == target) return DynamicCastFeasibility::WillSucceed;
|
||||
|
||||
// Return a conservative answer for opaque archetypes for now.
|
||||
if (source->hasOpaqueArchetype() || target->hasOpaqueArchetype())
|
||||
return DynamicCastFeasibility::MaySucceed;
|
||||
|
||||
auto sourceObject = source.getOptionalObjectType();
|
||||
auto targetObject = target.getOptionalObjectType();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user