Skip to content

Commit

Permalink
fix: module stub for type aliases (#2191)
Browse files Browse the repository at this point in the history
  • Loading branch information
worstell authored Jul 29, 2024
1 parent d0f1370 commit 0e6ff0c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}}[
Expand Down
2 changes: 1 addition & 1 deletion go-runtime/schema/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 0e6ff0c

Please sign in to comment.