aboutsummaryrefslogtreecommitdiffhomepage
path: root/testdata
diff options
context:
space:
mode:
authorDamian Gryski <[email protected]>2023-03-08 12:28:51 -0800
committerAyke <[email protected]>2023-03-15 21:53:57 +0100
commit344e493ac8fa3a3f3bcfcd0ec91e237f01d01dc1 (patch)
treeacf992732b20db4e11c3da53c9b8ba507cd4dc16 /testdata
parent1626b50457c5941e6747b0da1f77aa311b91bda6 (diff)
downloadtinygo-344e493ac8fa3a3f3bcfcd0ec91e237f01d01dc1.tar.gz
tinygo-344e493ac8fa3a3f3bcfcd0ec91e237f01d01dc1.zip
compiler,reflect: fix pkgpath for struct fields
Diffstat (limited to 'testdata')
-rw-r--r--testdata/reflect.go1
-rw-r--r--testdata/reflect.txt15
2 files changed, 16 insertions, 0 deletions
diff --git a/testdata/reflect.go b/testdata/reflect.go
index f7c6616c4..1a92e47ab 100644
--- a/testdata/reflect.go
+++ b/testdata/reflect.go
@@ -481,6 +481,7 @@ func showValue(rv reflect.Value, indent string) {
for i := 0; i < rv.NumField(); i++ {
field := rt.Field(i)
println(indent+" field:", i, field.Name)
+ println(indent+" pkg:", field.PkgPath)
println(indent+" tag:", strconv.Quote(string(field.Tag)))
println(indent+" embedded:", field.Anonymous)
println(indent+" exported:", field.IsExported())
diff --git a/testdata/reflect.txt b/testdata/reflect.txt
index b8f93715c..e4a92a5e1 100644
--- a/testdata/reflect.txt
+++ b/testdata/reflect.txt
@@ -233,6 +233,7 @@ reflect type: struct
reflect type: struct
struct: 1
field: 0 error
+ pkg: main
tag: ""
embedded: true
exported: false
@@ -242,18 +243,21 @@ reflect type: struct
reflect type: struct
struct: 3
field: 0 a
+ pkg: main
tag: ""
embedded: false
exported: false
reflect type: uint8 caninterface=false
uint: 42
field: 1 b
+ pkg: main
tag: ""
embedded: false
exported: false
reflect type: int16 caninterface=false
int: 321
field: 2 c
+ pkg: main
tag: ""
embedded: false
exported: false
@@ -262,36 +266,42 @@ reflect type: struct
reflect type: struct comparable=false
struct: 5
field: 0 n
+ pkg: main
tag: "foo:\"bar\""
embedded: false
exported: false
reflect type: int caninterface=false
int: 5
field: 1 some
+ pkg: main
tag: "some\x00tag"
embedded: false
exported: false
reflect type: struct caninterface=false
struct: 2
field: 0 X
+ pkg:
tag: ""
embedded: false
exported: true
reflect type: int16 caninterface=false
int: -5
field: 1 Y
+ pkg:
tag: ""
embedded: false
exported: true
reflect type: int16 caninterface=false
int: 3
field: 2 zero
+ pkg: main
tag: ""
embedded: false
exported: false
reflect type: struct caninterface=false
struct: 0
field: 3 buf
+ pkg: main
tag: ""
embedded: false
exported: false
@@ -306,6 +316,7 @@ reflect type: struct comparable=false
reflect type: uint8 addrable=true caninterface=false
uint: 111
field: 4 Buf
+ pkg:
tag: ""
embedded: false
exported: true
@@ -322,6 +333,7 @@ reflect type: ptr
reflect type: struct settable=true addrable=true
struct: 2
field: 0 next
+ pkg: main
tag: "description:\"chain\""
embedded: false
exported: false
@@ -329,6 +341,7 @@ reflect type: ptr
pointer: false struct
nil: true
field: 1 foo
+ pkg: main
tag: ""
embedded: false
exported: false
@@ -337,12 +350,14 @@ reflect type: ptr
reflect type: struct
struct: 2
field: 0 A
+ pkg:
tag: ""
embedded: false
exported: true
reflect type: uintptr
uint: 2
field: 1 B
+ pkg:
tag: ""
embedded: false
exported: true