Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekseyTs committed Jan 8, 2023
1 parent 608c702 commit a102b6c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1924,7 +1924,7 @@ private BoundExpression BindNonMethod(SimpleNameSyntax node, Symbol symbol, Bind

if (primaryCtor is not null &&
(!IsInDeclaringTypeInstanceMember(primaryCtor) ||
(this.ContainingMember() is MethodSymbol { MethodKind: MethodKind.Constructor } contaningMember && (object)contaningMember != primaryCtor)) && // We are in a non-primary instance constructor
(this.ContainingMember() is MethodSymbol { MethodKind: MethodKind.Constructor } containingMember && (object)containingMember != primaryCtor)) && // We are in a non-primary instance constructor
!IsInsideNameof)
{
Error(diagnostics, ErrorCode.ERR_InvalidPrimaryConstructorParameterReference, node, parameter);
Expand Down Expand Up @@ -2039,8 +2039,8 @@ private bool IsInDeclaringTypeInstanceMember(SynthesizedPrimaryConstructor prima
{
return !(InParameterDefaultValue ||
InAttributeArgument ||
this.ContainingMember() is not { Kind: not SymbolKind.NamedType, IsStatic: false } contaningMember || // We are not in an instance member
(object)contaningMember.ContainingSymbol != primaryCtor.ContainingSymbol); // The member doesn't belong to our type, i.e. from nested type
this.ContainingMember() is not { Kind: not SymbolKind.NamedType, IsStatic: false } containingMember || // We are not in an instance member
(object)containingMember.ContainingSymbol != primaryCtor.ContainingSymbol); // The member doesn't belong to our type, i.e. from nested type
}

private bool ReportSimpleProgramLocalReferencedOutsideOfTopLevelStatement(SimpleNameSyntax node, Symbol symbol, BindingDiagnosticBag diagnostics)
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Portable/Binder/Binder_Invocation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1564,7 +1564,7 @@ private BoundExpression ReplaceTypeOrValueReceiver(BoundExpression receiver, boo
}
}

private BoundExpression GetValueExpressionIfTypeOrValueReceiver(BoundExpression receiver)
private static BoundExpression GetValueExpressionIfTypeOrValueReceiver(BoundExpression receiver)
{
if ((object)receiver == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ bool treatAsInstanceMemberAccess(
return treatAsInstanceMemberAccess;
}

// Follows the logic of BindQuery
bool checkQuery(QueryExpressionSyntax query, Binder enclosingBinder)
{
if (checkParameterReferencesInNode(query.FromClause.Expression, enclosingBinder))
Expand Down

0 comments on commit a102b6c

Please sign in to comment.