@@ -51,8 +51,10 @@ private void AddOperatorCall(IMethodSymbol method)
51
51
)
52
52
. FirstOrDefault ( ) ;
53
53
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 ,
56
58
Extraction . Entities . Location location )
57
59
{
58
60
ExpressionInfo create ( ExprKind kind , string ? v ) =>
@@ -79,7 +81,27 @@ ExpressionInfo create(ExprKind kind, string? v) =>
79
81
}
80
82
}
81
83
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>
83
105
public static Expression Create ( ExpressionNodeInfo info )
84
106
{
85
107
var resolvedType = info . ResolvedType ;
0 commit comments