mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #85625 from aschwaighofer/wip_embedded_cast_tuples
[embedded] Allow casting to tuples and tighten the check which existentials we support in embedded with existentials
This commit is contained in:
@@ -94,6 +94,11 @@ private struct FunctionChecker {
|
||||
for conf in ie.conformances {
|
||||
try checkConformance(conf, location: ie.location)
|
||||
}
|
||||
} else if instruction is OpenExistentialAddrInst {
|
||||
// okay in embedded with exitentials
|
||||
} else {
|
||||
// not supported even in embedded with exitentials
|
||||
throw Diagnostic(.embedded_swift_existential_type, instruction.operands[0].value.type, at: instruction.location)
|
||||
}
|
||||
|
||||
case let aeb as AllocExistentialBoxInst:
|
||||
|
||||
@@ -1051,8 +1051,7 @@ func isCastSupportedInEmbeddedSwift(from sourceType: Type,
|
||||
return false
|
||||
}
|
||||
|
||||
// Tuple?
|
||||
if !destType.isStruct && !destType.isClass && !destType.isEnum {
|
||||
if !destType.isStruct && !destType.isClass && !destType.isEnum && !destType.isTuple {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user