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

Type aliasing and indirections #669

Open
HGuillemet opened this issue Apr 8, 2023 · 0 comments
Open

Type aliasing and indirections #669

HGuillemet opened this issue Apr 8, 2023 · 0 comments

Comments

@HGuillemet
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants