Skip to content

Commit 5f2c49b

Browse files
committed
RequirementMachine: Canonicalize protocol list in RequirementMachine::getLocalRequirements()
1 parent 1b99dd2 commit 5f2c49b

File tree

4 files changed

+3
-7
lines changed

4 files changed

+3
-7
lines changed

lib/AST/RequirementMachine/GenericSignatureQueries.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ RequirementMachine::getLocalRequirements(
7575
for (const auto *proto : props->getConformsTo())
7676
result.protos.push_back(const_cast<ProtocolDecl *>(proto));
7777

78+
ProtocolType::canonicalizeProtocols(result.protos);
79+
7880
result.layout = props->getLayoutConstraint();
7981

8082
return result;

test/IDE/complete_type_relation_global_results.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// RUN: %empty-directory(%t/ImportPath)
33
// RUN: %{python} %utils/split_file.py -o %t %s
44

5-
// XFAIL: noncopyable_generics
6-
75
// RUN: %target-swift-frontend -disable-availability-checking -emit-module %t/Lib.swift -o %t/ImportPath/Lib.swiftmodule -emit-module-interface-path %t/ImportPath/Lib.swiftinterface
86

97
// BEGIN Lib.swift

test/Sema/type_eraser.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// RUN: %target-swift-frontend -typecheck -disable-availability-checking -dump-ast %s | %FileCheck %s
22

3-
// XFAIL: noncopyable_generics
4-
53
class AnyP: P {
64
init<T: P>(erasing: T) {}
75
}
@@ -43,7 +41,7 @@ func testNoDynamic() -> some P {
4341
dynamic func testNoOpaque() -> P {
4442
// CHECK: erasure_expr implicit type="any P"
4543
// CHECK-NEXT: normal_conformance type="ConcreteP" protocol="P"
46-
// CHECK-NEXT: call_expr type="ConcreteP"
44+
// CHECK: call_expr type="ConcreteP"
4745
ConcreteP()
4846
}
4947

test/Sema/type_eraser_experimental_flag.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// RUN: %target-swift-frontend -typecheck -disable-availability-checking -dump-ast -enable-experimental-opaque-type-erasure %s | %FileCheck %s
22

3-
// XFAIL: noncopyable_generics
4-
53
class AnyP: P {
64
init<T: P>(erasing: T) {}
75
}

0 commit comments

Comments
 (0)