Skip to content

Commit bf4f284

Browse files
authored
Merge pull request #14385 from DougGregor/conformance-location-sr-6839
2 parents f51d925 + 2f6cb21 commit bf4f284

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Swift 5.0
3333

3434
Runtime query of conditional conformances is now implemented. Therefore,
3535
a dynamic cast such as `value as? P`, where the dynamic type of `value`
36-
conditional conforms to `P`, will succeed when the conditional
36+
conditionally conforms to `P`, will succeed when the conditional
3737
requirements are met.
3838

3939
Swift 4.1

include/swift/AST/DeclContext.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ enum class LocalDeclContextKind : uint8_t {
120120
///
121121
/// The enumerators are ordered in terms of decreasing preference:
122122
/// an inherited conformance is best, followed by explicit
123-
/// conformances, then implied conformances. Earlier conformance
124-
/// kinds supersede later conformance kinds, possibly with a
123+
/// conformances, then synthesized and implied conformances. Earlier
124+
/// conformance kinds supersede later conformance kinds, possibly with a
125125
/// diagnostic (e.g., if an inherited conformance supersedes an
126126
/// explicit conformance).
127127
enum class ConformanceEntryKind : unsigned {
@@ -131,11 +131,11 @@ enum class ConformanceEntryKind : unsigned {
131131
/// Explicitly specified.
132132
Explicit,
133133

134-
/// Implied by an explicitly-specified conformance.
135-
Implied,
136-
137134
/// Implicitly synthesized.
138135
Synthesized,
136+
137+
/// Implied by an explicitly-specified conformance.
138+
Implied,
139139
};
140140

141141
/// Describes the kind of conformance lookup desired.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class EnumValueConstructor<EnumType : EnumValueType> where EnumType.RawValue : Hashable {}
2+
class _PositionRelation_GeneratedWrapperConstructor : EnumValueConstructor<_PositionRelation> {}
3+
extension _PositionRelation : EnumValueType {}
4+
protocol EnumValueType : RawRepresentable {}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: %target-swift-frontend -emit-sil -module-name main -primary-file %s %S/Inputs/protocol-conformance-sr6839-other.swift | %FileCheck -check-prefix CHECK-FIRST %s
2+
// RUN: %target-swift-frontend -emit-sil -module-name main %s -primary-file %S/Inputs/protocol-conformance-sr6839-other.swift | %FileCheck -check-prefix CHECK-SECOND %s
3+
4+
// We need to consistently pick where the witness table for _PositionRelation :
5+
// RawRepresentable goes.
6+
// CHECK-FIRST: sil_witness_table hidden _PositionRelation: RawRepresentable
7+
// CHECK-SECOND-NOT: sil_witness_table hidden _PositionRelation: RawRepresentable
8+
enum _PositionRelation: Int {
9+
case before = 0
10+
}

0 commit comments

Comments
 (0)