Skip to content

Commit d22f7d1

Browse files
authored
Merge pull request #13717 from rudkx/add-cast-locator
2 parents e792f8c + a93cde1 commit d22f7d1

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

lib/Sema/ConstraintLocator.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ void ConstraintLocator::Profile(llvm::FoldingSetNodeID &id, Expr *anchor,
7878
case KeyPathComponent:
7979
case ConditionalRequirement:
8080
case TypeParameterRequirement:
81+
case ImplicitlyUnwrappedCoercionResult:
8182
if (unsigned numValues = numNumericValuesInPathElement(elt.getKind())) {
8283
id.AddInteger(elt.getValue());
8384
if (numValues > 1)
@@ -248,6 +249,10 @@ void ConstraintLocator::dump(SourceManager *sm, raw_ostream &out) {
248249
case TypeParameterRequirement:
249250
out << "type parameter requirement #" << llvm::utostr(elt.getValue());
250251
break;
252+
253+
case ImplicitlyUnwrappedCoercionResult:
254+
out << "implictly unwrapped coercion result";
255+
break;
251256
}
252257
}
253258

lib/Sema/ConstraintLocator.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ class ConstraintLocator : public llvm::FoldingSetNode {
127127
ConditionalRequirement,
128128
/// A single requirement placed on the type parameters.
129129
TypeParameterRequirement,
130+
/// \brief A coercion to an Optional type that can potentially be
131+
/// force-unwrapped to the underlying type.
132+
ImplicitlyUnwrappedCoercionResult,
130133
};
131134

132135
/// \brief Determine the number of numeric values used for the given path
@@ -159,6 +162,7 @@ class ConstraintLocator : public llvm::FoldingSetNode {
159162
case Requirement:
160163
case Witness:
161164
case OpenedGeneric:
165+
case ImplicitlyUnwrappedCoercionResult:
162166
return 0;
163167

164168
case GenericArgument:
@@ -221,6 +225,7 @@ class ConstraintLocator : public llvm::FoldingSetNode {
221225
case KeyPathComponent:
222226
case ConditionalRequirement:
223227
case TypeParameterRequirement:
228+
case ImplicitlyUnwrappedCoercionResult:
224229
return 0;
225230

226231
case FunctionArgument:

0 commit comments

Comments
 (0)