Skip to content

fix(codegen): resolve inherited PROPERTY through derived FB instance (upstream #183) - #83

Merged
devin-ai-integration[bot] merged 2 commits into
developmentfrom
devin/upstream-183-inherited-property
Aug 4, 2026
Merged

fix(codegen): resolve inherited PROPERTY through derived FB instance (upstream #183)#83
devin-ai-integration[bot] merged 2 commits into
developmentfrom
devin/upstream-183-inherited-property

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Ports Autonomy-Logic/STruCpp PR Autonomy-Logic#183 to fix inherited PROPERTY access through derived FB instances.

What changed

  • Added fbExtendsMap to CodeGenerator and populated it while scanning FB declarations.
  • Updated resolvePropertyName() to walk the EXTENDS chain, so Derived.Val resolves to Base.Val and emits d.get_VAL() / d.set_VAL(...) instead of raw d.VAL (which fails C++ compilation because the field lives in the base class).
  • Added regression tests for single-level and multi-level inherited property access.

Conflict resolution

Our fork already used virtual public for interface implementations, so the upstream test expectation class WORKER : public IRUNNABLE was updated to virtual public IRUNNABLE. Our existing property VAR-block test was preserved alongside the new inherited-property tests.

Verification

  • npm run typecheck clean
  • npx eslint src/ --quiet clean
  • npx vitest run tests/backend/codegen-oop.test.ts — 65 tests passed
  • Full npm test and Struc-ToolTest1 downstream are running now.

Closes upstream Autonomy-Logic#182

Link to Devin session: https://app.devin.ai/sessions/01bd5a0c3ebc4e3a93e5228eb07cf11b
Requested by: @wattzor

strwthvn and others added 2 commits June 18, 2026 13:11
External access to a PROPERTY declared on a base FB, made through an
instance of a derived FB, emitted raw field access (inst.PROP) instead
of the accessor call (inst.get_PROP()/set_PROP()). The C++ failed to
compile while strucpp reported success; the error only surfaced at g++.

resolvePropertyName looked up only the exact type name and never walked
fb.extends, so DERIVED.VAL missed the map and fell through to raw .field
access. Methods were unaffected because a method call emits .NAME(),
valid via C++ public inheritance, regardless of the lookup.

Build an fbExtendsMap (FB -> parent) and walk the EXTENDS chain in
resolvePropertyName, consulting each ancestor in turn (with a visited
guard against cyclic inheritance). This fixes reads, writes, and chained
access, since all five call sites route through that one resolver.

Fixes Autonomy-Logic#182
…(upstream Autonomy-Logic#183)

Ports Autonomy-Logic/STruCpp PR Autonomy-Logic#183 to our fork with test-conflict resolution.

- Adds fbExtendsMap and walks the EXTENDS chain in resolvePropertyName.

- Preserved our virtual-public interface inheritance test expectations.

- Preserved our property VAR-block test while adding the inherited-property tests.

Closes upstream Autonomy-Logic#182

Co-Authored-By: Simon Atti <wattimedia@gmail.com>
@wattzor wattzor self-assigned this Aug 4, 2026
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration
devin-ai-integration Bot merged commit d7cf875 into development Aug 4, 2026
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.

2 participants