mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-11 22:43:40 +00:00
reflect: TypeOf(nil) should be nil
This commit is contained in:
@@ -313,6 +313,14 @@ func TestAddr(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestNilType(t *testing.T) {
|
||||
var a any = nil
|
||||
typ := TypeOf(a)
|
||||
if typ != nil {
|
||||
t.Errorf("Type of any{nil} is not nil")
|
||||
}
|
||||
}
|
||||
|
||||
func equal[T comparable](a, b []T) bool {
|
||||
if len(a) != len(b) {
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user