Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 27, 2025

This PR corrects the terminology used for CType throughout the Visual Basic documentation, changing references from "CType Function" to "CType Operator" and moves the documentation to the appropriate Operators section to align with the Visual Basic specification and compiler team guidance.

Background

According to the VB specification, CType is classified as a "cast expression" rather than a function. As confirmed by the compiler team (@AlekseyTs), the specification refers to these as "Cast Expressions" and states: "Three general cast keywords, CType, TryCast and DirectCast, coerce an expression into a type."

Changes Made

File Organization

  • Moved docs/visual-basic/language-reference/functions/ctype-function.md to docs/visual-basic/language-reference/operators/ctype-operator.md
  • Added redirection in .openpublishing.redirection.visual-basic.json to preserve external links

Documentation Structure

  • Updated table of contents to move CType from Functions section to Operators section (alphabetically placed)
  • Removed CType from functions index (docs/visual-basic/language-reference/functions/index.md)
  • Added CType to operators index (docs/visual-basic/language-reference/operators/index.md)

Cross-References

  • Updated 28 documentation files across language reference and programming guide sections
  • Fixed all relative references to point to the new location
  • Updated internal links within the CType documentation to reference functions correctly

Content Updates

  • Updated the main CType documentation file title and content to use "operator" terminology
  • Updated cross-references in DirectCast and TryCast operator documentation for consistency
  • Modified programming guide articles covering data types and conversions
  • Updated language reference files including data types, modifiers, and error messages
  • Updated procedure-related documentation that references CType

Build Warning Fixes

  • Fixed relative file links in 5 language reference files that were causing build warnings:
    • docs/visual-basic/language-reference/data-types/boolean-data-type.md
    • docs/visual-basic/language-reference/error-messages/latebound-overload-resolution-cannot-be-applied.md
    • docs/visual-basic/language-reference/keywords/conversion-summary.md
    • docs/visual-basic/language-reference/modifiers/narrowing.md
    • docs/visual-basic/language-reference/modifiers/widening.md

Validation

  • All changes maintain existing file URLs through redirections to avoid breaking external links
  • Cross-references verified to work correctly with new file location
  • Terminology is now consistent with DirectCast and TryCast operators
  • File structure properly organizes CType with other type conversion operators
  • Build warnings resolved for invalid file links

This change ensures the documentation accurately reflects the VB language specification while maintaining backward compatibility for existing links.

Fixes #16434.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


Internal previews

