xoofx / xoofx/CppAst.NET

Issue parsing a class field which its type is a template class

Open
#44 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
C#
Stars
620
Forks
79
Avg merge
14h 27m
Merged PRs (30d)
1

Description

Hi,
Consider the following code:
class TemplateTesterClass
{
public:
TestTemplate a;
TestNamespace::TestTemplate2 b;
};

Field 'a' is parsed correctly, its type is fully available by using the Type.GetDisplayName() I get "TestTemplate", from which I can extract the "int".
However in field 'b' the parser reacts differently and I get only "TestTemplate2" from the parser by using the Type.GetDisplayName().
The difference is TestTemplate2 is in a namespace named "TestNamespace".

The problem is the type "int" for field 'b' is not available from the parser.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the shown TemplateTesterClass example and compare Type.GetDisplayName() for fields a and b. Trace how the parser handles the namespaced TestNamespace::TestTemplate2; done when field b retains its template argument and exposes int like field a.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, csharp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.