CsWinRT icon indicating copy to clipboard operation
CsWinRT copied to clipboard

Handle Versioned / Overloaded functions

Open pmpurifoy opened this issue 10 months ago • 0 comments

Description

If a WinRT class has a versioned / overloaded function, generating the projections results in error CS0540. The projection should be able to properly handle this scenario.

Sample input: runtimeclass MyClass { [contract(MyClassContract, 1.0)] { void ReportResult(UInt32 itemIndex, Boolean isAccurate); } [contract(MyClassContract, 1.1)] { void ReportResult(UInt32 itemIndex, Int32 isAccurate); } }

Sample output: error CS0540 'MyClass.IMyClass2.ReportResult(uint, Int32)': containing type does not implement interface 'IMyClass2'

@manodasanW was able to provide workaround but filing bug for future.

Steps To Reproduce

  1. Write an idl with overloaded functions that are versioned.
  2. Use CsWinRT to generate the projections
  3. Warning will be visible in the output with error CS0540

Expected Behavior

No warning should be provided after building the projections.

Version Info

CsWinRT version: 2.2.0

Additional Context

No response

pmpurifoy avatar Jan 14 '25 20:01 pmpurifoy