We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Version Used: Version 17.7.0 Preview 1.0 [33603.545.main]
Steps to Reproduce:
using System.Collections.Generic; using System.Linq; public class Student(int id, string name, IEnumerable<decimal> grades) { public Student(int id, string name) : this(id, name, new List<decimal>()) { } public int Id => id; public string Name { get; set; } = name.Trim(); public decimal GPA => grades.Any() ? grades.Average() : 4.0m; }
Diagnostic Id: CA182
Expected Behavior: Does not offer to change to static.
Actual Behavior: For two of the three primary ctor parameters in the example, an offer is made to change to static. It is not clear why 2 of the 3.
The text was updated successfully, but these errors were encountered:
This is blocking hte ability for Roslyn to use primary constructors itself. Can you guys please prioritize this?
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Version Used: Version 17.7.0 Preview 1.0 [33603.545.main]
Steps to Reproduce:
Diagnostic Id: CA182
Expected Behavior: Does not offer to change to static.
Actual Behavior: For two of the three primary ctor parameters in the example, an offer is made to change to static. It is not clear why 2 of the 3.
The text was updated successfully, but these errors were encountered: