Skip to content

Commit 73262ae

Browse files
committed
[ConstraintSystem] Add Solution::getResolvedType to get a concrete type for a given ASTNode
1 parent a81b7d1 commit 73262ae

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

lib/Sema/CSApply.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8415,6 +8415,10 @@ Type Solution::getType(ASTNode node) const {
84158415
return cs.getType(node);
84168416
}
84178417

8418+
Type Solution::getResolvedType(ASTNode node) const {
8419+
return simplifyType(getType(node));
8420+
}
8421+
84188422
void Solution::setExprTypes(Expr *expr) const {
84198423
if (!expr)
84208424
return;

lib/Sema/ConstraintSystem.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,11 @@ class Solution {
11901190
/// Retrieve the type of the given node, as recorded in this solution.
11911191
Type getType(ASTNode node) const;
11921192

1193+
/// Retrieve the type of the given node as recorded in this solution
1194+
/// and resolve all of the type variables in contains to form a fully
1195+
/// "resolved" concrete type.
1196+
Type getResolvedType(ASTNode node) const;
1197+
11931198
/// Resolve type variables present in the raw type, using generic parameter
11941199
/// types where possible.
11951200
Type resolveInterfaceType(Type type) const;

0 commit comments

Comments
 (0)