mirror of
https://github.com/golang/go
synced 2024-11-14 13:30:30 -07:00
7dc5d909fb
CL 271906 allows loading single field of typed-interface{} OpIData, but it does not update the corresponding selector type. So the generated OpLoad has the named type instead, prevent it from being lowered by lower pass. Fixes #42784 Change-Id: Idf32e4f711731be09d508dd712b60bc8c58309bd Reviewed-on: https://go-review.googlesource.com/c/go/+/272466 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
27 lines
426 B
Go
27 lines
426 B
Go
// compile
|
|
|
|
// Copyright 2020 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.
|
|
|
|
// Ensure that late expansion correctly set OpLoad argument type interface{}
|
|
|
|
package p
|
|
|
|
type iface interface {
|
|
m()
|
|
}
|
|
|
|
type it interface{}
|
|
|
|
type makeIface func() iface
|
|
|
|
func f() {
|
|
var im makeIface
|
|
e := im().(it)
|
|
g(e)
|
|
}
|
|
|
|
//go:noinline
|
|
func g(i it) {}
|