Skip to content

Elision and variadic parameters #33

@aws5295

Description

@aws5295

Elision does not seem to match variadic parameters - which also use the ... notation.
Below is a simple repro.

Patch file (goal is to swap order of first 2 parameters only):

@@
var first expression
var second expression
@@
-bar(second, first,...)
+bar(first, second,...)

Input:

func foo() {
	bar("b", "a")
	bar("b", "a", "c")
	bar("b", "a", []string{"c"}...)
}

Output:

func foo() {
	bar("a", "b")
	bar("a", "b", "c")
        // Expected: bar("a", "b", []string{"c"}...)
	bar("b", "a", []string{"c"}...)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions