Interface inheritance and duplicate fields
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
No files, tests, or entry points are named. Start by tracing how C# interface inheritance is flattened during DTO generation, then determine where duplicate properties can be detected. Done means DTOs with duplicate flattened properties are rejected, including duplicates with different types or explicit interface implementations.
Written by the indexing model from the issue text.
Description
Since we support inheritance on the C# side, but want to convert it to "extension", we need to prevent the following case:
interface A { int PropA { get; set; } }
interface B { int PropA { get; set; } }
class C : A, B { public int PropA { get; set; } }
Currently, both A and B will have PropA. C won't, but it will extend both A and B and the resulting type will need to support both. That is wrong as we don't really know which PropA we are talking about. And if these two differ in type, e.g. when they are done like this:
interface A { int PropA { get; set; } }
interface B { string PropA { get; set; } }
class C : A, B { int A.PropA { get; set; } string B.PropA { get; set; } }
or like that
interface A { int PropA { get; set; } }
interface B { string PropA { get; set; } }
class M : A { public int PropA { get; set; } }
class C : M, B { new public string PropA { get; set; } }
we have totally undecidable case.
I suggest blocking this - i.e. when any DTO has a duplicate property when "flattened", reject it. What are your thoughts?
- Dominant language
- C#
- Stars
- 9
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from leancodepl/contractsgenerator
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 38/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
All issues in leancodepl/contractsgenerator
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100