xoofx / xoofx/CppAst.NET

InclusionDirectives.Add throws on duplicate directive

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

Nobody has claimed this yet.

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

Description

In commit a8325cea1420031400942dd3a880500922227b1a, calling

rootContainer.InclusionDirectives.Add(inclusionDirective);

throws an exception if the directive is already present in the collection.

Expected Behavior:
Adding the same InclusionDirective multiple times should be ignored or handled gracefully.

Actual Behavior:
An exception is thrown when the directive already exists.

Thank you very much for this awesome library!

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 locating InclusionDirectives.Add and reproduce the duplicate-directive exception described in the issue. Add a regression test for adding the same InclusionDirective more than once, and consider the issue done when repeated additions no longer throw and the test passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
compilers
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.