-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VB -> C#: someInterface.Value
becomes someInterface
if the interface has the DefaultMember("Value")
attribute
#1091
Comments
OK, I did some more debugging and managed to create a repro example without an Outlook reference:
Expected result: Actual result: Apparently, the |
.Value
property access lost on COM objectsomeInterface.Value
becomes someInterface
if the interface has the DefaultMember("Value")
attribute
Thanks, looks like something needs changing near here: CodeConverter/CodeConverter/CSharp/ExpressionNodeVisitor.cs Lines 1033 to 1052 in a978d1b
In VB, it's a compile error to mark a property with no required parameters as |
Good question. My guess is that whatever creates those COM interop assemblies translates COM default properties (DISPID 0, used e.g. for "Let coercion" in VB6/VBA/VBScript) by marking them as For those unfamiliar with it, this is Let coercion in VB6/VBA/VBScript:
My first instinct was that that On a slightly related note, if we have the following VB library
and a client uses |
VB.Net input code
Requires a reference to "Microsoft Outlook 16.0 Object Library".
Erroneous output
Expected output
Console.WriteLine(p)
should beConsole.WriteLine(p.Value)
.Details
newProperty.Value = oldProperty.Value
becomesnewProperty = oldProperty
, which (unfortunately) compiles, but does something completely different.The text was updated successfully, but these errors were encountered: