bytedeco / javacpp

The missing bridge between Java and native C++
Other
4.46k stars 581 forks source link

Type aliasing and indirections #669

Open HGuillemet opened 1 year ago

HGuillemet commented 1 year ago
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:

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.