Commit 72a11c57 authored by Austin Clements's avatar Austin Clements

Update asInterface now that 6g type switch is fixed.

R=rsc
APPROVED=rsc
DELTA=31  (0 added, 4 deleted, 27 changed)
OCL=34251
CL=34259
parent 0b3407e4
...@@ -57,34 +57,32 @@ func (a *expr) asMulti() (func(*Frame) []Value) { ...@@ -57,34 +57,32 @@ func (a *expr) asMulti() (func(*Frame) []Value) {
} }
func (a *expr) asInterface() (func(*Frame) interface{}) { func (a *expr) asInterface() (func(*Frame) interface{}) {
// TODO(rsc): Drop f from (f *Frame) in case labels
// after fixing 6g type switch bug.
switch sf := a.eval.(type) { switch sf := a.eval.(type) {
case func(f *Frame)bool: case func(*Frame)bool:
return func(f *Frame) interface{} { return sf(f) } return func(f *Frame) interface{} { return sf(f) }
case func(f *Frame)uint64: case func(*Frame)uint64:
return func(f *Frame) interface{} { return sf(f) } return func(f *Frame) interface{} { return sf(f) }
case func(f *Frame)int64: case func(*Frame)int64:
return func(f *Frame) interface{} { return sf(f) } return func(f *Frame) interface{} { return sf(f) }
case func(f *Frame)*bignum.Integer: case func(*Frame)*bignum.Integer:
return func(f *Frame) interface{} { return sf(f) } return func(f *Frame) interface{} { return sf(f) }
case func(f *Frame)float64: case func(*Frame)float64:
return func(f *Frame) interface{} { return sf(f) } return func(f *Frame) interface{} { return sf(f) }
case func(f *Frame)*bignum.Rational: case func(*Frame)*bignum.Rational:
return func(f *Frame) interface{} { return sf(f) } return func(f *Frame) interface{} { return sf(f) }
case func(f *Frame)string: case func(*Frame)string:
return func(f *Frame) interface{} { return sf(f) } return func(f *Frame) interface{} { return sf(f) }
case func(f *Frame)ArrayValue: case func(*Frame)ArrayValue:
return func(f *Frame) interface{} { return sf(f) } return func(f *Frame) interface{} { return sf(f) }
case func(f *Frame)StructValue: case func(*Frame)StructValue:
return func(f *Frame) interface{} { return sf(f) } return func(f *Frame) interface{} { return sf(f) }
case func(f *Frame)Value: case func(*Frame)Value:
return func(f *Frame) interface{} { return sf(f) } return func(f *Frame) interface{} { return sf(f) }
case func(f *Frame)Func: case func(*Frame)Func:
return func(f *Frame) interface{} { return sf(f) } return func(f *Frame) interface{} { return sf(f) }
case func(f *Frame)Slice: case func(*Frame)Slice:
return func(f *Frame) interface{} { return sf(f) } return func(f *Frame) interface{} { return sf(f) }
case func(f *Frame)Map: case func(*Frame)Map:
return func(f *Frame) interface{} { return sf(f) } return func(f *Frame) interface{} { return sf(f) }
default: default:
log.Crashf("unexpected expression node type %T at %v", a.eval, a.pos); log.Crashf("unexpected expression node type %T at %v", a.eval, a.pos);
......
...@@ -132,7 +132,7 @@ var data = Data { ...@@ -132,7 +132,7 @@ var data = Data {
const templateStr = ` const templateStr = `
// This file is machine generated by gen.go. // This file is machine generated by gen.go.
// 6g gen.go && 6l gen.6 && 6.out >expr1.go // 6g gen.go && 6l gen.6 && ./6.out >expr1.go
package eval package eval
...@@ -161,11 +161,9 @@ func (a *expr) asMulti() (func(*Frame) []Value) { ...@@ -161,11 +161,9 @@ func (a *expr) asMulti() (func(*Frame) []Value) {
} }
func (a *expr) asInterface() (func(*Frame) interface{}) { func (a *expr) asInterface() (func(*Frame) interface{}) {
// TODO(rsc): Drop f from (f *Frame) in case labels
// after fixing 6g type switch bug.
switch sf := a.eval.(type) { switch sf := a.eval.(type) {
«.repeated section Types» «.repeated section Types»
case func(f *Frame)«Native»: case func(*Frame)«Native»:
«.section IsIdeal» «.section IsIdeal»
return func(f *Frame) interface{} { return sf(f) } return func(f *Frame) interface{} { return sf(f) }
«.or» «.or»
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment