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 @@ -2667,10 +2667,7 @@ func compositeBinSlice(n *node) {
26672667func doCompositeBinStruct (n * node , hasType bool ) {
26682668 next := getExec (n .tnext )
26692669 value := valueGenerator (n , n .findex )
2670- typ := n .typ .rtype
2671- if n .typ .cat == ptrT || n .typ .cat == linkedT {
2672- typ = n .typ .val .rtype
2673- }
2670+ typ := baseType (n .typ ).rtype
26742671 child := n .child
26752672 if hasType {
26762673 child = n .child [1 :]
@@ -2734,10 +2731,7 @@ func destType(n *node) *itype {
27342731func doComposite (n * node , hasType bool , keyed bool ) {
27352732 value := valueGenerator (n , n .findex )
27362733 next := getExec (n .tnext )
2737- typ := n .typ
2738- if typ .cat == ptrT || typ .cat == linkedT {
2739- typ = typ .val
2740- }
2734+ typ := baseType (n .typ )
27412735 child := n .child
27422736 if hasType {
27432737 child = n .child [1 :]
Original file line number Diff line number Diff line change @@ -1714,10 +1714,7 @@ func (t *itype) fieldIndex(name string) int {
17141714func (t * itype ) fieldSeq (seq []int ) * itype {
17151715 ft := t
17161716 for _ , i := range seq {
1717- if ft .cat == ptrT {
1718- ft = ft .val
1719- }
1720- ft = ft .field [i ].typ
1717+ ft = baseType (ft ).field [i ].typ
17211718 }
17221719 return ft
17231720}
You can’t perform that action at this time.
0 commit comments