Skip to content

docs: fix XML comments that contradict the code - #36

Merged
rameel merged 2 commits into
mainfrom
docs/fix-contradicting-comments
Nov 19, 2026
Merged

rameel merged 2 commits into
mainfrom
docs/fix-contradicting-comments

Conversation

@rameel

@rameel rameel commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Several XML comments described behavior that the code does not have. This PR corrects them:

  • 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.

It also removes the <exception> tags from ReflectionExtensions.IsStatic and GetMemberType: exceptions are documented only on the helpers that exist to throw them, such as Error.Throw.

The new Expr.Unary examples were compiled and run against the library. DefaultBinder.BindToMethod still throws where the Binder contract promises null; that is left for a separate fix.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

rameel and others added 2 commits November 19, 2026 14:54
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>
@rameel
rameel merged commit fe9259b into main Nov 19, 2026
1 check passed
@rameel
rameel deleted the docs/fix-contradicting-comments branch November 19, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant