File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,11 @@ ASTNode FailureDiagnostic::getAnchor() const {
73
73
}
74
74
75
75
Type FailureDiagnostic::getType (ASTNode node, bool wantRValue) const {
76
- return resolveType (S.getType (node), /* reconstituteSugar=*/ false , wantRValue);
76
+ return resolveType (getRawType (node), /* reconstituteSugar=*/ false , wantRValue);
77
+ }
78
+
79
+ Type FailureDiagnostic::getRawType (ASTNode node) const {
80
+ return S.getType (node);
77
81
}
78
82
79
83
template <typename ... ArgTypes>
@@ -3420,7 +3424,8 @@ bool MissingMemberFailure::diagnoseInLiteralCollectionContext() const {
3420
3424
return false ;
3421
3425
}
3422
3426
3423
- if (auto *defaultableVar = getType (parentExpr)->getAs <TypeVariableType>()) {
3427
+ if (auto *defaultableVar =
3428
+ getRawType (parentExpr)->getAs <TypeVariableType>()) {
3424
3429
if (solution.DefaultedConstraints .count (
3425
3430
defaultableVar->getImpl ().getLocator ()) != 0 ) {
3426
3431
emitDiagnostic (diag::unresolved_member_no_inference, getName ());
Original file line number Diff line number Diff line change @@ -86,6 +86,10 @@ class FailureDiagnostic {
86
86
87
87
Type getType (ASTNode node, bool wantRValue = true ) const ;
88
88
89
+ // / Get type associated with a given ASTNode without resolving it,
90
+ // / which means that returned type would have type variables.
91
+ Type getRawType (ASTNode node) const ;
92
+
89
93
// / Resolve type variables present in the raw type, if any.
90
94
Type resolveType (Type rawType, bool reconstituteSugar = false ,
91
95
bool wantRValue = true ) const {
@@ -205,7 +209,7 @@ class FailureDiagnostic {
205
209
206
210
bool isCollectionType (Type type) const {
207
211
auto &cs = getConstraintSystem ();
208
- return bool ( cs.isCollectionType (type) );
212
+ return cs.isCollectionType (type);
209
213
}
210
214
211
215
bool isArrayType (Type type) const {
You can’t perform that action at this time.
0 commit comments