Skip to content

Conversation

@gpanaitescu
Copy link
Contributor

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modifies the expression compiler to use explicit cast operators instead of safe cast operators (the as keyword) for location-compatible expressions. This change enables support for user-defined implicit cast operators, which are not invoked by the as operator but are properly handled by explicit cast syntax.

Changes:

  • Simplified FormatWithTypeCast to always use explicit cast syntax instead of conditionally choosing between safe cast and explicit cast
  • Removed helper methods CanUseSafeCastOperator, SafeCastText, and IsNullableValueType that are no longer needed
  • Added defensive null/empty check for expression text in FormatWithTypeCast

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…mplicit cast, to cover implicit cast operators (STUD-78703)
@gpanaitescu gpanaitescu force-pushed the fix/implicit_cast_operator_for_expressioncompiler branch from 96ba045 to 19c16a3 Compare January 21, 2026 10:23
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.

2 participants