mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fix AbstractionPattern::isNoncopyable to handle archetypes.
This fixes TypeLowering for ~Copyable generics, such as:
struct S<T: ~Copyable>: ~Copyable {
var x: T
}
extension S: Copyable where T: Copyable {}
func foo<T>(s: S<T>) -> ()
Previously, TypeLowering would ignore the implicit Copyable
requirement on the archetype 'T'.
This commit is contained in:
@@ -290,7 +290,7 @@ bool AbstractionPattern::isNoncopyable(CanType substTy) const {
|
||||
|
||||
auto isDefinitelyCopyable = [&](CanType t) -> bool {
|
||||
auto result = copyable->getParentModule()
|
||||
->checkConformanceWithoutContext(substTy, copyable,
|
||||
->checkConformanceWithoutContext(t, copyable,
|
||||
/*allowMissing=*/false);
|
||||
return result.has_value() && !result.value().isInvalid();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user