@@ -66,8 +66,8 @@ public async Task TestNativeMethods()
6666 [ Fact ]
6767 public async Task CheckITypeCompIsUnmanaged ( )
6868 {
69- // Request DebugPropertyInfo and we should see ITypeComp_unmanaged get generated because it has an embedded managed field
70- this . nativeMethods . Add ( "DebugPropertyInfo " ) ;
69+ // Request BINDPTR and we should see ITypeComp_unmanaged get generated because it has an embedded managed field
70+ this . nativeMethods . Add ( "BINDPTR " ) ;
7171 await this . InvokeGeneratorAndCompileFromFact ( ) ;
7272
7373 var iface = this . FindGeneratedType ( "ITypeComp_unmanaged" ) ;
@@ -565,4 +565,20 @@ public async Task CrossWinMD_IInspectable(
565565 this . nativeMethods . Add ( "ITestDerivedFromInspectable" ) ;
566566 await this . InvokeGeneratorAndCompile ( $ "{ nameof ( this . CrossWinMD_IInspectable ) } _{ tfm } _{ allowMarshaling } _{ pinvokeClassName ?? "null" } ") ;
567567 }
568+
569+ [ Fact ]
570+ public async Task TestComVariantReturnValue ( )
571+ {
572+ // IUIAutomationElement has methods that return VARIANT, they should be translated to ComVariant
573+ this . nativeMethods . Add ( "IUIAutomationElement" ) ;
574+ await this . InvokeGeneratorAndCompileFromFact ( ) ;
575+
576+ var iface = this . FindGeneratedType ( "IUIAutomationElement" ) ;
577+ Assert . NotEmpty ( iface ) ;
578+
579+ // And when generating IDispatch explicitly it should have "real" methods on it.
580+ var methods = iface . SelectMany ( t => t . DescendantNodes ( ) . OfType < MethodDeclarationSyntax > ( ) ) ;
581+ var method = Assert . Single ( methods , m => m . Identifier . Text == "GetCachedPropertyValue" ) ;
582+ Assert . Contains ( "ComVariant" , method . ReturnType . ToString ( ) ) ;
583+ }
568584}
0 commit comments