From 65e21d78731ae5825b3921a870221fbc8fdeee67 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 28 Jul 2022 11:49:34 +0000 Subject: [main] Update dependencies from dotnet/arcade (#2884) [main] Update dependencies from dotnet/arcade - Bump to 7.0 preview6 sdk Fixes the dotnet-format issue. - Use TryGetValue instead of ContainsKey for Dictionary Fixes "error CA1854: Prefer a 'TryGetValue' call over a Dictionary indexer access guarded by a 'ContainsKey' check to avoid double lookup" - Seal classes to fix CA1852 - Add 7.0 P6 runtime - Upgrade SDK to nightly Preview 7 to get a fix for dotnet test bug --- eng/Version.Details.xml | 8 +++--- eng/Versions.props | 2 +- eng/common/cross/build-rootfs.sh | 33 +++++++++++++--------- eng/common/cross/toolchain.cmake | 30 ++++++++++++-------- eng/common/generate-locproject.ps1 | 14 ++++----- eng/common/generate-sbom-prep.ps1 | 2 ++ eng/common/generate-sbom-prep.sh | 12 ++++++++ eng/common/init-tools-native.ps1 | 4 ++- eng/common/native/init-compiler.sh | 2 +- eng/common/tools.ps1 | 2 +- global.json | 6 ++-- src/analyzer/LinkerAnalyzerCore/DependencyGraph.cs | 4 +-- src/analyzer/LinkerAnalyzerCore/SpaceAnalyzer.cs | 11 ++++---- .../TestCaseGenerator.cs | 4 +-- .../TestCaseCompilation.cs | 4 +-- test/ILLink.RoslynAnalyzer.Tests/TestChecker.cs | 2 +- test/ILLink.RoslynAnalyzer.Tests/XmlText.cs | 2 +- .../Tests/DocumentationSignatureParserTests.cs | 2 +- .../Tests/TypeNameResolverTests.cs | 2 +- 19 files changed, 86 insertions(+), 60 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 634be9321..2628fbec5 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,14 +3,14 @@ - + https://github.com/dotnet/arcade - a264eb13fea14125f3ef8d4056586cd66fa55309 + 11672d906390046e77a34b6406d9e02229fd7e45 - + https://github.com/dotnet/arcade - a264eb13fea14125f3ef8d4056586cd66fa55309 + 11672d906390046e77a34b6406d9e02229fd7e45 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 4e31b891d..461201684 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -18,7 +18,7 @@ 5.0.0 17.0.0-preview-21267-01 17.0.0-preview-21267-01 - 7.0.0-beta.22327.2 + 7.0.0-beta.22372.1 6.0.0-beta.21271.1 3.10.0-2.final 4.3.0-1.22206.2 diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index 5a59dcff2..c8540474a 100755 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -5,7 +5,7 @@ set -e usage() { echo "Usage: $0 [BuildArch] [CodeName] [lldbx.y] [llvmx[.y]] [--skipunmount] --rootfsdir ]" - echo "BuildArch can be: arm(default), armel, arm64, x86" + echo "BuildArch can be: arm(default), armel, arm64, x86, x64" echo "CodeName - optional, Code name for Linux, can be: xenial(default), zesty, bionic, alpine, alpine3.13 or alpine3.14. If BuildArch is armel, LinuxCodeName is jessie(default) or tizen." echo " for FreeBSD can be: freebsd12, freebsd13" echo " for illumos can be: illumos." @@ -21,6 +21,9 @@ __CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) __InitialDir=$PWD __BuildArch=arm __AlpineArch=armv7 +__FreeBSDArch=arm +__FreeBSDMachineArch=armv7 +__IllumosArch=arm7 __QEMUArch=arm __UbuntuArch=armhf __UbuntuRepo="http://ports.ubuntu.com/" @@ -115,6 +118,8 @@ while :; do __UbuntuArch=arm64 __AlpineArch=aarch64 __QEMUArch=aarch64 + __FreeBSDArch=arm64 + __FreeBSDMachineArch=aarch64 ;; armel) __BuildArch=armel @@ -140,6 +145,14 @@ while :; do __UbuntuPackages=$(echo ${__UbuntuPackages} | sed 's/ libomp5//') unset __LLDB_Package ;; + x64) + __BuildArch=x64 + __UbuntuArch=amd64 + __FreeBSDArch=amd64 + __FreeBSDMachineArch=amd64 + __illumosArch=x86_64 + __UbuntuRepo= + ;; x86) __BuildArch=x86 __UbuntuArch=i386 @@ -205,11 +218,6 @@ while :; do __LLDB_Package="liblldb-6.0-dev" ;; tizen) - if [ "$__BuildArch" != "arm" ] && [ "$__BuildArch" != "armel" ] && [ "$__BuildArch" != "arm64" ] && [ "$__BuildArch" != "x86" ] ; then - echo "Tizen is available only for arm, armel, arm64 and x86." - usage; - exit 1; - fi __CodeName= __UbuntuRepo= __Tizen=tizen @@ -228,19 +236,16 @@ while :; do ;; freebsd12) __CodeName=freebsd - __BuildArch=x64 __SkipUnmount=1 ;; freebsd13) __CodeName=freebsd __FreeBSDBase="13.0-RELEASE" __FreeBSDABI="13" - __BuildArch=x64 __SkipUnmount=1 ;; illumos) __CodeName=illumos - __BuildArch=x64 __SkipUnmount=1 ;; --skipunmount) @@ -312,8 +317,8 @@ if [[ "$__CodeName" == "alpine" ]]; then elif [[ "$__CodeName" == "freebsd" ]]; then mkdir -p $__RootfsDir/usr/local/etc JOBS="$(getconf _NPROCESSORS_ONLN)" - wget -O - https://download.freebsd.org/ftp/releases/amd64/${__FreeBSDBase}/base.txz | tar -C $__RootfsDir -Jxf - ./lib ./usr/lib ./usr/libdata ./usr/include ./usr/share/keys ./etc ./bin/freebsd-version - echo "ABI = \"FreeBSD:${__FreeBSDABI}:amd64\"; FINGERPRINTS = \"${__RootfsDir}/usr/share/keys\"; REPOS_DIR = [\"${__RootfsDir}/etc/pkg\"]; REPO_AUTOUPDATE = NO; RUN_SCRIPTS = NO;" > ${__RootfsDir}/usr/local/etc/pkg.conf + wget -O - https://download.freebsd.org/ftp/releases/${__FreeBSDArch}/${__FreeBSDMachineArch}/${__FreeBSDBase}/base.txz | tar -C $__RootfsDir -Jxf - ./lib ./usr/lib ./usr/libdata ./usr/include ./usr/share/keys ./etc ./bin/freebsd-version + echo "ABI = \"FreeBSD:${__FreeBSDABI}:${__FreeBSDMachineArch}\"; FINGERPRINTS = \"${__RootfsDir}/usr/share/keys\"; REPOS_DIR = [\"${__RootfsDir}/etc/pkg\"]; REPO_AUTOUPDATE = NO; RUN_SCRIPTS = NO;" > ${__RootfsDir}/usr/local/etc/pkg.conf echo "FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly", mirror_type: \"srv\", signature_type: \"fingerprints\", fingerprints: \"${__RootfsDir}/usr/share/keys/pkg\", enabled: yes }" > ${__RootfsDir}/etc/pkg/FreeBSD.conf mkdir -p $__RootfsDir/tmp # get and build package manager @@ -335,7 +340,7 @@ elif [[ "$__CodeName" == "illumos" ]]; then echo "Building binutils. Please wait.." wget -O - https://ftp.gnu.org/gnu/binutils/binutils-2.33.1.tar.bz2 | tar -xjf - mkdir build-binutils && cd build-binutils - ../binutils-2.33.1/configure --prefix="$__RootfsDir" --target="x86_64-sun-solaris2.10" --program-prefix="x86_64-illumos-" --with-sysroot="$__RootfsDir" + ../binutils-2.33.1/configure --prefix="$__RootfsDir" --target="${__illumosArch}-sun-solaris2.10" --program-prefix="${__illumosArch}-illumos-" --with-sysroot="$__RootfsDir" make -j "$JOBS" && make install && cd .. echo "Building gcc. Please wait.." wget -O - https://ftp.gnu.org/gnu/gcc/gcc-8.4.0/gcc-8.4.0.tar.xz | tar -xJf - @@ -345,7 +350,7 @@ elif [[ "$__CodeName" == "illumos" ]]; then CFLAGS_FOR_TARGET="-fPIC" export CFLAGS CXXFLAGS CXXFLAGS_FOR_TARGET CFLAGS_FOR_TARGET mkdir build-gcc && cd build-gcc - ../gcc-8.4.0/configure --prefix="$__RootfsDir" --target="x86_64-sun-solaris2.10" --program-prefix="x86_64-illumos-" --with-sysroot="$__RootfsDir" --with-gnu-as \ + ../gcc-8.4.0/configure --prefix="$__RootfsDir" --target="${__illumosArch}-sun-solaris2.10" --program-prefix="${__illumosArch}-illumos-" --with-sysroot="$__RootfsDir" --with-gnu-as \ --with-gnu-ld --disable-nls --disable-libgomp --disable-libquadmath --disable-libssp --disable-libvtv --disable-libcilkrts --disable-libada --disable-libsanitizer \ --disable-libquadmath-support --disable-shared --enable-tls make -j "$JOBS" && make install && cd .. @@ -353,7 +358,7 @@ elif [[ "$__CodeName" == "illumos" ]]; then if [[ "$__UseMirror" == 1 ]]; then BaseUrl=http://pkgsrc.smartos.skylime.net fi - BaseUrl="$BaseUrl"/packages/SmartOS/2020Q1/x86_64/All + BaseUrl="$BaseUrl"/packages/SmartOS/2020Q1/${__illumosArch}/All echo "Downloading dependencies." read -ra array <<<"$__IllumosPackages" for package in "${array[@]}"; do diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake index eaeeab38f..d5dfc1350 100644 --- a/eng/common/cross/toolchain.cmake +++ b/eng/common/cross/toolchain.cmake @@ -48,11 +48,13 @@ elseif(TARGET_ARCH_NAME STREQUAL "arm64") set(CMAKE_SYSTEM_PROCESSOR aarch64) if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/aarch64-alpine-linux-musl) set(TOOLCHAIN "aarch64-alpine-linux-musl") - else() + elseif(LINUX) set(TOOLCHAIN "aarch64-linux-gnu") - endif() - if(TIZEN) - set(TIZEN_TOOLCHAIN "aarch64-tizen-linux-gnu/9.2.0") + if(TIZEN) + set(TIZEN_TOOLCHAIN "aarch64-tizen-linux-gnu/9.2.0") + endif() + elseif(FREEBSD) + set(triple "aarch64-unknown-freebsd12") endif() elseif(TARGET_ARCH_NAME STREQUAL "ppc64le") set(CMAKE_SYSTEM_PROCESSOR ppc64le) @@ -66,12 +68,18 @@ elseif(TARGET_ARCH_NAME STREQUAL "x86") if(TIZEN) set(TIZEN_TOOLCHAIN "i586-tizen-linux-gnu/9.2.0") endif() -elseif (FREEBSD) - set(CMAKE_SYSTEM_PROCESSOR "x86_64") - set(triple "x86_64-unknown-freebsd12") -elseif (ILLUMOS) - set(CMAKE_SYSTEM_PROCESSOR "x86_64") - set(TOOLCHAIN "x86_64-illumos") +elseif(TARGET_ARCH_NAME STREQUAL "x64") + set(CMAKE_SYSTEM_PROCESSOR x86_64) + if(LINUX) + set(TOOLCHAIN "x86_64-linux-gnu") + if(TIZEN) + set(TIZEN_TOOLCHAIN "x86_64-tizen-linux-gnu/9.2.0") + endif() + elseif(FREEBSD) + set(triple "x86_64-unknown-freebsd12") + elseif(ILLUMOS) + set(TOOLCHAIN "x86_64-illumos") + endif() else() message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, armv6, arm64, ppc64le, s390x and x86 are supported!") endif() @@ -218,7 +226,7 @@ endif() # Specify compile options -if((TARGET_ARCH_NAME MATCHES "^(arm|armv6|armel|arm64|ppc64le|s390x)$" AND NOT ANDROID) OR ILLUMOS) +if((TARGET_ARCH_NAME MATCHES "^(arm|armv6|armel|arm64|ppc64le|s390x)$" AND NOT ANDROID AND NOT FREEBSD) OR ILLUMOS) set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN}) diff --git a/eng/common/generate-locproject.ps1 b/eng/common/generate-locproject.ps1 index 25e97ac00..afdd17502 100644 --- a/eng/common/generate-locproject.ps1 +++ b/eng/common/generate-locproject.ps1 @@ -10,9 +10,7 @@ Param( Set-StrictMode -Version 2.0 $ErrorActionPreference = "Stop" -. $PSScriptRoot\tools.ps1 - -Import-Module -Name (Join-Path $PSScriptRoot 'native\CommonLibrary.psm1') +. $PSScriptRoot\pipeline-logging-functions.ps1 $exclusionsFilePath = "$SourcesDirectory\eng\Localize\LocExclusions.json" $exclusions = @{ Exclusions = @() } @@ -28,7 +26,7 @@ $jsonFiles = @() $jsonTemplateFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\.template\.config\\localize\\.+\.en\.json" } # .NET templating pattern $jsonTemplateFiles | ForEach-Object { $null = $_.Name -Match "(.+)\.[\w-]+\.json" # matches '[filename].[langcode].json - + $destinationFile = "$($_.Directory.FullName)\$($Matches.1).json" $jsonFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru } @@ -46,7 +44,7 @@ if ($allXlfFiles) { } $langXlfFiles | ForEach-Object { $null = $_.Name -Match "(.+)\.[\w-]+\.xlf" # matches '[filename].[langcode].xlf - + $destinationFile = "$($_.Directory.FullName)\$($Matches.1).xlf" $xlfFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru } @@ -59,7 +57,7 @@ $locJson = @{ LanguageSet = $LanguageSet LocItems = @( $locFiles | ForEach-Object { - $outputPath = "$(($_.DirectoryName | Resolve-Path -Relative) + "\")" + $outputPath = "$(($_.DirectoryName | Resolve-Path -Relative) + "\")" $continue = $true foreach ($exclusion in $exclusions.Exclusions) { if ($outputPath.Contains($exclusion)) @@ -108,10 +106,10 @@ else { if ((Get-FileHash "$SourcesDirectory\eng\Localize\LocProject-generated.json").Hash -ne (Get-FileHash "$SourcesDirectory\eng\Localize\LocProject.json").Hash) { Write-PipelineTelemetryError -Category "OneLocBuild" -Message "Existing LocProject.json differs from generated LocProject.json. Download LocProject-generated.json and compare them." - + exit 1 } else { Write-Host "Generated LocProject.json and current LocProject.json are identical." } -} \ No newline at end of file +} diff --git a/eng/common/generate-sbom-prep.ps1 b/eng/common/generate-sbom-prep.ps1 index a733a8885..3e5c1c74a 100644 --- a/eng/common/generate-sbom-prep.ps1 +++ b/eng/common/generate-sbom-prep.ps1 @@ -2,6 +2,8 @@ Param( [Parameter(Mandatory=$true)][string] $ManifestDirPath # Manifest directory where sbom will be placed ) +. $PSScriptRoot\pipeline-logging-functions.ps1 + Write-Host "Creating dir $ManifestDirPath" # create directory for sbom manifest to be placed if (!(Test-Path -path $ManifestDirPath)) diff --git a/eng/common/generate-sbom-prep.sh b/eng/common/generate-sbom-prep.sh index f6c774531..d5c76dc82 100644 --- a/eng/common/generate-sbom-prep.sh +++ b/eng/common/generate-sbom-prep.sh @@ -2,6 +2,18 @@ source="${BASH_SOURCE[0]}" +# resolve $SOURCE until the file is no longer a symlink +while [[ -h $source ]]; do + scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + source="$(readlink "$source")" + + # if $source was a relative symlink, we need to resolve it relative to the path where the + # symlink file was located + [[ $source != /* ]] && source="$scriptroot/$source" +done +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" +. $scriptroot/pipeline-logging-functions.sh + manifest_dir=$1 if [ ! -d "$manifest_dir" ] ; then diff --git a/eng/common/init-tools-native.ps1 b/eng/common/init-tools-native.ps1 index 24a5e65de..8d48ec568 100644 --- a/eng/common/init-tools-native.ps1 +++ b/eng/common/init-tools-native.ps1 @@ -87,6 +87,7 @@ try { $NativeTools.PSObject.Properties | ForEach-Object { $ToolName = $_.Name $ToolVersion = $_.Value + $InstalledTools = @{} if ((Get-Command "$ToolName" -ErrorAction SilentlyContinue) -eq $null) { if ($ToolVersion -eq "latest") { @@ -111,9 +112,10 @@ try { $ToolPath = Convert-Path -Path $BinPath Write-Host "Adding $ToolName to the path ($ToolPath)..." Write-Host "##vso[task.prependpath]$ToolPath" + $InstalledTools += @{ $ToolName = $ToolDirectory.FullName } } } - exit 0 + return $InstalledTools } else { $NativeTools.PSObject.Properties | ForEach-Object { $ToolName = $_.Name diff --git a/eng/common/native/init-compiler.sh b/eng/common/native/init-compiler.sh index 6d7ba15e5..4b99a9cad 100644 --- a/eng/common/native/init-compiler.sh +++ b/eng/common/native/init-compiler.sh @@ -71,7 +71,7 @@ if [[ -z "$CLR_CC" ]]; then # Set default versions if [[ -z "$majorVersion" ]]; then # note: gcc (all versions) and clang versions higher than 6 do not have minor version in file name, if it is zero. - if [[ "$compiler" == "clang" ]]; then versions=( 13 12 11 10 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 ) + if [[ "$compiler" == "clang" ]]; then versions=( 14 13 12 11 10 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 ) elif [[ "$compiler" == "gcc" ]]; then versions=( 12 11 10 9 8 7 6 5 4.9 ); fi for version in "${versions[@]}"; do diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index 395b43eeb..9638c63c7 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -635,7 +635,7 @@ function InitializeNativeTools() { InstallDirectory = "$ToolsDir" } } - if (Test-Path variable:NativeToolsOnMachine) { + if ($env:NativeToolsOnMachine) { Write-Host "Variable NativeToolsOnMachine detected, enabling native tool path promotion..." $nativeArgs += @{ PathPromotion = $true } } diff --git a/global.json b/global.json index b37a327bb..16833d974 100644 --- a/global.json +++ b/global.json @@ -1,14 +1,14 @@ { "sdk": { - "version": "7.0.100-preview.4.22252.9", + "version": "7.0.100-preview.7.22377.5", "allowPrerelease": true, "rollForward": "major" }, "tools": { - "dotnet": "7.0.100-preview.4.22252.9" + "dotnet": "7.0.100-preview.7.22377.5" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22327.2", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22372.1", "Microsoft.FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", "Microsoft.NET.Sdk.IL": "7.0.0-rc.1.22374.4" } diff --git a/src/analyzer/LinkerAnalyzerCore/DependencyGraph.cs b/src/analyzer/LinkerAnalyzerCore/DependencyGraph.cs index 787d47e8c..2507cae70 100644 --- a/src/analyzer/LinkerAnalyzerCore/DependencyGraph.cs +++ b/src/analyzer/LinkerAnalyzerCore/DependencyGraph.cs @@ -100,8 +100,8 @@ namespace LinkerAnalyzer.Core vertices.Add (vertex); indexes.Add (vertexName, index); string prefix = vertexName.Substring (0, vertexName.IndexOf (':')); - if (counts.ContainsKey (prefix)) - counts[prefix]++; + if (counts.TryGetValue (prefix, out var count)) + counts[prefix] = count + 1; else counts[prefix] = 1; //Console.WriteLine ("prefix " + prefix + " count " + counts[prefix]); diff --git a/src/analyzer/LinkerAnalyzerCore/SpaceAnalyzer.cs b/src/analyzer/LinkerAnalyzerCore/SpaceAnalyzer.cs index 21650f487..9d0d8577a 100644 --- a/src/analyzer/LinkerAnalyzerCore/SpaceAnalyzer.cs +++ b/src/analyzer/LinkerAnalyzerCore/SpaceAnalyzer.cs @@ -76,11 +76,12 @@ namespace LinkerAnalyzer.Core int GetMethodSize (MethodDefinition method) { var key = GetKey (method); + int msize; - if (sizes.ContainsKey (key)) - return sizes[key]; + if (sizes.TryGetValue (key, out msize)) + return msize; - var msize = method.Body.CodeSize; + msize = method.Body.CodeSize; msize += method.Name.Length; sizes.Add (key, msize); @@ -148,9 +149,7 @@ namespace LinkerAnalyzer.Core public int GetSize (VertexData vertex) { - if (sizes.ContainsKey (vertex.value)) - return sizes[vertex.value]; - return 0; + return sizes.TryGetValue (vertex.value, out var size) ? size : 0; } } } diff --git a/test/ILLink.RoslynAnalyzer.Tests.Generator/TestCaseGenerator.cs b/test/ILLink.RoslynAnalyzer.Tests.Generator/TestCaseGenerator.cs index a3753d49e..7ed577262 100644 --- a/test/ILLink.RoslynAnalyzer.Tests.Generator/TestCaseGenerator.cs +++ b/test/ILLink.RoslynAnalyzer.Tests.Generator/TestCaseGenerator.cs @@ -10,7 +10,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; namespace ILLink.RoslynAnalyzer.Tests { - class TestCases + sealed class TestCases { // Maps from suite name to a set of testcase names. // Suite name is: @@ -179,7 +179,7 @@ namespace {TestNamespace}{suiteNamespacePart} } } - class ExistingTestCaseDiscoverer : ISyntaxContextReceiver + sealed class ExistingTestCaseDiscoverer : ISyntaxContextReceiver { public readonly TestCases ExistingTestCases = new TestCases (); diff --git a/test/ILLink.RoslynAnalyzer.Tests/TestCaseCompilation.cs b/test/ILLink.RoslynAnalyzer.Tests/TestCaseCompilation.cs index aaa35beb9..e45d10a01 100644 --- a/test/ILLink.RoslynAnalyzer.Tests/TestCaseCompilation.cs +++ b/test/ILLink.RoslynAnalyzer.Tests/TestCaseCompilation.cs @@ -63,7 +63,7 @@ namespace ILLink.RoslynAnalyzer.Tests return (new CompilationWithAnalyzers (comp, SupportedDiagnosticAnalyzers, compWithAnalyzerOptions), comp.GetSemanticModel (src), exceptionDiagnostics); } - class SimpleAnalyzerOptions : AnalyzerConfigOptionsProvider + sealed class SimpleAnalyzerOptions : AnalyzerConfigOptionsProvider { public SimpleAnalyzerOptions ((string, string)[]? globalOptions) { @@ -81,7 +81,7 @@ namespace ILLink.RoslynAnalyzer.Tests public override AnalyzerConfigOptions GetOptions (AdditionalText textFile) => SimpleAnalyzerConfigOptions.Empty; - class SimpleAnalyzerConfigOptions : AnalyzerConfigOptions + sealed class SimpleAnalyzerConfigOptions : AnalyzerConfigOptions { public static readonly SimpleAnalyzerConfigOptions Empty = new SimpleAnalyzerConfigOptions (ImmutableDictionary.Empty); diff --git a/test/ILLink.RoslynAnalyzer.Tests/TestChecker.cs b/test/ILLink.RoslynAnalyzer.Tests/TestChecker.cs index 2c49d205c..750271099 100644 --- a/test/ILLink.RoslynAnalyzer.Tests/TestChecker.cs +++ b/test/ILLink.RoslynAnalyzer.Tests/TestChecker.cs @@ -16,7 +16,7 @@ using Xunit; namespace ILLink.RoslynAnalyzer.Tests { - internal class TestChecker : CSharpSyntaxWalker + internal sealed class TestChecker : CSharpSyntaxWalker { private readonly CSharpSyntaxTree _tree; private readonly SemanticModel _semanticModel; diff --git a/test/ILLink.RoslynAnalyzer.Tests/XmlText.cs b/test/ILLink.RoslynAnalyzer.Tests/XmlText.cs index 93557e74b..61d82465c 100644 --- a/test/ILLink.RoslynAnalyzer.Tests/XmlText.cs +++ b/test/ILLink.RoslynAnalyzer.Tests/XmlText.cs @@ -8,7 +8,7 @@ using Microsoft.CodeAnalysis.Text; namespace ILLink.RoslynAnalyzer.Tests { - class XmlText : AdditionalText + sealed class XmlText : AdditionalText { public override string Path { get; } diff --git a/test/Mono.Linker.Tests/Tests/DocumentationSignatureParserTests.cs b/test/Mono.Linker.Tests/Tests/DocumentationSignatureParserTests.cs index 52766fd47..7b442116c 100644 --- a/test/Mono.Linker.Tests/Tests/DocumentationSignatureParserTests.cs +++ b/test/Mono.Linker.Tests/Tests/DocumentationSignatureParserTests.cs @@ -12,7 +12,7 @@ using NUnit.Framework; namespace Mono.Linker.Tests { - class TestResolver : ITryResolveMetadata + sealed class TestResolver : ITryResolveMetadata { public static TestResolver Instance => new TestResolver (); diff --git a/test/Mono.Linker.Tests/Tests/TypeNameResolverTests.cs b/test/Mono.Linker.Tests/Tests/TypeNameResolverTests.cs index 8bda61089..de3759d46 100644 --- a/test/Mono.Linker.Tests/Tests/TypeNameResolverTests.cs +++ b/test/Mono.Linker.Tests/Tests/TypeNameResolverTests.cs @@ -83,6 +83,6 @@ namespace Mono.Linker.Tests Assert.IsNull (TypeParser.ParseTypeName (", System")); } - class GenericType { } + sealed class GenericType { } } } -- cgit v1.2.3