diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-25 16:20:03 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-25 16:20:03 +0000 |
commit | 4b786d35e0af0c254988199551709abef06b925e (patch) | |
tree | 5dfe28c3f573ae57b971ed4d9a1c99a76f0a70c4 /libgo/go/text/template/exec.go | |
parent | 2e6c5d723ff7407704f2cbd343383991b498fb5b (diff) | |
download | ppe42-gcc-4b786d35e0af0c254988199551709abef06b925e.tar.gz ppe42-gcc-4b786d35e0af0c254988199551709abef06b925e.zip |
libgo: Update to Go 1.0.2 release.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188943 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/text/template/exec.go')
-rw-r--r-- | libgo/go/text/template/exec.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libgo/go/text/template/exec.go b/libgo/go/text/template/exec.go index feb434a3be9..aba21ce28f5 100644 --- a/libgo/go/text/template/exec.go +++ b/libgo/go/text/template/exec.go @@ -518,6 +518,13 @@ func (s *state) validateType(value reflect.Value, typ reflect.Type) reflect.Valu } } if !value.Type().AssignableTo(typ) { + if value.Kind() == reflect.Interface && !value.IsNil() { + value = value.Elem() + if value.Type().AssignableTo(typ) { + return value + } + // fallthrough + } // Does one dereference or indirection work? We could do more, as we // do with method receivers, but that gets messy and method receivers // are much more constrained, so it makes more sense there than here. |