mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-11 06:23:39 +00:00
reflect: implement CanInterface and fix string Index()
This commit fixes two related issues:
1. CanInterface was unimplemented. It now uses the same check as is
used in Interface() itself.
This issue led to https://github.com/tinygo-org/tinygo/issues/3033
2. Allow making an interface out of a string char element.
Doing this in one commit (instead of two) because they are shown to be
correct with the same tests.
This commit is contained in:
committed by
Ron Evans
parent
edaf13f951
commit
e955aa1941
Vendored
+3
@@ -415,6 +415,9 @@ func showValue(rv reflect.Value, indent string) {
|
||||
if rv.CanAddr() {
|
||||
print(" addrable=true")
|
||||
}
|
||||
if !rv.CanInterface() {
|
||||
print(" caninterface=false")
|
||||
}
|
||||
if !rt.Comparable() {
|
||||
print(" comparable=false")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user