Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #3025: Annotate nested types #3030

Merged

Conversation

ltrzesniewski
Copy link
Contributor

@ltrzesniewski ltrzesniewski commented Jul 1, 2023

Fixes #3025

Problem

Solution

  • Any comments on the approach taken, its consistency with surrounding code, etc.

Normally, AddTypeAnnotation is called right after ConvertTypeHelper in the ConvertType method:

AstType astType = ConvertTypeHelper(type);
AddTypeAnnotation(astType, type);

But in the case of nested types, ConvertTypeHelper calls itself recursively for declaring types, and therefore AddTypeAnnotation was never called for these nodes.

  • Which part of this PR is most in need of attention/improvement?

This is a very simple change.

  • At least one test covering the code changed

I couldn't find any existing unit tests which check for type annotations (ResolveResult), so I wasn't sure where to put this. If you'd like me to add a unit test, please tell me in which way you'd like for type annotations to be tested.

@siegfriedpammer siegfriedpammer merged commit fa98b3c into icsharpcode:master Jul 2, 2023
5 checks passed
@siegfriedpammer
Copy link
Member

Thank you for your contribution!

@ltrzesniewski ltrzesniewski deleted the annotate-nested-types branch July 2, 2023 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The outer class of a nested class is not clickable
2 participants