mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-09 13:33:39 +00:00
compiler, reflect: add support for named types
This commit is contained in:
committed by
Damian Gryski
parent
45f119de34
commit
7654d86d2c
@@ -213,6 +213,16 @@ func TestBytes(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestNamedTypes(t *testing.T) {
|
||||
type namedString string
|
||||
|
||||
named := namedString("foo")
|
||||
if got, want := TypeOf(named).Name(), "namedString"; got != want {
|
||||
t.Errorf("TypeOf.Name()=%v, want %v", got, want)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func equal[T comparable](a, b []T) bool {
|
||||
if len(a) != len(b) {
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user