Skip to content

gccgo: problems appending string to string subtype #31412

@thanm

Description

@thanm

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

Go, gccgo tip

$ go version
go version devel +06e4097f52 Tue Apr 9 12:08:48 2019 -0400 linux/amd64
$ gccgo --version
...
gccgo (GCC) 9.0.1 20190408 (experimental)

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

linux/amd64

go env Output
$ go env

What did you do?

Compile this program:

https://play.golang.org/p/1g5oPWL7tQ3

What did you expect to see?

Clean compile

What did you see instead?

Compiles and runs ok with the main Go compiler, but when compiled with gccgo I get:

GO111MODULE=off go build -compiler gccgo meas_a.go
./meas_a.go:19:14: error: argument 2 has incompatible type (cannot use type string as type Name)
   19 |  Register(f, n, d)
      |              ^
./meas_a.go:19:17: error: argument 3 has incompatible type (cannot use type string as type Name)
   19 |  Register(f, n, d)
      |                 ^

I am guessing there is a discrepancy in the way the string "+" operator is handled? Haven't yet looked into it in detail.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions