@@ -2987,6 +2987,41 @@ class PrintTypeRepr : public TypeReprVisitor<PrintTypeRepr> {
2987
2987
printRec (T->getBase ());
2988
2988
PrintWithColorRAII (OS, ParenthesisColor) << ' )' ;
2989
2989
}
2990
+
2991
+ void visitOptionalTypeRepr (OptionalTypeRepr *T) {
2992
+ printCommon (" type_optional" ) << ' \n ' ;
2993
+ printRec (T->getBase ());
2994
+ PrintWithColorRAII (OS, ParenthesisColor) << ' )' ;
2995
+ }
2996
+
2997
+ void visitImplicitlyUnwrappedOptionalTypeRepr (
2998
+ ImplicitlyUnwrappedOptionalTypeRepr *T) {
2999
+ printCommon (" type_implicitly_unwrapped_optional" ) << ' \n ' ;
3000
+ printRec (T->getBase ());
3001
+ PrintWithColorRAII (OS, ParenthesisColor) << ' )' ;
3002
+ }
3003
+
3004
+ void visitOpaqueReturnTypeRepr (OpaqueReturnTypeRepr *T) {
3005
+ printCommon (" type_opaque_return" );
3006
+ printRec (T->getConstraint ());
3007
+ PrintWithColorRAII (OS, ParenthesisColor) << ' )' ;
3008
+ }
3009
+
3010
+ void visitFixedTypeRepr (FixedTypeRepr *T) {
3011
+ printCommon (" type_fixed" );
3012
+ auto Ty = T->getType ();
3013
+ if (Ty) {
3014
+ auto &srcMgr = Ty->getASTContext ().SourceMgr ;
3015
+ if (T->getLoc ().isValid ()) {
3016
+ OS << " location=@" ;
3017
+ T->getLoc ().print (OS, srcMgr);
3018
+ } else {
3019
+ OS << " location=<<invalid>>" ;
3020
+ }
3021
+ }
3022
+ OS << " type=" ; Ty.dump (OS);
3023
+ PrintWithColorRAII (OS, ParenthesisColor) << ' )' ;
3024
+ }
2990
3025
};
2991
3026
2992
3027
} // end anonymous namespace
0 commit comments