return reflect.ValueOf(nil), errors.New("Too many arguments")
}
+ for i := 0; i < num; i++ {
+ if xt, targ := n[i].Type(), fn.Type().In(i); !xt.AssignableTo(targ) {
+ return reflect.ValueOf(nil), errors.New("called apply using " + xt.String() + " as type " + targ.String())
+ }
+ }
+
res := fn.Call(n)
if len(res) == 1 || res[1].IsNil() {
{"{{ slicestr \"000000\" 10}}", 2},
// Issue #1091
{"{{apply .C \"first\" 0 0 0}}", 2},
- {"{{seq 3e80}}", 2}} {
+ {"{{seq 3e80}}", 2},
+ // Issue #1095
+ {"{{apply .C \"urlize\" " +
+ "\".\"}}", 2}} {
templ := New()
d := &Data{