File tree 4 files changed +44
-2
lines changed
src/cmd/compile/internal/typecheck 4 files changed +44
-2
lines changed Original file line number Diff line number Diff line change @@ -1222,12 +1222,14 @@ func (r *importReader) node() ir.Node {
1222
1222
switch op {
1223
1223
case ir .ODOT , ir .ODOTPTR , ir .ODOTINTER :
1224
1224
n .Selection = r .exoticField ()
1225
- case ir .ODOTMETH , ir .OCALLPART , ir .OMETHEXPR :
1225
+ case ir .OMETHEXPR :
1226
+ n = typecheckMethodExpr (n ).(* ir.SelectorExpr )
1227
+ case ir .ODOTMETH , ir .OCALLPART :
1226
1228
// These require a Lookup to link to the correct declaration.
1227
1229
rcvrType := expr .Type ()
1228
1230
typ := n .Type ()
1229
1231
n .Selection = Lookdot (n , rcvrType , 1 )
1230
- if op == ir .OCALLPART || op == ir . OMETHEXPR {
1232
+ if op == ir .OCALLPART {
1231
1233
// Lookdot clobbers the opcode and type, undo that.
1232
1234
n .SetOp (op )
1233
1235
n .SetType (typ )
Original file line number Diff line number Diff line change
1
+ // Copyright 2021 The Go Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style
3
+ // license that can be found in the LICENSE file.
4
+
5
+ package a
6
+
7
+ type T1 struct {
8
+ * T2
9
+ }
10
+
11
+ type T2 struct {
12
+ }
13
+
14
+ func (t2 * T2 ) M () {
15
+ }
16
+
17
+ func F () {
18
+ f (T1 .M )
19
+ }
20
+
21
+ func f (f func (T1 )) {
22
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright 2021 The Go Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style
3
+ // license that can be found in the LICENSE file.
4
+
5
+ package b
6
+
7
+ import "a"
8
+
9
+ func F () {
10
+ a .F ()
11
+ }
Original file line number Diff line number Diff line change
1
+ // compiledir
2
+
3
+ // Copyright 2021 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