mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 12:03:41 +00:00
reflect: add reflect.TypeOf
This is the beginning of true reflection support in TinyGo.
This commit is contained in:
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
package main
|
||||
|
||||
import "reflect"
|
||||
|
||||
type myint int
|
||||
|
||||
func main() {
|
||||
println("matching types")
|
||||
println(reflect.TypeOf(int(3)) == reflect.TypeOf(int(5)))
|
||||
println(reflect.TypeOf(int(3)) == reflect.TypeOf(uint(5)))
|
||||
println(reflect.TypeOf(myint(3)) == reflect.TypeOf(int(5)))
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
matching types
|
||||
true
|
||||
false
|
||||
false
|
||||
Reference in New Issue
Block a user