Skip to content

fix(go): spell dependency type aliases as module types - #72

Merged
eunomie merged 1 commit into
dagger:mainfrom
eunomie:fix-dependency-struct-fields
Oct 16, 2026
Merged

eunomie merged 1 commit into
dagger:mainfrom
eunomie:fix-dependency-struct-fields

Conversation

@eunomie

@eunomie eunomie commented Oct 16, 2026

Copy link
Copy Markdown
Member

What

A private field typed with the global client's alias of a dependency type,
such as Go *dagger.Go // +private, failed dagger generate: the generated
code named the type through the dependency client package, which it does not
import ("expected declaration, found '%'", or undefined: <dep>).

Generation now keeps the alias spelling (dagger.Go) for object, enum and
interface types. A dependency type in the module's API now gets a clear
error: a module with a Dang entrypoint has no manifest dependencies, so the
engine cannot load such an API.

How verified

  • On v1.0.0-beta.18, a fixture with a private dependency field: generation
    failed before, and at this commit it generates, compiles and the functions
    return the dependency's values.
  • Unit tests: field spelling for five shapes, the exact refusal error, and
    the PetClient alias.

Not covered

A dependency type in the module's API stays unsupported, now with a clear error.

Walkthrough: https://gistpreview.github.io/?659b2d022bc1f5439730b69ecc75ca9e

A private field typed with the global client's alias of a dependency type
was qualified with the client package, which the generated code does not
import. The module's API cannot use such types; generation now says so.

Signed-off-by: Yves Brissaud <[email protected]>
@eunomie
eunomie merged commit ebaa280 into dagger:main Oct 16, 2026
9 checks passed
@eunomie
eunomie deleted the fix-dependency-struct-fields branch October 16, 2026 19:12
eunomie added a commit to eunomie/dagger that referenced this pull request Oct 20, 2026
dagger/go-sdk#72, dagger#73 and dagger#74 fix dependency type aliases, same-repo
clients in git workspaces and otel-go's genproto requirements.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/dagger that referenced this pull request Oct 21, 2026
dagger/go-sdk#72, dagger#73 and dagger#74 fix dependency type aliases, same-repo
clients in git workspaces and otel-go's genproto requirements.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/dagger that referenced this pull request Oct 22, 2026
dagger/go-sdk#72, dagger#73 and dagger#74 fix dependency type aliases, same-repo
clients in git workspaces and otel-go's genproto requirements.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/dagger that referenced this pull request Oct 22, 2026
dagger/go-sdk#72, dagger#73 and dagger#74 fix dependency type aliases, same-repo
clients in git workspaces and otel-go's genproto requirements.

Signed-off-by: Yves Brissaud <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant