bytedeco/javacpp

Type aliasing and indirections

Open

#669 创建于 2023年4月8日

在 GitHub 查看
 (0 评论) (0 反应) (0 负责人)Java (620 fork)batch import
bughelp wanted

仓库指标

Star
 (4,279 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

namespace ns {
  struct M;
  using MPtr = std::shared_ptr<M>;
}


static public void f(ns::MPtr x) {}

In this example, f is parsed correctly as:

public static native @ByVal public f(@SharedPtr M x);

But if we add an info, for instance new Info("ns::M").purify(), then f becomes:

public static native @ByVal public f(@SharedPtr ns::M x);

Not something blocking, since we can force an additional info: new Info("ns::M").purify().pointerTypes("M"), but there may be something to fix here. Note that:

  • without the type aliasing, it works as expected.
  • the bug seems to show up for other indirections like M* instead of shared pointer.

I'm not sure how to fix that, maybe it's related to this line where valueTypes is given the value of typeName, which is a CPP name and not a Java name.

贡献者指南