WIP: alternative/follow-up to #5739 — flatten embedded interface method sets#5833
Closed
ltzmaxwell wants to merge 9 commits into
Closed
WIP: alternative/follow-up to #5739 — flatten embedded interface method sets#5833ltzmaxwell wants to merge 9 commits into
ltzmaxwell wants to merge 9 commits into
Conversation
…elling
Interface identity is the method set, so interface{ SAlias } must equal interface{ Stringer }; only struct embeds take the written name. Adds alias5 regression test. interface{ Stringer } != interface{ Str()string } stays (pre-existing; needs method-set flattening, see TODO).
Replaces gnolang#5739's minimal interface-embed fix: instead of naming embeds from the resolved type, flatten embedded interfaces into their method set at construction, so the embed name leaves the TypeID entirely. interface{Stringer} == interface{Str()string} now holds too, not just alias-vs-target. Consensus-breaking (anonymous-interface TypeIDs change); land with a chain upgrade.
Collaborator
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
Contributor
Author
|
Folded into #5739 — the flattening commit is now stacked there, so this standalone follow-up is redundant. Closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status: WIP / draft. Alternative to, and follow-up on, #5739. Stacked on
fix/alias_2; until that merges this PR's diff also shows #5739's commits — the net-new change here is the single commitfix(gnovm): flatten embedded interface method sets for type identity.#5739 makes embedded struct alias names take the written spelling (correct), and ships a minimal interface fix that only re-equalizes an embedded alias with its target (
interface{ SAlias } == interface{ Stringer }). This PR replaces that minimal interface fix with the deeper one.doOpInterfaceType,staticTypeFromAST), so the embedded-interface name leaves theTypeIDentirely. Interface identity becomes the flattened method set, matching Go.interface{ Stringer } == interface{ Str() string }(and embed-of-two vs methods-listed, diamond dedup) — not just the alias case.FindEmbeddedFieldType/VerifyImplementedByfor already-persisted (pre-upgrade) state, whoseMethodsare still unflattened.iface_embed_id.gno(embed-vs-explicit, alias-vs-target, diamond);alias5.gnoretained.Consensus-breaking, distinct from #5739's struct break: anonymous-interface
TypeIDs that embed other interfaces change. Must land with a chain upgrade.Verified:
Files -short,sdk/vm -run Gas,integration -run TestTestdataall green.