Skip to content

Commit

Permalink
interp: fix setting interface objects from operators
Browse files Browse the repository at this point in the history
This is a follow-up of #1017, generalizing the use of reflect.Set
method to set, and possibly overwrite, the concrete value of
interface objects all accross the implementation of operators.
Previous optimized implementation for non-interface objects is
preserved.
  • Loading branch information
mvertes authored Feb 8, 2021
1 parent 2e17cfa commit ac80d1b
Show file tree
Hide file tree
Showing 4 changed files with 879 additions and 171 deletions.
13 changes: 13 additions & 0 deletions _test/interface50.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package main

func main() {
a := true
var b interface{} = 5
println(b.(int))
b = a == true
println(b.(bool))
}

// Output:
// 5
// true
188 changes: 123 additions & 65 deletions internal/cmd/genop/genop.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ac80d1b

Please sign in to comment.