Skip to content

Commit d6d0674

Browse files
committed
reflect: implement StructOf
This change exposes a facility to create new struct types from a slice of reflect.StructFields. - reflect: implement StructOf - reflect: tests for StructOf - runtime: generate typelinks for structs Fixes golang#5748. Change-Id: I3b8fd4fadd6ce3b1b922e284f0ae72a3a8e3ce44
1 parent 9406f68 commit d6d0674

File tree

3 files changed

+658
-2
lines changed

3 files changed

+658
-2
lines changed

src/cmd/internal/gc/reflect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,7 @@ ok:
12261226
break
12271227
}
12281228
fallthrough
1229-
case TARRAY, TCHAN, TFUNC, TMAP:
1229+
case TARRAY, TCHAN, TFUNC, TMAP, TSTRUCT:
12301230
slink := typelinksym(t)
12311231
dsymptr(slink, 0, s, 0)
12321232
ggloblsym(slink, int32(Widthptr), int8(dupok|obj.RODATA))

0 commit comments

Comments
 (0)