Skip to content

fix: resolve itable member type dependencies for Value annotations#1650

Merged
ghaith merged 3 commits intomasterfrom
interface_multi_bug
Apr 2, 2026
Merged

fix: resolve itable member type dependencies for Value annotations#1650
ghaith merged 3 commits intomasterfrom
interface_multi_bug

Conversation

@ghaith
Copy link
Copy Markdown
Collaborator

@ghaith ghaith commented Mar 27, 2026

Previously, StatementAnnotation::Value only inserted a shallow Dependency::Datatype for the resulting type name without recursively resolving its member types via get_datatype_dependencies. This caused multi-file compilation to fail with ´Unknown type: __itable´ when a non-implementing FB that consumes an interface (holds it as a member, calls methods on it) was in a separate file from both the interface definition and any implementor.

The itable struct types and their function pointer members were never added to the dependency set for the consumer's compilation unit, so codegen could not find them.

This is the itable analogue of the vtable dependency fix in #1535.

Fixes #1649

Previously, StatementAnnotation::Value only inserted a shallow
Dependency::Datatype for the resulting type name without recursively
resolving its member types via get_datatype_dependencies. This caused
multi-file compilation to fail with 'Unknown type: ____itable_<I>_<M>'
when a non-implementing FB that consumes an interface (holds it as a
member, calls methods on it) was in a separate file from both the
interface definition and any implementor.

The itable struct types and their function pointer members were never
added to the dependency set for the consumer's compilation unit, so
codegen could not find them.

This is the itable analogue of the vtable dependency fix in #1535.

Fixes #1649
@ghaith ghaith requested review from mhasel and volsa March 27, 2026 13:02
@ghaith ghaith enabled auto-merge (squash) April 2, 2026 06:07
@ghaith ghaith merged commit ccd3a95 into master Apr 2, 2026
33 checks passed
@ghaith ghaith deleted the interface_multi_bug branch April 2, 2026 06:24
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.

Multi-file compilation fails when a non-implementing FB that consumes an interface is in its own file

2 participants