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

The fixer for Y0002 does not do anything for generics #37

Open
xecrets opened this issue Jun 17, 2021 · 2 comments
Open

The fixer for Y0002 does not do anything for generics #37

xecrets opened this issue Jun 17, 2021 · 2 comments
Labels
bug Something isn't working code-fix needs-more-info

Comments

@xecrets
Copy link

xecrets commented Jun 17, 2021

Maybe this is a known limitation? var myList = Array.Empty<string>().ToList(); will suggest to use an explicit type, but the fixer does nothing, I'd hoped for a suggested change to List<string> myList = Array.Empty<string>().ToList(); .

(Yes one can argue that the type really is apparent here, but that's not the point. I just wanted a simple one-liner to demonstrate that the fixer doesn't do what I hoped).

@Youssef1313
Copy link
Owner

This is certainly a bug. Thanks for opening the issue @xecrets.

@Youssef1313 Youssef1313 added bug Something isn't working code-fix labels Jun 17, 2021
@Youssef1313
Copy link
Owner

@xecrets I just tested this. The behavior I'm seeing is different than your description:

image

The fixer does offer to use explicit type, but doesn't add imports, which is tracked by #31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working code-fix needs-more-info
Projects
None yet
Development

No branches or pull requests

2 participants