mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 02:27:48 +00:00
reflect: call decomposeInterface() directly in TypeOf()
This commit is contained in:
committed by
Damian Gryski
parent
584a2718d0
commit
a366c014c7
+2
-1
@@ -465,7 +465,8 @@ func (t *rawType) isNamed() bool {
|
||||
}
|
||||
|
||||
func TypeOf(i interface{}) Type {
|
||||
return ValueOf(i).typecode
|
||||
typecode, _ := decomposeInterface(i)
|
||||
return (*rawType)(typecode)
|
||||
}
|
||||
|
||||
func PtrTo(t Type) Type { return PointerTo(t) }
|
||||
|
||||
Reference in New Issue
Block a user