fix(compiler): preserve proto package info in IR type lookup and validation#3523
Draft
BaldDemian wants to merge 1 commit intoapache:mainfrom
Draft
fix(compiler): preserve proto package info in IR type lookup and validation#3523BaldDemian wants to merge 1 commit intoapache:mainfrom
BaldDemian wants to merge 1 commit intoapache:mainfrom
Conversation
…dation Signed-off-by: Peiyang He <peiyang_he@smail.nju.edu.cn>
Contributor
Author
|
Current fix cannot handle some complex cases properly, still working on it |
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.
Why?
Current Fory compiler's translator and validator for protobuf cannot handle the package information correctly. All four newly-added test cases in
test_proto_frontend.pywould fail in the current version, despite they are all verified by protoc (should reject / should accept).What does this PR do?
Introduce a new
packagefield to theMessage,Enum, andUniontypes in the Fory IR AST. For.fbsand.fdlinputs, this field is alwaysNone. During protobuf translation, type looking-up and validation, the package information is utilized and enforced.Define testcases accordingly. Actually this fix is test-driven.
Related issues
N/A.
AI Contribution Checklist
yes/noyes, I included the standardizedAI Usage Disclosureblock below.yes, I can explain and defend all important changes without AI help.yes, I reviewed AI-assisted code changes line by line before submission.yes, I ran adequate human verification and recorded evidence (checks run locally or in CI, pass/fail summary, and confirmation I reviewed results).yes, I added/updated tests and specs where required.yes, I validated protocol/performance impacts with evidence when applicable.yes, I verified licensing and provenance compliance.AI Usage Disclosure
Does this PR introduce any user-facing change?
N/A.
Benchmark
N/A.