fix: do not panic when assigning to _ (blank) var.

Fix interp.isEmptyInterface to tolerate a nil type.

Fixes #1619
This commit is contained in:
Marc Vertes
2024-04-02 19:18:03 +02:00
committed by GitHub
parent 9aa161f2da
commit 2c92a7c7ab
4 changed files with 21 additions and 1 deletions

View File

@@ -2393,7 +2393,7 @@ func isMap(t *itype) bool { return t.TypeOf().Kind() == reflect.Map }
func isPtr(t *itype) bool { return t.TypeOf().Kind() == reflect.Ptr }
func isEmptyInterface(t *itype) bool {
return t.cat == interfaceT && len(t.field) == 0
return t != nil && t.cat == interfaceT && len(t.field) == 0
}
func isGeneric(t *itype) bool {