Repository navigation
docs: fix XML comments that contradict the code - #36
Merged
Merged
Conversation
Several XML comments described behavior that the code does not have: - The Expr.Unary.Deconstruct examples did not compile: they used the nonexistent UnaryType.Arithmetic and passed an Identifier as the operand. The Expr.Unary comments also mentioned an arithmetic unary type and documented ToString as returning -x instead of -(x). - ExprVisitor.Visit was described as dispatching on Expr.Kind, but it calls Expr.Accept. - Binder.BindToMember listed methods among the members it binds, although the expression builder can read only fields and properties. - ExprKind.Reference and Expr.Reference described references to variables and parameters, which the expression language does not have. - The Subparser remarks and README said that a + b + c is as deep as ((a + b) + c), although each pair of parentheses adds a level. - MethodResolver.ResolveMethod did not mention that it also returns null for an ambiguous match. - TypeUtils.FindConversionOperator did not say that it searches only the source type or when it returns null. - ReflectionExtensions.GetMemberType called the declared type of a member its runtime type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Exceptions are documented only on the helpers that exist to throw them, such as Error.Throw. IsStatic and GetMemberType documented the ArgumentException they throw for an unsupported member type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several XML comments described behavior that the code does not have. This PR corrects them:
Expr.Unary.Deconstructexamples did not compile: they used the nonexistentUnaryType.Arithmeticand passed anIdentifieras the operand. TheExpr.Unarycomments also mentioned an arithmetic unary type and documentedToStringas returning-xinstead of-(x).ExprVisitor.Visitwas described as dispatching onExpr.Kind, but it callsExpr.Accept.Binder.BindToMemberlisted methods among the members it binds, although the expression builder can read only fields and properties.ExprKind.ReferenceandExpr.Referencedescribed references to variables and parameters, which the expression language does not have.Subparserremarks and README said thata + b + cis as deep as((a + b) + c), although each pair of parentheses adds a level.MethodResolver.ResolveMethoddid not mention that it also returnsnullfor an ambiguous match.TypeUtils.FindConversionOperatordid not say that it searches only the source type or when it returnsnull.ReflectionExtensions.GetMemberTypecalled the declared type of a member its runtime type.It also removes the
<exception>tags fromReflectionExtensions.IsStaticandGetMemberType: exceptions are documented only on the helpers that exist to throw them, such asError.Throw.The new
Expr.Unaryexamples were compiled and run against the library.DefaultBinder.BindToMethodstill throws where theBindercontract promisesnull; that is left for a separate fix.Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com