Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

VB -> C#: Collection Initializers/Collection Expressions #1211

Open
Labels
VB -> C#Specific to VB -> C# conversion

Description

VB.Net input code

Public Sub MyMethod(params As Key())
MyMethod({ "foo", "bar", "baz" })

Erroneous output

MyMethod(new[] { "foo", "bar", "baz" })

Expected output

MyMethod(new Key[] { "foo", "bar", "baz" })
//or
MyMethod(["foo", "bar", "baz"])

Details

  • Product in use: codeconv 10.0

It probably has to do with our own Key Class that C# then interprets as strings.
Collections of other classes (e.g. Integers, other more complex classes) work fine with new[] { 1, 2, 3 }
I don't know if this is something the converter should (could) be able to handle, as it looks like a problem particular to our codebase.
If not, it's a candidate for custom pre/post-processing we need to implement ourselves.

Metadata

Metadata

Assignees

No one assigned

    Labels

    VB -> C#Specific to VB -> C# conversion

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /