Skip to content

Doxygen will not generate class information for a C# class that contains certain string combinations #9736

Closed
@gvsoft3750

Description

@gvsoft3750

Doxygen fails to generate any class information for a class if the source file contains certain string combinations:

namespace MyNamespace
{
    public class MyClass
    {
        public string MyMethod()
        {
            return $"'{"''"}'"; // fails (class information is NOT generated)
        }
    }
}

When no class information is generated:

NoClassInfoGenerated

Here is what is expected:

ClassInfoGenerated

Replacing the above return statement with the following gives the results as described in the comment:

return $"'{"''"}'"; // fails (class information is NOT generated)
return $"'{"'"}'"; // fails (class information is NOT generated)
return $"'{""}'"; // okay (class information is generated)
return $"'{"''"}"; // okay (class information is generated)
return $"'{""}'"; // okay (class information is generated)

The original code where I discovered this issue looked like this:

returnValue = $"'{value.Replace("'", "''")}'";

I am using Doxygen v1.9.5 (obtained via download), on Windows 10, 64-bit

I was able to work around the problem in my original code by doing this:

string replaced = value.Replace("'", "''");
returnValue = $"'{replaced}'";

Dennis Jones

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions