@@ -3075,7 +3075,14 @@ namespace {
3075
3075
3076
3076
std::pair<bool , Expr *> walkToExprPre (Expr *expr) override {
3077
3077
TS->ExprTypes [expr] = expr->getType ();
3078
-
3078
+
3079
+ SWIFT_DEFER {
3080
+ assert ((!expr->getType () || !expr->getType ()->hasTypeVariable ()
3081
+ // FIXME: We shouldn't allow these, either.
3082
+ || isa<LiteralExpr>(expr)) &&
3083
+ " Type variable didn't get erased!" );
3084
+ };
3085
+
3079
3086
// Preserve module expr type data to prevent further lookups.
3080
3087
if (auto *declRef = dyn_cast<DeclRefExpr>(expr))
3081
3088
if (isa<ModuleDecl>(declRef->getDecl ()))
@@ -3086,17 +3093,13 @@ namespace {
3086
3093
if (isa<OtherConstructorDeclRefExpr>(expr))
3087
3094
return { false , expr };
3088
3095
3089
- // TypeExpr's are relabeled by CSGen.
3090
- if (isa<TypeExpr>(expr))
3091
- return { false , expr };
3092
-
3093
3096
// If a literal has a Builtin.Int or Builtin.FP type on it already,
3094
3097
// then sema has already expanded out a call to
3095
3098
// Init.init(<builtinliteral>)
3096
3099
// and we don't want it to make
3097
3100
// Init.init(Init.init(<builtinliteral>))
3098
3101
// preserve the type info to prevent this from happening.
3099
- if (isa<LiteralExpr>(expr) &&
3102
+ if (isa<LiteralExpr>(expr) && !isa<InterpolatedStringLiteralExpr>(expr) &&
3100
3103
!(expr->getType () && expr->getType ()->is <ErrorType>()))
3101
3104
return { false , expr };
3102
3105
0 commit comments