fix: do not panic when assigning to _ (blank) var.
Fix interp.isEmptyInterface to tolerate a nil type. Fixes #1619
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,6 +1,7 @@
|
||||
.*.swo
|
||||
.*.swp
|
||||
*.dot
|
||||
*.out
|
||||
.idea/
|
||||
/yaegi
|
||||
internal/cmd/extract/extract
|
||||
|
||||
9
_test/op10.go
Normal file
9
_test/op10.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
_ = 1 + 1
|
||||
println("ok")
|
||||
}
|
||||
|
||||
// Output:
|
||||
// ok
|
||||
10
_test/op11.go
Normal file
10
_test/op11.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
a, b := 1, 2
|
||||
_ = a + b
|
||||
println("ok")
|
||||
}
|
||||
|
||||
// Output:
|
||||
// ok
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user