Toggle expand/collapse
📄 File 🔗 Preview link
docs/framework/data/adonet/sql/linq/basic-data-types.md docs/framework/data/adonet/sql/linq/basic-data-types
docs/visual-basic/language-reference/data-types/boolean-data-type.md docs/visual-basic/language-reference/data-types/boolean-data-type
docs/visual-basic/language-reference/error-messages/latebound-overload-resolution-cannot-be-applied.md docs/visual-basic/language-reference/error-messages/latebound-overload-resolution-cannot-be-applied
docs/visual-basic/language-reference/functions/conversion-functions.md docs/visual-basic/language-reference/functions/conversion-functions
docs/visual-basic/language-reference/functions/index.md docs/visual-basic/language-reference/functions/index
docs/visual-basic/language-reference/functions/type-conversion-functions.md docs/visual-basic/language-reference/functions/type-conversion-functions
docs/visual-basic/language-reference/keywords/conversion-summary.md docs/visual-basic/language-reference/keywords/conversion-summary
docs/visual-basic/language-reference/modifiers/narrowing.md docs/visual-basic/language-reference/modifiers/narrowing
docs/visual-basic/language-reference/modifiers/widening.md docs/visual-basic/language-reference/modifiers/widening
docs/visual-basic/language-reference/operators/ctype-operator.md docs/visual-basic/language-reference/operators/ctype-operator
docs/visual-basic/language-reference/operators/directcast-operator.md docs/visual-basic/language-reference/operators/directcast-operator
docs/visual-basic/language-reference/operators/trycast-operator.md docs/visual-basic/language-reference/operators/trycast-operator
docs/visual-basic/misc/bc30423.md docs/visual-basic/misc/bc30423
docs/visual-basic/misc/bc30512.md docs/visual-basic/misc/bc30512
docs/visual-basic/misc/bc30521.md docs/visual-basic/misc/bc30521
docs/visual-basic/misc/bc30741.md docs/visual-basic/misc/bc30741
docs/visual-basic/misc/bc30742.md docs/visual-basic/misc/bc30742
docs/visual-basic/misc/bc30753.md docs/visual-basic/misc/bc30753
docs/visual-basic/misc/bc30792.md docs/visual-basic/misc/bc30792
docs/visual-basic/misc/bc30793.md docs/visual-basic/misc/bc30793
docs/visual-basic/misc/bc30944.md docs/visual-basic/misc/bc30944
docs/visual-basic/misc/bc33038.md docs/visual-basic/misc/bc33038
docs/visual-basic/misc/bc36621.md docs/visual-basic/misc/bc36621
docs/visual-basic/programming-guide/language-features/data-types/how-to-convert-an-object-to-another-type.md docs/visual-basic/programming-guide/language-features/data-types/how-to-convert-an-object-to-another-type
docs/visual-basic/programming-guide/language-features/data-types/implicit-and-explicit-conversions.md docs/visual-basic/programming-guide/language-features/data-types/implicit-and-explicit-conversions
docs/visual-basic/programming-guide/language-features/data-types/troubleshooting-data-types.md docs/visual-basic/programming-guide/language-features/data-types/troubleshooting-data-types
docs/visual-basic/programming-guide/language-features/data-types/widening-and-narrowing-conversions.md docs/visual-basic/programming-guide/language-features/data-types/widening-and-narrowing-conversions
docs/visual-basic/programming-guide/language-features/procedures/how-to-use-a-class-that-defines-operators.md docs/visual-basic/programming-guide/language-features/procedures/how-to-use-a-class-that-defines-operators
docs/visual-basic/programming-guide/language-features/procedures/troubleshooting-procedures.md docs/visual-basic/programming-guide/language-features/procedures/troubleshooting-procedures
docs/visual-basic/toc.yml docs/visual-basic/toc

Note

This table shows preview links for the 30 files with the most changes. For preview links for other files in this PR, select OpenPublishing.Build Details within checks.

@dotnet-policy-service dotnet-policy-service bot added the okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. label Aug 27, 2025
Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] CType is referred to as a function. Isn't it an operator ? Update CType terminology from "Function" to "Operator" in Visual Basic documentation Aug 27, 2025
@Copilot Copilot AI requested a review from BillWagner August 27, 2025 20:10
Copilot finished work on behalf of BillWagner August 27, 2025 20:10
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ready for final review.

@BillWagner BillWagner marked this pull request as ready for review August 28, 2025 14:02
@BillWagner BillWagner requested a review from a team as a code owner August 28, 2025 14:02
@BillWagner BillWagner requested a review from adegeo August 28, 2025 14:02
@BillWagner
Copy link
Member

@copilot please address the comments from @gewarren

When you move the file, update https://github.com/dotnet/docs/blob/main/.openpublishing.redirection.visual-basic.json to add a redirection for the moved file.

Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 28, 2025

@copilot please address the comments from @gewarren

When you move the file, update https://github.com/dotnet/docs/blob/main/.openpublishing.redirection.visual-basic.json to add a redirection for t...

Completed all requested changes. Moved CType file to operators folder, updated TOC placement, added redirection entry, and updated all 28 cross-references throughout the documentation. Commit db56383

@Copilot Copilot AI changed the title Update CType terminology from "Function" to "Operator" in Visual Basic documentation Update CType terminology from "Function" to "Operator" and move to Operators section Aug 28, 2025
@Copilot Copilot AI requested a review from BillWagner August 28, 2025 20:03
Copilot finished work on behalf of BillWagner August 28, 2025 20:03
@BillWagner
Copy link
Member

BillWagner commented Aug 28, 2025

@copilot Can you address the build warnings:

Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 28, 2025

@copilot Can you address the build warnings:

Fixed the build warnings by updating the relative file links in the 5 affected files to correctly point to ../operators/ctype-operator.md. The issue was that after moving CType to the operators folder, the relative paths needed to be updated. Commit 3cc939c

Copilot finished work on behalf of BillWagner August 28, 2025 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data-access/subsvc dotnet-framework/svc dotnet-visualbasic/svc errors-warnings/subsvc okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CType is referred to as a function. Isn't it an operator ?
3 participants