mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Return expression types from the constraint system type map.
Switch ConstraintSystem::getType() to returning the type from the constraint system type map. For now, assert that these types equal the types in the expression nodes since we are still setting the expression node types in ConstraintSystem::setType().
This commit is contained in:
@@ -1287,16 +1287,10 @@ public:
|
|||||||
|
|
||||||
/// Get the type for an expression.
|
/// Get the type for an expression.
|
||||||
Type getType(Expr *E) {
|
Type getType(Expr *E) {
|
||||||
// FIXME: Ideally this would be enabled but there are currently
|
assert(hasType(E) && "Expected type to have been set!");
|
||||||
// cases where we ask for types that are not set.
|
assert(ExprTypes[E]->isEqual(E->getType()) &&
|
||||||
|
"Expected type in map to be the same type in expression!");
|
||||||
// assert(ExprTypes.find(E) != ExprTypes.end() &&
|
return ExprTypes[E];
|
||||||
// "Expected type to have been set!");
|
|
||||||
|
|
||||||
// FIXME: Temporary until all references to expression types are
|
|
||||||
// updated.
|
|
||||||
// return ExprTypes[E];
|
|
||||||
return E->getType();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Cache the type of the expression argument and return that same
|
/// Cache the type of the expression argument and return that same
|
||||||
|
|||||||
Reference in New Issue
Block a user