Add a diagnostic for constructors with base constructors

このコミットが含まれているのは:
Sergio Pedri committed 2023-12-02 23:25:23 +01:00
1 親 4ec30767ce
コミット 7e7b57cd67
6ファイル変更
+75

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

+8
ファイルの表示
@@ -662,6 +662,14 @@ internal sealed partial class ShaderSourceRewriter : HlslSourceRewriter
return updatedNode;
}
// Chaining constructors is not supported, so emit a diagnostic to inform the user.
// The rest of the code will work as usual, but the semantics of the other chained
// constructor being invoked is not preserved, so the resulting code is not the same.
if (constructorNode.Initializer is not null)
{
Diagnostics.Add(InvalidBaseConstructorDeclaration, node, constructor);
}
ShaderSourceRewriter shaderSourceRewriter = new(
SemanticModel,
DiscoveredTypes,