@@ -185,13 +185,8 @@ public override TypePrinterResult VisitPointerType(PointerType pointer,
185
185
if ( MarshalKind == MarshalKind . NativeField )
186
186
return IntPtrType ;
187
187
188
- var pointee = pointer . Pointee ;
189
-
190
- if ( pointee is FunctionType )
191
- {
192
- var function = pointee as FunctionType ;
193
- return string . Format ( "{0}" , function . Visit ( this , quals ) ) ;
194
- }
188
+ if ( pointer . Pointee is FunctionType )
189
+ return pointer . Pointee . Visit ( this , quals ) ;
195
190
196
191
var isManagedContext = ContextKind == TypePrinterContextKind . Managed ;
197
192
@@ -206,11 +201,10 @@ public override TypePrinterResult VisitPointerType(PointerType pointer,
206
201
if ( Options . Encoding == Encoding . Unicode ||
207
202
Options . Encoding == Encoding . BigEndianUnicode )
208
203
return string . Format ( "[MarshalAs(UnmanagedType.LPWStr)] string" ) ;
209
- throw new NotSupportedException ( string . Format ( "{0} is not supported yet." ,
210
- Options . Encoding . EncodingName ) ) ;
204
+ throw new NotSupportedException ( $ "{ Options . Encoding . EncodingName } is not supported yet.") ;
211
205
}
212
206
213
- var desugared = pointee . Desugar ( ) ;
207
+ var pointee = pointer . Pointee . Desugar ( ) ;
214
208
215
209
// From http://msdn.microsoft.com/en-us/library/y31yhkeb.aspx
216
210
// Any of the following types may be a pointer type:
@@ -243,7 +237,7 @@ public override TypePrinterResult VisitPointerType(PointerType pointer,
243
237
}
244
238
245
239
Enumeration @enum ;
246
- if ( desugared . TryGetEnum ( out @enum ) )
240
+ if ( pointee . TryGetEnum ( out @enum ) )
247
241
{
248
242
// Skip one indirection if passed by reference
249
243
if ( isManagedContext && Parameter != null && ( Parameter . IsOut || Parameter . IsInOut )
@@ -254,7 +248,7 @@ public override TypePrinterResult VisitPointerType(PointerType pointer,
254
248
}
255
249
256
250
Class @class ;
257
- if ( ( desugared . IsDependent || desugared . TryGetClass ( out @class ) )
251
+ if ( ( pointee . IsDependent || pointee . TryGetClass ( out @class ) )
258
252
&& ContextKind == TypePrinterContextKind . Native )
259
253
{
260
254
return IntPtrType ;
0 commit comments