mirror of
https://github.com/golang/go
synced 2024-11-23 21:30:08 -07:00
a1cedf0842
Dupok symbols may be defined in multiple packages. Its associated package is chosen sort of arbitrarily (the first containing package that the linker loads). Canonicalize its package to the package with which it will be laid down in text, which is the first package in dependency order that defines the symbol. So later passes (for example, trampoline insertion pass) know that the dupok symbol is laid down along with the package. Fixes #19764. Change-Id: I7cbc7474ff3016d5069c8b7be04af934abab8bc3 Reviewed-on: https://go-review.googlesource.com/39150 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Reviewed-by: David Chase <drchase@google.com>
16 lines
305 B
Go
16 lines
305 B
Go
// Copyright 2017 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package a
|
|
|
|
type T struct{ _ int }
|
|
func (t T) M() {}
|
|
|
|
type I interface { M() }
|
|
|
|
func F() {
|
|
var t I = &T{}
|
|
t.M() // call to the wrapper (*T).M
|
|
}
|