@@ -1434,39 +1434,39 @@ class TypeExpr : public Expr {
1434
1434
};
1435
1435
1436
1436
class TypeValueExpr : public Expr {
1437
- TypeLoc paramTypeLoc;
1437
+ GenericTypeParamDecl *paramDecl;
1438
+ DeclNameLoc loc;
1439
+ Type paramType;
1438
1440
1439
- public:
1440
- // / Create a \c TypeValueExpr from an underlying parameter \c TypeRepr.
1441
- TypeValueExpr (TypeRepr *paramRepr) :
1442
- Expr (ExprKind::TypeValue, /* implicit */ false ), paramTypeLoc(paramRepr ) {}
1441
+ // / Create a \c TypeValueExpr from a given generic value param decl.
1442
+ TypeValueExpr (DeclNameLoc loc, GenericTypeParamDecl *paramDecl) :
1443
+ Expr (ExprKind::TypeValue, /* implicit */ false ), paramDecl(paramDecl),
1444
+ loc (loc ), paramType( nullptr ) {}
1443
1445
1444
- // / Create a \c TypeValueExpr for a given \c TypeDecl at the specified
1445
- // / location .
1446
+ public:
1447
+ // / Create a \c TypeValueExpr for a given \c GenericTypeParamDecl .
1446
1448
// /
1447
- // / The given location must be valid. If it is not, you must use
1448
- // / \c TypeExpr::createImplicitForDecl instead.
1449
- static TypeValueExpr *createForDecl (DeclNameLoc Loc, TypeDecl *D,
1450
- DeclContext *DC);
1449
+ // / The given location must be valid.
1450
+ static TypeValueExpr *createForDecl (DeclNameLoc Loc, GenericTypeParamDecl *D);
1451
1451
1452
- TypeRepr * getParamTypeRepr () const {
1453
- return paramTypeLoc. getTypeRepr () ;
1452
+ GenericTypeParamDecl * getParamDecl () const {
1453
+ return paramDecl ;
1454
1454
}
1455
1455
1456
1456
// / Retrieves the corresponding parameter type of the value referenced by this
1457
1457
// / expression.
1458
- ArchetypeType * getParamType () const {
1459
- return paramTypeLoc. getType ()-> castTo <ArchetypeType>() ;
1458
+ Type getParamType () const {
1459
+ return paramType ;
1460
1460
}
1461
1461
1462
1462
// / Sets the corresponding parameter type of the value referenced by this
1463
1463
// / expression.
1464
1464
void setParamType (Type paramType) {
1465
- paramTypeLoc. setType ( paramType) ;
1465
+ this -> paramType = paramType ;
1466
1466
}
1467
1467
1468
1468
SourceRange getSourceRange () const {
1469
- return paramTypeLoc .getSourceRange ();
1469
+ return loc .getSourceRange ();
1470
1470
}
1471
1471
1472
1472
static bool classof (const Expr *E) {
0 commit comments