mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 03:27:48 +00:00
compiler: fix crash with linked lists in interfaces
This commit fixes the following issue: https://github.com/tinygo-org/tinygo/issues/309 Also, it prepares for some other reflect-related changes that should make it easier to add support for named types (etc.) in the future.
This commit is contained in:
committed by
Ron Evans
parent
a04db67ea9
commit
33dc4b5121
@@ -43,7 +43,16 @@ type interfaceMethodInfo struct {
|
||||
funcptr uintptr // bitcast from the actual function pointer
|
||||
}
|
||||
|
||||
type typecodeID struct{}
|
||||
type typecodeID struct {
|
||||
// Depending on the type kind of this typecodeID, this pointer is something
|
||||
// different:
|
||||
// * basic types: null
|
||||
// * named type: the underlying type
|
||||
// * interface: null
|
||||
// * chan/pointer/slice: the element type
|
||||
// * array/func/map/struct: TODO
|
||||
references *typecodeID
|
||||
}
|
||||
|
||||
// Pseudo type used before interface lowering. By using a struct instead of a
|
||||
// function call, this is simpler to reason about during init interpretation
|
||||
|
||||
Reference in New Issue
Block a user