Skip to content

Commit

Permalink
fix: allow non-FTL enums to exists in a module (#1748)
Browse files Browse the repository at this point in the history
fixes #1747
  • Loading branch information
matt2e authored Jun 12, 2024
1 parent b4357a2 commit 787aa4f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 1 addition & 2 deletions go-runtime/compile/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -949,9 +949,8 @@ func maybeVisitTypeEnumVariant(pctx *parseContext, node *ast.GenDecl, directives
return
}
typ := pctx.pkg.TypesInfo.TypeOf(t.Type)
if typeInterface, ok := typ.Underlying().(*types.Interface); ok {
if _, ok := typ.Underlying().(*types.Interface); ok {
// Type enums should not count as variants of themselves
pctx.enumInterfaces[t.Name.Name] = typeInterface
return
}

Expand Down
10 changes: 10 additions & 0 deletions go-runtime/compile/testdata/one/one.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,13 @@ func Http(ctx context.Context, req builtin.HttpRequest[Req]) (builtin.HttpRespon
type DataWithType[T any] struct {
Value T
}

type NonFTLInterface interface {
NonFTLInterface()
}

type NonFTLStruct struct {
Name string
}

func (NonFTLStruct) NonFTLInterface() {}

0 comments on commit 787aa4f

Please sign in to comment.