Skip to content

go 1.14 overlapping-interface does not work on mac os  #37728

@bigwhite

Description

@bigwhite

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

$ go version
go version go1.14 darwin/amd64

Does this issue reproduce with the latest release?

yes. go 1.14 is the latest version.

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/tonybai/Library/Caches/go-build"
GOENV="/Users/tonybai/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/tonybai/Go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/Users/tonybai/.bin/go1.14"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/Users/tonybai/.bin/go1.14/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/tonybai/go/src/github.com/bigwhite/experiments/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/cz/sbj5kg2d3m3c6j650z0qfm800000gn/T/go-build199896134=/tmp/go-build -gno-record-gcc-switches -fno-common"

$uname -a
Darwin tonybaideMacBook-Pro.local 18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64

What did you do?

I run the code below with go 1.14 under mac os 10.15. the go 1.14 i use is downloaded from https://dl.google.com/go/go1.14.darwin-amd64.tar.gz

//overlapping_interface.go
package main

type I interface {
	f()
	String() string
}
type J interface {
	g()
	String() string
}

type IJ interface {
	I
	J
}


func main() {
	var _ IJ
}

But on linux, the code run with go 1.14 is ok.

What did you expect to see?

go run ok without compiler error.

What did you see instead?

$go run overlapping_interface.go
# command-line-arguments
./overlapping_interface.go:14:2: duplicate method String

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions