mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 03:27:48 +00:00
reflect: add support for struct types
This commit is contained in:
committed by
Ron Evans
parent
5012be337f
commit
e2c8654237
@@ -50,10 +50,20 @@ type typecodeID struct {
|
||||
// * named type: the underlying type
|
||||
// * interface: null
|
||||
// * chan/pointer/slice: the element type
|
||||
// * array/func/map/struct: TODO
|
||||
// * struct: GEP of structField array (to typecode field)
|
||||
// * array/func/map: TODO
|
||||
references *typecodeID
|
||||
}
|
||||
|
||||
// structField is used by the compiler to pass information to the interface
|
||||
// lowering pass. It is not used in the final binary.
|
||||
type structField struct {
|
||||
typecode *typecodeID // type of this struct field
|
||||
name *uint8 // pointer to char array
|
||||
tag *uint8 // pointer to char array, or nil
|
||||
embedded bool
|
||||
}
|
||||
|
||||
// Pseudo type used before interface lowering. By using a struct instead of a
|
||||
// function call, this is simpler to reason about during init interpretation
|
||||
// than a function call. Also, by keeping the method set around it is easier to
|
||||
|
||||
Reference in New Issue
Block a user