@@ -51,8 +51,10 @@ private void AddOperatorCall(IMethodSymbol method)
5151 )
5252 . FirstOrDefault ( ) ;
5353
54- // Creates a new generated expression with an implicit cast added, if needed.
55- public static Expression CreateGenerated ( Context cx , IExpressionParentEntity parent , int childIndex , ITypeSymbol type , object value ,
54+ /// <summary>
55+ /// Creates a new generated expression with an implicit conversion added.
56+ /// </summary>
57+ public static Expression CreateGeneratedConversion ( Context cx , IExpressionParentEntity parent , int childIndex , ITypeSymbol type , object value ,
5658 Extraction . Entities . Location location )
5759 {
5860 ExpressionInfo create ( ExprKind kind , string ? v ) =>
@@ -79,7 +81,27 @@ ExpressionInfo create(ExprKind kind, string? v) =>
7981 }
8082 }
8183
82- // Creates a new expression, adding casts as required.
84+ /// <summary>
85+ /// Creates a new generated cast expression.
86+ /// </summary>
87+ public static Expression CreateGenerated ( Context cx , IExpressionParentEntity parent , int childIndex , ITypeSymbol type , object value ,
88+ Extraction . Entities . Location location )
89+ {
90+ var info = new ExpressionInfo ( cx ,
91+ AnnotatedTypeSymbol . CreateNotAnnotated ( type ) ,
92+ location ,
93+ ExprKind . CAST ,
94+ parent ,
95+ childIndex ,
96+ true ,
97+ ValueAsString ( value ) ) ;
98+
99+ return new Expression ( info ) ;
100+ }
101+
102+ /// <summary>
103+ /// Creates a new expression, adding casts as required.
104+ /// </summary>
83105 public static Expression Create ( ExpressionNodeInfo info )
84106 {
85107 var resolvedType = info . ResolvedType ;
0 commit comments