Add 'RequireCSharpLanguageVersionPreviewAnalyzer'

このコミットが含まれているのは:
Sergio Pedri committed 2024-10-17 21:41:43 -07:00
1 親 afe8e1d93a
コミット f57bf4252a
7ファイル変更
+94 -4

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

+10
ファイルの表示
@@ -46,6 +46,16 @@ internal static class CompilationExtensions
return true;
}
/// <summary>
/// Checks whether a given compilation (assumed to be for C#) is using the preview language version.
/// </summary>
/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param>
/// <returns>Whether <paramref name="compilation"/> is using the preview language version.</returns>
public static bool IsLanguageVersionPreview(this Compilation compilation)
{
return ((CSharpCompilation)compilation).LanguageVersion == LanguageVersion.Preview;
}
/// <summary>
/// Checks whether the <c>AllowUnsafeBlocks</c> option is set for a given compilation.
/// </summary>