go.tools: fix build

Missed a couple of places with previous CL.

R=adonovan
TBR=adonovan
CC=golang-dev
https://golang.org/cl/40850046
This commit is contained in:
Robert Griesemer 2013-12-17 16:21:23 -08:00
parent 74d33a9c33
commit 53dfbf8a00
2 changed files with 8 additions and 10 deletions

View File

@ -6,7 +6,6 @@ package typemap_test
// (e.g. all types generated by type-checking some body of real code). // (e.g. all types generated by type-checking some body of real code).
import ( import (
"go/ast"
"testing" "testing"
"code.google.com/p/go.tools/go/types" "code.google.com/p/go.tools/go/types"
@ -14,12 +13,12 @@ import (
) )
var ( var (
tStr = types.Typ[types.String] // string tStr = types.Typ[types.String] // string
tPStr1 = types.NewPointer(tStr) // *string tPStr1 = types.NewPointer(tStr) // *string
tPStr2 = types.NewPointer(tStr) // *string, again tPStr2 = types.NewPointer(tStr) // *string, again
tInt = types.Typ[types.Int] // int tInt = types.Typ[types.Int] // int
tChanInt1 = types.NewChan(ast.RECV, tInt) // <-chan int tChanInt1 = types.NewChan(types.RecvOnly, tInt) // <-chan int
tChanInt2 = types.NewChan(ast.RECV, tInt) // <-chan int, again tChanInt2 = types.NewChan(types.RecvOnly, tInt) // <-chan int, again
) )
func checkEqualButNotIdentical(t *testing.T, x, y types.Type, comment string) { func checkEqualButNotIdentical(t *testing.T, x, y types.Type, comment string) {

View File

@ -46,7 +46,6 @@ package interp
import ( import (
"fmt" "fmt"
"go/ast"
"go/token" "go/token"
"os" "os"
"reflect" "reflect"
@ -369,7 +368,7 @@ func visitInstr(fr *frame, instr ssa.Instruction) continuation {
} }
for _, state := range instr.States { for _, state := range instr.States {
var dir reflect.SelectDir var dir reflect.SelectDir
if state.Dir == ast.RECV { if state.Dir == types.RecvOnly {
dir = reflect.SelectRecv dir = reflect.SelectRecv
} else { } else {
dir = reflect.SelectSend dir = reflect.SelectSend
@ -390,7 +389,7 @@ func visitInstr(fr *frame, instr ssa.Instruction) continuation {
} }
r := tuple{chosen, recvOk} r := tuple{chosen, recvOk}
for i, st := range instr.States { for i, st := range instr.States {
if st.Dir == ast.RECV { if st.Dir == types.RecvOnly {
var v value var v value
if i == chosen && recvOk { if i == chosen && recvOk {
// No need to copy since send makes an unaliased copy. // No need to copy since send makes an unaliased copy.