@@ -52,34 +52,34 @@ std::string ForceDowncast::getName() const {
52
52
return name.c_str ();
53
53
}
54
54
55
- bool ForceDowncast::diagnose (Expr *expr) const {
55
+ bool ForceDowncast::diagnose (Expr *expr, bool asNote ) const {
56
56
MissingExplicitConversionFailure failure (expr, getConstraintSystem (),
57
57
getLocator (), DowncastTo);
58
- return failure.diagnose ();
58
+ return failure.diagnose (asNote );
59
59
}
60
60
61
61
ForceDowncast *ForceDowncast::create (ConstraintSystem &cs, Type toType,
62
62
ConstraintLocator *locator) {
63
63
return new (cs.getAllocator ()) ForceDowncast (cs, toType, locator);
64
64
}
65
65
66
- bool ForceOptional::diagnose (Expr *root) const {
66
+ bool ForceOptional::diagnose (Expr *root, bool asNote ) const {
67
67
MissingOptionalUnwrapFailure failure (root, getConstraintSystem (),
68
68
getLocator ());
69
- return failure.diagnose ();
69
+ return failure.diagnose (asNote );
70
70
}
71
71
72
72
ForceOptional *ForceOptional::create (ConstraintSystem &cs,
73
73
ConstraintLocator *locator) {
74
74
return new (cs.getAllocator ()) ForceOptional (cs, locator);
75
75
}
76
76
77
- bool UnwrapOptionalBase::diagnose (Expr *root) const {
77
+ bool UnwrapOptionalBase::diagnose (Expr *root, bool asNote ) const {
78
78
bool resultIsOptional =
79
79
getKind () == FixKind::UnwrapOptionalBaseWithOptionalResult;
80
80
MemberAccessOnOptionalBaseFailure failure (
81
81
root, getConstraintSystem (), getLocator (), MemberName, resultIsOptional);
82
- return failure.diagnose ();
82
+ return failure.diagnose (asNote );
83
83
}
84
84
85
85
UnwrapOptionalBase *UnwrapOptionalBase::create (ConstraintSystem &cs,
@@ -95,41 +95,41 @@ UnwrapOptionalBase *UnwrapOptionalBase::createWithOptionalResult(
95
95
cs, FixKind::UnwrapOptionalBaseWithOptionalResult, member, locator);
96
96
}
97
97
98
- bool AddAddressOf::diagnose (Expr *root) const {
98
+ bool AddAddressOf::diagnose (Expr *root, bool asNote ) const {
99
99
MissingAddressOfFailure failure (root, getConstraintSystem (), getLocator ());
100
- return failure.diagnose ();
100
+ return failure.diagnose (asNote );
101
101
}
102
102
103
103
AddAddressOf *AddAddressOf::create (ConstraintSystem &cs,
104
104
ConstraintLocator *locator) {
105
105
return new (cs.getAllocator ()) AddAddressOf (cs, locator);
106
106
}
107
107
108
- bool TreatRValueAsLValue::diagnose (Expr *root) const {
108
+ bool TreatRValueAsLValue::diagnose (Expr *root, bool asNote ) const {
109
109
RValueTreatedAsLValueFailure failure (getConstraintSystem (), getLocator ());
110
- return failure.diagnose ();
110
+ return failure.diagnose (asNote );
111
111
}
112
112
113
113
TreatRValueAsLValue *TreatRValueAsLValue::create (ConstraintSystem &cs,
114
114
ConstraintLocator *locator) {
115
115
return new (cs.getAllocator ()) TreatRValueAsLValue (cs, locator);
116
116
}
117
117
118
- bool CoerceToCheckedCast::diagnose (Expr *root) const {
118
+ bool CoerceToCheckedCast::diagnose (Expr *root, bool asNote ) const {
119
119
MissingForcedDowncastFailure failure (root, getConstraintSystem (),
120
120
getLocator ());
121
- return failure.diagnose ();
121
+ return failure.diagnose (asNote );
122
122
}
123
123
124
124
CoerceToCheckedCast *CoerceToCheckedCast::create (ConstraintSystem &cs,
125
125
ConstraintLocator *locator) {
126
126
return new (cs.getAllocator ()) CoerceToCheckedCast (cs, locator);
127
127
}
128
128
129
- bool MarkExplicitlyEscaping::diagnose (Expr *root) const {
129
+ bool MarkExplicitlyEscaping::diagnose (Expr *root, bool asNote ) const {
130
130
NoEscapeFuncToTypeConversionFailure failure (root, getConstraintSystem (),
131
131
getLocator (), ConvertTo);
132
- return failure.diagnose ();
132
+ return failure.diagnose (asNote );
133
133
}
134
134
135
135
MarkExplicitlyEscaping *
@@ -139,9 +139,9 @@ MarkExplicitlyEscaping::create(ConstraintSystem &cs, ConstraintLocator *locator,
139
139
MarkExplicitlyEscaping (cs, locator, convertingTo);
140
140
}
141
141
142
- bool RelabelArguments::diagnose (Expr *root) const {
142
+ bool RelabelArguments::diagnose (Expr *root, bool asNote ) const {
143
143
LabelingFailure failure (getConstraintSystem (), getLocator (), getLabels ());
144
- return failure.diagnose ();
144
+ return failure.diagnose (asNote );
145
145
}
146
146
147
147
RelabelArguments *
@@ -153,10 +153,10 @@ RelabelArguments::create(ConstraintSystem &cs,
153
153
return new (mem) RelabelArguments (cs, correctLabels, locator);
154
154
}
155
155
156
- bool MissingConformance::diagnose (Expr *root) const {
156
+ bool MissingConformance::diagnose (Expr *root, bool asNote ) const {
157
157
MissingConformanceFailure failure (root, getConstraintSystem (), getLocator (),
158
158
{NonConformingType, Protocol});
159
- return failure.diagnose ();
159
+ return failure.diagnose (asNote );
160
160
}
161
161
162
162
MissingConformance *MissingConformance::create (ConstraintSystem &cs, Type type,
@@ -166,10 +166,10 @@ MissingConformance *MissingConformance::create(ConstraintSystem &cs, Type type,
166
166
MissingConformance (cs, type, protocol, locator);
167
167
}
168
168
169
- bool SkipSameTypeRequirement::diagnose (Expr *root) const {
169
+ bool SkipSameTypeRequirement::diagnose (Expr *root, bool asNote ) const {
170
170
SameTypeRequirementFailure failure (root, getConstraintSystem (), LHS, RHS,
171
171
getLocator ());
172
- return failure.diagnose ();
172
+ return failure.diagnose (asNote );
173
173
}
174
174
175
175
SkipSameTypeRequirement *
@@ -178,10 +178,10 @@ SkipSameTypeRequirement::create(ConstraintSystem &cs, Type lhs, Type rhs,
178
178
return new (cs.getAllocator ()) SkipSameTypeRequirement (cs, lhs, rhs, locator);
179
179
}
180
180
181
- bool SkipSuperclassRequirement::diagnose (Expr *root) const {
181
+ bool SkipSuperclassRequirement::diagnose (Expr *root, bool asNote ) const {
182
182
SuperclassRequirementFailure failure (root, getConstraintSystem (), LHS, RHS,
183
183
getLocator ());
184
- return failure.diagnose ();
184
+ return failure.diagnose (asNote );
185
185
}
186
186
187
187
SkipSuperclassRequirement *
0 commit comments