diff --git a/go-runtime/compile/build.go b/go-runtime/compile/build.go index 5e00e25ac..f9bc6204f 100644 --- a/go-runtime/compile/build.go +++ b/go-runtime/compile/build.go @@ -400,12 +400,10 @@ var scaffoldFuncs = scaffolder.FuncMap{ imports[path.Join("ftl", n.Module)] = "ftl" + n.Module for _, tp := range n.TypeParameters { - tpRef, err := schema.ParseRef(tp.String()) - if err != nil { - panic(err) - } - if tpRef.Module != "" && tpRef.Module != m.Name { - imports[path.Join("ftl", tpRef.Module)] = "ftl" + tpRef.Module + if tpRef, ok := tp.(*schema.Ref); ok { + if tpRef.Module != "" && tpRef.Module != m.Name { + imports[path.Join("ftl", tpRef.Module)] = "ftl" + tpRef.Module + } } } diff --git a/go-runtime/compile/testdata/go/two/two.go b/go-runtime/compile/testdata/go/two/two.go index 25ec35c6d..5c51c927d 100644 --- a/go-runtime/compile/testdata/go/two/two.go +++ b/go-runtime/compile/testdata/go/two/two.go @@ -2,6 +2,7 @@ package two import ( "context" + "ftl/builtin" "github.com/TBD54566975/ftl/go-runtime/ftl" lib "github.com/TBD54566975/ftl/go-runtime/schema/testdata" @@ -114,3 +115,8 @@ func superTransitiveVerbCall(ctx context.Context, req Payload[string]) error { _, err := ftl.Call(ctx, Three, req) return err } + +//ftl:verb export +func CatchArray(ctx context.Context, req builtin.CatchRequest[[]TwoEnum]) error { + return nil +}