Skip to content

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

@longyn

Description

@longyn
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions