matthewmueller / joy

A delightful Go to Javascript compiler (ON HOLD)
https://mat.tm/joy
GNU General Public License v3.0
1.32k stars 35 forks source link

handle methods with the same name as the function #44

Closed matthewmueller closed 6 years ago

matthewmueller commented 6 years ago
package main

func main() {
    items := test("a", "b", "c", "d")
    for _, item := range items {
        println(item)
    }

    a := aa{}
    items = a.test("a", "b", "c", "d")
    for _, item := range items {
        println(item)
    }
}

func test(a string, items ...string) []string {
    return items
}

type aa struct{}

func (*aa) test(a string, items ...string) []string {
    return items
}
matthewmueller commented 6 years ago

fixed