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

有2层namespace时,生成代码出错 #392

Open
longyn opened this issue Jun 25, 2024 · 3 comments
Open

有2层namespace时,生成代码出错 #392

longyn opened this issue Jun 25, 2024 · 3 comments

Comments

@longyn
Copy link

longyn commented Jun 25, 2024

  • define.thrift
namespace cpp Net.Ping

struct PingData
{
  1: i32 src = 0;
  2: i32 dst;
  3: i32 payload;
}
  • ping.thrift
include "define.thrift"
// namespace of cpp code
namespace cpp Net.Ping

typedef define.PingData SPingData_t;

service TPingService
{
  void ping();

  i32 payload(1: define.PingData data);
}

生成代码如下:

  • ping.thrift.h
#pragma once
#include "srpc/rpc_thrift_idl.h"
#include "define.thrift.h"

namespace Net
{

namespace Ping
{

typedef Net::PingData SPingData_t;;
...

代码生成应为Net::Ping::PingData, 实际为Net::PingData, 只取了第一层namespace

@Barenboim
Copy link
Contributor

多谢报bug。我们修一下。

@Barenboim
Copy link
Contributor

#393
可以看一下这个修改。

@longyn
Copy link
Author

longyn commented Jun 26, 2024

@Barenboim 多谢快速回复,确认此修复有效

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

No branches or pull requests

2 participants