You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[severity:It bothers me. A fix would be nice]
I was working on a source generator and ran into a problem. I ended up minimally reproducing with no source generator at all determining it to be an IDE issue. Intellisense/IDE generates a "CS0229 Ambiguity between 'TestClass.Test2' and 'TestClass.Test2'" error when accessing a partial property on a class with a primary constructor, but compilation works with no errors and the code should not be ambiguous.
Problem occurs with the following requirements:
Must access the property in a different file than the class is declared. - If the definitions are in the same file as the property access, the issue does not occur
The class for the property must have a primary constructor - If using a regular constructor the issue does not occur
I've attached a minimal reproduction project, as well as showing it inline here since it is really small:
usingTest;publicclassProgram{publicProgram(TestClasstest,TestClass2test2){Console.WriteLine(test.Test);//#error version Compiler version: '4.12.0-3.24572.7 (dfa7fc6b)'. Language version: preview.Console.WriteLine(test.Test2);// CS0229 Ambiguity between 'TestClass.Test2' and 'TestClass.Test2'Console.WriteLine(test2.Test);Console.WriteLine(test2.Test2);// No Error}publicstaticvoidMain(){}}
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
The text was updated successfully, but these errors were encountered:
This issue has been moved from a ticket on Developer Community.
[severity:It bothers me. A fix would be nice]
I was working on a source generator and ran into a problem. I ended up minimally reproducing with no source generator at all determining it to be an IDE issue. Intellisense/IDE generates a "CS0229 Ambiguity between 'TestClass.Test2' and 'TestClass.Test2'" error when accessing a partial property on a class with a primary constructor, but compilation works with no errors and the code should not be ambiguous.
Problem occurs with the following requirements:
I've attached a minimal reproduction project, as well as showing it inline here since it is really small:
Original Comments
Feedback Bot on 31/12/2024, 08:23 AM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
The text was updated successfully, but these errors were encountered: