Address review comments from #33178 documented in comment stream in #33175#45454
Address review comments from #33178 documented in comment stream in #33175#45454gafter merged 2 commits intodotnet:masterfrom
Conversation
|
@AlekseyTs One of your comments from a previous review is addressed here. |
|
@AlekseyTs One of your comments from a previous review is addressed here. Would you please have a look? #Resolved |
|
|
||
| var compilation = CreateCompilation(source); | ||
| compilation.VerifyDiagnostics( | ||
| // (6,32): error CS0154: The property or indexer 'A' cannot be used in this context because it lacks the get accessor |
There was a problem hiding this comment.
The property or indexer 'A' cannot be used in this context because it lacks the get accessor [](start = 41, length = 92)
The error feels misleading, E is not a property and is not an indexer. #Closed
|
|
||
| var compilation = CreateCompilation(source); | ||
| compilation.VerifyDiagnostics( | ||
| // (6,32): error CS0154: The property or indexer 'B' cannot be used in this context because it lacks the get accessor |
There was a problem hiding this comment.
The property or indexer 'B' cannot be used in this context because it lacks the get accessor [](start = 41, length = 92)
Same comment. #Closed
| // (6,32): error CS0572: 'C': cannot reference a type through an expression; try 'D.C' instead | ||
| // _ = /*<bind>*/o is D { C: var c }/*</bind>*/; | ||
| Diagnostic(ErrorCode.ERR_BadTypeReference, "C").WithArguments("C", "D.C").WithLocation(6, 32), | ||
| // (6,32): error CS0154: The property or indexer 'C' cannot be used in this context because it lacks the get accessor |
There was a problem hiding this comment.
The property or indexer 'C' cannot be used in this context because it lacks the get accessor [](start = 41, length = 92)
Same comment #Closed
| Member: | ||
| IFieldReferenceOperation: System.Int32 D.X (Static) (OperationKind.FieldReference, Type: System.Int32, Constant: 3, IsInvalid) (Syntax: 'X') | ||
| Instance Receiver: | ||
| IInstanceReferenceOperation (ReferenceKind: PatternInput) (OperationKind.InstanceReference, Type: D, Constant: 3, IsInvalid, IsImplicit) (Syntax: 'X') |
There was a problem hiding this comment.
IInstanceReferenceOperation (ReferenceKind: PatternInput) (OperationKind.InstanceReference, Type: D, Constant: 3, IsInvalid, IsImplicit) (Syntax: 'X') [](start = 18, length = 150)
I think we are removing all synthesized receivers for static member references in the operation factory. It looks like this one should be dropped as well because it is not explicitly specified in syntax. #Closed
There was a problem hiding this comment.
See IFieldReference_StaticFieldInObjectInitializer_NoInstance unit-test, for example.
In reply to: 449143457 [](ancestors = 449143457)
| Member: | ||
| IFieldReferenceOperation: System.Int32 D.X (Static) (OperationKind.FieldReference, Type: System.Int32, IsInvalid) (Syntax: 'X') | ||
| Instance Receiver: | ||
| IInstanceReferenceOperation (ReferenceKind: PatternInput) (OperationKind.InstanceReference, Type: D, IsInvalid, IsImplicit) (Syntax: 'X') |
There was a problem hiding this comment.
IInstanceReferenceOperation (ReferenceKind: PatternInput) (OperationKind.InstanceReference, Type: D, IsInvalid, IsImplicit) (Syntax: 'X') [](start = 18, length = 137)
Should be dropped, I think. #Closed
| Member: | ||
| IPropertyReferenceOperation: System.Int32 D.X { get; } (Static) (OperationKind.PropertyReference, Type: System.Int32, IsInvalid) (Syntax: 'X') | ||
| Instance Receiver: | ||
| IInstanceReferenceOperation (ReferenceKind: PatternInput) (OperationKind.InstanceReference, Type: D, IsInvalid, IsImplicit) (Syntax: 'X') |
There was a problem hiding this comment.
IInstanceReferenceOperation (ReferenceKind: PatternInput) (OperationKind.InstanceReference, Type: D, IsInvalid, IsImplicit) (Syntax: 'X') [](start = 18, length = 137)
Should be dropped, I think. #Closed
|
Done with review pass (iteration 2) |
|
@AlekseyTs I have responded to your comments. Do you have any comments on the compiler changes implemented here or the tests covering them? Note that this PR is not intended to have any effect on the behavior of the compiler. |
Related to #33178 and #33175