File tree Expand file tree Collapse file tree 3 files changed +20
-12
lines changed
Expand file tree Collapse file tree 3 files changed +20
-12
lines changed Original file line number Diff line number Diff line change 1+ package main
2+
3+ type original struct {
4+ Field string
5+ }
6+
7+ func main () {
8+ type alias original
9+ type alias2 alias
10+ var a = & alias2 {
11+ Field : "test" ,
12+ }
13+ println (a .Field )
14+ }
15+
16+ // Output:
17+ // test
Original file line number Diff line number Diff line change @@ -2662,10 +2662,7 @@ func compositeBinSlice(n *node) {
26622662func doCompositeBinStruct (n * node , hasType bool ) {
26632663 next := getExec (n .tnext )
26642664 value := valueGenerator (n , n .findex )
2665- typ := n .typ .rtype
2666- if n .typ .cat == ptrT || n .typ .cat == linkedT {
2667- typ = n .typ .val .rtype
2668- }
2665+ typ := baseType (n .typ ).rtype
26692666 child := n .child
26702667 if hasType {
26712668 child = n .child [1 :]
@@ -2729,10 +2726,7 @@ func destType(n *node) *itype {
27292726func doComposite (n * node , hasType bool , keyed bool ) {
27302727 value := valueGenerator (n , n .findex )
27312728 next := getExec (n .tnext )
2732- typ := n .typ
2733- if typ .cat == ptrT || typ .cat == linkedT {
2734- typ = typ .val
2735- }
2729+ typ := baseType (n .typ )
27362730 child := n .child
27372731 if hasType {
27382732 child = n .child [1 :]
Original file line number Diff line number Diff line change @@ -1720,10 +1720,7 @@ func (t *itype) fieldIndex(name string) int {
17201720func (t * itype ) fieldSeq (seq []int ) * itype {
17211721 ft := t
17221722 for _ , i := range seq {
1723- if ft .cat == ptrT {
1724- ft = ft .val
1725- }
1726- ft = ft .field [i ].typ
1723+ ft = baseType (ft ).field [i ].typ
17271724 }
17281725 return ft
17291726}
You can’t perform that action at this time.
0 commit comments