-
Notifications
You must be signed in to change notification settings - Fork 17.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/compile: be sure to export types mentioned in f.i.g. method signa…
…ture When a fully instantiated generic method is exported, be sure to also export the types in its signature. Updates #52279. Fixes #52286. Change-Id: Icc6bca05b01f914cf67faaf1bf184eaa5484f521 Reviewed-on: https://go-review.googlesource.com/c/go/+/405118 Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 1284cc2) Reviewed-on: https://go-review.googlesource.com/c/go/+/405543 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com>
- Loading branch information
Showing
4 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package lib | ||
|
||
type FMap[K comparable, V comparable] map[K]V | ||
|
||
//go:noinline | ||
func (m FMap[K, V]) Flip() FMap[V, K] { | ||
out := make(FMap[V, K]) | ||
return out | ||
} | ||
|
||
type MyType uint8 | ||
|
||
const ( | ||
FIRST MyType = 0 | ||
) | ||
|
||
var typeStrs = FMap[MyType, string]{ | ||
FIRST: "FIRST", | ||
} | ||
|
||
func (self MyType) String() string { | ||
return typeStrs[self] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package main | ||
|
||
import "./lib" | ||
|
||
func main() { lib.FIRST.String() } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// rundir -G=3 | ||
|
||
// Copyright 2022 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 ignored |