mirror of
https://github.com/golang/go
synced 2024-11-24 08:30:15 -07:00
2d357d8da8
typecheck type alias always replaces the original definition of the symbol. This is wrong behavior because if the symbol's definition is replaced by a local type alias, it ends up being written to compiled file as an alias, instead of the original type. To fix, only replace the definition of symbol with global type alias. Fixes #31959 Change-Id: Id85a15e8a9d6a4b06727e655a95dc81e63df633a Reviewed-on: https://go-review.googlesource.com/c/go/+/177378 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
22 lines
359 B
Go
22 lines
359 B
Go
// run
|
|
|
|
// Copyright 2019 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.
|
|
|
|
// Check import package contains type alias in function
|
|
// with the same name with an export type not panic
|
|
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"a"
|
|
)
|
|
|
|
func main() {
|
|
fmt.Println(a.T{})
|
|
a.F()
|
|
}
|