Fixed type mapping for return types

このコミットが含まれているのは:
Sergio Pedri committed 2021-02-23 02:16:36 +01:00
1 親 97d023387d
コミット ab43075351
3ファイル変更
+33 -1

検索条件に一致するファイルはありません

+5 -1
ファイルの表示
@@ -153,7 +153,9 @@ namespace ComputeSharp.SourceGenerators.SyntaxRewriters
{
this.currentMethod = node;
var updatedNode = (MethodDeclarationSyntax?)base.Visit(node);
var updatedNode = (MethodDeclarationSyntax?)base.Visit(node)!;
updatedNode = updatedNode.ReplaceAndTrackType(updatedNode.ReturnType, node!.ReturnType, this.semanticModel, this.discoveredTypes);
if (node!.Modifiers.Any(m => m.IsKind(SyntaxKind.AsyncKeyword)))
{
@@ -358,6 +360,8 @@ namespace ComputeSharp.SourceGenerators.SyntaxRewriters
.WithAttributeLists(List<AttributeListSyntax>())
.WithIdentifier(Identifier($"__{this.currentMethod!.Identifier.Text}__{node.Identifier.Text}"));
updatedNode = updatedNode.ReplaceAndTrackType(updatedNode.ReturnType, node!.ReturnType, this.semanticModel, this.discoveredTypes);
if (node.Modifiers.Any(m => m.IsKind(SyntaxKind.AsyncKeyword)))
{
this.context.ReportDiagnostic(AsyncModifierOnMethodOrFunction, node);