File tree 4 files changed +38
-1
lines changed
src/cmd/compile/internal/typecheck
4 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ func (p *crawler) checkForFullyInst(t *types.Type) {
234
234
for i , t1 := range t .RParams () {
235
235
shapes [i ] = Shapify (t1 , i , baseType .RParams ()[i ])
236
236
}
237
- for j := range t .Methods ().Slice () {
237
+ for j , tmethod := range t .Methods ().Slice () {
238
238
baseNname := baseType .Methods ().Slice ()[j ].Nname .(* ir.Name )
239
239
dictsym := MakeDictSym (baseNname .Sym (), t .RParams (), true )
240
240
if dictsym .Def == nil {
@@ -255,6 +255,8 @@ func (p *crawler) checkForFullyInst(t *types.Type) {
255
255
ImportedBody (methNode .Func )
256
256
methNode .Func .SetExportInline (true )
257
257
}
258
+ // Make sure that any associated types are also exported. (See #52279)
259
+ p .checkForFullyInst (tmethod .Type )
258
260
}
259
261
}
260
262
Original file line number Diff line number Diff line change
1
+ package lib
2
+
3
+ type FMap [K comparable , V comparable ] map [K ]V
4
+
5
+ //go:noinline
6
+ func (m FMap [K , V ]) Flip () FMap [V , K ] {
7
+ out := make (FMap [V , K ])
8
+ return out
9
+ }
10
+
11
+ type MyType uint8
12
+
13
+ const (
14
+ FIRST MyType = 0
15
+ )
16
+
17
+ var typeStrs = FMap [MyType , string ]{
18
+ FIRST : "FIRST" ,
19
+ }
20
+
21
+ func (self MyType ) String () string {
22
+ return typeStrs [self ]
23
+ }
Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import "./lib"
4
+
5
+ func main () { lib .FIRST .String () }
Original file line number Diff line number Diff line change
1
+ // rundir
2
+
3
+ // Copyright 2022 The Go Authors. All rights reserved.
4
+ // Use of this source code is governed by a BSD-style
5
+ // license that can be found in the LICENSE file.
6
+
7
+ package ignored
You can’t perform that action at this time.
0 commit comments