mirror of
https://github.com/golang/go
synced 2024-11-18 20:04:52 -07:00
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:
parent
74d33a9c33
commit
53dfbf8a00
@ -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) {
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user