From c62b4feb730279f694d99cc0e8bcf953a123e5ba Mon Sep 17 00:00:00 2001 From: Elizabeth Worstell Date: Mon, 29 Jul 2024 12:37:31 -0700 Subject: [PATCH] fix: module stub for type aliases --- .../.ftl/go/modules/{{ .Module.Name }}/external_module.go.tmpl | 2 +- go-runtime/schema/common/common.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/go-runtime/compile/external-module-template/.ftl/go/modules/{{ .Module.Name }}/external_module.go.tmpl b/go-runtime/compile/external-module-template/.ftl/go/modules/{{ .Module.Name }}/external_module.go.tmpl index 577548dd4c..7288d73a1a 100644 --- a/go-runtime/compile/external-module-template/.ftl/go/modules/{{ .Module.Name }}/external_module.go.tmpl +++ b/go-runtime/compile/external-module-template/.ftl/go/modules/{{ .Module.Name }}/external_module.go.tmpl @@ -45,7 +45,7 @@ func ({{.Name|title}}) {{$enumInterfaceFuncName}}() {} {{- end}} {{- else if is "TypeAlias" .}} //ftl:typealias -type {{.Name|title}} {{typeAliasType $.Module .}} +type {{.Name|title}} = {{typeAliasType $.Module .}} {{- else if is "Data" .}} type {{.Name|title}} {{- if .TypeParameters}}[ diff --git a/go-runtime/schema/common/common.go b/go-runtime/schema/common/common.go index e650fb23ce..479f91e6b9 100644 --- a/go-runtime/schema/common/common.go +++ b/go-runtime/schema/common/common.go @@ -217,7 +217,7 @@ func IsPathInModule(pkg *types.Package, path string) bool { if err != nil { return false } - return strings.HasPrefix(path, "ftl/"+moduleName) + return pkg.Path() == path || strings.HasPrefix(path, "ftl/"+moduleName+"/") } // ExtractType extracts the schema type for the given node.