Skip to content

C#: Make TypeParameterConstraints a CachedEntity#7766

Merged
hvitved merged 1 commit intogithub:mainfrom
hvitved:csharp/extractor/type-param-constraints
Jan 28, 2022
Merged

C#: Make TypeParameterConstraints a CachedEntity#7766
hvitved merged 1 commit intogithub:mainfrom
hvitved:csharp/extractor/type-param-constraints

Conversation

@hvitved
Copy link
Contributor

@hvitved hvitved commented Jan 27, 2022

Extracted from #7456, in preparation for shared extraction.

@github-actions github-actions bot added the C# label Jan 27, 2022
@hvitved hvitved marked this pull request as ready for review January 27, 2022 14:26
@hvitved hvitved requested a review from a team as a code owner January 27, 2022 14:26
Copy link
Contributor

@michaelnebel michaelnebel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

public override void WriteId(EscapingTextWriter trapFile)
{
trapFile.WriteSubId(parent);
trapFile.Write(";typeparameterconstraints");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remind me, why this is needed (we are only doing this for entities and not fresh entities).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is to give a unique ID to the entity. If we simply did trapFile.WriteSubId(parent); it would overlap with the ID of the parent.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so the ID we write into the trap, is basically the same as the parent id except that we postfix it with ";typeparameterconstraints"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, exactly.

@hvitved hvitved merged commit 864b61a into github:main Jan 28, 2022
@hvitved hvitved deleted the csharp/extractor/type-param-constraints branch January 28, 2022 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants