Skip to content

Commit 6ed1211

Browse files
Update types needed in 4.8.0
1 parent 365302e commit 6ed1211

6 files changed

Lines changed: 8 additions & 8 deletions

File tree

CodeConverter/CSharp/CommonConversions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ public static ExpressionSyntax ThrowawayParameters(ExpressionSyntax invocable, i
674674
return SyntaxFactory.ParenthesizedLambdaExpression(parameters, SyntaxFactory.InvocationExpression(invocable));
675675
}
676676

677-
public static CSSyntax.ParameterListSyntax CreateParameterList(IEnumerable<SyntaxNode> ps)
677+
public static CSSyntax.ParameterListSyntax CreateParameterList(IEnumerable<CSSyntax.ParameterSyntax> ps)
678678
{
679679
return SyntaxFactory.ParameterList(SyntaxFactory.SeparatedList(ps));
680680
}

CodeConverter/CSharp/HandledEventsAnalysis.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private PropertyDeclarationSyntax GetDeclarationsForHandlingBaseMembers((EventCo
8585
var prop = (PropertyDeclarationSyntax) _commonConversions.CsSyntaxGenerator.Declaration(basePropertyEventSubscription.PropertyDetails.Property);
8686
var modifiers = prop.Modifiers.RemoveWhere(m => m.IsKind(SyntaxKind.VirtualKeyword)).Add(SyntaxFactory.Token(SyntaxKind.OverrideKeyword));
8787
//TODO Stash away methodwithandles in constructor that don't match any symbol from that type, to match here against base symbols
88-
return GetDeclarationsForFieldBackedProperty(basePropertyEventSubscription.HandledMethods, SyntaxFactory.List<SyntaxNode>(), modifiers,
88+
return GetDeclarationsForFieldBackedProperty(basePropertyEventSubscription.HandledMethods, SyntaxFactory.List<AttributeListSyntax>(), modifiers,
8989
prop.Type, prop.Identifier, SyntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, SyntaxFactory.BaseExpression(), ValidSyntaxFactory.IdentifierName(prop.Identifier)));
9090
}
9191

CodeConverter/CSharp/LambdaConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ private async Task<CSharpSyntaxNode> ConvertToFunctionDeclarationOrNullAsync(VBS
6767
// Could do: See if we can improve upon returning "object" for pretty much everything (which is what the symbols say)
6868
// I believe that in general, special VB functions such as MultiplyObject are designed to work the same as integer when given two integers for example.
6969
// If all callers currently pass an integer, perhaps it'd be more idiomatic in C# to specify "int", than to have Operators
70-
var paramsWithTypes = anonFuncOp.Symbol.Parameters.Select(p => CommonConversions.CsSyntaxGenerator.ParameterDeclaration(p));
70+
var paramsWithTypes = anonFuncOp.Symbol.Parameters.Select(p => (ParameterSyntax) CommonConversions.CsSyntaxGenerator.ParameterDeclaration(p));
7171

7272
var paramListWithTypes = param.WithParameters(SyntaxFactory.SeparatedList(paramsWithTypes));
7373
if (potentialAncestorDeclarationOperation is IFieldInitializerOperation fieldInit) {

CodeConverter/CSharp/MethodBodyExecutableStatementVisitor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ public override async Task<SyntaxList<StatementSyntax>> VisitForBlock(VBSyntax.F
611611
}
612612

613613

614-
var preLoopStatements = new List<SyntaxNode>();
614+
var preLoopStatements = new List<StatementSyntax>();
615615
var csToValue = await stmt.ToValue.AcceptAsync<ExpressionSyntax>(_expressionVisitor);
616616
csToValue = CommonConversions.TypeConversionAnalyzer.AddExplicitConversion(stmt.ToValue, csToValue?.SkipIntoParens(), forceTargetType: controlVarType);
617617

CodeConverter/CSharp/TypeConversionAnalyzer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,17 +242,17 @@ private CSSyntax.NameSyntax GetCommonDelegateTypeOrNull(VBSyntax.ExpressionSynta
242242
private CSSyntax.NameSyntax CreateCommonDelegateTypeSyntax(IMethodSymbol vbLambda)
243243
{
244244
var parameters = vbLambda.Parameters
245-
.Select(p => _csSyntaxGenerator.TypeExpression(p.Type));
245+
.Select(p => (TypeSyntax) _csSyntaxGenerator.TypeExpression(p.Type));
246246

247247
if (vbLambda.ReturnType.IsSystemVoid()) {
248248
return CreateType("Action", parameters);
249249
}
250250

251-
var typeExpression = _csSyntaxGenerator.TypeExpression(vbLambda.ReturnType);
251+
var typeExpression = (TypeSyntax) _csSyntaxGenerator.TypeExpression(vbLambda.ReturnType);
252252
return CreateType("Func", parameters.Concat(typeExpression));
253253
}
254254

255-
private static CSSyntax.NameSyntax CreateType(string baseTypeName, IEnumerable<SyntaxNode> parameters)
255+
private static CSSyntax.NameSyntax CreateType(string baseTypeName, IEnumerable<TypeSyntax> parameters)
256256
{
257257
var parameterList = SyntaxFactory.TypeArgumentList(SyntaxFactory.SeparatedList(parameters));
258258
if (!parameterList.Arguments.Any()) return ValidSyntaxFactory.IdentifierName(baseTypeName);

CodeConverter/VB/NodesVisitor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ public override VisualBasicSyntaxNode VisitEventDeclaration(CSSyntax.EventDeclar
657657
);
658658
} else {
659659
if ((int)LanguageVersion < 14) {
660-
var conditionalStatement = _vbSyntaxGenerator.IfStatement(
660+
var conditionalStatement = (StatementSyntax) _vbSyntaxGenerator.IfStatement(
661661
_vbSyntaxGenerator.ReferenceNotEqualsExpression(eventFieldIdentifier,
662662
_vbSyntaxGenerator.NullLiteralExpression()),
663663
SyntaxFactory.InvocationExpression(

0 commit comments

Comments
 (0)