Skip to content

cmd/go: program that shadows 'string' type fails to compile with go 1.11 #27584

Closed
@zigo101

Description

@zigo101

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.11 linux/amd64

Does this issue reproduce with the latest release?

yes

What did you do?

package main

type string = []int

func main() {
}

What did you expect to see?

run okay.

What did you see instead?

build error:

/tmp/go-build910164881/b001/_gomod_.go:7:24: cannot use "0w\xaf\f\x92t\b\x02A\xe1\xc1\a\xe6\xd6\x18\xe6path\tapp\nmod\tapp\t(devel)\t\n\xf92C1\x86\x18 r\x00\x82B\x10A\x16\xd8\xf2" (type string) as type []int in assignment

It runs okay with Go 1.10.3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.modules

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions