Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: raw_struct will generate bad code when thrift has typedef #225

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wzekin
Copy link

@wzekin wzekin commented Aug 21, 2024

Description

raw_struct extension 增加一个新的 template Typedef 用于覆盖默认 template 中的 Typedef
其删除了默认 Typedef 中生成 NewStruct 的逻辑

Motivation and Context

问题:
如果 Thrift 中定义了 typedef A=B,在代码生成的过程中,默认 template 中的 Typedef 会为 A 生成 NewStruct 相关的 func,其会调用BNewStruct
但是如果使用了 raw_struct extension,thriftgo 并不会为 B 生成 NewStruct,导致编译失败。

Related Issue

@wzekin wzekin requested review from a team as code owners August 21, 2024 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants