Fixed handling of constants in parent type hierarchy

このコミットが含まれているのは:
Sergio Pedri committed 2021-01-10 22:49:36 +01:00
1 親 27438f7a69
コミット ad58397e1d
3ファイル変更
+21 -20

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

+5
ファイルの表示
@@ -473,6 +473,11 @@ namespace ComputeSharp.SourceGenerators.SyntaxRewriters
!this.constantDefinitions.ContainsKey(operation.Field))
{
this.constantDefinitions.Add(operation.Field, operation.Field.ConstantValue!.ToString());
var ownerTypeName = ((INamedTypeSymbol)operation.Field.ContainingSymbol).ToDisplayString().Replace(".", "__");
var constantName = $"__{ownerTypeName}__{operation.Field.Name}";
return IdentifierName(constantName);
}
return updatedNode;