diff --git a/go/types/typemap/typemap_test.go b/go/types/typemap/typemap_test.go index 70fcd48e..3eea5b58 100644 --- a/go/types/typemap/typemap_test.go +++ b/go/types/typemap/typemap_test.go @@ -6,7 +6,6 @@ package typemap_test // (e.g. all types generated by type-checking some body of real code). import ( - "go/ast" "testing" "code.google.com/p/go.tools/go/types" @@ -14,12 +13,12 @@ import ( ) var ( - tStr = types.Typ[types.String] // string - tPStr1 = types.NewPointer(tStr) // *string - tPStr2 = types.NewPointer(tStr) // *string, again - tInt = types.Typ[types.Int] // int - tChanInt1 = types.NewChan(ast.RECV, tInt) // <-chan int - tChanInt2 = types.NewChan(ast.RECV, tInt) // <-chan int, again + tStr = types.Typ[types.String] // string + tPStr1 = types.NewPointer(tStr) // *string + tPStr2 = types.NewPointer(tStr) // *string, again + tInt = types.Typ[types.Int] // int + tChanInt1 = types.NewChan(types.RecvOnly, tInt) // <-chan int + tChanInt2 = types.NewChan(types.RecvOnly, tInt) // <-chan int, again ) func checkEqualButNotIdentical(t *testing.T, x, y types.Type, comment string) { diff --git a/ssa/interp/interp.go b/ssa/interp/interp.go index 61d05030..b9be370b 100644 --- a/ssa/interp/interp.go +++ b/ssa/interp/interp.go @@ -46,7 +46,6 @@ package interp import ( "fmt" - "go/ast" "go/token" "os" "reflect" @@ -369,7 +368,7 @@ func visitInstr(fr *frame, instr ssa.Instruction) continuation { } for _, state := range instr.States { var dir reflect.SelectDir - if state.Dir == ast.RECV { + if state.Dir == types.RecvOnly { dir = reflect.SelectRecv } else { dir = reflect.SelectSend @@ -390,7 +389,7 @@ func visitInstr(fr *frame, instr ssa.Instruction) continuation { } r := tuple{chosen, recvOk} for i, st := range instr.States { - if st.Dir == ast.RECV { + if st.Dir == types.RecvOnly { var v value if i == chosen && recvOk { // No need to copy since send makes an unaliased copy.