Skip to content

Commit a4e35ed

Browse files
committed
[GSB] Remove unused form of addSameTypeRequirementDirect()
1 parent 52e52b5 commit a4e35ed

File tree

6 files changed

+6
-23
lines changed

6 files changed

+6
-23
lines changed

include/swift/AST/GenericSignatureBuilder.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -330,15 +330,6 @@ class GenericSignatureBuilder {
330330
FloatingRequirementSource Source,
331331
llvm::function_ref<void(Type, Type)> diagnoseMismatch);
332332

333-
/// \brief Add a new same-type requirement between two fully resolved types
334-
/// (output of GenericSignatureBuilder::resolve).
335-
///
336-
/// The two types must not be incompatible concrete types.
337-
ConstraintResult addSameTypeRequirementDirect(
338-
ResolvedType paOrT1,
339-
ResolvedType paOrT2,
340-
FloatingRequirementSource Source);
341-
342333
/// \brief Add a new same-type requirement between two unresolved types.
343334
///
344335
/// The types are resolved with \c GenericSignatureBuilder::resolve, and must

lib/AST/GenericSignatureBuilder.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3514,17 +3514,6 @@ ConstraintResult GenericSignatureBuilder::addSameTypeRequirement(
35143514
diagnoseMismatch);
35153515
}
35163516

3517-
ConstraintResult GenericSignatureBuilder::addSameTypeRequirementDirect(
3518-
ResolvedType paOrT1,
3519-
ResolvedType paOrT2,
3520-
FloatingRequirementSource source) {
3521-
return addSameTypeRequirementDirect(paOrT1, paOrT2, source,
3522-
[&](Type type1, Type type2) {
3523-
Diags.diagnose(source.getLoc(), diag::requires_same_concrete_type,
3524-
type1, type2);
3525-
});
3526-
}
3527-
35283517
ConstraintResult GenericSignatureBuilder::addSameTypeRequirementDirect(
35293518
ResolvedType paOrT1, ResolvedType paOrT2, FloatingRequirementSource source,
35303519
llvm::function_ref<void(Type, Type)> diagnoseMismatch) {

test/Constraints/same_types.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ func test6<T: Barrable>(_ t: T) -> (Y, X) where T.Bar == Y {
8888

8989
func test7<T: Barrable>(_ t: T) -> (Y, X) where T.Bar == Y, T.Bar.Foo == X {
9090
// expected-warning@-1{{redundant same-type constraint 'T.Bar.Foo' == 'X'}}
91+
// expected-note@-2{{same-type constraint 'T.Bar.Foo' == 'Y.Foo' (aka 'X') implied here}}
9192
return (t.bar, t.bar.foo)
9293
}
9394

@@ -119,12 +120,14 @@ func fail6<T>(_ t: T) -> Int where T == Int { // expected-error{{same-type requi
119120

120121
func test8<T: Barrable, U: Barrable>(_ t: T, u: U) -> (Y, Y, X, X)
121122
where T.Bar == Y, U.Bar.Foo == X, T.Bar == U.Bar { // expected-warning{{redundant same-type constraint 'U.Bar.Foo' == 'X'}}
123+
// expected-note@-1{{same-type constraint 'T.Bar.Foo' == 'Y.Foo' (aka 'X') implied here}}
122124
return (t.bar, u.bar, t.bar.foo, u.bar.foo)
123125
}
124126

125127
func test8a<T: Barrable, U: Barrable>(_ t: T, u: U) -> (Y, Y, X, X)
126128
where
127129
T.Bar == Y, U.Bar.Foo == X, U.Bar == T.Bar { // expected-warning{{redundant same-type constraint 'U.Bar.Foo' == 'X'}}
130+
// expected-note@-1{{same-type constraint 'T.Bar.Foo' == 'Y.Foo' (aka 'X') implied here}}
128131
return (t.bar, u.bar, t.bar.foo, u.bar.foo)
129132
}
130133

test/Generics/superclass_constraint.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class C2 : C, P4 { }
102102
// CHECK: superclassConformance3
103103
// CHECK: Requirements:
104104
// CHECK-NEXT: τ_0_0 : C2 [τ_0_0: Explicit @ {{.*}}:61]
105-
// CHECK-NEXT: τ_0_0 : _NativeClass [τ_0_0: Explicit @ {{.*}}:46 -> Superclass]
105+
// CHECK-NEXT: τ_0_0 : _NativeClass [τ_0_0: Explicit @ {{.*}}:46 -> Derived]
106106
// CHECK-NEXT: τ_0_0 : P4 [τ_0_0: Explicit @ {{.*}}:61 -> Superclass (C2: P4)]
107107
// CHECK: Canonical generic signature: <τ_0_0 where τ_0_0 : C2>
108108
func superclassConformance3<T>(t: T) where T : C, T : P4, T : C2 {}

validation-test/compiler_crashers/28788-conformance-isconcrete-concrete-isexistentialtype.swift renamed to validation-test/compiler_crashers_fixed/28788-conformance-isconcrete-concrete-isexistentialtype.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
77

88
// REQUIRES: asserts
9-
// RUN: not --crash %target-swift-frontend %s -emit-ir
9+
// RUN: not %target-swift-frontend %s -emit-ir
1010
protocol P{
1111
typealias e:RangeReplaceableCollection
1212
}{}extension P{{}func e

validation-test/compiler_crashers/28793-nestedpabyname-didnt-find-the-associated-type-we-wanted.swift renamed to validation-test/compiler_crashers_fixed/28793-nestedpabyname-didnt-find-the-associated-type-we-wanted.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
77

88
// REQUIRES: asserts
9-
// RUN: not --crash %target-swift-frontend %s -emit-ir
9+
// RUN: not %target-swift-frontend %s -emit-ir
1010
protocol A:RangeReplaceableCollection
1111
protocol P{
1212
protocol A

0 commit comments

Comments
 (0)