gopherjs/gopherjs — pull request #51 by cryptix (2014-06-17 08:44:48+00:00)
Title: First stab at the changed Value type

Hi,

there seems to be an issue with Go 1.3 rc2.

```
[cryptix@planc /tmp/25502f3063a6e5e538b6:master] gopherjs build main.go
./main.go:4:2: could not import fmt (/home/cryptix/go/src/github.com/gopherjs/gopherjs/compiler/natives/reflect/reflect.go:504:69: cannot use fl (variable of type flag) as uintptr value in struct literal)
./main.go:46:19: undeclared name: fmt
```

The problem (`cannot use fl (variable of type flag) as uintptr value in struct literal` which is raised [here](https://github.com/gopherjs/gopherjs/blob/master/compiler/natives/reflect/reflect.go#L504)) comes from the changed `Value` type in Go 1.3. The `val` field is gone and replaces with `ptr` and `scalar`. You might want to compare the [current](http://golang.org/src/pkg/reflect/value.go#L44) to the [tip](http://tip.golang.org/src/pkg/reflect/value.go#L44) version. I guess the whole thing is related to the changes to the GC outlined in the release notes [here](http://tip.golang.org/doc/go1.3#garbage_collector).

I tried the naive thing and changed every `v.val` to `v.ptr` and made the `Value` literals use the field names but then I hit this and ran out of time and mind-juice.
```
./main.go:4:2: could not import fmt (/mnt/fast/go/src/pkg/reflect/value.go:444:21: cannot assign methodReceiver(op, v, int(v.flag) >> flagMethodShift) (value of type unsafe.Pointer) to t (variable of type *rtype))
```

It might be wrong anyway since I'm not sure when to use the `scalar` field but I just wanted to share my findings so far.