Skip to content

Commit 8ac9a65

Browse files
Jason Mittertreinerjrose-apple
authored andcommitted
Fix 'operator ==' is ambiguous with MSVC (#19501)
When compiling with MSVC on Windows, this error among other similar conflicts with AnyValue occur: Defined the overloads so it selects the correct one.
1 parent 3ad2fd6 commit 8ac9a65

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

include/swift/AST/Type.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,10 @@ class CanGenericSignature {
592592
GenericSignature *getPointer() const {
593593
return Signature;
594594
}
595+
596+
bool operator==(const swift::CanGenericSignature& other) {
597+
return Signature == other.Signature;
598+
}
595599
};
596600

597601
template <typename T>

include/swift/SIL/SILValue.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ struct ValueOwnershipKind {
134134

135135
operator innerty() const { return Value; }
136136

137+
bool operator==(const swift::ValueOwnershipKind::innerty& b) {
138+
return Value == b;
139+
}
140+
137141
Optional<ValueOwnershipKind> merge(ValueOwnershipKind RHS) const;
138142

139143
bool isTrivialOr(ValueOwnershipKind Kind) const {

lib/SILGen/SILGenApply.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4558,7 +4558,7 @@ RValue SILGenFunction::emitApply(ResultPlanPtr &&resultPlan,
45584558
}
45594559

45604560
// Emit the raw application.
4561-
auto genericSig =
4561+
GenericSignature *genericSig =
45624562
fn.getType().castTo<SILFunctionType>()->getGenericSignature();
45634563

45644564
// When calling a closure that's defined in a generic context but does not

0 commit comments

Comments
 (0)