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) {
2667
2667
func doCompositeBinStruct (n * node , hasType bool ) {
2668
2668
next := getExec (n .tnext )
2669
2669
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
2674
2671
child := n .child
2675
2672
if hasType {
2676
2673
child = n .child [1 :]
@@ -2734,10 +2731,7 @@ func destType(n *node) *itype {
2734
2731
func doComposite (n * node , hasType bool , keyed bool ) {
2735
2732
value := valueGenerator (n , n .findex )
2736
2733
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 )
2741
2735
child := n .child
2742
2736
if hasType {
2743
2737
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 {
1714
1714
func (t * itype ) fieldSeq (seq []int ) * itype {
1715
1715
ft := t
1716
1716
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
1721
1718
}
1722
1719
return ft
1723
1720
}
You can’t perform that action at this time.
0 commit comments