Add diagnostic for invalid 'this' expressions

このコミットが含まれているのは:
Sergio Pedri committed 2023-12-06 20:22:19 +01:00
1 親 b19ca68920
コミット b49e3365a4
5ファイル変更
+43

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

+13
ファイルの表示
@@ -872,4 +872,17 @@ partial class DiagnosticDescriptors
isEnabledByDefault: true,
description: "Only standalone constructors (with no base constructor declaration) can be used in a shader.",
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");
/// <summary>
/// Gets a <see cref="DiagnosticDescriptor"/> for a <see langword="this"/> expression.
/// </summary>
public static readonly DiagnosticDescriptor ThisExpression = new(
id: "CMPS0062",
title: "Invalid 'this' expression",
messageFormat: "A compute shader cannot use a 'this' expression outside of member accesses (such as 'this.field')",
category: "ComputeSharp.Shaders",
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true,
description: "A compute shader cannot use a 'this' expression outside of member accesses (such as 'this.field').",
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");
}