aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/reflect
diff options
context:
space:
mode:
authorDamian Gryski <[email protected]>2023-03-24 11:33:57 -0700
committerRon Evans <[email protected]>2023-03-30 21:10:54 +0200
commit017ab4c352b2cfacfb0cfcf4ab38505797017f6a (patch)
treed31c0313c2ebb78189e0d6973febee53530f3bed /src/reflect
parent181d2ad2b46aaf5fd48e487405560191b83e45b1 (diff)
downloadtinygo-017ab4c352b2cfacfb0cfcf4ab38505797017f6a.tar.gz
tinygo-017ab4c352b2cfacfb0cfcf4ab38505797017f6a.zip
reflect: fix TestCanSetField
Diffstat (limited to 'src/reflect')
-rw-r--r--src/reflect/value.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/reflect/value.go b/src/reflect/value.go
index ccdd427cf..f0b4c3903 100644
--- a/src/reflect/value.go
+++ b/src/reflect/value.go
@@ -639,6 +639,9 @@ func (v Value) Field(i int) Value {
// The fact that PkgPath is present means that this field is not
// exported.
flags &^= valueFlagExported
+ } else {
+ // Parent field may not have been exported but we are
+ flags |= valueFlagExported
}
size := v.typecode.Size()