Skip to content

Commit

Permalink
fix: do not parse associated types as refs (#2504)
Browse files Browse the repository at this point in the history
fixes #2503
  • Loading branch information
matt2e authored Aug 27, 2024
1 parent 992d72c commit e309020
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 4 additions & 6 deletions go-runtime/compile/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

Expand Down
6 changes: 6 additions & 0 deletions go-runtime/compile/testdata/go/two/two.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}

0 comments on commit e309020

Please sign in to comment.