@@ -1434,39 +1434,39 @@ class TypeExpr : public Expr {
14341434};
14351435
14361436class TypeValueExpr : public Expr {
1437- TypeLoc paramTypeLoc;
1437+ GenericTypeParamDecl *paramDecl;
1438+ DeclNameLoc loc;
1439+ Type paramType;
14381440
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 ) {}
14431445
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 .
14461448 // /
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);
14511451
1452- TypeRepr * getParamTypeRepr () const {
1453- return paramTypeLoc. getTypeRepr () ;
1452+ GenericTypeParamDecl * getParamDecl () const {
1453+ return paramDecl ;
14541454 }
14551455
14561456 // / Retrieves the corresponding parameter type of the value referenced by this
14571457 // / expression.
1458- ArchetypeType * getParamType () const {
1459- return paramTypeLoc. getType ()-> castTo <ArchetypeType>() ;
1458+ Type getParamType () const {
1459+ return paramType ;
14601460 }
14611461
14621462 // / Sets the corresponding parameter type of the value referenced by this
14631463 // / expression.
14641464 void setParamType (Type paramType) {
1465- paramTypeLoc. setType ( paramType) ;
1465+ this -> paramType = paramType ;
14661466 }
14671467
14681468 SourceRange getSourceRange () const {
1469- return paramTypeLoc .getSourceRange ();
1469+ return loc .getSourceRange ();
14701470 }
14711471
14721472 static bool classof (const Expr *E) {
0 commit comments