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

Fix FullParentName for types not in a root namespace #108

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Petezah
Copy link

@Petezah Petezah commented Oct 21, 2024

This was an issue I ran into while making a code generator. I didn't end up depending on this codepath, but thought it might still be useful to you or other users of the library. Unfortunately, I cannot remember how to repro the issue I was seeing.

@xoofx
Copy link
Owner

xoofx commented Nov 13, 2024

This was an issue I ran into while making a code generator. I didn't end up depending on this codepath, but thought it might still be useful to you or other users of the library. Unfortunately, I cannot remember how to repro the issue I was seeing.

Yeah, this part can be a bit messy to get right, and the halo effect could be annoying so I will keep this PR around for now until someone found a similar issue and provides a repro so that it can be investigated properly.

@cjkfdev
Copy link

cjkfdev commented Dec 31, 2024

I also hit this issue when parsing template type parameters defined in the STL. Here is a simple example that hits this issue:

#include <ratio>

template <typename T>
struct foo
{
    T bar;
};

foo<std::ratio<0, 1>> test;

and here is the exception stack trace:

Unhandled exception. System.NotImplementedException: Can not be here, not support type here!
   at CppAst.CppElement.get_FullParentName()
   at CppAst.CppClass.get_FullName()
   at CppAst.CppTemplateArgument.get_ArgString()
   at CppAst.CppTemplateArgument.ToString()
   at CppAst.CppClass.ToString()
   at System.IO.TextWriter.WriteLine(Object value)
   at System.IO.TextWriter.SyncTextWriter.WriteLine(Object value)
   at System.Console.WriteLine(Object value)
   at Program.<Main>$(String[] args) in Program.cs:line 48

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

Successfully merging this pull request may close these issues.

3 participants