repo_name
stringclasses
6 values
pr_number
int64
512
78.9k
pr_title
stringlengths
3
144
pr_description
stringlengths
0
30.3k
author
stringlengths
2
21
date_created
timestamp[ns, tz=UTC]
date_merged
timestamp[ns, tz=UTC]
previous_commit
stringlengths
40
40
pr_commit
stringlengths
40
40
query
stringlengths
17
30.4k
filepath
stringlengths
9
210
before_content
stringlengths
0
112M
after_content
stringlengths
0
112M
label
int64
-1
1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Setup/Installer/tools/install.ps1
[CmdletBinding(PositionalBinding=$false)] param ( [string][Alias("hive")]$rootSuffix = "" ) Set-StrictMode -version 2.0 $ErrorActionPreference="Stop" try { . (Join-Path $PSScriptRoot "utils.ps1") # Welcome Message Write-Host "Installing Roslyn Preview Build" -ForegroundColor Green # Find VS Instance $vsInstances = Get-VisualStudioInstances # We are given two strings per VS instance (vsdir and vsid) # Check to see if more than one instance meets our reqs if ($vsInstances.Count -gt 1) { while ($true) { Write-Host "Multiple Visual Studio instances detected" -ForegroundColor White Write-Host "Please select an instance to install into:" -ForegroundColor White for ($i=0; $i -lt $vsInstances.Length; $i++) { $devenvPath = Join-Path $vsInstances[$i].installationPath "Common7\IDE\devenv.exe" Write-Host "[$($i + 1)]: $devenvPath" -ForegroundColor White } $input = Read-Host $vsInstallNumber = $input -as [int] if (($vsInstallNumber -is [int]) -and ($vsInstallNumber -gt 0) -and ($vsInstallNumber -le $vsInstances.Length)) { $vsInstance = $vsInstances[$vsInstallNumber - 1] break } Write-Host "" } } else { $vsInstance = $vsInstances[0] } $vsDir = $vsInstance.installationPath.Trim("\") $vsId = $vsInstance.instanceId $vsMajorVersion = $vsInstance.installationVersion.Split(".")[0] $vsLocalDir = Get-VisualStudioLocalDir -vsMajorVersion $vsMajorVersion -vsId $vsId -rootSuffix $rootSuffix Stop-Processes $vsDir $vsLocalDir # Install VSIX $vsExe = Join-Path $vsDir "Common7\IDE\devenv.exe" Write-Host "Installing Preview into $vsExe" -ForegroundColor Gray Uninstall-VsixViaTool -vsDir $vsDir -vsId $vsId -rootSuffix $rootSuffix Install-VsixViaTool -vsDir $vsDir -vsId $vsId -rootSuffix $rootSuffix # Clear MEF Cache Write-Host "Refreshing MEF Cache" -ForegroundColor Gray $mefCacheFolder = Get-MefCacheDir $vsLocalDir if (Test-Path $mefCacheFolder) { Get-ChildItem -Path $mefCacheFolder -Include *.* -File -Recurse | foreach { Remove-Item $_ } } $args = "/updateconfiguration" Exec-Console $vsExe $args Write-Host "Install Succeeded" -ForegroundColor Green exit 0 } catch { Write-Host $_ -ForegroundColor Red Write-Host $_.Exception -ForegroundColor Red Write-Host $_.ScriptStackTrace -ForegroundColor Red exit 1 }
[CmdletBinding(PositionalBinding=$false)] param ( [string][Alias("hive")]$rootSuffix = "" ) Set-StrictMode -version 2.0 $ErrorActionPreference="Stop" try { . (Join-Path $PSScriptRoot "utils.ps1") # Welcome Message Write-Host "Installing Roslyn Preview Build" -ForegroundColor Green # Find VS Instance $vsInstances = Get-VisualStudioInstances # We are given two strings per VS instance (vsdir and vsid) # Check to see if more than one instance meets our reqs if ($vsInstances.Count -gt 1) { while ($true) { Write-Host "Multiple Visual Studio instances detected" -ForegroundColor White Write-Host "Please select an instance to install into:" -ForegroundColor White for ($i=0; $i -lt $vsInstances.Length; $i++) { $devenvPath = Join-Path $vsInstances[$i].installationPath "Common7\IDE\devenv.exe" Write-Host "[$($i + 1)]: $devenvPath" -ForegroundColor White } $input = Read-Host $vsInstallNumber = $input -as [int] if (($vsInstallNumber -is [int]) -and ($vsInstallNumber -gt 0) -and ($vsInstallNumber -le $vsInstances.Length)) { $vsInstance = $vsInstances[$vsInstallNumber - 1] break } Write-Host "" } } else { $vsInstance = $vsInstances[0] } $vsDir = $vsInstance.installationPath.Trim("\") $vsId = $vsInstance.instanceId $vsMajorVersion = $vsInstance.installationVersion.Split(".")[0] $vsLocalDir = Get-VisualStudioLocalDir -vsMajorVersion $vsMajorVersion -vsId $vsId -rootSuffix $rootSuffix Stop-Processes $vsDir $vsLocalDir # Install VSIX $vsExe = Join-Path $vsDir "Common7\IDE\devenv.exe" Write-Host "Installing Preview into $vsExe" -ForegroundColor Gray Uninstall-VsixViaTool -vsDir $vsDir -vsId $vsId -rootSuffix $rootSuffix Install-VsixViaTool -vsDir $vsDir -vsId $vsId -rootSuffix $rootSuffix # Clear MEF Cache Write-Host "Refreshing MEF Cache" -ForegroundColor Gray $mefCacheFolder = Get-MefCacheDir $vsLocalDir if (Test-Path $mefCacheFolder) { Get-ChildItem -Path $mefCacheFolder -Include *.* -File -Recurse | foreach { Remove-Item $_ } } $args = "/updateconfiguration" Exec-Console $vsExe $args Write-Host "Install Succeeded" -ForegroundColor Green exit 0 } catch { Write-Host $_ -ForegroundColor Red Write-Host $_.Exception -ForegroundColor Red Write-Host $_.ScriptStackTrace -ForegroundColor Red exit 1 }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./scripts/vscode-run-tests.ps1
param ( [Parameter(Mandatory = $true)][string]$filePath, [string]$msbuildEngine = "vs", [string]$framework = $null, [string]$filter = "" ) Set-StrictMode -version 3.0 $ErrorActionPreference = "Stop" . (Join-Path $PSScriptRoot "../eng/build-utils.ps1") # Run a build . (Join-Path $PSScriptRoot "./vscode-build.ps1") -filePath $filePath -framework $framework -msbuildEngine $msbuildEngine Write-Output "" $fileInfo = Get-ItemProperty $filePath $projectFileInfo = Get-ProjectFile $fileInfo if ($projectFileInfo) { $dotnetPath = Resolve-Path (Ensure-DotNetSdk) -Relative $projectDir = Resolve-Path $projectFileInfo.Directory -Relative $filterArg = if ($filter) { " --filter $filter" } else { "" } $logFilePrefix = if ($filter) { $fileInfo.Name } else { $projectFileInfo.Name } $frameworkArg = if ($framework) { " --framework $framework" } else { "" } $resultsPath = Join-Path $PSScriptRoot ".." "artifacts/TestResults" $resultsPath = Resolve-Path (New-Item -ItemType Directory -Force -Path $resultsPath) -Relative # Remove old run logs with the same prefix Remove-Item (Join-Path $resultsPath "$logFilePrefix*.html") -ErrorAction SilentlyContinue $invocation = "& `"$dotnetPath`" test $projectDir" + $filterArg + $frameworkArg + " --logger `"html;LogFilePrefix=$logfilePrefix`" --results-directory $resultsPath --no-build" Write-Output "> $invocation" Invoke-Expression $invocation exit 0 } else { Write-Host "Failed to run tests. $fileInfo is not part of a C# project." exit 1 }
param ( [Parameter(Mandatory = $true)][string]$filePath, [string]$msbuildEngine = "vs", [string]$framework = $null, [string]$filter = "" ) Set-StrictMode -version 3.0 $ErrorActionPreference = "Stop" . (Join-Path $PSScriptRoot "../eng/build-utils.ps1") # Run a build . (Join-Path $PSScriptRoot "./vscode-build.ps1") -filePath $filePath -framework $framework -msbuildEngine $msbuildEngine Write-Output "" $fileInfo = Get-ItemProperty $filePath $projectFileInfo = Get-ProjectFile $fileInfo if ($projectFileInfo) { $dotnetPath = Resolve-Path (Ensure-DotNetSdk) -Relative $projectDir = Resolve-Path $projectFileInfo.Directory -Relative $filterArg = if ($filter) { " --filter $filter" } else { "" } $logFilePrefix = if ($filter) { $fileInfo.Name } else { $projectFileInfo.Name } $frameworkArg = if ($framework) { " --framework $framework" } else { "" } $resultsPath = Join-Path $PSScriptRoot ".." "artifacts/TestResults" $resultsPath = Resolve-Path (New-Item -ItemType Directory -Force -Path $resultsPath) -Relative # Remove old run logs with the same prefix Remove-Item (Join-Path $resultsPath "$logFilePrefix*.html") -ErrorAction SilentlyContinue $invocation = "& `"$dotnetPath`" test $projectDir" + $filterArg + $frameworkArg + " --logger `"html;LogFilePrefix=$logfilePrefix`" --results-directory $resultsPath --no-build" Write-Output "> $invocation" Invoke-Expression $invocation exit 0 } else { Write-Host "Failed to run tests. $fileInfo is not part of a C# project." exit 1 }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./azure-pipelines-integration-lsp.yml
# Separate pipeline from normal integration CI to allow branches to change legs # Branches that trigger a build on commit trigger: - main - main-vs-deps - release/* - features/* - demos/* # Branches that are allowed to trigger a build via /azp run. # Automatic building of all PRs is disabled in the pipeline's trigger page. # See https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml#comment-triggers pr: - main - main-vs-deps - release/* - features/* - demos/* jobs: - job: VS_Integration_LSP pool: name: NetCorePublic-Pool queue: $(queueName) timeoutInMinutes: 135 steps: - template: eng/pipelines/test-integration-job.yml parameters: configuration: Debug oop64bit: true lspEditor: true
# Separate pipeline from normal integration CI to allow branches to change legs # Branches that trigger a build on commit trigger: - main - main-vs-deps - release/* - features/* - demos/* # Branches that are allowed to trigger a build via /azp run. # Automatic building of all PRs is disabled in the pipeline's trigger page. # See https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml#comment-triggers pr: - main - main-vs-deps - release/* - features/* - demos/* jobs: - job: VS_Integration_LSP pool: name: NetCorePublic-Pool queue: $(queueName) timeoutInMinutes: 135 steps: - template: eng/pipelines/test-integration-job.yml parameters: configuration: Debug oop64bit: true lspEditor: true
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/common/post-build/publish-using-darc.ps1
param( [Parameter(Mandatory=$true)][int] $BuildId, [Parameter(Mandatory=$true)][int] $PublishingInfraVersion, [Parameter(Mandatory=$true)][string] $AzdoToken, [Parameter(Mandatory=$true)][string] $MaestroToken, [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro-prod.westus2.cloudapp.azure.com', [Parameter(Mandatory=$true)][string] $WaitPublishingFinish, [Parameter(Mandatory=$false)][string] $EnableSourceLinkValidation, [Parameter(Mandatory=$false)][string] $EnableSigningValidation, [Parameter(Mandatory=$false)][string] $EnableNugetValidation, [Parameter(Mandatory=$false)][string] $PublishInstallersAndChecksums, [Parameter(Mandatory=$false)][string] $ArtifactsPublishingAdditionalParameters, [Parameter(Mandatory=$false)][string] $SymbolPublishingAdditionalParameters, [Parameter(Mandatory=$false)][string] $SigningValidationAdditionalParameters ) try { . $PSScriptRoot\post-build-utils.ps1 $darc = Get-Darc $optionalParams = [System.Collections.ArrayList]::new() if ("" -ne $ArtifactsPublishingAdditionalParameters) { $optionalParams.Add("--artifact-publishing-parameters") | Out-Null $optionalParams.Add($ArtifactsPublishingAdditionalParameters) | Out-Null } if ("" -ne $SymbolPublishingAdditionalParameters) { $optionalParams.Add("--symbol-publishing-parameters") | Out-Null $optionalParams.Add($SymbolPublishingAdditionalParameters) | Out-Null } if ("false" -eq $WaitPublishingFinish) { $optionalParams.Add("--no-wait") | Out-Null } if ("false" -ne $PublishInstallersAndChecksums) { $optionalParams.Add("--publish-installers-and-checksums") | Out-Null } if ("true" -eq $EnableNugetValidation) { $optionalParams.Add("--validate-nuget") | Out-Null } if ("true" -eq $EnableSourceLinkValidation) { $optionalParams.Add("--validate-sourcelinkchecksums") | Out-Null } if ("true" -eq $EnableSigningValidation) { $optionalParams.Add("--validate-signingchecksums") | Out-Null if ("" -ne $SigningValidationAdditionalParameters) { $optionalParams.Add("--signing-validation-parameters") | Out-Null $optionalParams.Add($SigningValidationAdditionalParameters) | Out-Null } } & $darc add-build-to-channel ` --id $buildId ` --publishing-infra-version $PublishingInfraVersion ` --default-channels ` --source-branch main ` --azdev-pat $AzdoToken ` --bar-uri $MaestroApiEndPoint ` --password $MaestroToken ` @optionalParams if ($LastExitCode -ne 0) { Write-Host "Problems using Darc to promote build ${buildId} to default channels. Stopping execution..." exit 1 } Write-Host 'done.' } catch { Write-Host $_ Write-PipelineTelemetryError -Category 'PromoteBuild' -Message "There was an error while trying to publish build '$BuildId' to default channels." ExitWithExitCode 1 }
param( [Parameter(Mandatory=$true)][int] $BuildId, [Parameter(Mandatory=$true)][int] $PublishingInfraVersion, [Parameter(Mandatory=$true)][string] $AzdoToken, [Parameter(Mandatory=$true)][string] $MaestroToken, [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro-prod.westus2.cloudapp.azure.com', [Parameter(Mandatory=$true)][string] $WaitPublishingFinish, [Parameter(Mandatory=$false)][string] $EnableSourceLinkValidation, [Parameter(Mandatory=$false)][string] $EnableSigningValidation, [Parameter(Mandatory=$false)][string] $EnableNugetValidation, [Parameter(Mandatory=$false)][string] $PublishInstallersAndChecksums, [Parameter(Mandatory=$false)][string] $ArtifactsPublishingAdditionalParameters, [Parameter(Mandatory=$false)][string] $SymbolPublishingAdditionalParameters, [Parameter(Mandatory=$false)][string] $SigningValidationAdditionalParameters ) try { . $PSScriptRoot\post-build-utils.ps1 $darc = Get-Darc $optionalParams = [System.Collections.ArrayList]::new() if ("" -ne $ArtifactsPublishingAdditionalParameters) { $optionalParams.Add("--artifact-publishing-parameters") | Out-Null $optionalParams.Add($ArtifactsPublishingAdditionalParameters) | Out-Null } if ("" -ne $SymbolPublishingAdditionalParameters) { $optionalParams.Add("--symbol-publishing-parameters") | Out-Null $optionalParams.Add($SymbolPublishingAdditionalParameters) | Out-Null } if ("false" -eq $WaitPublishingFinish) { $optionalParams.Add("--no-wait") | Out-Null } if ("false" -ne $PublishInstallersAndChecksums) { $optionalParams.Add("--publish-installers-and-checksums") | Out-Null } if ("true" -eq $EnableNugetValidation) { $optionalParams.Add("--validate-nuget") | Out-Null } if ("true" -eq $EnableSourceLinkValidation) { $optionalParams.Add("--validate-sourcelinkchecksums") | Out-Null } if ("true" -eq $EnableSigningValidation) { $optionalParams.Add("--validate-signingchecksums") | Out-Null if ("" -ne $SigningValidationAdditionalParameters) { $optionalParams.Add("--signing-validation-parameters") | Out-Null $optionalParams.Add($SigningValidationAdditionalParameters) | Out-Null } } & $darc add-build-to-channel ` --id $buildId ` --publishing-infra-version $PublishingInfraVersion ` --default-channels ` --source-branch main ` --azdev-pat $AzdoToken ` --bar-uri $MaestroApiEndPoint ` --password $MaestroToken ` @optionalParams if ($LastExitCode -ne 0) { Write-Host "Problems using Darc to promote build ${buildId} to default channels. Stopping execution..." exit 1 } Write-Host 'done.' } catch { Write-Host $_ Write-PipelineTelemetryError -Category 'PromoteBuild' -Message "There was an error while trying to publish build '$BuildId' to default channels." ExitWithExitCode 1 }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/common/templates/post-build/post-build.yml
parameters: # Which publishing infra should be used. THIS SHOULD MATCH THE VERSION ON THE BUILD MANIFEST. # Publishing V2 accepts optionally outlining the publishing stages - default is inline. # Publishing V3 DOES NOT accept inlining the publishing stages. publishingInfraVersion: 2 # When set to true the publishing templates from the repo will be used # otherwise Darc add-build-to-channel will be used to trigger the promotion pipeline inline: true # Only used if inline==false. When set to true will stall the current build until # the Promotion Pipeline build finishes. Otherwise, the current build will continue # execution concurrently with the promotion build. waitPublishingFinish: true BARBuildId: '' PromoteToChannelIds: '' enableSourceLinkValidation: false enableSigningValidation: true enableSymbolValidation: false enableNugetValidation: true publishInstallersAndChecksums: true SDLValidationParameters: enable: false continueOnError: false params: '' artifactNames: '' downloadArtifacts: true # These parameters let the user customize the call to sdk-task.ps1 for publishing # symbols & general artifacts as well as for signing validation symbolPublishingAdditionalParameters: '' artifactsPublishingAdditionalParameters: '' signingValidationAdditionalParameters: '' # Which stages should finish execution before post-build stages start validateDependsOn: - build publishDependsOn: - Validate # Channel ID's instantiated in this file. # When adding a new channel implementation the call to `check-channel-consistency.ps1` # needs to be updated with the new channel ID NetEngLatestChannelId: 2 NetEngValidationChannelId: 9 NetDev5ChannelId: 131 NetDev6ChannelId: 1296 GeneralTestingChannelId: 529 NETCoreToolingDevChannelId: 548 NETCoreToolingReleaseChannelId: 549 NETInternalToolingChannelId: 551 NETCoreExperimentalChannelId: 562 NetEngServicesIntChannelId: 678 NetEngServicesProdChannelId: 679 NetCoreSDK313xxChannelId: 759 NetCoreSDK313xxInternalChannelId: 760 NetCoreSDK314xxChannelId: 921 NetCoreSDK314xxInternalChannelId: 922 VS166ChannelId: 1010 VS167ChannelId: 1011 VS168ChannelId: 1154 VSMasterChannelId: 1012 VS169ChannelId: 1473 VS1610ChannelId: 1692 stages: - ${{ if or(and(le(parameters.publishingInfraVersion, 2), eq(parameters.inline, 'true')), eq( parameters.enableNugetValidation, 'true'), eq(parameters.enableSigningValidation, 'true'), eq(parameters.enableSourceLinkValidation, 'true'), eq(parameters.SDLValidationParameters.enable, 'true')) }}: - stage: Validate dependsOn: ${{ parameters.validateDependsOn }} displayName: Validate Build Assets variables: - template: common-variables.yml jobs: - template: setup-maestro-vars.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - ${{ if and(le(parameters.publishingInfraVersion, 2), eq(parameters.inline, 'true')) }}: - job: displayName: Post-build Checks dependsOn: setupMaestroVars variables: - name: TargetChannels value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.TargetChannels'] ] pool: vmImage: 'windows-2019' steps: - task: PowerShell@2 displayName: Maestro Channels Consistency inputs: filePath: $(Build.SourcesDirectory)/eng/common/post-build/check-channel-consistency.ps1 arguments: -PromoteToChannels "$(TargetChannels)" -AvailableChannelIds ${{parameters.NetEngLatestChannelId}},${{parameters.NetEngValidationChannelId}},${{parameters.NetDev5ChannelId}},${{parameters.NetDev6ChannelId}},${{parameters.GeneralTestingChannelId}},${{parameters.NETCoreToolingDevChannelId}},${{parameters.NETCoreToolingReleaseChannelId}},${{parameters.NETInternalToolingChannelId}},${{parameters.NETCoreExperimentalChannelId}},${{parameters.NetEngServicesIntChannelId}},${{parameters.NetEngServicesProdChannelId}},${{parameters.NetCoreSDK313xxChannelId}},${{parameters.NetCoreSDK313xxInternalChannelId}},${{parameters.NetCoreSDK314xxChannelId}},${{parameters.NetCoreSDK314xxInternalChannelId}},${{parameters.VS166ChannelId}},${{parameters.VS167ChannelId}},${{parameters.VS168ChannelId}},${{parameters.VSMasterChannelId}},${{parameters.VS169ChannelId}},${{parameters.VS1610ChannelId}} - job: displayName: NuGet Validation dependsOn: setupMaestroVars condition: eq( ${{ parameters.enableNugetValidation }}, 'true') pool: vmImage: 'windows-2019' variables: - name: AzDOProjectName value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ] - name: AzDOPipelineId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ] - name: AzDOBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ] steps: - task: DownloadBuildArtifacts@0 displayName: Download Package Artifacts inputs: buildType: specific buildVersionToDownload: specific project: $(AzDOProjectName) pipeline: $(AzDOPipelineId) buildId: $(AzDOBuildId) artifactName: PackageArtifacts checkDownloadedFiles: true - task: PowerShell@2 displayName: Validate inputs: filePath: $(Build.SourcesDirectory)/eng/common/post-build/nuget-validation.ps1 arguments: -PackagesPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ -ToolDestinationPath $(Agent.BuildDirectory)/Extract/ - job: displayName: Signing Validation dependsOn: setupMaestroVars condition: and( eq( ${{ parameters.enableSigningValidation }}, 'true'), ne( variables['PostBuildSign'], 'true')) variables: - template: common-variables.yml - name: AzDOProjectName value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ] - name: AzDOPipelineId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ] - name: AzDOBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ] pool: vmImage: 'windows-2019' steps: - task: DownloadBuildArtifacts@0 displayName: Download Package Artifacts inputs: buildType: specific buildVersionToDownload: specific project: $(AzDOProjectName) pipeline: $(AzDOPipelineId) buildId: $(AzDOBuildId) artifactName: PackageArtifacts checkDownloadedFiles: true itemPattern: | ** !**/Microsoft.SourceBuild.Intermediate.*.nupkg # This is necessary whenever we want to publish/restore to an AzDO private feed # Since sdk-task.ps1 tries to restore packages we need to do this authentication here # otherwise it'll complain about accessing a private feed. - task: NuGetAuthenticate@0 displayName: 'Authenticate to AzDO Feeds' - task: PowerShell@2 displayName: Enable cross-org publishing inputs: filePath: eng\common\enable-cross-org-publishing.ps1 arguments: -token $(dn-bot-dnceng-artifact-feeds-rw) # Signing validation will optionally work with the buildmanifest file which is downloaded from # Azure DevOps above. - task: PowerShell@2 displayName: Validate inputs: filePath: eng\common\sdk-task.ps1 arguments: -task SigningValidation -restore -msbuildEngine vs /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts' /p:SignCheckExclusionsFile='$(Build.SourcesDirectory)/eng/SignCheckExclusionsFile.txt' ${{ parameters.signingValidationAdditionalParameters }} - template: ../steps/publish-logs.yml parameters: StageLabel: 'Validation' JobLabel: 'Signing' - job: displayName: SourceLink Validation dependsOn: setupMaestroVars condition: eq( ${{ parameters.enableSourceLinkValidation }}, 'true') variables: - template: common-variables.yml - name: AzDOProjectName value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ] - name: AzDOPipelineId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ] - name: AzDOBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ] pool: vmImage: 'windows-2019' steps: - task: DownloadBuildArtifacts@0 displayName: Download Blob Artifacts inputs: buildType: specific buildVersionToDownload: specific project: $(AzDOProjectName) pipeline: $(AzDOPipelineId) buildId: $(AzDOBuildId) artifactName: BlobArtifacts checkDownloadedFiles: true - task: PowerShell@2 displayName: Validate inputs: filePath: $(Build.SourcesDirectory)/eng/common/post-build/sourcelink-validation.ps1 arguments: -InputPath $(Build.ArtifactStagingDirectory)/BlobArtifacts/ -ExtractPath $(Agent.BuildDirectory)/Extract/ -GHRepoName $(Build.Repository.Name) -GHCommit $(Build.SourceVersion) -SourcelinkCliVersion $(SourceLinkCLIVersion) continueOnError: true - template: /eng/common/templates/job/execute-sdl.yml parameters: enable: ${{ parameters.SDLValidationParameters.enable }} dependsOn: setupMaestroVars additionalParameters: ${{ parameters.SDLValidationParameters.params }} continueOnError: ${{ parameters.SDLValidationParameters.continueOnError }} artifactNames: ${{ parameters.SDLValidationParameters.artifactNames }} downloadArtifacts: ${{ parameters.SDLValidationParameters.downloadArtifacts }} - ${{ if or(ge(parameters.publishingInfraVersion, 3), eq(parameters.inline, 'false')) }}: - stage: publish_using_darc ${{ if or(eq(parameters.enableNugetValidation, 'true'), eq(parameters.enableSigningValidation, 'true'), eq(parameters.enableSourceLinkValidation, 'true'), eq(parameters.SDLValidationParameters.enable, 'true')) }}: dependsOn: ${{ parameters.publishDependsOn }} ${{ if and(ne(parameters.enableNugetValidation, 'true'), ne(parameters.enableSigningValidation, 'true'), ne(parameters.enableSourceLinkValidation, 'true'), ne(parameters.SDLValidationParameters.enable, 'true')) }}: dependsOn: ${{ parameters.validateDependsOn }} displayName: Publish using Darc variables: - template: common-variables.yml jobs: - template: setup-maestro-vars.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - job: displayName: Publish Using Darc dependsOn: setupMaestroVars timeoutInMinutes: 120 variables: - name: BARBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] pool: vmImage: 'windows-2019' steps: - task: PowerShell@2 displayName: Publish Using Darc inputs: filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 arguments: -BuildId $(BARBuildId) -PublishingInfraVersion ${{ parameters.PublishingInfraVersion }} -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' -MaestroToken '$(MaestroApiAccessToken)' -WaitPublishingFinish ${{ parameters.waitPublishingFinish }} -PublishInstallersAndChecksums ${{ parameters.publishInstallersAndChecksums }} -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' - ${{ if and(le(parameters.publishingInfraVersion, 2), eq(parameters.inline, 'true')) }}: - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'NetCore_Dev5_Publish' channelName: '.NET 5 Dev' akaMSChannelName: 'net5/dev' channelId: ${{ parameters.NetDev5ChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'NetCore_Dev6_Publish' channelName: '.NET 6 Dev' akaMSChannelName: 'net6/dev' channelId: ${{ parameters.NetDev6ChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'Net_Eng_Latest_Publish' channelName: '.NET Eng - Latest' akaMSChannelName: 'eng/daily' channelId: ${{ parameters.NetEngLatestChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'Net_Eng_Validation_Publish' channelName: '.NET Eng - Validation' akaMSChannelName: 'eng/validation' channelId: ${{ parameters.NetEngValidationChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'General_Testing_Publish' channelName: 'General Testing' akaMSChannelName: 'generaltesting' channelId: ${{ parameters.GeneralTestingChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/general-testing/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/general-testing/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/general-testing-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'NETCore_Tooling_Dev_Publishing' channelName: '.NET Core Tooling Dev' channelId: ${{ parameters.NETCoreToolingDevChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'NETCore_Tooling_Release_Publishing' channelName: '.NET Core Tooling Release' channelId: ${{ parameters.NETCoreToolingReleaseChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-internal-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'NET_Internal_Tooling_Publishing' channelName: '.NET Internal Tooling' channelId: ${{ parameters.NETInternalToolingChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'NETCore_Experimental_Publishing' channelName: '.NET Core Experimental' channelId: ${{ parameters.NETCoreExperimentalChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'Net_Eng_Services_Int_Publish' channelName: '.NET Eng Services - Int' channelId: ${{ parameters.NetEngServicesIntChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'Net_Eng_Services_Prod_Publish' channelName: '.NET Eng Services - Prod' channelId: ${{ parameters.NetEngServicesProdChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'NETCore_SDK_314xx_Publishing' channelName: '.NET Core SDK 3.1.4xx' channelId: ${{ parameters.NetCoreSDK314xxChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-internal-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'NETCore_SDK_314xx_Internal_Publishing' channelName: '.NET Core SDK 3.1.4xx Internal' channelId: ${{ parameters.NetCoreSDK314xxInternalChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'NETCore_SDK_313xx_Publishing' channelName: '.NET Core SDK 3.1.3xx' channelId: ${{ parameters.NetCoreSDK313xxChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-internal-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'NETCore_SDK_313xx_Internal_Publishing' channelName: '.NET Core SDK 3.1.3xx Internal' channelId: ${{ parameters.NetCoreSDK313xxInternalChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'VS16_6_Publishing' channelName: 'VS 16.6' channelId: ${{ parameters.VS166ChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'VS16_7_Publishing' channelName: 'VS 16.7' channelId: ${{ parameters.VS167ChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'VS16_8_Publishing' channelName: 'VS 16.8' channelId: ${{ parameters.VS168ChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'VS_Master_Publishing' channelName: 'VS Master' channelId: ${{ parameters.VSMasterChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'VS_16_9_Publishing' channelName: 'VS 16.9' channelId: ${{ parameters.VS169ChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'VS_16_10_Publishing' channelName: 'VS 16.10' channelId: ${{ parameters.VS1610ChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json'
parameters: # Which publishing infra should be used. THIS SHOULD MATCH THE VERSION ON THE BUILD MANIFEST. # Publishing V2 accepts optionally outlining the publishing stages - default is inline. # Publishing V3 DOES NOT accept inlining the publishing stages. publishingInfraVersion: 2 # When set to true the publishing templates from the repo will be used # otherwise Darc add-build-to-channel will be used to trigger the promotion pipeline inline: true # Only used if inline==false. When set to true will stall the current build until # the Promotion Pipeline build finishes. Otherwise, the current build will continue # execution concurrently with the promotion build. waitPublishingFinish: true BARBuildId: '' PromoteToChannelIds: '' enableSourceLinkValidation: false enableSigningValidation: true enableSymbolValidation: false enableNugetValidation: true publishInstallersAndChecksums: true SDLValidationParameters: enable: false continueOnError: false params: '' artifactNames: '' downloadArtifacts: true # These parameters let the user customize the call to sdk-task.ps1 for publishing # symbols & general artifacts as well as for signing validation symbolPublishingAdditionalParameters: '' artifactsPublishingAdditionalParameters: '' signingValidationAdditionalParameters: '' # Which stages should finish execution before post-build stages start validateDependsOn: - build publishDependsOn: - Validate # Channel ID's instantiated in this file. # When adding a new channel implementation the call to `check-channel-consistency.ps1` # needs to be updated with the new channel ID NetEngLatestChannelId: 2 NetEngValidationChannelId: 9 NetDev5ChannelId: 131 NetDev6ChannelId: 1296 GeneralTestingChannelId: 529 NETCoreToolingDevChannelId: 548 NETCoreToolingReleaseChannelId: 549 NETInternalToolingChannelId: 551 NETCoreExperimentalChannelId: 562 NetEngServicesIntChannelId: 678 NetEngServicesProdChannelId: 679 NetCoreSDK313xxChannelId: 759 NetCoreSDK313xxInternalChannelId: 760 NetCoreSDK314xxChannelId: 921 NetCoreSDK314xxInternalChannelId: 922 VS166ChannelId: 1010 VS167ChannelId: 1011 VS168ChannelId: 1154 VSMasterChannelId: 1012 VS169ChannelId: 1473 VS1610ChannelId: 1692 stages: - ${{ if or(and(le(parameters.publishingInfraVersion, 2), eq(parameters.inline, 'true')), eq( parameters.enableNugetValidation, 'true'), eq(parameters.enableSigningValidation, 'true'), eq(parameters.enableSourceLinkValidation, 'true'), eq(parameters.SDLValidationParameters.enable, 'true')) }}: - stage: Validate dependsOn: ${{ parameters.validateDependsOn }} displayName: Validate Build Assets variables: - template: common-variables.yml jobs: - template: setup-maestro-vars.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - ${{ if and(le(parameters.publishingInfraVersion, 2), eq(parameters.inline, 'true')) }}: - job: displayName: Post-build Checks dependsOn: setupMaestroVars variables: - name: TargetChannels value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.TargetChannels'] ] pool: vmImage: 'windows-2019' steps: - task: PowerShell@2 displayName: Maestro Channels Consistency inputs: filePath: $(Build.SourcesDirectory)/eng/common/post-build/check-channel-consistency.ps1 arguments: -PromoteToChannels "$(TargetChannels)" -AvailableChannelIds ${{parameters.NetEngLatestChannelId}},${{parameters.NetEngValidationChannelId}},${{parameters.NetDev5ChannelId}},${{parameters.NetDev6ChannelId}},${{parameters.GeneralTestingChannelId}},${{parameters.NETCoreToolingDevChannelId}},${{parameters.NETCoreToolingReleaseChannelId}},${{parameters.NETInternalToolingChannelId}},${{parameters.NETCoreExperimentalChannelId}},${{parameters.NetEngServicesIntChannelId}},${{parameters.NetEngServicesProdChannelId}},${{parameters.NetCoreSDK313xxChannelId}},${{parameters.NetCoreSDK313xxInternalChannelId}},${{parameters.NetCoreSDK314xxChannelId}},${{parameters.NetCoreSDK314xxInternalChannelId}},${{parameters.VS166ChannelId}},${{parameters.VS167ChannelId}},${{parameters.VS168ChannelId}},${{parameters.VSMasterChannelId}},${{parameters.VS169ChannelId}},${{parameters.VS1610ChannelId}} - job: displayName: NuGet Validation dependsOn: setupMaestroVars condition: eq( ${{ parameters.enableNugetValidation }}, 'true') pool: vmImage: 'windows-2019' variables: - name: AzDOProjectName value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ] - name: AzDOPipelineId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ] - name: AzDOBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ] steps: - task: DownloadBuildArtifacts@0 displayName: Download Package Artifacts inputs: buildType: specific buildVersionToDownload: specific project: $(AzDOProjectName) pipeline: $(AzDOPipelineId) buildId: $(AzDOBuildId) artifactName: PackageArtifacts checkDownloadedFiles: true - task: PowerShell@2 displayName: Validate inputs: filePath: $(Build.SourcesDirectory)/eng/common/post-build/nuget-validation.ps1 arguments: -PackagesPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ -ToolDestinationPath $(Agent.BuildDirectory)/Extract/ - job: displayName: Signing Validation dependsOn: setupMaestroVars condition: and( eq( ${{ parameters.enableSigningValidation }}, 'true'), ne( variables['PostBuildSign'], 'true')) variables: - template: common-variables.yml - name: AzDOProjectName value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ] - name: AzDOPipelineId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ] - name: AzDOBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ] pool: vmImage: 'windows-2019' steps: - task: DownloadBuildArtifacts@0 displayName: Download Package Artifacts inputs: buildType: specific buildVersionToDownload: specific project: $(AzDOProjectName) pipeline: $(AzDOPipelineId) buildId: $(AzDOBuildId) artifactName: PackageArtifacts checkDownloadedFiles: true itemPattern: | ** !**/Microsoft.SourceBuild.Intermediate.*.nupkg # This is necessary whenever we want to publish/restore to an AzDO private feed # Since sdk-task.ps1 tries to restore packages we need to do this authentication here # otherwise it'll complain about accessing a private feed. - task: NuGetAuthenticate@0 displayName: 'Authenticate to AzDO Feeds' - task: PowerShell@2 displayName: Enable cross-org publishing inputs: filePath: eng\common\enable-cross-org-publishing.ps1 arguments: -token $(dn-bot-dnceng-artifact-feeds-rw) # Signing validation will optionally work with the buildmanifest file which is downloaded from # Azure DevOps above. - task: PowerShell@2 displayName: Validate inputs: filePath: eng\common\sdk-task.ps1 arguments: -task SigningValidation -restore -msbuildEngine vs /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts' /p:SignCheckExclusionsFile='$(Build.SourcesDirectory)/eng/SignCheckExclusionsFile.txt' ${{ parameters.signingValidationAdditionalParameters }} - template: ../steps/publish-logs.yml parameters: StageLabel: 'Validation' JobLabel: 'Signing' - job: displayName: SourceLink Validation dependsOn: setupMaestroVars condition: eq( ${{ parameters.enableSourceLinkValidation }}, 'true') variables: - template: common-variables.yml - name: AzDOProjectName value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ] - name: AzDOPipelineId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ] - name: AzDOBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ] pool: vmImage: 'windows-2019' steps: - task: DownloadBuildArtifacts@0 displayName: Download Blob Artifacts inputs: buildType: specific buildVersionToDownload: specific project: $(AzDOProjectName) pipeline: $(AzDOPipelineId) buildId: $(AzDOBuildId) artifactName: BlobArtifacts checkDownloadedFiles: true - task: PowerShell@2 displayName: Validate inputs: filePath: $(Build.SourcesDirectory)/eng/common/post-build/sourcelink-validation.ps1 arguments: -InputPath $(Build.ArtifactStagingDirectory)/BlobArtifacts/ -ExtractPath $(Agent.BuildDirectory)/Extract/ -GHRepoName $(Build.Repository.Name) -GHCommit $(Build.SourceVersion) -SourcelinkCliVersion $(SourceLinkCLIVersion) continueOnError: true - template: /eng/common/templates/job/execute-sdl.yml parameters: enable: ${{ parameters.SDLValidationParameters.enable }} dependsOn: setupMaestroVars additionalParameters: ${{ parameters.SDLValidationParameters.params }} continueOnError: ${{ parameters.SDLValidationParameters.continueOnError }} artifactNames: ${{ parameters.SDLValidationParameters.artifactNames }} downloadArtifacts: ${{ parameters.SDLValidationParameters.downloadArtifacts }} - ${{ if or(ge(parameters.publishingInfraVersion, 3), eq(parameters.inline, 'false')) }}: - stage: publish_using_darc ${{ if or(eq(parameters.enableNugetValidation, 'true'), eq(parameters.enableSigningValidation, 'true'), eq(parameters.enableSourceLinkValidation, 'true'), eq(parameters.SDLValidationParameters.enable, 'true')) }}: dependsOn: ${{ parameters.publishDependsOn }} ${{ if and(ne(parameters.enableNugetValidation, 'true'), ne(parameters.enableSigningValidation, 'true'), ne(parameters.enableSourceLinkValidation, 'true'), ne(parameters.SDLValidationParameters.enable, 'true')) }}: dependsOn: ${{ parameters.validateDependsOn }} displayName: Publish using Darc variables: - template: common-variables.yml jobs: - template: setup-maestro-vars.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - job: displayName: Publish Using Darc dependsOn: setupMaestroVars timeoutInMinutes: 120 variables: - name: BARBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] pool: vmImage: 'windows-2019' steps: - task: PowerShell@2 displayName: Publish Using Darc inputs: filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 arguments: -BuildId $(BARBuildId) -PublishingInfraVersion ${{ parameters.PublishingInfraVersion }} -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' -MaestroToken '$(MaestroApiAccessToken)' -WaitPublishingFinish ${{ parameters.waitPublishingFinish }} -PublishInstallersAndChecksums ${{ parameters.publishInstallersAndChecksums }} -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' - ${{ if and(le(parameters.publishingInfraVersion, 2), eq(parameters.inline, 'true')) }}: - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'NetCore_Dev5_Publish' channelName: '.NET 5 Dev' akaMSChannelName: 'net5/dev' channelId: ${{ parameters.NetDev5ChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'NetCore_Dev6_Publish' channelName: '.NET 6 Dev' akaMSChannelName: 'net6/dev' channelId: ${{ parameters.NetDev6ChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'Net_Eng_Latest_Publish' channelName: '.NET Eng - Latest' akaMSChannelName: 'eng/daily' channelId: ${{ parameters.NetEngLatestChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'Net_Eng_Validation_Publish' channelName: '.NET Eng - Validation' akaMSChannelName: 'eng/validation' channelId: ${{ parameters.NetEngValidationChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'General_Testing_Publish' channelName: 'General Testing' akaMSChannelName: 'generaltesting' channelId: ${{ parameters.GeneralTestingChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/general-testing/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/general-testing/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/general-testing-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'NETCore_Tooling_Dev_Publishing' channelName: '.NET Core Tooling Dev' channelId: ${{ parameters.NETCoreToolingDevChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'NETCore_Tooling_Release_Publishing' channelName: '.NET Core Tooling Release' channelId: ${{ parameters.NETCoreToolingReleaseChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-internal-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'NET_Internal_Tooling_Publishing' channelName: '.NET Internal Tooling' channelId: ${{ parameters.NETInternalToolingChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'NETCore_Experimental_Publishing' channelName: '.NET Core Experimental' channelId: ${{ parameters.NETCoreExperimentalChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'Net_Eng_Services_Int_Publish' channelName: '.NET Eng Services - Int' channelId: ${{ parameters.NetEngServicesIntChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'Net_Eng_Services_Prod_Publish' channelName: '.NET Eng Services - Prod' channelId: ${{ parameters.NetEngServicesProdChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'NETCore_SDK_314xx_Publishing' channelName: '.NET Core SDK 3.1.4xx' channelId: ${{ parameters.NetCoreSDK314xxChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-internal-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'NETCore_SDK_314xx_Internal_Publishing' channelName: '.NET Core SDK 3.1.4xx Internal' channelId: ${{ parameters.NetCoreSDK314xxInternalChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'NETCore_SDK_313xx_Publishing' channelName: '.NET Core SDK 3.1.3xx' channelId: ${{ parameters.NetCoreSDK313xxChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-internal-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'NETCore_SDK_313xx_Internal_Publishing' channelName: '.NET Core SDK 3.1.3xx Internal' channelId: ${{ parameters.NetCoreSDK313xxInternalChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'VS16_6_Publishing' channelName: 'VS 16.6' channelId: ${{ parameters.VS166ChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'VS16_7_Publishing' channelName: 'VS 16.7' channelId: ${{ parameters.VS167ChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'VS16_8_Publishing' channelName: 'VS 16.8' channelId: ${{ parameters.VS168ChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'VS_Master_Publishing' channelName: 'VS Master' channelId: ${{ parameters.VSMasterChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'VS_16_9_Publishing' channelName: 'VS 16.9' channelId: ${{ parameters.VS169ChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} stageName: 'VS_16_10_Publishing' channelName: 'VS 16.10' channelId: ${{ parameters.VS1610ChannelId }} transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json' shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json'
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/common/templates/job/execute-sdl.yml
parameters: enable: 'false' # Whether the SDL validation job should execute or not overrideParameters: '' # Optional: to override values for parameters. additionalParameters: '' # Optional: parameters that need user specific values eg: '-SourceToolsList @("abc","def") -ArtifactToolsList @("ghi","jkl")' # Optional: if specified, restore and use this version of Guardian instead of the default. overrideGuardianVersion: '' # Optional: if true, publish the '.gdn' folder as a pipeline artifact. This can help with in-depth # diagnosis of problems with specific tool configurations. publishGuardianDirectoryToPipeline: false # The script to run to execute all SDL tools. Use this if you want to use a script to define SDL # parameters rather than relying on YAML. It may be better to use a local script, because you can # reproduce results locally without piecing together a command based on the YAML. executeAllSdlToolsScript: 'eng/common/sdl/execute-all-sdl-tools.ps1' # There is some sort of bug (has been reported) in Azure DevOps where if this parameter is named # 'continueOnError', the parameter value is not correctly picked up. # This can also be remedied by the caller (post-build.yml) if it does not use a nested parameter sdlContinueOnError: false # optional: determines whether to continue the build if the step errors; # optional: determines if build artifacts should be downloaded. downloadArtifacts: true # optional: determines if this job should search the directory of downloaded artifacts for # 'tar.gz' and 'zip' archive files and extract them before running SDL validation tasks. extractArchiveArtifacts: false dependsOn: '' # Optional: dependencies of the job artifactNames: '' # Optional: patterns supplied to DownloadBuildArtifacts # Usage: # artifactNames: # - 'BlobArtifacts' # - 'Artifacts_Windows_NT_Release' # Optional: download a list of pipeline artifacts. 'downloadArtifacts' controls build artifacts, # not pipeline artifacts, so doesn't affect the use of this parameter. pipelineArtifactNames: [] # Optional: location and ID of the AzDO build that the build/pipeline artifacts should be # downloaded from. By default, uses runtime expressions to decide based on the variables set by # the 'setupMaestroVars' dependency. Overriding this parameter is necessary if SDL tasks are # running without Maestro++/BAR involved, or to download artifacts from a specific existing build # to iterate quickly on SDL changes. AzDOProjectName: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ] AzDOPipelineId: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ] AzDOBuildId: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ] jobs: - job: Run_SDL dependsOn: ${{ parameters.dependsOn }} displayName: Run SDL tool condition: eq( ${{ parameters.enable }}, 'true') variables: - group: DotNet-VSTS-Bot - name: AzDOProjectName value: ${{ parameters.AzDOProjectName }} - name: AzDOPipelineId value: ${{ parameters.AzDOPipelineId }} - name: AzDOBuildId value: ${{ parameters.AzDOBuildId }} # The Guardian version specified in 'eng/common/sdl/packages.config'. This value must be kept in # sync with the packages.config file. - name: DefaultGuardianVersion value: 0.53.3 - name: GuardianVersion value: ${{ coalesce(parameters.overrideGuardianVersion, '$(DefaultGuardianVersion)') }} - name: GuardianPackagesConfigFile value: $(Build.SourcesDirectory)\eng\common\sdl\packages.config pool: # To extract archives (.tar.gz, .zip), we need access to "tar", added in Windows 10/2019. ${{ if eq(parameters.extractArchiveArtifacts, 'false') }}: name: Hosted VS2017 ${{ if ne(parameters.extractArchiveArtifacts, 'false') }}: vmImage: windows-2019 steps: - checkout: self clean: true - ${{ if ne(parameters.downloadArtifacts, 'false')}}: - ${{ if ne(parameters.artifactNames, '') }}: - ${{ each artifactName in parameters.artifactNames }}: - task: DownloadBuildArtifacts@0 displayName: Download Build Artifacts inputs: buildType: specific buildVersionToDownload: specific project: $(AzDOProjectName) pipeline: $(AzDOPipelineId) buildId: $(AzDOBuildId) artifactName: ${{ artifactName }} downloadPath: $(Build.ArtifactStagingDirectory)\artifacts checkDownloadedFiles: true - ${{ if eq(parameters.artifactNames, '') }}: - task: DownloadBuildArtifacts@0 displayName: Download Build Artifacts inputs: buildType: specific buildVersionToDownload: specific project: $(AzDOProjectName) pipeline: $(AzDOPipelineId) buildId: $(AzDOBuildId) downloadType: specific files itemPattern: "**" downloadPath: $(Build.ArtifactStagingDirectory)\artifacts checkDownloadedFiles: true - ${{ each artifactName in parameters.pipelineArtifactNames }}: - task: DownloadPipelineArtifact@2 displayName: Download Pipeline Artifacts inputs: buildType: specific buildVersionToDownload: specific project: $(AzDOProjectName) pipeline: $(AzDOPipelineId) buildId: $(AzDOBuildId) artifactName: ${{ artifactName }} downloadPath: $(Build.ArtifactStagingDirectory)\artifacts checkDownloadedFiles: true - powershell: eng/common/sdl/extract-artifact-packages.ps1 -InputPath $(Build.ArtifactStagingDirectory)\artifacts\BlobArtifacts -ExtractPath $(Build.ArtifactStagingDirectory)\artifacts\BlobArtifacts displayName: Extract Blob Artifacts continueOnError: ${{ parameters.sdlContinueOnError }} - powershell: eng/common/sdl/extract-artifact-packages.ps1 -InputPath $(Build.ArtifactStagingDirectory)\artifacts\PackageArtifacts -ExtractPath $(Build.ArtifactStagingDirectory)\artifacts\PackageArtifacts displayName: Extract Package Artifacts continueOnError: ${{ parameters.sdlContinueOnError }} - ${{ if ne(parameters.extractArchiveArtifacts, 'false') }}: - powershell: eng/common/sdl/extract-artifact-archives.ps1 -InputPath $(Build.ArtifactStagingDirectory)\artifacts -ExtractPath $(Build.ArtifactStagingDirectory)\artifacts displayName: Extract Archive Artifacts continueOnError: ${{ parameters.sdlContinueOnError }} - ${{ if ne(parameters.overrideGuardianVersion, '') }}: - powershell: | $content = Get-Content $(GuardianPackagesConfigFile) Write-Host "packages.config content was:`n$content" $content = $content.Replace('$(DefaultGuardianVersion)', '$(GuardianVersion)') $content | Set-Content $(GuardianPackagesConfigFile) Write-Host "packages.config content updated to:`n$content" displayName: Use overridden Guardian version ${{ parameters.overrideGuardianVersion }} - task: NuGetToolInstaller@1 displayName: 'Install NuGet.exe' - task: NuGetCommand@2 displayName: 'Install Guardian' inputs: restoreSolution: $(Build.SourcesDirectory)\eng\common\sdl\packages.config feedsToUse: config nugetConfigPath: $(Build.SourcesDirectory)\eng\common\sdl\NuGet.config externalFeedCredentials: GuardianConnect restoreDirectory: $(Build.SourcesDirectory)\.packages - ${{ if ne(parameters.overrideParameters, '') }}: - powershell: ${{ parameters.executeAllSdlToolsScript }} ${{ parameters.overrideParameters }} displayName: Execute SDL continueOnError: ${{ parameters.sdlContinueOnError }} - ${{ if eq(parameters.overrideParameters, '') }}: - powershell: ${{ parameters.executeAllSdlToolsScript }} -GuardianPackageName Microsoft.Guardian.Cli.$(GuardianVersion) -NugetPackageDirectory $(Build.SourcesDirectory)\.packages -AzureDevOpsAccessToken $(dn-bot-dotnet-build-rw-code-rw) ${{ parameters.additionalParameters }} displayName: Execute SDL continueOnError: ${{ parameters.sdlContinueOnError }} - ${{ if ne(parameters.publishGuardianDirectoryToPipeline, 'false') }}: # We want to publish the Guardian results and configuration for easy diagnosis. However, the # '.gdn' dir is a mix of configuration, results, extracted dependencies, and Guardian default # tooling files. Some of these files are large and aren't useful during an investigation, so # exclude them by simply deleting them before publishing. (As of writing, there is no documented # way to selectively exclude a dir from the pipeline artifact publish task.) - task: DeleteFiles@1 displayName: Delete Guardian dependencies to avoid uploading inputs: SourceFolder: $(Agent.BuildDirectory)/.gdn Contents: | c i condition: succeededOrFailed() - publish: $(Agent.BuildDirectory)/.gdn artifact: GuardianConfiguration displayName: Publish GuardianConfiguration condition: succeededOrFailed()
parameters: enable: 'false' # Whether the SDL validation job should execute or not overrideParameters: '' # Optional: to override values for parameters. additionalParameters: '' # Optional: parameters that need user specific values eg: '-SourceToolsList @("abc","def") -ArtifactToolsList @("ghi","jkl")' # Optional: if specified, restore and use this version of Guardian instead of the default. overrideGuardianVersion: '' # Optional: if true, publish the '.gdn' folder as a pipeline artifact. This can help with in-depth # diagnosis of problems with specific tool configurations. publishGuardianDirectoryToPipeline: false # The script to run to execute all SDL tools. Use this if you want to use a script to define SDL # parameters rather than relying on YAML. It may be better to use a local script, because you can # reproduce results locally without piecing together a command based on the YAML. executeAllSdlToolsScript: 'eng/common/sdl/execute-all-sdl-tools.ps1' # There is some sort of bug (has been reported) in Azure DevOps where if this parameter is named # 'continueOnError', the parameter value is not correctly picked up. # This can also be remedied by the caller (post-build.yml) if it does not use a nested parameter sdlContinueOnError: false # optional: determines whether to continue the build if the step errors; # optional: determines if build artifacts should be downloaded. downloadArtifacts: true # optional: determines if this job should search the directory of downloaded artifacts for # 'tar.gz' and 'zip' archive files and extract them before running SDL validation tasks. extractArchiveArtifacts: false dependsOn: '' # Optional: dependencies of the job artifactNames: '' # Optional: patterns supplied to DownloadBuildArtifacts # Usage: # artifactNames: # - 'BlobArtifacts' # - 'Artifacts_Windows_NT_Release' # Optional: download a list of pipeline artifacts. 'downloadArtifacts' controls build artifacts, # not pipeline artifacts, so doesn't affect the use of this parameter. pipelineArtifactNames: [] # Optional: location and ID of the AzDO build that the build/pipeline artifacts should be # downloaded from. By default, uses runtime expressions to decide based on the variables set by # the 'setupMaestroVars' dependency. Overriding this parameter is necessary if SDL tasks are # running without Maestro++/BAR involved, or to download artifacts from a specific existing build # to iterate quickly on SDL changes. AzDOProjectName: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ] AzDOPipelineId: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ] AzDOBuildId: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ] jobs: - job: Run_SDL dependsOn: ${{ parameters.dependsOn }} displayName: Run SDL tool condition: eq( ${{ parameters.enable }}, 'true') variables: - group: DotNet-VSTS-Bot - name: AzDOProjectName value: ${{ parameters.AzDOProjectName }} - name: AzDOPipelineId value: ${{ parameters.AzDOPipelineId }} - name: AzDOBuildId value: ${{ parameters.AzDOBuildId }} # The Guardian version specified in 'eng/common/sdl/packages.config'. This value must be kept in # sync with the packages.config file. - name: DefaultGuardianVersion value: 0.53.3 - name: GuardianVersion value: ${{ coalesce(parameters.overrideGuardianVersion, '$(DefaultGuardianVersion)') }} - name: GuardianPackagesConfigFile value: $(Build.SourcesDirectory)\eng\common\sdl\packages.config pool: # To extract archives (.tar.gz, .zip), we need access to "tar", added in Windows 10/2019. ${{ if eq(parameters.extractArchiveArtifacts, 'false') }}: name: Hosted VS2017 ${{ if ne(parameters.extractArchiveArtifacts, 'false') }}: vmImage: windows-2019 steps: - checkout: self clean: true - ${{ if ne(parameters.downloadArtifacts, 'false')}}: - ${{ if ne(parameters.artifactNames, '') }}: - ${{ each artifactName in parameters.artifactNames }}: - task: DownloadBuildArtifacts@0 displayName: Download Build Artifacts inputs: buildType: specific buildVersionToDownload: specific project: $(AzDOProjectName) pipeline: $(AzDOPipelineId) buildId: $(AzDOBuildId) artifactName: ${{ artifactName }} downloadPath: $(Build.ArtifactStagingDirectory)\artifacts checkDownloadedFiles: true - ${{ if eq(parameters.artifactNames, '') }}: - task: DownloadBuildArtifacts@0 displayName: Download Build Artifacts inputs: buildType: specific buildVersionToDownload: specific project: $(AzDOProjectName) pipeline: $(AzDOPipelineId) buildId: $(AzDOBuildId) downloadType: specific files itemPattern: "**" downloadPath: $(Build.ArtifactStagingDirectory)\artifacts checkDownloadedFiles: true - ${{ each artifactName in parameters.pipelineArtifactNames }}: - task: DownloadPipelineArtifact@2 displayName: Download Pipeline Artifacts inputs: buildType: specific buildVersionToDownload: specific project: $(AzDOProjectName) pipeline: $(AzDOPipelineId) buildId: $(AzDOBuildId) artifactName: ${{ artifactName }} downloadPath: $(Build.ArtifactStagingDirectory)\artifacts checkDownloadedFiles: true - powershell: eng/common/sdl/extract-artifact-packages.ps1 -InputPath $(Build.ArtifactStagingDirectory)\artifacts\BlobArtifacts -ExtractPath $(Build.ArtifactStagingDirectory)\artifacts\BlobArtifacts displayName: Extract Blob Artifacts continueOnError: ${{ parameters.sdlContinueOnError }} - powershell: eng/common/sdl/extract-artifact-packages.ps1 -InputPath $(Build.ArtifactStagingDirectory)\artifacts\PackageArtifacts -ExtractPath $(Build.ArtifactStagingDirectory)\artifacts\PackageArtifacts displayName: Extract Package Artifacts continueOnError: ${{ parameters.sdlContinueOnError }} - ${{ if ne(parameters.extractArchiveArtifacts, 'false') }}: - powershell: eng/common/sdl/extract-artifact-archives.ps1 -InputPath $(Build.ArtifactStagingDirectory)\artifacts -ExtractPath $(Build.ArtifactStagingDirectory)\artifacts displayName: Extract Archive Artifacts continueOnError: ${{ parameters.sdlContinueOnError }} - ${{ if ne(parameters.overrideGuardianVersion, '') }}: - powershell: | $content = Get-Content $(GuardianPackagesConfigFile) Write-Host "packages.config content was:`n$content" $content = $content.Replace('$(DefaultGuardianVersion)', '$(GuardianVersion)') $content | Set-Content $(GuardianPackagesConfigFile) Write-Host "packages.config content updated to:`n$content" displayName: Use overridden Guardian version ${{ parameters.overrideGuardianVersion }} - task: NuGetToolInstaller@1 displayName: 'Install NuGet.exe' - task: NuGetCommand@2 displayName: 'Install Guardian' inputs: restoreSolution: $(Build.SourcesDirectory)\eng\common\sdl\packages.config feedsToUse: config nugetConfigPath: $(Build.SourcesDirectory)\eng\common\sdl\NuGet.config externalFeedCredentials: GuardianConnect restoreDirectory: $(Build.SourcesDirectory)\.packages - ${{ if ne(parameters.overrideParameters, '') }}: - powershell: ${{ parameters.executeAllSdlToolsScript }} ${{ parameters.overrideParameters }} displayName: Execute SDL continueOnError: ${{ parameters.sdlContinueOnError }} - ${{ if eq(parameters.overrideParameters, '') }}: - powershell: ${{ parameters.executeAllSdlToolsScript }} -GuardianPackageName Microsoft.Guardian.Cli.$(GuardianVersion) -NugetPackageDirectory $(Build.SourcesDirectory)\.packages -AzureDevOpsAccessToken $(dn-bot-dotnet-build-rw-code-rw) ${{ parameters.additionalParameters }} displayName: Execute SDL continueOnError: ${{ parameters.sdlContinueOnError }} - ${{ if ne(parameters.publishGuardianDirectoryToPipeline, 'false') }}: # We want to publish the Guardian results and configuration for easy diagnosis. However, the # '.gdn' dir is a mix of configuration, results, extracted dependencies, and Guardian default # tooling files. Some of these files are large and aren't useful during an investigation, so # exclude them by simply deleting them before publishing. (As of writing, there is no documented # way to selectively exclude a dir from the pipeline artifact publish task.) - task: DeleteFiles@1 displayName: Delete Guardian dependencies to avoid uploading inputs: SourceFolder: $(Agent.BuildDirectory)/.gdn Contents: | c i condition: succeededOrFailed() - publish: $(Agent.BuildDirectory)/.gdn artifact: GuardianConfiguration displayName: Publish GuardianConfiguration condition: succeededOrFailed()
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./scripts/generate-badges.ps1
# Script for generating our badges line in the README.md [CmdletBinding(PositionalBinding=$false)] param () $branchNames = @( 'main', 'main-vs-deps') function Get-AzureBadge($branchName, $jobName, $configName, [switch]$integration = $false) { $name = if ($integration) { "roslyn-integration-CI" } else { "roslyn-CI" } $id = if ($integration) { 245 } else { 15 } $template = "[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/$($name)?branchname=$branchName&jobname=$jobName&configuration=$jobName$configName&label=build)]" $template += "(https://dev.azure.com/dnceng/public/_build/latest?definitionId=$($id)&branchname=$branchName&view=logs)" return $template } function Get-AzureLine($branchName, $jobNames, [switch]$integration = $false) { $line = "**$branchName**|" foreach ($jobName in $jobNames) { $configName = "" $i = $jobName.IndexOf('#') if ($i -ge 0) { $configName = "%20$($jobName.SubString($i + 1))" $jobName = $jobName.Substring(0, $i) } $line += Get-AzureBadge $branchName $jobName $configName -integration:$integration $line += "|" } return $line + [Environment]::NewLine } function Get-BuildsTable() { $jobNames = @( 'Build_Windows_Debug' 'Build_Windows_Release' 'Build_Unix_Debug' ) $table = @' #### Builds |Branch|Windows Debug|Windows Release|Unix Debug| |:--:|:--:|:--:|:--:| '@ foreach ($branchName in $branchNames) { $table += Get-AzureLine $branchName $jobNames } return $table } function Get-DesktopTable() { $jobNames = @( 'Test_Windows_Desktop_Debug_32' 'Test_Windows_Desktop_Debug_64' 'Test_Windows_Desktop_Release_32' 'Test_Windows_Desktop_Release_64' ) $table = @' #### Desktop Unit Tests |Branch|Debug x86|Debug x64|Release x86|Release x64| |:--:|:--:|:--:|:--:|:--:| '@ foreach ($branchName in $branchNames) { $table += Get-AzureLine $branchName $jobNames } return $table } function Get-CoreClrTable() { $jobNames = @( 'Test_Windows_CoreClr_Debug', 'Test_Windows_CoreClr_Release', 'Test_Linux_Debug' ) $table = @' #### CoreClr Unit Tests |Branch|Windows Debug|Windows Release|Linux| |:--:|:--:|:--:|:--:| '@ foreach ($branchName in $branchNames) { $table += Get-AzureLine $branchName $jobNames } return $table } function Get-IntegrationTable() { $jobNames = @( 'VS_Integration#debug_32', 'VS_Integration#debug_64', 'VS_Integration#release_32', 'VS_Integration#release_64' ) $table = @' #### Integration Tests |Branch|Debug x86|Debug x64|Release x86|Release x64 |:--:|:--:|:--:|:--:|:--:| '@ foreach ($branchName in $branchNames) { $table += Get-AzureLine $branchName $jobNames -integration:$true } return $table } function Get-MiscTable() { $jobNames = @( 'Correctness_Determinism', 'Correctness_Build', 'Correctness_SourceBuild', 'Test_Windows_Desktop_Spanish_Release_32', 'Test_macOS_Debug' ) $table = @' #### Misc Tests |Branch|Determinism|Build Correctness|Source build|Spanish|MacOS| |:--:|:--:|:--|:--:|:--:|:--:| '@ foreach ($branchName in $branchNames) { $table += Get-AzureLine $branchName $jobNames } return $table } Set-StrictMode -version 2.0 $ErrorActionPreference="Stop" try { Get-BuildsTable | Write-Output Get-DesktopTable | Write-Output Get-CoreClrTable | Write-Output Get-IntegrationTable | Write-Output Get-MiscTable | Write-Output exit 0 } catch { Write-Host $_ Write-Host $_.Exception Write-Host $_.ScriptStackTrace exit 1 }
# Script for generating our badges line in the README.md [CmdletBinding(PositionalBinding=$false)] param () $branchNames = @( 'main', 'main-vs-deps') function Get-AzureBadge($branchName, $jobName, $configName, [switch]$integration = $false) { $name = if ($integration) { "roslyn-integration-CI" } else { "roslyn-CI" } $id = if ($integration) { 245 } else { 15 } $template = "[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/$($name)?branchname=$branchName&jobname=$jobName&configuration=$jobName$configName&label=build)]" $template += "(https://dev.azure.com/dnceng/public/_build/latest?definitionId=$($id)&branchname=$branchName&view=logs)" return $template } function Get-AzureLine($branchName, $jobNames, [switch]$integration = $false) { $line = "**$branchName**|" foreach ($jobName in $jobNames) { $configName = "" $i = $jobName.IndexOf('#') if ($i -ge 0) { $configName = "%20$($jobName.SubString($i + 1))" $jobName = $jobName.Substring(0, $i) } $line += Get-AzureBadge $branchName $jobName $configName -integration:$integration $line += "|" } return $line + [Environment]::NewLine } function Get-BuildsTable() { $jobNames = @( 'Build_Windows_Debug' 'Build_Windows_Release' 'Build_Unix_Debug' ) $table = @' #### Builds |Branch|Windows Debug|Windows Release|Unix Debug| |:--:|:--:|:--:|:--:| '@ foreach ($branchName in $branchNames) { $table += Get-AzureLine $branchName $jobNames } return $table } function Get-DesktopTable() { $jobNames = @( 'Test_Windows_Desktop_Debug_32' 'Test_Windows_Desktop_Debug_64' 'Test_Windows_Desktop_Release_32' 'Test_Windows_Desktop_Release_64' ) $table = @' #### Desktop Unit Tests |Branch|Debug x86|Debug x64|Release x86|Release x64| |:--:|:--:|:--:|:--:|:--:| '@ foreach ($branchName in $branchNames) { $table += Get-AzureLine $branchName $jobNames } return $table } function Get-CoreClrTable() { $jobNames = @( 'Test_Windows_CoreClr_Debug', 'Test_Windows_CoreClr_Release', 'Test_Linux_Debug' ) $table = @' #### CoreClr Unit Tests |Branch|Windows Debug|Windows Release|Linux| |:--:|:--:|:--:|:--:| '@ foreach ($branchName in $branchNames) { $table += Get-AzureLine $branchName $jobNames } return $table } function Get-IntegrationTable() { $jobNames = @( 'VS_Integration#debug_32', 'VS_Integration#debug_64', 'VS_Integration#release_32', 'VS_Integration#release_64' ) $table = @' #### Integration Tests |Branch|Debug x86|Debug x64|Release x86|Release x64 |:--:|:--:|:--:|:--:|:--:| '@ foreach ($branchName in $branchNames) { $table += Get-AzureLine $branchName $jobNames -integration:$true } return $table } function Get-MiscTable() { $jobNames = @( 'Correctness_Determinism', 'Correctness_Build', 'Correctness_SourceBuild', 'Test_Windows_Desktop_Spanish_Release_32', 'Test_macOS_Debug' ) $table = @' #### Misc Tests |Branch|Determinism|Build Correctness|Source build|Spanish|MacOS| |:--:|:--:|:--|:--:|:--:|:--:| '@ foreach ($branchName in $branchNames) { $table += Get-AzureLine $branchName $jobNames } return $table } Set-StrictMode -version 2.0 $ErrorActionPreference="Stop" try { Get-BuildsTable | Write-Output Get-DesktopTable | Write-Output Get-CoreClrTable | Write-Output Get-IntegrationTable | Write-Output Get-MiscTable | Write-Output exit 0 } catch { Write-Host $_ Write-Host $_.Exception Write-Host $_.ScriptStackTrace exit 1 }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/setup-pr-validation.ps1
[CmdletBinding(PositionalBinding=$false)] param ( [string]$sourceBranchName, [string]$prNumber, [string]$commitSHA) try { # name and email are only used for merge commit, it doesn't really matter what we put in there. git config user.name "RoslynValidation" git config user.email "[email protected]" if ($sourceBranchName -notlike '*-vs-deps') { Write-Host "##vso[task.LogIssue type=warning;]The base branch for insertion validation is $sourceBranchName, which is not a vs-deps branch." } Write-Host "Validating the PR head matches the specified commit SHA ($commitSHA)..." if ($commitSHA.Length -lt 7) { Write-Host "##vso[task.LogIssue type=error;]The PR Commit SHA must be at least 7 characters long." exit 1 } Write-Host "Getting the hash of refs/pull/$prNumber/head..." $remoteRef = git ls-remote origin refs/pull/$prNumber/head Write-Host ($remoteRef | Out-String) $prHeadSHA = $remoteRef.Split()[0] if (!$prHeadSHA.StartsWith($commitSHA)) { Write-Host "##vso[task.LogIssue type=error;]The PR's Head SHA ($prHeadSHA) does not begin with the specified commit SHA ($commitSHA). Unreviewed changes may have been pushed to the PR." exit 1 } Write-Host "Setting up the build for PR validation by merging refs/pull/$prNumber/merge into $sourceBranchName..." git pull origin refs/pull/$prNumber/merge if (!$?) { Write-Host "##vso[task.LogIssue type=error;]Merging branch refs/pull/$prNumber/merge failed." exit 1 } } catch { Write-Host $_ Write-Host $_.Exception Write-Host $_.ScriptStackTrace exit 1 }
[CmdletBinding(PositionalBinding=$false)] param ( [string]$sourceBranchName, [string]$prNumber, [string]$commitSHA) try { # name and email are only used for merge commit, it doesn't really matter what we put in there. git config user.name "RoslynValidation" git config user.email "[email protected]" if ($sourceBranchName -notlike '*-vs-deps') { Write-Host "##vso[task.LogIssue type=warning;]The base branch for insertion validation is $sourceBranchName, which is not a vs-deps branch." } Write-Host "Validating the PR head matches the specified commit SHA ($commitSHA)..." if ($commitSHA.Length -lt 7) { Write-Host "##vso[task.LogIssue type=error;]The PR Commit SHA must be at least 7 characters long." exit 1 } Write-Host "Getting the hash of refs/pull/$prNumber/head..." $remoteRef = git ls-remote origin refs/pull/$prNumber/head Write-Host ($remoteRef | Out-String) $prHeadSHA = $remoteRef.Split()[0] if (!$prHeadSHA.StartsWith($commitSHA)) { Write-Host "##vso[task.LogIssue type=error;]The PR's Head SHA ($prHeadSHA) does not begin with the specified commit SHA ($commitSHA). Unreviewed changes may have been pushed to the PR." exit 1 } Write-Host "Setting up the build for PR validation by merging refs/pull/$prNumber/merge into $sourceBranchName..." git pull origin refs/pull/$prNumber/merge if (!$?) { Write-Host "##vso[task.LogIssue type=error;]Merging branch refs/pull/$prNumber/merge failed." exit 1 } } catch { Write-Host $_ Write-Host $_.Exception Write-Host $_.ScriptStackTrace exit 1 }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/pipelines/test-unix-job.yml
# Test on Unix using Helix parameters: - name: testRunName type: string default: '' - name: jobName type: string default: '' - name: buildJobName type: string default: '' - name: testArtifactName type: string default: '' - name: configuration type: string default: 'Debug' - name: testArguments type: string default: '' jobs: - job: ${{ parameters.jobName }} dependsOn: ${{ parameters.buildJobName }} pool: # Note that when helix is enabled, the agent running this job is essentially # a thin client that kicks off a helix job and waits for it to complete. # Thus we don't use a helix queue to run the job here, and instead use the plentiful AzDO vmImages. vmImage: ubuntu-20.04 timeoutInMinutes: 90 steps: - checkout: none - task: DownloadPipelineArtifact@2 displayName: Download Test Payload inputs: artifact: ${{ parameters.testArtifactName }} path: '$(Build.SourcesDirectory)' - task: ShellScript@2 displayName: Rehydrate RunTests inputs: scriptPath: ./artifacts/bin/RunTests/${{ parameters.configuration }}/netcoreapp3.1/rehydrate.sh env: HELIX_CORRELATION_PAYLOAD: '$(Build.SourcesDirectory)/.duplicate' - task: ShellScript@2 inputs: scriptPath: ./eng/build.sh args: --ci --helix --configuration ${{ parameters.configuration }} ${{ parameters.testArguments }} displayName: Test env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) - template: publish-logs.yml parameters: configuration: ${{ parameters.configuration }} jobName: ${{ parameters.jobName }}
# Test on Unix using Helix parameters: - name: testRunName type: string default: '' - name: jobName type: string default: '' - name: buildJobName type: string default: '' - name: testArtifactName type: string default: '' - name: configuration type: string default: 'Debug' - name: testArguments type: string default: '' jobs: - job: ${{ parameters.jobName }} dependsOn: ${{ parameters.buildJobName }} pool: # Note that when helix is enabled, the agent running this job is essentially # a thin client that kicks off a helix job and waits for it to complete. # Thus we don't use a helix queue to run the job here, and instead use the plentiful AzDO vmImages. vmImage: ubuntu-20.04 timeoutInMinutes: 90 steps: - checkout: none - task: DownloadPipelineArtifact@2 displayName: Download Test Payload inputs: artifact: ${{ parameters.testArtifactName }} path: '$(Build.SourcesDirectory)' - task: ShellScript@2 displayName: Rehydrate RunTests inputs: scriptPath: ./artifacts/bin/RunTests/${{ parameters.configuration }}/netcoreapp3.1/rehydrate.sh env: HELIX_CORRELATION_PAYLOAD: '$(Build.SourcesDirectory)/.duplicate' - task: ShellScript@2 inputs: scriptPath: ./eng/build.sh args: --ci --helix --configuration ${{ parameters.configuration }} ${{ parameters.testArguments }} displayName: Test env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) - template: publish-logs.yml parameters: configuration: ${{ parameters.configuration }} jobName: ${{ parameters.jobName }}
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/pipelines/publish-logs.yml
# Build on windows desktop parameters: - name: jobName type: string default: '' - name: configuration type: string default: 'Debug' steps: - task: PublishPipelineArtifact@1 displayName: Publish Logs inputs: targetPath: '$(Build.SourcesDirectory)/artifacts/log/${{ parameters.configuration }}' artifactName: '${{ parameters.jobName }} Attempt $(System.JobAttempt) Logs' continueOnError: true condition: not(succeeded())
# Build on windows desktop parameters: - name: jobName type: string default: '' - name: configuration type: string default: 'Debug' steps: - task: PublishPipelineArtifact@1 displayName: Publish Logs inputs: targetPath: '$(Build.SourcesDirectory)/artifacts/log/${{ parameters.configuration }}' artifactName: '${{ parameters.jobName }} Attempt $(System.JobAttempt) Logs' continueOnError: true condition: not(succeeded())
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/common/post-build/nuget-validation.ps1
# This script validates NuGet package metadata information using this # tool: https://github.com/NuGet/NuGetGallery/tree/jver-verify/src/VerifyMicrosoftPackage param( [Parameter(Mandatory=$true)][string] $PackagesPath, # Path to where the packages to be validated are [Parameter(Mandatory=$true)][string] $ToolDestinationPath # Where the validation tool should be downloaded to ) try { . $PSScriptRoot\post-build-utils.ps1 $url = 'https://raw.githubusercontent.com/NuGet/NuGetGallery/3e25ad135146676bcab0050a516939d9958bfa5d/src/VerifyMicrosoftPackage/verify.ps1' New-Item -ItemType 'directory' -Path ${ToolDestinationPath} -Force Invoke-WebRequest $url -OutFile ${ToolDestinationPath}\verify.ps1 & ${ToolDestinationPath}\verify.ps1 ${PackagesPath}\*.nupkg } catch { Write-Host $_.ScriptStackTrace Write-PipelineTelemetryError -Category 'NuGetValidation' -Message $_ ExitWithExitCode 1 }
# This script validates NuGet package metadata information using this # tool: https://github.com/NuGet/NuGetGallery/tree/jver-verify/src/VerifyMicrosoftPackage param( [Parameter(Mandatory=$true)][string] $PackagesPath, # Path to where the packages to be validated are [Parameter(Mandatory=$true)][string] $ToolDestinationPath # Where the validation tool should be downloaded to ) try { . $PSScriptRoot\post-build-utils.ps1 $url = 'https://raw.githubusercontent.com/NuGet/NuGetGallery/3e25ad135146676bcab0050a516939d9958bfa5d/src/VerifyMicrosoftPackage/verify.ps1' New-Item -ItemType 'directory' -Path ${ToolDestinationPath} -Force Invoke-WebRequest $url -OutFile ${ToolDestinationPath}\verify.ps1 & ${ToolDestinationPath}\verify.ps1 ${PackagesPath}\*.nupkg } catch { Write-Host $_.ScriptStackTrace Write-PipelineTelemetryError -Category 'NuGetValidation' -Message $_ ExitWithExitCode 1 }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/common/cross/arm64/tizen-build-rootfs.sh
#!/usr/bin/env bash set -e __CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) __TIZEN_CROSSDIR="$__CrossDir/tizen" if [[ -z "$ROOTFS_DIR" ]]; then echo "ROOTFS_DIR is not defined." exit 1; fi TIZEN_TMP_DIR=$ROOTFS_DIR/tizen_tmp mkdir -p $TIZEN_TMP_DIR # Download files echo ">>Start downloading files" VERBOSE=1 $__CrossDir/tizen-fetch.sh $TIZEN_TMP_DIR echo "<<Finish downloading files" echo ">>Start constructing Tizen rootfs" TIZEN_RPM_FILES=`ls $TIZEN_TMP_DIR/*.rpm` cd $ROOTFS_DIR for f in $TIZEN_RPM_FILES; do rpm2cpio $f | cpio -idm --quiet done echo "<<Finish constructing Tizen rootfs" # Cleanup tmp rm -rf $TIZEN_TMP_DIR # Configure Tizen rootfs echo ">>Start configuring Tizen rootfs" ln -sfn asm-arm64 ./usr/include/asm patch -p1 < $__TIZEN_CROSSDIR/tizen.patch echo "<<Finish configuring Tizen rootfs"
#!/usr/bin/env bash set -e __CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) __TIZEN_CROSSDIR="$__CrossDir/tizen" if [[ -z "$ROOTFS_DIR" ]]; then echo "ROOTFS_DIR is not defined." exit 1; fi TIZEN_TMP_DIR=$ROOTFS_DIR/tizen_tmp mkdir -p $TIZEN_TMP_DIR # Download files echo ">>Start downloading files" VERBOSE=1 $__CrossDir/tizen-fetch.sh $TIZEN_TMP_DIR echo "<<Finish downloading files" echo ">>Start constructing Tizen rootfs" TIZEN_RPM_FILES=`ls $TIZEN_TMP_DIR/*.rpm` cd $ROOTFS_DIR for f in $TIZEN_RPM_FILES; do rpm2cpio $f | cpio -idm --quiet done echo "<<Finish constructing Tizen rootfs" # Cleanup tmp rm -rf $TIZEN_TMP_DIR # Configure Tizen rootfs echo ">>Start configuring Tizen rootfs" ln -sfn asm-arm64 ./usr/include/asm patch -p1 < $__TIZEN_CROSSDIR/tizen.patch echo "<<Finish configuring Tizen rootfs"
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/common/templates/steps/source-build.yml
parameters: # This template adds arcade-powered source-build to CI. # This is a 'steps' template, and is intended for advanced scenarios where the existing build # infra has a careful build methodology that must be followed. For example, a repo # (dotnet/runtime) might choose to clone the GitHub repo only once and store it as a pipeline # artifact for all subsequent jobs to use, to reduce dependence on a strong network connection to # GitHub. Using this steps template leaves room for that infra to be included. # Defines the platform on which to run the steps. See 'eng/common/templates/job/source-build.yml' # for details. The entire object is described in the 'job' template for simplicity, even though # the usage of the properties on this object is split between the 'job' and 'steps' templates. platform: {} steps: # Build. Keep it self-contained for simple reusability. (No source-build-specific job variables.) - script: | set -x df -h # If building on the internal project, the artifact feeds variable may be available (usually only if needed) # In that case, call the feed setup script to add internal feeds corresponding to public ones. # In addition, add an msbuild argument to copy the WIP from the repo to the target build location. # This is because SetupNuGetSources.sh will alter the current NuGet.config file, and we need to preserve those # changes. $internalRestoreArgs= if [ '$(dn-bot-dnceng-artifact-feeds-rw)' != '$''(dn-bot-dnceng-artifact-feeds-rw)' ]; then # Temporarily work around https://github.com/dotnet/arcade/issues/7709 chmod +x $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh $(Build.SourcesDirectory)/NuGet.config $(dn-bot-dnceng-artifact-feeds-rw) internalRestoreArgs='/p:CopyWipIntoInnerSourceBuildRepo=true' # The 'Copy WIP' feature of source build uses git stash to apply changes from the original repo. # This only works if there is a username/email configured, which won't be the case in most CI runs. git config --get user.email if [ $? -ne 0 ]; then git config user.email [email protected] git config user.name dn-bot fi fi # If building on the internal project, the internal storage variable may be available (usually only if needed) # In that case, add variables to allow the download of internal runtimes if the specified versions are not found # in the default public locations. internalRuntimeDownloadArgs= if [ '$(dotnetclimsrc-read-sas-token-base64)' != '$''(dotnetclimsrc-read-sas-token-base64)' ]; then internalRuntimeDownloadArgs='/p:DotNetRuntimeSourceFeed=https://dotnetclimsrc.blob.core.windows.net/dotnet /p:DotNetRuntimeSourceFeedKey=$(dotnetclimsrc-read-sas-token-base64) --runtimesourcefeed https://dotnetclimsrc.blob.core.windows.net/dotnet --runtimesourcefeedkey $(dotnetclimsrc-read-sas-token-base64)' fi buildConfig=Release # Check if AzDO substitutes in a build config from a variable, and use it if so. if [ '$(_BuildConfig)' != '$''(_BuildConfig)' ]; then buildConfig='$(_BuildConfig)' fi officialBuildArgs= if [ '${{ and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}' = 'True' ]; then officialBuildArgs='/p:DotNetPublishUsingPipelines=true /p:OfficialBuildId=$(BUILD.BUILDNUMBER)' fi targetRidArgs= if [ '${{ parameters.platform.targetRID }}' != '' ]; then targetRidArgs='/p:TargetRid=${{ parameters.platform.targetRID }}' fi publishArgs= if [ '${{ parameters.platform.skipPublishValidation }}' != 'true' ]; then publishArgs='--publish' fi ${{ coalesce(parameters.platform.buildScript, './build.sh') }} --ci \ --configuration $buildConfig \ --restore --build --pack $publishArgs -bl \ $officialBuildArgs \ $internalRuntimeDownloadArgs \ $internalRestoreArgs \ $targetRidArgs \ /p:SourceBuildNonPortable=${{ parameters.platform.nonPortable }} \ /p:ArcadeBuildFromSource=true displayName: Build # Upload build logs for diagnosis. - task: CopyFiles@2 displayName: Prepare BuildLogs staging directory inputs: SourceFolder: '$(Build.SourcesDirectory)' Contents: | **/*.log **/*.binlog artifacts/source-build/self/prebuilt-report/** TargetFolder: '$(Build.StagingDirectory)/BuildLogs' CleanTargetFolder: true continueOnError: true condition: succeededOrFailed() - task: PublishPipelineArtifact@1 displayName: Publish BuildLogs inputs: targetPath: '$(Build.StagingDirectory)/BuildLogs' artifactName: BuildLogs_SourceBuild_${{ parameters.platform.name }}_Attempt$(System.JobAttempt) continueOnError: true condition: succeededOrFailed()
parameters: # This template adds arcade-powered source-build to CI. # This is a 'steps' template, and is intended for advanced scenarios where the existing build # infra has a careful build methodology that must be followed. For example, a repo # (dotnet/runtime) might choose to clone the GitHub repo only once and store it as a pipeline # artifact for all subsequent jobs to use, to reduce dependence on a strong network connection to # GitHub. Using this steps template leaves room for that infra to be included. # Defines the platform on which to run the steps. See 'eng/common/templates/job/source-build.yml' # for details. The entire object is described in the 'job' template for simplicity, even though # the usage of the properties on this object is split between the 'job' and 'steps' templates. platform: {} steps: # Build. Keep it self-contained for simple reusability. (No source-build-specific job variables.) - script: | set -x df -h # If building on the internal project, the artifact feeds variable may be available (usually only if needed) # In that case, call the feed setup script to add internal feeds corresponding to public ones. # In addition, add an msbuild argument to copy the WIP from the repo to the target build location. # This is because SetupNuGetSources.sh will alter the current NuGet.config file, and we need to preserve those # changes. $internalRestoreArgs= if [ '$(dn-bot-dnceng-artifact-feeds-rw)' != '$''(dn-bot-dnceng-artifact-feeds-rw)' ]; then # Temporarily work around https://github.com/dotnet/arcade/issues/7709 chmod +x $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh $(Build.SourcesDirectory)/NuGet.config $(dn-bot-dnceng-artifact-feeds-rw) internalRestoreArgs='/p:CopyWipIntoInnerSourceBuildRepo=true' # The 'Copy WIP' feature of source build uses git stash to apply changes from the original repo. # This only works if there is a username/email configured, which won't be the case in most CI runs. git config --get user.email if [ $? -ne 0 ]; then git config user.email [email protected] git config user.name dn-bot fi fi # If building on the internal project, the internal storage variable may be available (usually only if needed) # In that case, add variables to allow the download of internal runtimes if the specified versions are not found # in the default public locations. internalRuntimeDownloadArgs= if [ '$(dotnetclimsrc-read-sas-token-base64)' != '$''(dotnetclimsrc-read-sas-token-base64)' ]; then internalRuntimeDownloadArgs='/p:DotNetRuntimeSourceFeed=https://dotnetclimsrc.blob.core.windows.net/dotnet /p:DotNetRuntimeSourceFeedKey=$(dotnetclimsrc-read-sas-token-base64) --runtimesourcefeed https://dotnetclimsrc.blob.core.windows.net/dotnet --runtimesourcefeedkey $(dotnetclimsrc-read-sas-token-base64)' fi buildConfig=Release # Check if AzDO substitutes in a build config from a variable, and use it if so. if [ '$(_BuildConfig)' != '$''(_BuildConfig)' ]; then buildConfig='$(_BuildConfig)' fi officialBuildArgs= if [ '${{ and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}' = 'True' ]; then officialBuildArgs='/p:DotNetPublishUsingPipelines=true /p:OfficialBuildId=$(BUILD.BUILDNUMBER)' fi targetRidArgs= if [ '${{ parameters.platform.targetRID }}' != '' ]; then targetRidArgs='/p:TargetRid=${{ parameters.platform.targetRID }}' fi publishArgs= if [ '${{ parameters.platform.skipPublishValidation }}' != 'true' ]; then publishArgs='--publish' fi ${{ coalesce(parameters.platform.buildScript, './build.sh') }} --ci \ --configuration $buildConfig \ --restore --build --pack $publishArgs -bl \ $officialBuildArgs \ $internalRuntimeDownloadArgs \ $internalRestoreArgs \ $targetRidArgs \ /p:SourceBuildNonPortable=${{ parameters.platform.nonPortable }} \ /p:ArcadeBuildFromSource=true displayName: Build # Upload build logs for diagnosis. - task: CopyFiles@2 displayName: Prepare BuildLogs staging directory inputs: SourceFolder: '$(Build.SourcesDirectory)' Contents: | **/*.log **/*.binlog artifacts/source-build/self/prebuilt-report/** TargetFolder: '$(Build.StagingDirectory)/BuildLogs' CleanTargetFolder: true continueOnError: true condition: succeededOrFailed() - task: PublishPipelineArtifact@1 displayName: Publish BuildLogs inputs: targetPath: '$(Build.StagingDirectory)/BuildLogs' artifactName: BuildLogs_SourceBuild_${{ parameters.platform.name }}_Attempt$(System.JobAttempt) continueOnError: true condition: succeededOrFailed()
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/SourceBuildPrebuiltBaseline.xml
<UsageData> <IgnorePatterns> <UsagePattern IdentityGlob="*/*" /> </IgnorePatterns> </UsageData>
<UsageData> <IgnorePatterns> <UsagePattern IdentityGlob="*/*" /> </IgnorePatterns> </UsageData>
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/common/pipeline-logging-functions.ps1
# Source for this file was taken from https://github.com/microsoft/azure-pipelines-task-lib/blob/11c9439d4af17e6475d9fe058e6b2e03914d17e6/powershell/VstsTaskSdk/LoggingCommandFunctions.ps1 and modified. # NOTE: You should not be calling these method directly as they are likely to change. Instead you should be calling the Write-Pipeline* functions defined in tools.ps1 $script:loggingCommandPrefix = '##vso[' $script:loggingCommandEscapeMappings = @( # TODO: WHAT ABOUT "="? WHAT ABOUT "%"? New-Object psobject -Property @{ Token = ';' ; Replacement = '%3B' } New-Object psobject -Property @{ Token = "`r" ; Replacement = '%0D' } New-Object psobject -Property @{ Token = "`n" ; Replacement = '%0A' } New-Object psobject -Property @{ Token = "]" ; Replacement = '%5D' } ) # TODO: BUG: Escape % ??? # TODO: Add test to verify don't need to escape "=". # Specify "-Force" to force pipeline formatted output even if "$ci" is false or not set function Write-PipelineTelemetryError { [CmdletBinding()] param( [Parameter(Mandatory = $true)] [string]$Category, [Parameter(Mandatory = $true)] [string]$Message, [Parameter(Mandatory = $false)] [string]$Type = 'error', [string]$ErrCode, [string]$SourcePath, [string]$LineNumber, [string]$ColumnNumber, [switch]$AsOutput, [switch]$Force) $PSBoundParameters.Remove('Category') | Out-Null if ($Force -Or ((Test-Path variable:ci) -And $ci)) { $Message = "(NETCORE_ENGINEERING_TELEMETRY=$Category) $Message" } $PSBoundParameters.Remove('Message') | Out-Null $PSBoundParameters.Add('Message', $Message) Write-PipelineTaskError @PSBoundParameters } # Specify "-Force" to force pipeline formatted output even if "$ci" is false or not set function Write-PipelineTaskError { [CmdletBinding()] param( [Parameter(Mandatory = $true)] [string]$Message, [Parameter(Mandatory = $false)] [string]$Type = 'error', [string]$ErrCode, [string]$SourcePath, [string]$LineNumber, [string]$ColumnNumber, [switch]$AsOutput, [switch]$Force ) if (!$Force -And (-Not (Test-Path variable:ci) -Or !$ci)) { if ($Type -eq 'error') { Write-Host $Message -ForegroundColor Red return } elseif ($Type -eq 'warning') { Write-Host $Message -ForegroundColor Yellow return } } if (($Type -ne 'error') -and ($Type -ne 'warning')) { Write-Host $Message return } $PSBoundParameters.Remove('Force') | Out-Null if (-not $PSBoundParameters.ContainsKey('Type')) { $PSBoundParameters.Add('Type', 'error') } Write-LogIssue @PSBoundParameters } function Write-PipelineSetVariable { [CmdletBinding()] param( [Parameter(Mandatory = $true)] [string]$Name, [string]$Value, [switch]$Secret, [switch]$AsOutput, [bool]$IsMultiJobVariable = $true) if ((Test-Path variable:ci) -And $ci) { Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data $Value -Properties @{ 'variable' = $Name 'isSecret' = $Secret 'isOutput' = $IsMultiJobVariable } -AsOutput:$AsOutput } } function Write-PipelinePrependPath { [CmdletBinding()] param( [Parameter(Mandatory = $true)] [string]$Path, [switch]$AsOutput) if ((Test-Path variable:ci) -And $ci) { Write-LoggingCommand -Area 'task' -Event 'prependpath' -Data $Path -AsOutput:$AsOutput } } function Write-PipelineSetResult { [CmdletBinding()] param( [ValidateSet("Succeeded", "SucceededWithIssues", "Failed", "Cancelled", "Skipped")] [Parameter(Mandatory = $true)] [string]$Result, [string]$Message) if ((Test-Path variable:ci) -And $ci) { Write-LoggingCommand -Area 'task' -Event 'complete' -Data $Message -Properties @{ 'result' = $Result } } } <######################################## # Private functions. ########################################> function Format-LoggingCommandData { [CmdletBinding()] param([string]$Value, [switch]$Reverse) if (!$Value) { return '' } if (!$Reverse) { foreach ($mapping in $script:loggingCommandEscapeMappings) { $Value = $Value.Replace($mapping.Token, $mapping.Replacement) } } else { for ($i = $script:loggingCommandEscapeMappings.Length - 1 ; $i -ge 0 ; $i--) { $mapping = $script:loggingCommandEscapeMappings[$i] $Value = $Value.Replace($mapping.Replacement, $mapping.Token) } } return $Value } function Format-LoggingCommand { [CmdletBinding()] param( [Parameter(Mandatory = $true)] [string]$Area, [Parameter(Mandatory = $true)] [string]$Event, [string]$Data, [hashtable]$Properties) # Append the preamble. [System.Text.StringBuilder]$sb = New-Object -TypeName System.Text.StringBuilder $null = $sb.Append($script:loggingCommandPrefix).Append($Area).Append('.').Append($Event) # Append the properties. if ($Properties) { $first = $true foreach ($key in $Properties.Keys) { [string]$value = Format-LoggingCommandData $Properties[$key] if ($value) { if ($first) { $null = $sb.Append(' ') $first = $false } else { $null = $sb.Append(';') } $null = $sb.Append("$key=$value") } } } # Append the tail and output the value. $Data = Format-LoggingCommandData $Data $sb.Append(']').Append($Data).ToString() } function Write-LoggingCommand { [CmdletBinding(DefaultParameterSetName = 'Parameters')] param( [Parameter(Mandatory = $true, ParameterSetName = 'Parameters')] [string]$Area, [Parameter(Mandatory = $true, ParameterSetName = 'Parameters')] [string]$Event, [Parameter(ParameterSetName = 'Parameters')] [string]$Data, [Parameter(ParameterSetName = 'Parameters')] [hashtable]$Properties, [Parameter(Mandatory = $true, ParameterSetName = 'Object')] $Command, [switch]$AsOutput) if ($PSCmdlet.ParameterSetName -eq 'Object') { Write-LoggingCommand -Area $Command.Area -Event $Command.Event -Data $Command.Data -Properties $Command.Properties -AsOutput:$AsOutput return } $command = Format-LoggingCommand -Area $Area -Event $Event -Data $Data -Properties $Properties if ($AsOutput) { $command } else { Write-Host $command } } function Write-LogIssue { [CmdletBinding()] param( [ValidateSet('warning', 'error')] [Parameter(Mandatory = $true)] [string]$Type, [string]$Message, [string]$ErrCode, [string]$SourcePath, [string]$LineNumber, [string]$ColumnNumber, [switch]$AsOutput) $command = Format-LoggingCommand -Area 'task' -Event 'logissue' -Data $Message -Properties @{ 'type' = $Type 'code' = $ErrCode 'sourcepath' = $SourcePath 'linenumber' = $LineNumber 'columnnumber' = $ColumnNumber } if ($AsOutput) { return $command } if ($Type -eq 'error') { $foregroundColor = $host.PrivateData.ErrorForegroundColor $backgroundColor = $host.PrivateData.ErrorBackgroundColor if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) { $foregroundColor = [System.ConsoleColor]::Red $backgroundColor = [System.ConsoleColor]::Black } } else { $foregroundColor = $host.PrivateData.WarningForegroundColor $backgroundColor = $host.PrivateData.WarningBackgroundColor if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) { $foregroundColor = [System.ConsoleColor]::Yellow $backgroundColor = [System.ConsoleColor]::Black } } Write-Host $command -ForegroundColor $foregroundColor -BackgroundColor $backgroundColor }
# Source for this file was taken from https://github.com/microsoft/azure-pipelines-task-lib/blob/11c9439d4af17e6475d9fe058e6b2e03914d17e6/powershell/VstsTaskSdk/LoggingCommandFunctions.ps1 and modified. # NOTE: You should not be calling these method directly as they are likely to change. Instead you should be calling the Write-Pipeline* functions defined in tools.ps1 $script:loggingCommandPrefix = '##vso[' $script:loggingCommandEscapeMappings = @( # TODO: WHAT ABOUT "="? WHAT ABOUT "%"? New-Object psobject -Property @{ Token = ';' ; Replacement = '%3B' } New-Object psobject -Property @{ Token = "`r" ; Replacement = '%0D' } New-Object psobject -Property @{ Token = "`n" ; Replacement = '%0A' } New-Object psobject -Property @{ Token = "]" ; Replacement = '%5D' } ) # TODO: BUG: Escape % ??? # TODO: Add test to verify don't need to escape "=". # Specify "-Force" to force pipeline formatted output even if "$ci" is false or not set function Write-PipelineTelemetryError { [CmdletBinding()] param( [Parameter(Mandatory = $true)] [string]$Category, [Parameter(Mandatory = $true)] [string]$Message, [Parameter(Mandatory = $false)] [string]$Type = 'error', [string]$ErrCode, [string]$SourcePath, [string]$LineNumber, [string]$ColumnNumber, [switch]$AsOutput, [switch]$Force) $PSBoundParameters.Remove('Category') | Out-Null if ($Force -Or ((Test-Path variable:ci) -And $ci)) { $Message = "(NETCORE_ENGINEERING_TELEMETRY=$Category) $Message" } $PSBoundParameters.Remove('Message') | Out-Null $PSBoundParameters.Add('Message', $Message) Write-PipelineTaskError @PSBoundParameters } # Specify "-Force" to force pipeline formatted output even if "$ci" is false or not set function Write-PipelineTaskError { [CmdletBinding()] param( [Parameter(Mandatory = $true)] [string]$Message, [Parameter(Mandatory = $false)] [string]$Type = 'error', [string]$ErrCode, [string]$SourcePath, [string]$LineNumber, [string]$ColumnNumber, [switch]$AsOutput, [switch]$Force ) if (!$Force -And (-Not (Test-Path variable:ci) -Or !$ci)) { if ($Type -eq 'error') { Write-Host $Message -ForegroundColor Red return } elseif ($Type -eq 'warning') { Write-Host $Message -ForegroundColor Yellow return } } if (($Type -ne 'error') -and ($Type -ne 'warning')) { Write-Host $Message return } $PSBoundParameters.Remove('Force') | Out-Null if (-not $PSBoundParameters.ContainsKey('Type')) { $PSBoundParameters.Add('Type', 'error') } Write-LogIssue @PSBoundParameters } function Write-PipelineSetVariable { [CmdletBinding()] param( [Parameter(Mandatory = $true)] [string]$Name, [string]$Value, [switch]$Secret, [switch]$AsOutput, [bool]$IsMultiJobVariable = $true) if ((Test-Path variable:ci) -And $ci) { Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data $Value -Properties @{ 'variable' = $Name 'isSecret' = $Secret 'isOutput' = $IsMultiJobVariable } -AsOutput:$AsOutput } } function Write-PipelinePrependPath { [CmdletBinding()] param( [Parameter(Mandatory = $true)] [string]$Path, [switch]$AsOutput) if ((Test-Path variable:ci) -And $ci) { Write-LoggingCommand -Area 'task' -Event 'prependpath' -Data $Path -AsOutput:$AsOutput } } function Write-PipelineSetResult { [CmdletBinding()] param( [ValidateSet("Succeeded", "SucceededWithIssues", "Failed", "Cancelled", "Skipped")] [Parameter(Mandatory = $true)] [string]$Result, [string]$Message) if ((Test-Path variable:ci) -And $ci) { Write-LoggingCommand -Area 'task' -Event 'complete' -Data $Message -Properties @{ 'result' = $Result } } } <######################################## # Private functions. ########################################> function Format-LoggingCommandData { [CmdletBinding()] param([string]$Value, [switch]$Reverse) if (!$Value) { return '' } if (!$Reverse) { foreach ($mapping in $script:loggingCommandEscapeMappings) { $Value = $Value.Replace($mapping.Token, $mapping.Replacement) } } else { for ($i = $script:loggingCommandEscapeMappings.Length - 1 ; $i -ge 0 ; $i--) { $mapping = $script:loggingCommandEscapeMappings[$i] $Value = $Value.Replace($mapping.Replacement, $mapping.Token) } } return $Value } function Format-LoggingCommand { [CmdletBinding()] param( [Parameter(Mandatory = $true)] [string]$Area, [Parameter(Mandatory = $true)] [string]$Event, [string]$Data, [hashtable]$Properties) # Append the preamble. [System.Text.StringBuilder]$sb = New-Object -TypeName System.Text.StringBuilder $null = $sb.Append($script:loggingCommandPrefix).Append($Area).Append('.').Append($Event) # Append the properties. if ($Properties) { $first = $true foreach ($key in $Properties.Keys) { [string]$value = Format-LoggingCommandData $Properties[$key] if ($value) { if ($first) { $null = $sb.Append(' ') $first = $false } else { $null = $sb.Append(';') } $null = $sb.Append("$key=$value") } } } # Append the tail and output the value. $Data = Format-LoggingCommandData $Data $sb.Append(']').Append($Data).ToString() } function Write-LoggingCommand { [CmdletBinding(DefaultParameterSetName = 'Parameters')] param( [Parameter(Mandatory = $true, ParameterSetName = 'Parameters')] [string]$Area, [Parameter(Mandatory = $true, ParameterSetName = 'Parameters')] [string]$Event, [Parameter(ParameterSetName = 'Parameters')] [string]$Data, [Parameter(ParameterSetName = 'Parameters')] [hashtable]$Properties, [Parameter(Mandatory = $true, ParameterSetName = 'Object')] $Command, [switch]$AsOutput) if ($PSCmdlet.ParameterSetName -eq 'Object') { Write-LoggingCommand -Area $Command.Area -Event $Command.Event -Data $Command.Data -Properties $Command.Properties -AsOutput:$AsOutput return } $command = Format-LoggingCommand -Area $Area -Event $Event -Data $Data -Properties $Properties if ($AsOutput) { $command } else { Write-Host $command } } function Write-LogIssue { [CmdletBinding()] param( [ValidateSet('warning', 'error')] [Parameter(Mandatory = $true)] [string]$Type, [string]$Message, [string]$ErrCode, [string]$SourcePath, [string]$LineNumber, [string]$ColumnNumber, [switch]$AsOutput) $command = Format-LoggingCommand -Area 'task' -Event 'logissue' -Data $Message -Properties @{ 'type' = $Type 'code' = $ErrCode 'sourcepath' = $SourcePath 'linenumber' = $LineNumber 'columnnumber' = $ColumnNumber } if ($AsOutput) { return $command } if ($Type -eq 'error') { $foregroundColor = $host.PrivateData.ErrorForegroundColor $backgroundColor = $host.PrivateData.ErrorBackgroundColor if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) { $foregroundColor = [System.ConsoleColor]::Red $backgroundColor = [System.ConsoleColor]::Black } } else { $foregroundColor = $host.PrivateData.WarningForegroundColor $backgroundColor = $host.PrivateData.WarningBackgroundColor if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) { $foregroundColor = [System.ConsoleColor]::Yellow $backgroundColor = [System.ConsoleColor]::Black } } Write-Host $command -ForegroundColor $foregroundColor -BackgroundColor $backgroundColor }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Scripting/CoreTest/Properties/launchSettings.json
{ "profiles": { "xUnit.net Console (32-bit)": { "commandName": "Executable", "executablePath": "$(NuGetPackageRoot)xunit.runner.console\\$(XUnitVersion)\\tools\\net452\\xunit.console.x86.exe", "commandLineArgs": "$(TargetPath) -noshadow -verbose" }, "xUnit.net Console (64-bit)": { "commandName": "Executable", "executablePath": "$(NuGetPackageRoot)xunit.runner.console\\$(XUnitVersion)\\tools\\net452\\xunit.console.exe", "commandLineArgs": "$(TargetPath) -noshadow -verbose" } } }
{ "profiles": { "xUnit.net Console (32-bit)": { "commandName": "Executable", "executablePath": "$(NuGetPackageRoot)xunit.runner.console\\$(XUnitVersion)\\tools\\net452\\xunit.console.x86.exe", "commandLineArgs": "$(TargetPath) -noshadow -verbose" }, "xUnit.net Console (64-bit)": { "commandName": "Executable", "executablePath": "$(NuGetPackageRoot)xunit.runner.console\\$(XUnitVersion)\\tools\\net452\\xunit.console.exe", "commandLineArgs": "$(TargetPath) -noshadow -verbose" } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./scripts/check-for-loc-changes.ps1
<# .SYNOPSIS Checks if a merge will result in changes to .xlf files, and returns a failure code if true. .DESCRIPTION The point of this script is to block changes to localized resources after we've entered a Loc freeze. It's meant to be run in a CI system prior to merging a PR. .PARAMETER base Generally the branch a change will be merged into, but this could also be a commit or tag. .PARAMETER head The commit that will be merged into $base. Again, this can be a branch, tag, or commit. #> [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory=$true)] [string]$base, [Parameter(Mandatory=$true)] [string]$head ) Set-StrictMode -version 2.0 $ErrorActionPreference="Stop" try { . (Join-Path $PSScriptRoot "build-utils.ps1") Push-Location $RepoRoot # Find the merge base, then the list of files that changed since then. $mergeBase = & git merge-base $base $head $changedFiles = @(& git diff --name-only $mergeBase $head) # Filter out everything that isn't a .xlf file. $changedXlfFiles = @($changedFiles | where { [IO.Path]::GetExtension($_) -eq ".xlf" }) # Fail if there are any changed .xlf files. $changedXlfFiles | % { Write-Host "$_ has been modified" } if ($changedXlfFiles.Count -eq 0) { exit 0 } else { exit 1 } } catch [exception] { Write-Host $_ Write-Host $_.Exception exit 1 } finally { Pop-Location }
<# .SYNOPSIS Checks if a merge will result in changes to .xlf files, and returns a failure code if true. .DESCRIPTION The point of this script is to block changes to localized resources after we've entered a Loc freeze. It's meant to be run in a CI system prior to merging a PR. .PARAMETER base Generally the branch a change will be merged into, but this could also be a commit or tag. .PARAMETER head The commit that will be merged into $base. Again, this can be a branch, tag, or commit. #> [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory=$true)] [string]$base, [Parameter(Mandatory=$true)] [string]$head ) Set-StrictMode -version 2.0 $ErrorActionPreference="Stop" try { . (Join-Path $PSScriptRoot "build-utils.ps1") Push-Location $RepoRoot # Find the merge base, then the list of files that changed since then. $mergeBase = & git merge-base $base $head $changedFiles = @(& git diff --name-only $mergeBase $head) # Filter out everything that isn't a .xlf file. $changedXlfFiles = @($changedFiles | where { [IO.Path]::GetExtension($_) -eq ".xlf" }) # Fail if there are any changed .xlf files. $changedXlfFiles | % { Write-Host "$_ has been modified" } if ($changedXlfFiles.Count -eq 0) { exit 0 } else { exit 1 } } catch [exception] { Write-Host $_ Write-Host $_.Exception exit 1 } finally { Pop-Location }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/build.ps1
# # This script controls the Roslyn build process. This encompasess everything from build, testing to # publishing of NuGet packages. The intent is to structure it to allow for a simple flow of logic # between the following phases: # # - restore # - build # - sign # - pack # - test # - publish # # Each of these phases has a separate command which can be executed independently. For instance # it's fine to call `build.ps1 -build -testDesktop` followed by repeated calls to # `.\build.ps1 -testDesktop`. [CmdletBinding(PositionalBinding=$false)] param ( [string][Alias('c')]$configuration = "Debug", [string][Alias('v')]$verbosity = "m", [string]$msbuildEngine = "vs", # Actions [switch][Alias('r')]$restore, [switch][Alias('b')]$build, [switch]$rebuild, [switch]$sign, [switch]$pack, [switch]$publish, [switch]$launch, [switch]$help, # Options [switch]$bootstrap, [string]$bootstrapConfiguration = "Release", [switch][Alias('bl')]$binaryLog, [switch]$buildServerLog, [switch]$ci, [switch]$collectDumps, [switch][Alias('a')]$runAnalyzers, [switch]$skipDocumentation = $false, [switch][Alias('d')]$deployExtensions, [switch]$prepareMachine, [switch]$useGlobalNuGetCache = $true, [switch]$warnAsError = $false, [switch]$sourceBuild = $false, [switch]$oop64bit = $true, [switch]$lspEditor = $false, # official build settings [string]$officialBuildId = "", [string]$officialSkipApplyOptimizationData = "", [string]$officialSkipTests = "", [string]$officialSourceBranchName = "", [string]$officialIbcDrop = "", [string]$officialVisualStudioDropAccessToken = "", # Test actions [switch]$test32, [switch]$test64, [switch]$testVsi, [switch][Alias('test')]$testDesktop, [switch]$testCoreClr, [switch]$testCompilerOnly = $false, [switch]$testIOperation, [switch]$testUsedAssemblies, [switch]$sequential, [switch]$helix, [string]$helixQueueName = "", [parameter(ValueFromRemainingArguments=$true)][string[]]$properties) Set-StrictMode -version 2.0 $ErrorActionPreference = "Stop" function Print-Usage() { Write-Host "Common settings:" Write-Host " -configuration <value> Build configuration: 'Debug' or 'Release' (short: -c)" Write-Host " -verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]" Write-Host " -deployExtensions Deploy built vsixes (short: -d)" Write-Host " -binaryLog Create MSBuild binary log (short: -bl)" Write-Host " -buildServerLog Create Roslyn build server log" Write-Host "" Write-Host "Actions:" Write-Host " -restore Restore packages (short: -r)" Write-Host " -build Build main solution (short: -b)" Write-Host " -rebuild Rebuild main solution" Write-Host " -pack Build NuGet packages, VS insertion manifests and installer" Write-Host " -sign Sign our binaries" Write-Host " -publish Publish build artifacts (e.g. symbols)" Write-Host " -launch Launch Visual Studio in developer hive" Write-Host " -help Print help and exit" Write-Host "" Write-Host "Test actions" Write-Host " -test32 Run unit tests in the 32-bit runner" Write-Host " -test64 Run units tests in the 64-bit runner" Write-Host " -testDesktop Run Desktop unit tests (short: -test)" Write-Host " -testCoreClr Run CoreClr unit tests" Write-Host " -testCompilerOnly Run only the compiler unit tests" Write-Host " -testVsi Run all integration tests" Write-Host " -testIOperation Run extra checks to validate IOperations" Write-Host " -testUsedAssemblies Run extra checks to validate used assemblies feature" Write-Host "" Write-Host "Advanced settings:" Write-Host " -ci Set when running on CI server" Write-Host " -bootstrap Build using a bootstrap compilers" Write-Host " -bootstrapConfiguration Build configuration for bootstrap compiler: 'Debug' or 'Release'" Write-Host " -msbuildEngine <value> Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)." Write-Host " -collectDumps Collect dumps from test runs" Write-Host " -runAnalyzers Run analyzers during build operations (short: -a)" Write-Host " -skipDocumentation Skip generation of XML documentation files" Write-Host " -prepareMachine Prepare machine for CI run, clean up processes after build" Write-Host " -useGlobalNuGetCache Use global NuGet cache." Write-Host " -warnAsError Treat all warnings as errors" Write-Host " -sourceBuild Simulate building source-build" Write-Host "" Write-Host "Official build settings:" Write-Host " -officialBuildId An official build id, e.g. 20190102.3" Write-Host " -officialSkipTests <bool> Pass 'true' to not run tests" Write-Host " -officialSkipApplyOptimizationData <bool> Pass 'true' to not apply optimization data" Write-Host " -officialSourceBranchName <string> The source branch name" Write-Host " -officialIbcDrop <string> IBC data drop to use (e.g. 'ProfilingOutputs/DevDiv/VS/..')." Write-Host " 'default' for the most recent available for the branch." Write-Host " -officialVisualStudioDropAccessToken <string> The access token to access OptProf data drop" Write-Host "" Write-Host "Command line arguments starting with '/p:' are passed through to MSBuild." } # Process the command line arguments and establish defaults for the values which are not # specified. # # In this function it's okay to use two arguments to extend the effect of another. For # example it's okay to look at $testVsi and infer $runAnalyzers. It's not okay though to infer # $build based on say $testDesktop. It's possible the developer wanted only for testing # to execute, not any build. function Process-Arguments() { function OfficialBuildOnly([string]$argName) { if ((Get-Variable $argName -Scope Script).Value) { if (!$officialBuildId) { Write-Host "$argName can only be specified for official builds" exit 1 } } else { if ($officialBuildId) { Write-Host "$argName must be specified in official builds" exit 1 } } } if ($help -or (($properties -ne $null) -and ($properties.Contains("/help") -or $properties.Contains("/?")))) { Print-Usage exit 0 } OfficialBuildOnly "officialSkipTests" OfficialBuildOnly "officialSkipApplyOptimizationData" OfficialBuildOnly "officialSourceBranchName" OfficialBuildOnly "officialVisualStudioDropAccessToken" if ($officialBuildId) { $script:useGlobalNuGetCache = $false $script:collectDumps = $true $script:testDesktop = ![System.Boolean]::Parse($officialSkipTests) $script:applyOptimizationData = ![System.Boolean]::Parse($officialSkipApplyOptimizationData) } else { $script:applyOptimizationData = $false } if ($ci) { $script:binaryLog = $true if ($bootstrap) { $script:buildServerLog = $true } } if ($test32 -and $test64) { Write-Host "Cannot combine -test32 and -test64" exit 1 } $anyUnit = $testDesktop -or $testCoreClr if ($anyUnit -and $testVsi) { Write-Host "Cannot combine unit and VSI testing" exit 1 } if ($testVsi -and $helix) { Write-Host "Cannot run integration tests on Helix" exit 1 } if ($testVsi) { # Avoid spending time in analyzers when requested, and also in the slowest integration test builds $script:runAnalyzers = $false $script:bootstrap = $false } if ($build -and $launch -and -not $deployExtensions) { Write-Host -ForegroundColor Red "Cannot combine -build and -launch without -deployExtensions" exit 1 } if ($bootstrap) { $script:restore = $true } $script:test32 = -not $test64 foreach ($property in $properties) { if (!$property.StartsWith("/p:", "InvariantCultureIgnoreCase")) { Write-Host "Invalid argument: $property" Print-Usage exit 1 } } } function BuildSolution() { $solution = "Roslyn.sln" Write-Host "$($solution):" $bl = if ($binaryLog) { "/bl:" + (Join-Path $LogDir "Build.binlog") } else { "" } if ($buildServerLog) { ${env:ROSLYNCOMMANDLINELOGFILE} = Join-Path $LogDir "Build.Server.log" } $projects = Join-Path $RepoRoot $solution $toolsetBuildProj = InitializeToolset $ibcDropName = GetIbcDropName # Do not set this property to true explicitly, since that would override values set in projects. $suppressExtensionDeployment = if (!$deployExtensions) { "/p:DeployExtension=false" } else { "" } # The warnAsError flag for MSBuild will promote all warnings to errors. This is true for warnings # that MSBuild output as well as ones that custom tasks output. $msbuildWarnAsError = if ($warnAsError) { "/warnAsError" } else { "" } # Workaround for some machines in the AzDO pool not allowing long paths (%5c is msbuild escaped backslash) $ibcDir = Join-Path $RepoRoot ".o%5c" # Set DotNetBuildFromSource to 'true' if we're simulating building for source-build. $buildFromSource = if ($sourceBuild) { "/p:DotNetBuildFromSource=true" } else { "" } $generateDocumentationFile = if ($skipDocumentation) { "/p:GenerateDocumentationFile=false" } else { "" } $roslynUseHardLinks = if ($ci) { "/p:ROSLYNUSEHARDLINKS=true" } else { "" } try { MSBuild $toolsetBuildProj ` $bl ` /p:Configuration=$configuration ` /p:Projects=$projects ` /p:RepoRoot=$RepoRoot ` /p:Restore=$restore ` /p:Build=$build ` /p:Rebuild=$rebuild ` /p:Pack=$pack ` /p:Sign=$sign ` /p:Publish=$publish ` /p:ContinuousIntegrationBuild=$ci ` /p:OfficialBuildId=$officialBuildId ` /p:RunAnalyzersDuringBuild=$runAnalyzers ` /p:BootstrapBuildPath=$bootstrapDir ` /p:TreatWarningsAsErrors=$warnAsError ` /p:EnableNgenOptimization=$applyOptimizationData ` /p:IbcOptimizationDataDir=$ibcDir ` /p:RestoreUseStaticGraphEvaluation=true ` /p:VisualStudioIbcDrop=$ibcDropName ` /p:VisualStudioDropAccessToken=$officialVisualStudioDropAccessToken ` $suppressExtensionDeployment ` $msbuildWarnAsError ` $buildFromSource ` $generateDocumentationFile ` $roslynUseHardLinks ` @properties } finally { ${env:ROSLYNCOMMANDLINELOGFILE} = $null } } # Get the branch that produced the IBC data this build is going to consume. # IBC data are only merged in official built, but we want to test some of the logic in CI builds as well. function GetIbcSourceBranchName() { if (Test-Path variable:global:_IbcSourceBranchName) { return $global:_IbcSourceBranchName } function calculate { $fallback = "main" $branchData = GetBranchPublishData $officialSourceBranchName if ($branchData -eq $null) { Write-LogIssue -Type "warning" -Message "Branch $officialSourceBranchName is not listed in PublishData.json. Using IBC data from '$fallback'." Write-Host "Override by setting IbcDrop build variable." -ForegroundColor Yellow return $fallback } return $branchData.vsBranch } return $global:_IbcSourceBranchName = calculate } function GetIbcDropName() { if ($officialIbcDrop -and $officialIbcDrop -ne "default"){ return $officialIbcDrop } # Don't try and get the ibc drop if we're not in an official build as it won't be used anyway if (!$applyOptimizationData -or !$officialBuildId) { return "" } # Bring in the ibc tools $packagePath = Join-Path (Get-PackageDir "Microsoft.DevDiv.Optimization.Data.PowerShell") "lib\net461" Import-Module (Join-Path $packagePath "Optimization.Data.PowerShell.dll") # Find the matching drop $branch = GetIbcSourceBranchName Write-Host "Optimization data branch name is '$branch'." $pat = ConvertTo-SecureString $officialVisualStudioDropAccessToken -AsPlainText -Force $drop = Find-OptimizationInputsStoreForBranch -ProjectName "DevDiv" -RepositoryName "VS" -BranchName $branch -PAT $pat return $drop.Name } function GetCompilerTestAssembliesIncludePaths() { $assemblies = " --include '^Microsoft\.CodeAnalysis\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.CompilerServer\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.CSharp\.Syntax\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.CSharp\.Symbol\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.CSharp\.Semantic\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.CSharp\.Emit\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.CSharp\.IOperation\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.CSharp\.CommandLine\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.VisualBasic\.Syntax\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.VisualBasic\.Symbol\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.VisualBasic\.Semantic\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.VisualBasic\.Emit\.UnitTests$'" $assemblies += " --include '^Roslyn\.Compilers\.VisualBasic\.IOperation\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.VisualBasic\.CommandLine\.UnitTests$'" return $assemblies } # Core function for running our unit / integration tests tests function TestUsingRunTests() { # Tests need to locate .NET Core SDK $dotnet = InitializeDotNetCli if ($testVsi) { Deploy-VsixViaTool if ($ci) { # Minimize all windows to avoid interference during integration test runs $shell = New-Object -ComObject "Shell.Application" $shell.MinimizeAll() } } if ($ci) { $env:ROSLYN_TEST_CI = "true" } if ($testIOperation) { $env:ROSLYN_TEST_IOPERATION = "true" } if ($testUsedAssemblies) { $env:ROSLYN_TEST_USEDASSEMBLIES = "true" } $runTests = GetProjectOutputBinary "RunTests.dll" -tfm "netcoreapp3.1" if (!(Test-Path $runTests)) { Write-Host "Test runner not found: '$runTests'. Run Build.cmd first." -ForegroundColor Red ExitWithExitCode 1 } $dotnetExe = Join-Path $dotnet "dotnet.exe" $args += " --dotnet `"$dotnetExe`"" $args += " --logs `"$LogDir`"" $args += " --configuration $configuration" if ($testCoreClr) { $args += " --tfm net5.0" $args += " --tfm netcoreapp3.1" $args += " --timeout 90" if ($testCompilerOnly) { $args += GetCompilerTestAssembliesIncludePaths } else { $args += " --include '\.UnitTests'" } } elseif ($testDesktop -or ($testIOperation -and -not $testCoreClr)) { $args += " --tfm net472" $args += " --timeout 90" if ($testCompilerOnly) { $args += GetCompilerTestAssembliesIncludePaths } else { $args += " --include '\.UnitTests'" } if (-not $test32) { $args += " --exclude '\.InteractiveHost'" } } elseif ($testVsi) { $args += " --timeout 110" $args += " --tfm net472" $args += " --retry" $args += " --sequential" $args += " --include '\.IntegrationTests'" $args += " --include 'Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests'" if ($lspEditor) { $args += " --testfilter Editor=LanguageServerProtocol" } } if (-not $ci -and -not $testVsi) { $args += " --html" } if ($collectDumps) { $procdumpFilePath = Ensure-ProcDump $args += " --procdumppath $procDumpFilePath" $args += " --collectdumps"; } if ($test64) { $args += " --platform x64" } else { $args += " --platform x86" } if ($sequential) { $args += " --sequential" } if ($helix) { $args += " --helix" } if ($helixQueueName) { $args += " --helixQueueName $helixQueueName" } try { Write-Host "$runTests $args" Exec-Console $dotnetExe "$runTests $args" } finally { Get-Process "xunit*" -ErrorAction SilentlyContinue | Stop-Process if ($ci) { Remove-Item env:\ROSLYN_TEST_CI } if ($testIOperation) { Remove-Item env:\ROSLYN_TEST_IOPERATION } if ($testUsedAssemblies) { Remove-Item env:\ROSLYN_TEST_USEDASSEMBLIES } if ($testVsi) { $serviceHubLogs = Join-Path $TempDir "servicehub\logs" if (Test-Path $serviceHubLogs) { Write-Host "Copying ServiceHub logs to $LogDir" Copy-Item -Path $serviceHubLogs -Destination (Join-Path $LogDir "servicehub") -Recurse } else { Write-Host "No ServiceHub logs found to copy" } if ($lspEditor) { $lspLogs = Join-Path $TempDir "VisualStudio\LSP" $telemetryLog = Join-Path $TempDir "VSTelemetryLog" if (Test-Path $lspLogs) { Write-Host "Copying LSP logs to $LogDir" Copy-Item -Path $lspLogs -Destination (Join-Path $LogDir "LSP") -Recurse } else { Write-Host "No LSP logs found to copy" } if (Test-Path $telemetryLog) { Write-Host "Copying telemetry logs to $LogDir" Copy-Item -Path $telemetryLog -Destination (Join-Path $LogDir "Telemetry") -Recurse } else { Write-Host "No telemetry logs found to copy" } } } } } function EnablePreviewSdks() { $vsInfo = LocateVisualStudio if ($vsInfo -eq $null) { # Preview SDKs are allowed when no Visual Studio instance is installed return } $vsId = $vsInfo.instanceId $vsMajorVersion = $vsInfo.installationVersion.Split('.')[0] $instanceDir = Join-Path ${env:USERPROFILE} "AppData\Local\Microsoft\VisualStudio\$vsMajorVersion.0_$vsId" Create-Directory $instanceDir $sdkFile = Join-Path $instanceDir "sdk.txt" 'UsePreviews=True' | Set-Content $sdkFile } # Deploy our core VSIX libraries to Visual Studio via the Roslyn VSIX tool. This is an alternative to # deploying at build time. function Deploy-VsixViaTool() { $vsixDir = Get-PackageDir "RoslynTools.VSIXExpInstaller" $vsixExe = Join-Path $vsixDir "tools\VsixExpInstaller.exe" $vsInfo = LocateVisualStudio if ($vsInfo -eq $null) { throw "Unable to locate required Visual Studio installation" } $vsDir = $vsInfo.installationPath.TrimEnd("\") $vsId = $vsInfo.instanceId $vsMajorVersion = $vsInfo.installationVersion.Split('.')[0] $displayVersion = $vsInfo.catalog.productDisplayVersion $hive = "RoslynDev" Write-Host "Using VS Instance $vsId ($displayVersion) at `"$vsDir`"" $baseArgs = "/rootSuffix:$hive /vsInstallDir:`"$vsDir`"" Write-Host "Uninstalling old Roslyn VSIX" # Actual uninstall is failing at the moment using the uninstall options. Temporarily using # wildfire to uninstall our VSIX extensions $extDir = Join-Path ${env:USERPROFILE} "AppData\Local\Microsoft\VisualStudio\$vsMajorVersion.0_$vsid$hive" if (Test-Path $extDir) { foreach ($dir in Get-ChildItem -Directory $extDir) { $name = Split-Path -leaf $dir Write-Host "`tUninstalling $name" } Remove-Item -re -fo $extDir } Write-Host "Installing all Roslyn VSIX" # VSIX files need to be installed in this specific order: $orderedVsixFileNames = @( "Roslyn.Compilers.Extension.vsix", "Roslyn.VisualStudio.Setup.vsix", "Roslyn.VisualStudio.Setup.Dependencies.vsix", "ExpressionEvaluatorPackage.vsix", "Roslyn.VisualStudio.DiagnosticsWindow.vsix", "Microsoft.VisualStudio.IntegrationTest.Setup.vsix") foreach ($vsixFileName in $orderedVsixFileNames) { $vsixFile = Join-Path $VSSetupDir $vsixFileName $fullArg = "$baseArgs $vsixFile" Write-Host "`tInstalling $vsixFileName" Exec-Console $vsixExe $fullArg } } # Ensure that procdump is available on the machine. Returns the path to the directory that contains # the procdump binaries (both 32 and 64 bit) function Ensure-ProcDump() { # Jenkins images default to having procdump installed in the root. Use that if available to avoid # an unnecessary download. if (Test-Path "C:\SysInternals\procdump.exe") { return "C:\SysInternals" } $outDir = Join-Path $ToolsDir "ProcDump" $filePath = Join-Path $outDir "procdump.exe" if (-not (Test-Path $filePath)) { Remove-Item -Re $filePath -ErrorAction SilentlyContinue Create-Directory $outDir $zipFilePath = Join-Path $toolsDir "procdump.zip" Invoke-WebRequest "https://download.sysinternals.com/files/Procdump.zip" -UseBasicParsing -outfile $zipFilePath | Out-Null Unzip $zipFilePath $outDir } return $filePath } # Setup the CI machine for running our integration tests. function Setup-IntegrationTestRun() { $processesToStopOnExit += "devenv" $screenshotPath = (Join-Path $LogDir "StartingBuild.png") try { Capture-Screenshot $screenshotPath } catch { Write-Host "Screenshot failed; attempting to connect to the console" # Keep the session open so we have a UI to interact with $quserItems = ((quser $env:USERNAME | select -Skip 1) -split '\s+') $sessionid = $quserItems[2] if ($sessionid -eq 'Disc') { # When the session isn't connected, the third value is 'Disc' instead of the ID $sessionid = $quserItems[1] } if ($quserItems[1] -eq 'console') { Write-Host "Disconnecting from console before attempting reconnection" try { tsdiscon } catch { # ignore } # Disconnection is asynchronous, so wait a few seconds for it to complete Start-Sleep -Seconds 3 query user } Write-Host "tscon $sessionid /dest:console" tscon $sessionid /dest:console # Connection is asynchronous, so wait a few seconds for it to complete Start-Sleep 3 query user # Make sure we can capture a screenshot. An exception at this point will fail-fast the build. Capture-Screenshot $screenshotPath } $env:ROSLYN_OOP64BIT = "$oop64bit" $env:ROSLYN_LSPEDITOR = "$lspEditor" } function Prepare-TempDir() { $env:TEMP=$TempDir $env:TMP=$TempDir Copy-Item (Join-Path $RepoRoot "src\Workspaces\MSBuildTest\Resources\.editorconfig") $TempDir Copy-Item (Join-Path $RepoRoot "src\Workspaces\MSBuildTest\Resources\global.json") $TempDir Copy-Item (Join-Path $RepoRoot "src\Workspaces\MSBuildTest\Resources\Directory.Build.props") $TempDir Copy-Item (Join-Path $RepoRoot "src\Workspaces\MSBuildTest\Resources\Directory.Build.targets") $TempDir Copy-Item (Join-Path $RepoRoot "src\Workspaces\MSBuildTest\Resources\Directory.Build.rsp") $TempDir Copy-Item (Join-Path $RepoRoot "src\Workspaces\MSBuildTest\Resources\NuGet.Config") $TempDir } function List-Processes() { Write-Host "Listing running build processes..." Get-Process -Name "msbuild" -ErrorAction SilentlyContinue | Out-Host Get-Process -Name "vbcscompiler" -ErrorAction SilentlyContinue | Out-Host Get-Process -Name "dotnet" -ErrorAction SilentlyContinue | where { $_.Modules | select { $_.ModuleName -eq "VBCSCompiler.dll" } } | Out-Host Get-Process -Name "devenv" -ErrorAction SilentlyContinue | Out-Host } try { if ($PSVersionTable.PSVersion.Major -lt "5") { Write-Host "PowerShell version must be 5 or greater (version $($PSVersionTable.PSVersion) detected)" exit 1 } $regKeyProperty = Get-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem -Name "LongPathsEnabled" -ErrorAction Ignore if (($null -eq $regKeyProperty) -or ($regKeyProperty.LongPathsEnabled -ne 1)) { Write-Host "LongPath is not enabled, you may experience build errors. You can avoid these by enabling LongPath with `"reg ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1`"" } Process-Arguments . (Join-Path $PSScriptRoot "build-utils.ps1") if ($testVsi) { . (Join-Path $PSScriptRoot "build-utils-win.ps1") } Push-Location $RepoRoot if ($ci) { List-Processes Prepare-TempDir EnablePreviewSdks if ($testVsi) { Setup-IntegrationTestRun } $global:_DotNetInstallDir = Join-Path $RepoRoot ".dotnet" InstallDotNetSdk $global:_DotNetInstallDir $GlobalJson.tools.dotnet } if ($restore) { &(Ensure-DotNetSdk) tool restore } try { if ($bootstrap) { $bootstrapDir = Make-BootstrapBuild -force32:$test32 } } catch { if ($ci) { echo "##vso[task.logissue type=error](NETCORE_ENGINEERING_TELEMETRY=Build) Build failed" } throw $_ } if ($restore -or $build -or $rebuild -or $pack -or $sign -or $publish) { BuildSolution } try { if ($testDesktop -or $testVsi -or $testIOperation -or $testCoreClr) { TestUsingRunTests } } catch { if ($ci) { echo "##vso[task.logissue type=error](NETCORE_ENGINEERING_TELEMETRY=Test) Tests failed" } throw $_ } if ($launch) { if (-not $build) { InitializeBuildTool } $devenvExe = Join-Path $env:VSINSTALLDIR 'Common7\IDE\devenv.exe' &$devenvExe /rootSuffix RoslynDev } ExitWithExitCode 0 } catch { Write-Host $_ Write-Host $_.Exception Write-Host $_.ScriptStackTrace ExitWithExitCode 1 } finally { if ($ci) { Stop-Processes } Pop-Location }
# # This script controls the Roslyn build process. This encompasess everything from build, testing to # publishing of NuGet packages. The intent is to structure it to allow for a simple flow of logic # between the following phases: # # - restore # - build # - sign # - pack # - test # - publish # # Each of these phases has a separate command which can be executed independently. For instance # it's fine to call `build.ps1 -build -testDesktop` followed by repeated calls to # `.\build.ps1 -testDesktop`. [CmdletBinding(PositionalBinding=$false)] param ( [string][Alias('c')]$configuration = "Debug", [string][Alias('v')]$verbosity = "m", [string]$msbuildEngine = "vs", # Actions [switch][Alias('r')]$restore, [switch][Alias('b')]$build, [switch]$rebuild, [switch]$sign, [switch]$pack, [switch]$publish, [switch]$launch, [switch]$help, # Options [switch]$bootstrap, [string]$bootstrapConfiguration = "Release", [switch][Alias('bl')]$binaryLog, [switch]$buildServerLog, [switch]$ci, [switch]$collectDumps, [switch][Alias('a')]$runAnalyzers, [switch]$skipDocumentation = $false, [switch][Alias('d')]$deployExtensions, [switch]$prepareMachine, [switch]$useGlobalNuGetCache = $true, [switch]$warnAsError = $false, [switch]$sourceBuild = $false, [switch]$oop64bit = $true, [switch]$lspEditor = $false, # official build settings [string]$officialBuildId = "", [string]$officialSkipApplyOptimizationData = "", [string]$officialSkipTests = "", [string]$officialSourceBranchName = "", [string]$officialIbcDrop = "", [string]$officialVisualStudioDropAccessToken = "", # Test actions [switch]$test32, [switch]$test64, [switch]$testVsi, [switch][Alias('test')]$testDesktop, [switch]$testCoreClr, [switch]$testCompilerOnly = $false, [switch]$testIOperation, [switch]$testUsedAssemblies, [switch]$sequential, [switch]$helix, [string]$helixQueueName = "", [parameter(ValueFromRemainingArguments=$true)][string[]]$properties) Set-StrictMode -version 2.0 $ErrorActionPreference = "Stop" function Print-Usage() { Write-Host "Common settings:" Write-Host " -configuration <value> Build configuration: 'Debug' or 'Release' (short: -c)" Write-Host " -verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]" Write-Host " -deployExtensions Deploy built vsixes (short: -d)" Write-Host " -binaryLog Create MSBuild binary log (short: -bl)" Write-Host " -buildServerLog Create Roslyn build server log" Write-Host "" Write-Host "Actions:" Write-Host " -restore Restore packages (short: -r)" Write-Host " -build Build main solution (short: -b)" Write-Host " -rebuild Rebuild main solution" Write-Host " -pack Build NuGet packages, VS insertion manifests and installer" Write-Host " -sign Sign our binaries" Write-Host " -publish Publish build artifacts (e.g. symbols)" Write-Host " -launch Launch Visual Studio in developer hive" Write-Host " -help Print help and exit" Write-Host "" Write-Host "Test actions" Write-Host " -test32 Run unit tests in the 32-bit runner" Write-Host " -test64 Run units tests in the 64-bit runner" Write-Host " -testDesktop Run Desktop unit tests (short: -test)" Write-Host " -testCoreClr Run CoreClr unit tests" Write-Host " -testCompilerOnly Run only the compiler unit tests" Write-Host " -testVsi Run all integration tests" Write-Host " -testIOperation Run extra checks to validate IOperations" Write-Host " -testUsedAssemblies Run extra checks to validate used assemblies feature" Write-Host "" Write-Host "Advanced settings:" Write-Host " -ci Set when running on CI server" Write-Host " -bootstrap Build using a bootstrap compilers" Write-Host " -bootstrapConfiguration Build configuration for bootstrap compiler: 'Debug' or 'Release'" Write-Host " -msbuildEngine <value> Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)." Write-Host " -collectDumps Collect dumps from test runs" Write-Host " -runAnalyzers Run analyzers during build operations (short: -a)" Write-Host " -skipDocumentation Skip generation of XML documentation files" Write-Host " -prepareMachine Prepare machine for CI run, clean up processes after build" Write-Host " -useGlobalNuGetCache Use global NuGet cache." Write-Host " -warnAsError Treat all warnings as errors" Write-Host " -sourceBuild Simulate building source-build" Write-Host "" Write-Host "Official build settings:" Write-Host " -officialBuildId An official build id, e.g. 20190102.3" Write-Host " -officialSkipTests <bool> Pass 'true' to not run tests" Write-Host " -officialSkipApplyOptimizationData <bool> Pass 'true' to not apply optimization data" Write-Host " -officialSourceBranchName <string> The source branch name" Write-Host " -officialIbcDrop <string> IBC data drop to use (e.g. 'ProfilingOutputs/DevDiv/VS/..')." Write-Host " 'default' for the most recent available for the branch." Write-Host " -officialVisualStudioDropAccessToken <string> The access token to access OptProf data drop" Write-Host "" Write-Host "Command line arguments starting with '/p:' are passed through to MSBuild." } # Process the command line arguments and establish defaults for the values which are not # specified. # # In this function it's okay to use two arguments to extend the effect of another. For # example it's okay to look at $testVsi and infer $runAnalyzers. It's not okay though to infer # $build based on say $testDesktop. It's possible the developer wanted only for testing # to execute, not any build. function Process-Arguments() { function OfficialBuildOnly([string]$argName) { if ((Get-Variable $argName -Scope Script).Value) { if (!$officialBuildId) { Write-Host "$argName can only be specified for official builds" exit 1 } } else { if ($officialBuildId) { Write-Host "$argName must be specified in official builds" exit 1 } } } if ($help -or (($properties -ne $null) -and ($properties.Contains("/help") -or $properties.Contains("/?")))) { Print-Usage exit 0 } OfficialBuildOnly "officialSkipTests" OfficialBuildOnly "officialSkipApplyOptimizationData" OfficialBuildOnly "officialSourceBranchName" OfficialBuildOnly "officialVisualStudioDropAccessToken" if ($officialBuildId) { $script:useGlobalNuGetCache = $false $script:collectDumps = $true $script:testDesktop = ![System.Boolean]::Parse($officialSkipTests) $script:applyOptimizationData = ![System.Boolean]::Parse($officialSkipApplyOptimizationData) } else { $script:applyOptimizationData = $false } if ($ci) { $script:binaryLog = $true if ($bootstrap) { $script:buildServerLog = $true } } if ($test32 -and $test64) { Write-Host "Cannot combine -test32 and -test64" exit 1 } $anyUnit = $testDesktop -or $testCoreClr if ($anyUnit -and $testVsi) { Write-Host "Cannot combine unit and VSI testing" exit 1 } if ($testVsi -and $helix) { Write-Host "Cannot run integration tests on Helix" exit 1 } if ($testVsi) { # Avoid spending time in analyzers when requested, and also in the slowest integration test builds $script:runAnalyzers = $false $script:bootstrap = $false } if ($build -and $launch -and -not $deployExtensions) { Write-Host -ForegroundColor Red "Cannot combine -build and -launch without -deployExtensions" exit 1 } if ($bootstrap) { $script:restore = $true } $script:test32 = -not $test64 foreach ($property in $properties) { if (!$property.StartsWith("/p:", "InvariantCultureIgnoreCase")) { Write-Host "Invalid argument: $property" Print-Usage exit 1 } } } function BuildSolution() { $solution = "Roslyn.sln" Write-Host "$($solution):" $bl = if ($binaryLog) { "/bl:" + (Join-Path $LogDir "Build.binlog") } else { "" } if ($buildServerLog) { ${env:ROSLYNCOMMANDLINELOGFILE} = Join-Path $LogDir "Build.Server.log" } $projects = Join-Path $RepoRoot $solution $toolsetBuildProj = InitializeToolset $ibcDropName = GetIbcDropName # Do not set this property to true explicitly, since that would override values set in projects. $suppressExtensionDeployment = if (!$deployExtensions) { "/p:DeployExtension=false" } else { "" } # The warnAsError flag for MSBuild will promote all warnings to errors. This is true for warnings # that MSBuild output as well as ones that custom tasks output. $msbuildWarnAsError = if ($warnAsError) { "/warnAsError" } else { "" } # Workaround for some machines in the AzDO pool not allowing long paths (%5c is msbuild escaped backslash) $ibcDir = Join-Path $RepoRoot ".o%5c" # Set DotNetBuildFromSource to 'true' if we're simulating building for source-build. $buildFromSource = if ($sourceBuild) { "/p:DotNetBuildFromSource=true" } else { "" } $generateDocumentationFile = if ($skipDocumentation) { "/p:GenerateDocumentationFile=false" } else { "" } $roslynUseHardLinks = if ($ci) { "/p:ROSLYNUSEHARDLINKS=true" } else { "" } try { MSBuild $toolsetBuildProj ` $bl ` /p:Configuration=$configuration ` /p:Projects=$projects ` /p:RepoRoot=$RepoRoot ` /p:Restore=$restore ` /p:Build=$build ` /p:Rebuild=$rebuild ` /p:Pack=$pack ` /p:Sign=$sign ` /p:Publish=$publish ` /p:ContinuousIntegrationBuild=$ci ` /p:OfficialBuildId=$officialBuildId ` /p:RunAnalyzersDuringBuild=$runAnalyzers ` /p:BootstrapBuildPath=$bootstrapDir ` /p:TreatWarningsAsErrors=$warnAsError ` /p:EnableNgenOptimization=$applyOptimizationData ` /p:IbcOptimizationDataDir=$ibcDir ` /p:RestoreUseStaticGraphEvaluation=true ` /p:VisualStudioIbcDrop=$ibcDropName ` /p:VisualStudioDropAccessToken=$officialVisualStudioDropAccessToken ` $suppressExtensionDeployment ` $msbuildWarnAsError ` $buildFromSource ` $generateDocumentationFile ` $roslynUseHardLinks ` @properties } finally { ${env:ROSLYNCOMMANDLINELOGFILE} = $null } } # Get the branch that produced the IBC data this build is going to consume. # IBC data are only merged in official built, but we want to test some of the logic in CI builds as well. function GetIbcSourceBranchName() { if (Test-Path variable:global:_IbcSourceBranchName) { return $global:_IbcSourceBranchName } function calculate { $fallback = "main" $branchData = GetBranchPublishData $officialSourceBranchName if ($branchData -eq $null) { Write-LogIssue -Type "warning" -Message "Branch $officialSourceBranchName is not listed in PublishData.json. Using IBC data from '$fallback'." Write-Host "Override by setting IbcDrop build variable." -ForegroundColor Yellow return $fallback } return $branchData.vsBranch } return $global:_IbcSourceBranchName = calculate } function GetIbcDropName() { if ($officialIbcDrop -and $officialIbcDrop -ne "default"){ return $officialIbcDrop } # Don't try and get the ibc drop if we're not in an official build as it won't be used anyway if (!$applyOptimizationData -or !$officialBuildId) { return "" } # Bring in the ibc tools $packagePath = Join-Path (Get-PackageDir "Microsoft.DevDiv.Optimization.Data.PowerShell") "lib\net461" Import-Module (Join-Path $packagePath "Optimization.Data.PowerShell.dll") # Find the matching drop $branch = GetIbcSourceBranchName Write-Host "Optimization data branch name is '$branch'." $pat = ConvertTo-SecureString $officialVisualStudioDropAccessToken -AsPlainText -Force $drop = Find-OptimizationInputsStoreForBranch -ProjectName "DevDiv" -RepositoryName "VS" -BranchName $branch -PAT $pat return $drop.Name } function GetCompilerTestAssembliesIncludePaths() { $assemblies = " --include '^Microsoft\.CodeAnalysis\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.CompilerServer\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.CSharp\.Syntax\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.CSharp\.Symbol\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.CSharp\.Semantic\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.CSharp\.Emit\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.CSharp\.IOperation\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.CSharp\.CommandLine\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.VisualBasic\.Syntax\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.VisualBasic\.Symbol\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.VisualBasic\.Semantic\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.VisualBasic\.Emit\.UnitTests$'" $assemblies += " --include '^Roslyn\.Compilers\.VisualBasic\.IOperation\.UnitTests$'" $assemblies += " --include '^Microsoft\.CodeAnalysis\.VisualBasic\.CommandLine\.UnitTests$'" return $assemblies } # Core function for running our unit / integration tests tests function TestUsingRunTests() { # Tests need to locate .NET Core SDK $dotnet = InitializeDotNetCli if ($testVsi) { Deploy-VsixViaTool if ($ci) { # Minimize all windows to avoid interference during integration test runs $shell = New-Object -ComObject "Shell.Application" $shell.MinimizeAll() } } if ($ci) { $env:ROSLYN_TEST_CI = "true" } if ($testIOperation) { $env:ROSLYN_TEST_IOPERATION = "true" } if ($testUsedAssemblies) { $env:ROSLYN_TEST_USEDASSEMBLIES = "true" } $runTests = GetProjectOutputBinary "RunTests.dll" -tfm "netcoreapp3.1" if (!(Test-Path $runTests)) { Write-Host "Test runner not found: '$runTests'. Run Build.cmd first." -ForegroundColor Red ExitWithExitCode 1 } $dotnetExe = Join-Path $dotnet "dotnet.exe" $args += " --dotnet `"$dotnetExe`"" $args += " --logs `"$LogDir`"" $args += " --configuration $configuration" if ($testCoreClr) { $args += " --tfm net5.0" $args += " --tfm netcoreapp3.1" $args += " --timeout 90" if ($testCompilerOnly) { $args += GetCompilerTestAssembliesIncludePaths } else { $args += " --include '\.UnitTests'" } } elseif ($testDesktop -or ($testIOperation -and -not $testCoreClr)) { $args += " --tfm net472" $args += " --timeout 90" if ($testCompilerOnly) { $args += GetCompilerTestAssembliesIncludePaths } else { $args += " --include '\.UnitTests'" } if (-not $test32) { $args += " --exclude '\.InteractiveHost'" } } elseif ($testVsi) { $args += " --timeout 110" $args += " --tfm net472" $args += " --retry" $args += " --sequential" $args += " --include '\.IntegrationTests'" $args += " --include 'Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests'" if ($lspEditor) { $args += " --testfilter Editor=LanguageServerProtocol" } } if (-not $ci -and -not $testVsi) { $args += " --html" } if ($collectDumps) { $procdumpFilePath = Ensure-ProcDump $args += " --procdumppath $procDumpFilePath" $args += " --collectdumps"; } if ($test64) { $args += " --platform x64" } else { $args += " --platform x86" } if ($sequential) { $args += " --sequential" } if ($helix) { $args += " --helix" } if ($helixQueueName) { $args += " --helixQueueName $helixQueueName" } try { Write-Host "$runTests $args" Exec-Console $dotnetExe "$runTests $args" } finally { Get-Process "xunit*" -ErrorAction SilentlyContinue | Stop-Process if ($ci) { Remove-Item env:\ROSLYN_TEST_CI } if ($testIOperation) { Remove-Item env:\ROSLYN_TEST_IOPERATION } if ($testUsedAssemblies) { Remove-Item env:\ROSLYN_TEST_USEDASSEMBLIES } if ($testVsi) { $serviceHubLogs = Join-Path $TempDir "servicehub\logs" if (Test-Path $serviceHubLogs) { Write-Host "Copying ServiceHub logs to $LogDir" Copy-Item -Path $serviceHubLogs -Destination (Join-Path $LogDir "servicehub") -Recurse } else { Write-Host "No ServiceHub logs found to copy" } if ($lspEditor) { $lspLogs = Join-Path $TempDir "VisualStudio\LSP" $telemetryLog = Join-Path $TempDir "VSTelemetryLog" if (Test-Path $lspLogs) { Write-Host "Copying LSP logs to $LogDir" Copy-Item -Path $lspLogs -Destination (Join-Path $LogDir "LSP") -Recurse } else { Write-Host "No LSP logs found to copy" } if (Test-Path $telemetryLog) { Write-Host "Copying telemetry logs to $LogDir" Copy-Item -Path $telemetryLog -Destination (Join-Path $LogDir "Telemetry") -Recurse } else { Write-Host "No telemetry logs found to copy" } } } } } function EnablePreviewSdks() { $vsInfo = LocateVisualStudio if ($vsInfo -eq $null) { # Preview SDKs are allowed when no Visual Studio instance is installed return } $vsId = $vsInfo.instanceId $vsMajorVersion = $vsInfo.installationVersion.Split('.')[0] $instanceDir = Join-Path ${env:USERPROFILE} "AppData\Local\Microsoft\VisualStudio\$vsMajorVersion.0_$vsId" Create-Directory $instanceDir $sdkFile = Join-Path $instanceDir "sdk.txt" 'UsePreviews=True' | Set-Content $sdkFile } # Deploy our core VSIX libraries to Visual Studio via the Roslyn VSIX tool. This is an alternative to # deploying at build time. function Deploy-VsixViaTool() { $vsixDir = Get-PackageDir "RoslynTools.VSIXExpInstaller" $vsixExe = Join-Path $vsixDir "tools\VsixExpInstaller.exe" $vsInfo = LocateVisualStudio if ($vsInfo -eq $null) { throw "Unable to locate required Visual Studio installation" } $vsDir = $vsInfo.installationPath.TrimEnd("\") $vsId = $vsInfo.instanceId $vsMajorVersion = $vsInfo.installationVersion.Split('.')[0] $displayVersion = $vsInfo.catalog.productDisplayVersion $hive = "RoslynDev" Write-Host "Using VS Instance $vsId ($displayVersion) at `"$vsDir`"" $baseArgs = "/rootSuffix:$hive /vsInstallDir:`"$vsDir`"" Write-Host "Uninstalling old Roslyn VSIX" # Actual uninstall is failing at the moment using the uninstall options. Temporarily using # wildfire to uninstall our VSIX extensions $extDir = Join-Path ${env:USERPROFILE} "AppData\Local\Microsoft\VisualStudio\$vsMajorVersion.0_$vsid$hive" if (Test-Path $extDir) { foreach ($dir in Get-ChildItem -Directory $extDir) { $name = Split-Path -leaf $dir Write-Host "`tUninstalling $name" } Remove-Item -re -fo $extDir } Write-Host "Installing all Roslyn VSIX" # VSIX files need to be installed in this specific order: $orderedVsixFileNames = @( "Roslyn.Compilers.Extension.vsix", "Roslyn.VisualStudio.Setup.vsix", "Roslyn.VisualStudio.Setup.Dependencies.vsix", "ExpressionEvaluatorPackage.vsix", "Roslyn.VisualStudio.DiagnosticsWindow.vsix", "Microsoft.VisualStudio.IntegrationTest.Setup.vsix") foreach ($vsixFileName in $orderedVsixFileNames) { $vsixFile = Join-Path $VSSetupDir $vsixFileName $fullArg = "$baseArgs $vsixFile" Write-Host "`tInstalling $vsixFileName" Exec-Console $vsixExe $fullArg } } # Ensure that procdump is available on the machine. Returns the path to the directory that contains # the procdump binaries (both 32 and 64 bit) function Ensure-ProcDump() { # Jenkins images default to having procdump installed in the root. Use that if available to avoid # an unnecessary download. if (Test-Path "C:\SysInternals\procdump.exe") { return "C:\SysInternals" } $outDir = Join-Path $ToolsDir "ProcDump" $filePath = Join-Path $outDir "procdump.exe" if (-not (Test-Path $filePath)) { Remove-Item -Re $filePath -ErrorAction SilentlyContinue Create-Directory $outDir $zipFilePath = Join-Path $toolsDir "procdump.zip" Invoke-WebRequest "https://download.sysinternals.com/files/Procdump.zip" -UseBasicParsing -outfile $zipFilePath | Out-Null Unzip $zipFilePath $outDir } return $filePath } # Setup the CI machine for running our integration tests. function Setup-IntegrationTestRun() { $processesToStopOnExit += "devenv" $screenshotPath = (Join-Path $LogDir "StartingBuild.png") try { Capture-Screenshot $screenshotPath } catch { Write-Host "Screenshot failed; attempting to connect to the console" # Keep the session open so we have a UI to interact with $quserItems = ((quser $env:USERNAME | select -Skip 1) -split '\s+') $sessionid = $quserItems[2] if ($sessionid -eq 'Disc') { # When the session isn't connected, the third value is 'Disc' instead of the ID $sessionid = $quserItems[1] } if ($quserItems[1] -eq 'console') { Write-Host "Disconnecting from console before attempting reconnection" try { tsdiscon } catch { # ignore } # Disconnection is asynchronous, so wait a few seconds for it to complete Start-Sleep -Seconds 3 query user } Write-Host "tscon $sessionid /dest:console" tscon $sessionid /dest:console # Connection is asynchronous, so wait a few seconds for it to complete Start-Sleep 3 query user # Make sure we can capture a screenshot. An exception at this point will fail-fast the build. Capture-Screenshot $screenshotPath } $env:ROSLYN_OOP64BIT = "$oop64bit" $env:ROSLYN_LSPEDITOR = "$lspEditor" } function Prepare-TempDir() { $env:TEMP=$TempDir $env:TMP=$TempDir Copy-Item (Join-Path $RepoRoot "src\Workspaces\MSBuildTest\Resources\.editorconfig") $TempDir Copy-Item (Join-Path $RepoRoot "src\Workspaces\MSBuildTest\Resources\global.json") $TempDir Copy-Item (Join-Path $RepoRoot "src\Workspaces\MSBuildTest\Resources\Directory.Build.props") $TempDir Copy-Item (Join-Path $RepoRoot "src\Workspaces\MSBuildTest\Resources\Directory.Build.targets") $TempDir Copy-Item (Join-Path $RepoRoot "src\Workspaces\MSBuildTest\Resources\Directory.Build.rsp") $TempDir Copy-Item (Join-Path $RepoRoot "src\Workspaces\MSBuildTest\Resources\NuGet.Config") $TempDir } function List-Processes() { Write-Host "Listing running build processes..." Get-Process -Name "msbuild" -ErrorAction SilentlyContinue | Out-Host Get-Process -Name "vbcscompiler" -ErrorAction SilentlyContinue | Out-Host Get-Process -Name "dotnet" -ErrorAction SilentlyContinue | where { $_.Modules | select { $_.ModuleName -eq "VBCSCompiler.dll" } } | Out-Host Get-Process -Name "devenv" -ErrorAction SilentlyContinue | Out-Host } try { if ($PSVersionTable.PSVersion.Major -lt "5") { Write-Host "PowerShell version must be 5 or greater (version $($PSVersionTable.PSVersion) detected)" exit 1 } $regKeyProperty = Get-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem -Name "LongPathsEnabled" -ErrorAction Ignore if (($null -eq $regKeyProperty) -or ($regKeyProperty.LongPathsEnabled -ne 1)) { Write-Host "LongPath is not enabled, you may experience build errors. You can avoid these by enabling LongPath with `"reg ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1`"" } Process-Arguments . (Join-Path $PSScriptRoot "build-utils.ps1") if ($testVsi) { . (Join-Path $PSScriptRoot "build-utils-win.ps1") } Push-Location $RepoRoot if ($ci) { List-Processes Prepare-TempDir EnablePreviewSdks if ($testVsi) { Setup-IntegrationTestRun } $global:_DotNetInstallDir = Join-Path $RepoRoot ".dotnet" InstallDotNetSdk $global:_DotNetInstallDir $GlobalJson.tools.dotnet } if ($restore) { &(Ensure-DotNetSdk) tool restore } try { if ($bootstrap) { $bootstrapDir = Make-BootstrapBuild -force32:$test32 } } catch { if ($ci) { echo "##vso[task.logissue type=error](NETCORE_ENGINEERING_TELEMETRY=Build) Build failed" } throw $_ } if ($restore -or $build -or $rebuild -or $pack -or $sign -or $publish) { BuildSolution } try { if ($testDesktop -or $testVsi -or $testIOperation -or $testCoreClr) { TestUsingRunTests } } catch { if ($ci) { echo "##vso[task.logissue type=error](NETCORE_ENGINEERING_TELEMETRY=Test) Tests failed" } throw $_ } if ($launch) { if (-not $build) { InitializeBuildTool } $devenvExe = Join-Path $env:VSINSTALLDIR 'Common7\IDE\devenv.exe' &$devenvExe /rootSuffix RoslynDev } ExitWithExitCode 0 } catch { Write-Host $_ Write-Host $_.Exception Write-Host $_.ScriptStackTrace ExitWithExitCode 1 } finally { if ($ci) { Stop-Processes } Pop-Location }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Compilers/Core/Portable/Operations/OperationInterfaces.xml
<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. --> <Tree Root="IOperation"> <!-- To regenerate the operation nodes, run eng/generate-compiler-code.cmd The operations in this file are _ordered_! If you change the order in here, you will affect the ordering in the generated OperationKind enum, which will break the public api analyzer. All new types should be put at the end of this file in order to ensure that the kind does not continue to change. UnusedOperationKinds indicates kinds that are currently skipped by the OperationKind enum. They can be used by future nodes by inserting those nodes at the correct point in the list. When implementing new operations, run tests with additional IOperation validation enabled. You can test with `Build.cmd -testIOperation`. Or to repro in VS, you can do `set ROSLYN_TEST_IOPERATION=true` then `devenv`. --> <UnusedOperationKinds> <Entry Value="0x1D"/> <Entry Value="0x62"/> <Entry Value="0x64"/> </UnusedOperationKinds> <Node Name="IInvalidOperation" Base="IOperation" SkipClassGeneration="true"> <Comments> <summary> Represents an invalid operation with one or more child operations. <para> Current usage: (1) C# invalid expression or invalid statement. (2) VB invalid expression or invalid statement. </para> </summary> </Comments> </Node> <Node Name="IBlockOperation" Base="IOperation"> <Comments> <summary> Represents a block containing a sequence of operations and local declarations. <para> Current usage: (1) C# "{ ... }" block statement. (2) VB implicit block statement for method bodies and other block scoped statements. </para> </summary> </Comments> <Property Name="Operations" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>Operations contained within the block.</summary> </Comments> </Property> <Property Name="Locals" Type="ImmutableArray&lt;ILocalSymbol&gt;"> <Comments> <summary>Local declarations contained within the block.</summary> </Comments> </Property> </Node> <Node Name="IVariableDeclarationGroupOperation" Base="IOperation"> <Comments> <summary>Represents a variable declaration statement.</summary> <para> Current Usage: (1) C# local declaration statement (2) C# fixed statement (3) C# using statement (4) C# using declaration (5) VB Dim statement (6) VB Using statement </para> </Comments> <Property Name="Declarations" Type="ImmutableArray&lt;IVariableDeclarationOperation&gt;"> <Comments> <summary>Variable declaration in the statement.</summary> <remarks> In C#, this will always be a single declaration, with all variables in <see cref="IVariableDeclarationOperation.Declarators" />. </remarks> </Comments> </Property> </Node> <Node Name="ISwitchOperation" Base="IOperation" ChildrenOrder="Value,Cases"> <Comments> <summary> Represents a switch operation with a value to be switched upon and switch cases. <para> Current usage: (1) C# switch statement. (2) VB Select Case statement. </para> </summary> </Comments> <Property Name="Locals" Type="ImmutableArray&lt;ILocalSymbol&gt;"> <Comments> <summary> Locals declared within the switch operation with scope spanning across all <see cref="Cases" />. </summary> </Comments> </Property> <Property Name="Value" Type="IOperation"> <Comments> <summary>Value to be switched upon.</summary> </Comments> </Property> <Property Name="Cases" Type="ImmutableArray&lt;ISwitchCaseOperation&gt;"> <Comments> <summary>Cases of the switch.</summary> </Comments> </Property> <Property Name="ExitLabel" Type="ILabelSymbol"> <Comments> <summary>Exit label for the switch statement.</summary> </Comments> </Property> </Node> <AbstractNode Name="ILoopOperation" Base="IOperation"> <OperationKind Include="true" ExtraDescription="This is further differentiated by &lt;see cref=&quot;ILoopOperation.LoopKind&quot;/&gt;." /> <Comments> <summary> Represents a loop operation. <para> Current usage: (1) C# 'while', 'for', 'foreach' and 'do' loop statements (2) VB 'While', 'ForTo', 'ForEach', 'Do While' and 'Do Until' loop statements </para> </summary> </Comments> <Property Name="LoopKind" Type="LoopKind" MakeAbstract="true"> <Comments> <summary>Kind of the loop.</summary> </Comments> </Property> <Property Name="Body" Type="IOperation"> <Comments> <summary>Body of the loop.</summary> </Comments> </Property> <Property Name="Locals" Type="ImmutableArray&lt;ILocalSymbol&gt;"> <Comments> <summary>Declared locals.</summary> </Comments> </Property> <Property Name="ContinueLabel" Type="ILabelSymbol"> <Comments> <summary>Loop continue label.</summary> </Comments> </Property> <Property Name="ExitLabel" Type="ILabelSymbol"> <Comments> <summary>Loop exit/break label.</summary> </Comments> </Property> </AbstractNode> <Node Name="IForEachLoopOperation" Base="ILoopOperation" ChildrenOrder="Collection,LoopControlVariable,Body,NextVariables"> <OperationKind Include="false" /> <Comments> <summary> Represents a for each loop. <para> Current usage: (1) C# 'foreach' loop statement (2) VB 'For Each' loop statement </para> </summary> </Comments> <Property Name="LoopControlVariable" Type="IOperation"> <Comments> <summary>Refers to the operation for declaring a new local variable or reference an existing variable or an expression.</summary> </Comments> </Property> <Property Name="Collection" Type="IOperation"> <Comments> <summary>Collection value over which the loop iterates.</summary> </Comments> </Property> <Property Name="NextVariables" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary> Optional list of comma separated next variables at loop bottom in VB. This list is always empty for C#. </summary> </Comments> </Property> <Property Name="Info" Type="ForEachLoopOperationInfo?" Internal="true" /> <Property Name="IsAsynchronous" Type="bool"> <Comments> <summary> Whether this for each loop is asynchronous. Always false for VB. </summary> </Comments> </Property> </Node> <Node Name="IForLoopOperation" Base="ILoopOperation" ChildrenOrder="Before,Condition,Body,AtLoopBottom"> <OperationKind Include="false" /> <Comments> <summary> Represents a for loop. <para> Current usage: (1) C# 'for' loop statement </para> </summary> </Comments> <Property Name="Before" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>List of operations to execute before entry to the loop. For C#, this comes from the first clause of the for statement.</summary> </Comments> </Property> <Property Name="ConditionLocals" Type="ImmutableArray&lt;ILocalSymbol&gt;"> <Comments> <summary> Locals declared within the loop Condition and are in scope throughout the <see cref="Condition" />, <see cref="ILoopOperation.Body" /> and <see cref="AtLoopBottom" />. They are considered to be declared per iteration. </summary> </Comments> </Property> <Property Name="Condition" Type="IOperation?"> <Comments> <summary>Condition of the loop. For C#, this comes from the second clause of the for statement.</summary> </Comments> </Property> <Property Name="AtLoopBottom" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>List of operations to execute at the bottom of the loop. For C#, this comes from the third clause of the for statement.</summary> </Comments> </Property> </Node> <Node Name="IForToLoopOperation" Base="ILoopOperation" ChildrenOrder="LoopControlVariable,InitialValue,LimitValue,StepValue,Body,NextVariables"> <OperationKind Include="false" /> <Comments> <summary> Represents a for to loop with loop control variable and initial, limit and step values for the control variable. <para> Current usage: (1) VB 'For ... To ... Step' loop statement </para> </summary> </Comments> <Property Name="LoopControlVariable" Type="IOperation"> <Comments> <summary>Refers to the operation for declaring a new local variable or reference an existing variable or an expression.</summary> </Comments> </Property> <Property Name="InitialValue" Type="IOperation"> <Comments> <summary>Operation for setting the initial value of the loop control variable. This comes from the expression between the 'For' and 'To' keywords.</summary> </Comments> </Property> <Property Name="LimitValue" Type="IOperation"> <Comments> <summary>Operation for the limit value of the loop control variable. This comes from the expression after the 'To' keyword.</summary> </Comments> </Property> <Property Name="StepValue" Type="IOperation"> <Comments> <summary> Operation for the step value of the loop control variable. This comes from the expression after the 'Step' keyword, or inferred by the compiler if 'Step' clause is omitted. </summary> </Comments> </Property> <Property Name="IsChecked" Type="bool"> <Comments> <summary> <code>true</code> if arithmetic operations behind this loop are 'checked'.</summary> </Comments> </Property> <Property Name="NextVariables" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>Optional list of comma separated next variables at loop bottom.</summary> </Comments> </Property> <Property Name="Info" Type="(ILocalSymbol LoopObject, ForToLoopOperationUserDefinedInfo UserDefinedInfo)" Internal="true" /> </Node> <Node Name="IWhileLoopOperation" Base="ILoopOperation" SkipChildrenGeneration="true"> <OperationKind Include="false" /> <Comments> <summary> Represents a while or do while loop. <para> Current usage: (1) C# 'while' and 'do while' loop statements. (2) VB 'While', 'Do While' and 'Do Until' loop statements. </para> </summary> </Comments> <Property Name="Condition" Type="IOperation?"> <Comments> <summary>Condition of the loop. This can only be null in error scenarios.</summary> </Comments> </Property> <Property Name="ConditionIsTop" Type="bool"> <Comments> <summary> True if the <see cref="Condition" /> is evaluated at start of each loop iteration. False if it is evaluated at the end of each loop iteration. </summary> </Comments> </Property> <Property Name="ConditionIsUntil" Type="bool"> <Comments> <summary>True if the loop has 'Until' loop semantics and the loop is executed while <see cref="Condition" /> is false.</summary> </Comments> </Property> <Property Name="IgnoredCondition" Type="IOperation?"> <Comments> <summary> Additional conditional supplied for loop in error cases, which is ignored by the compiler. For example, for VB 'Do While' or 'Do Until' loop with syntax errors where both the top and bottom conditions are provided. The top condition is preferred and exposed as <see cref="Condition" /> and the bottom condition is ignored and exposed by this property. This property should be null for all non-error cases. </summary> </Comments> </Property> </Node> <Node Name="ILabeledOperation" Base="IOperation"> <Comments> <summary> Represents an operation with a label. <para> Current usage: (1) C# labeled statement. (2) VB label statement. </para> </summary> </Comments> <Property Name="Label" Type="ILabelSymbol"> <Comments> <summary>Label that can be the target of branches.</summary> </Comments> </Property> <Property Name="Operation" Type="IOperation?"> <Comments> <summary>Operation that has been labeled. In VB, this is always null.</summary> </Comments> </Property> </Node> <Node Name="IBranchOperation" Base="IOperation"> <Comments> <summary> Represents a branch operation. <para> Current usage: (1) C# goto, break, or continue statement. (2) VB GoTo, Exit ***, or Continue *** statement. </para> </summary> </Comments> <Property Name="Target" Type="ILabelSymbol"> <Comments> <summary>Label that is the target of the branch.</summary> </Comments> </Property> <Property Name="BranchKind" Type="BranchKind"> <Comments> <summary>Kind of the branch.</summary> </Comments> </Property> </Node> <Node Name="IEmptyOperation" Base="IOperation"> <Comments> <summary> Represents an empty or no-op operation. <para> Current usage: (1) C# empty statement. </para> </summary> </Comments> </Node> <Node Name="IReturnOperation" Base="IOperation"> <OperationKind> <Entry Name="Return" Value="0x9"/> <Entry Name="YieldBreak" Value="0xa" ExtraDescription="This has yield break semantics."/> <Entry Name="YieldReturn" Value="0xe" ExtraDescription="This has yield return semantics."/> </OperationKind> <Comments> <summary> Represents a return from the method with an optional return value. <para> Current usage: (1) C# return statement and yield statement. (2) VB Return statement. </para> </summary> </Comments> <Property Name="ReturnedValue" Type="IOperation?"> <Comments> <summary>Value to be returned.</summary> </Comments> </Property> </Node> <Node Name="ILockOperation" Base="IOperation" ChildrenOrder="LockedValue,Body"> <Comments> <summary> Represents a <see cref="Body" /> of operations that are executed while holding a lock onto the <see cref="LockedValue" />. <para> Current usage: (1) C# lock statement. (2) VB SyncLock statement. </para> </summary> </Comments> <Property Name="LockedValue" Type="IOperation"> <Comments> <summary>Operation producing a value to be locked.</summary> </Comments> </Property> <Property Name="Body" Type="IOperation"> <Comments> <summary>Body of the lock, to be executed while holding the lock.</summary> </Comments> </Property> <Property Name="LockTakenSymbol" Type="ILocalSymbol?" Internal="true"/> </Node> <Node Name="ITryOperation" Base="IOperation" ChildrenOrder="Body,Catches,Finally"> <Comments> <summary> Represents a try operation for exception handling code with a body, catch clauses and a finally handler. <para> Current usage: (1) C# try statement. (2) VB Try statement. </para> </summary> </Comments> <Property Name="Body" Type="IBlockOperation"> <Comments> <summary>Body of the try, over which the handlers are active.</summary> </Comments> </Property> <Property Name="Catches" Type="ImmutableArray&lt;ICatchClauseOperation&gt;"> <Comments> <summary>Catch clauses of the try.</summary> </Comments> </Property> <Property Name="Finally" Type="IBlockOperation?"> <Comments> <summary>Finally handler of the try.</summary> </Comments> </Property> <Property Name="ExitLabel" Type="ILabelSymbol?"> <Comments> <summary>Exit label for the try. This will always be null for C#.</summary> </Comments> </Property> </Node> <Node Name="IUsingOperation" Base="IOperation" ChildrenOrder="Resources,Body"> <Comments> <summary> Represents a <see cref="Body" /> of operations that are executed while using disposable <see cref="Resources" />. <para> Current usage: (1) C# using statement. (2) VB Using statement. </para> </summary> </Comments> <Property Name="Resources" Type="IOperation"> <Comments> <summary>Declaration introduced or resource held by the using.</summary> </Comments> </Property> <Property Name="Body" Type="IOperation"> <Comments> <summary>Body of the using, over which the resources of the using are maintained.</summary> </Comments> </Property> <Property Name="Locals" Type="ImmutableArray&lt;ILocalSymbol&gt;"> <Comments> <summary> Locals declared within the <see cref="Resources" /> with scope spanning across this entire <see cref="IUsingOperation" />. </summary> </Comments> </Property> <Property Name="IsAsynchronous" Type="bool"> <Comments> <summary> Whether this using is asynchronous. Always false for VB. </summary> </Comments> </Property> <Property Name="DisposeInfo" Type="DisposeOperationInfo" Internal="true"> <Comments> <summary>Information about the method that will be invoked to dispose the <see cref="Resources" /> when pattern based disposal is used.</summary> </Comments> </Property> </Node> <Node Name="IExpressionStatementOperation" Base="IOperation"> <Comments> <summary> Represents an operation that drops the resulting value and the type of the underlying wrapped <see cref="Operation" />. <para> Current usage: (1) C# expression statement. (2) VB expression statement. </para> </summary> </Comments> <Property Name="Operation" Type="IOperation"> <Comments> <summary>Underlying operation with a value and type.</summary> </Comments> </Property> </Node> <Node Name="ILocalFunctionOperation" Base="IOperation" ChildrenOrder="Body,IgnoredBody"> <Comments> <summary> Represents a local function defined within a method. <para> Current usage: (1) C# local function statement. </para> </summary> </Comments> <Property Name="Symbol" Type="IMethodSymbol"> <Comments> <summary>Local function symbol.</summary> </Comments> </Property> <Property Name="Body" Type="IBlockOperation?"> <Comments> <summary>Body of the local function.</summary> <remarks>This can be null in error scenarios, or when the method is an extern method.</remarks> </Comments> </Property> <Property Name="IgnoredBody" Type="IBlockOperation?"> <Comments> <summary>An extra body for the local function, if both a block body and expression body are specified in source.</summary> <remarks>This is only ever non-null in error situations.</remarks> </Comments> </Property> </Node> <Node Name="IStopOperation" Base="IOperation"> <Comments> <summary> Represents an operation to stop or suspend execution of code. <para> Current usage: (1) VB Stop statement. </para> </summary> </Comments> </Node> <Node Name="IEndOperation" Base="IOperation"> <Comments> <summary> Represents an operation that stops the execution of code abruptly. <para> Current usage: (1) VB End Statement. </para> </summary> </Comments> </Node> <Node Name="IRaiseEventOperation" Base="IOperation" ChildrenOrder="EventReference,Arguments"> <Comments> <summary> Represents an operation for raising an event. <para> Current usage: (1) VB raise event statement. </para> </summary> </Comments> <Property Name="EventReference" Type="IEventReferenceOperation"> <Comments> <summary>Reference to the event to be raised.</summary> </Comments> </Property> <Property Name="Arguments" Type="ImmutableArray&lt;IArgumentOperation&gt;"> <Comments> <summary>Arguments of the invocation, excluding the instance argument. Arguments are in evaluation order.</summary> <remarks> If the invocation is in its expanded form, then params/ParamArray arguments would be collected into arrays. Default values are supplied for optional arguments missing in source. </remarks> </Comments> </Property> </Node> <Node Name="ILiteralOperation" Base="IOperation" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents a textual literal numeric, string, etc. <para> Current usage: (1) C# literal expression. (2) VB literal expression. </para> </summary> </Comments> </Node> <Node Name="IConversionOperation" Base="IOperation" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents a type conversion. <para> Current usage: (1) C# conversion expression. (2) VB conversion expression. </para> </summary> </Comments> <Property Name="Operand" Type="IOperation"> <Comments> <summary>Value to be converted.</summary> </Comments> </Property> <Property Name="OperatorMethod" Type="IMethodSymbol?" SkipGeneration="true"> <Comments> <summary>Operator method used by the operation, null if the operation does not use an operator method.</summary> </Comments> </Property> <Property Name="Conversion" Type="CommonConversion"> <Comments> <summary>Gets the underlying common conversion information.</summary> <remarks> If you need conversion information that is language specific, use either <see cref="T:Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetConversion(IConversionOperation)" /> or <see cref="T:Microsoft.CodeAnalysis.VisualBasic.VisualBasicExtensions.GetConversion(IConversionOperation)" />. </remarks> </Comments> </Property> <Property Name="IsTryCast" Type="bool"> <Comments> <summary> False if the conversion will fail with a <see cref="InvalidCastException" /> at runtime if the cast fails. This is true for C#'s <c>as</c> operator and for VB's <c>TryCast</c> operator. </summary> </Comments> </Property> <Property Name="IsChecked" Type="bool"> <Comments> <summary>True if the conversion can fail at runtime with an overflow exception. This corresponds to C# checked and unchecked blocks.</summary> </Comments> </Property> </Node> <Node Name="IInvocationOperation" Base="IOperation" ChildrenOrder="Instance,Arguments" HasType="true"> <Comments> <summary> Represents an invocation of a method. <para> Current usage: (1) C# method invocation expression. (2) C# collection element initializer. For example, in the following collection initializer: <code>new C() { 1, 2, 3 }</code>, we will have 3 <see cref="IInvocationOperation" /> nodes, each of which will be a call to the corresponding Add method with either 1, 2, 3 as the argument. (3) VB method invocation expression. (4) VB collection element initializer. Similar to the C# example, <code>New C() From {1, 2, 3}</code> will have 3 <see cref="IInvocationOperation" /> nodes with 1, 2, and 3 as their arguments, respectively. </para> </summary> </Comments> <Property Name="TargetMethod" Type="IMethodSymbol"> <Comments> <summary>Method to be invoked.</summary> </Comments> </Property> <Property Name="Instance" Type="IOperation?"> <Comments> <summary>'This' or 'Me' instance to be supplied to the method, or null if the method is static.</summary> </Comments> </Property> <Property Name="IsVirtual" Type="bool"> <Comments> <summary>True if the invocation uses a virtual mechanism, and false otherwise.</summary> </Comments> </Property> <Property Name="Arguments" Type="ImmutableArray&lt;IArgumentOperation&gt;"> <Comments> <summary>Arguments of the invocation, excluding the instance argument. Arguments are in evaluation order.</summary> <remarks> If the invocation is in its expanded form, then params/ParamArray arguments would be collected into arrays. Default values are supplied for optional arguments missing in source. </remarks> </Comments> </Property> </Node> <Node Name="IArrayElementReferenceOperation" Base="IOperation" ChildrenOrder="ArrayReference,Indices" HasType="true"> <Comments> <summary> Represents a reference to an array element. <para> Current usage: (1) C# array element reference expression. (2) VB array element reference expression. </para> </summary> </Comments> <Property Name="ArrayReference" Type="IOperation"> <Comments> <summary>Array to be indexed.</summary> </Comments> </Property> <Property Name="Indices" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>Indices that specify an individual element.</summary> </Comments> </Property> </Node> <Node Name="ILocalReferenceOperation" Base="IOperation" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents a reference to a declared local variable. <para> Current usage: (1) C# local reference expression. (2) VB local reference expression. </para> </summary> </Comments> <Property Name="Local" Type="ILocalSymbol"> <Comments> <summary>Referenced local variable.</summary> </Comments> </Property> <Property Name="IsDeclaration" Type="bool"> <Comments> <summary> True if this reference is also the declaration site of this variable. This is true in out variable declarations and in deconstruction operations where a new variable is being declared. </summary> </Comments> </Property> </Node> <Node Name="IParameterReferenceOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents a reference to a parameter. <para> Current usage: (1) C# parameter reference expression. (2) VB parameter reference expression. </para> </summary> </Comments> <Property Name="Parameter" Type="IParameterSymbol"> <Comments> <summary>Referenced parameter.</summary> </Comments> </Property> </Node> <AbstractNode Name="IMemberReferenceOperation" Base="IOperation" > <Comments> <summary> Represents a reference to a member of a class, struct, or interface. <para> Current usage: (1) C# member reference expression. (2) VB member reference expression. </para> </summary> </Comments> <Property Name="Instance" Type="IOperation?"> <Comments> <summary>Instance of the type. Null if the reference is to a static/shared member.</summary> </Comments> </Property> <Property Name="Member" Type="ISymbol" SkipGeneration="true"> <Comments> <summary>Referenced member.</summary> </Comments> </Property> </AbstractNode> <Node Name="IFieldReferenceOperation" Base="IMemberReferenceOperation" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents a reference to a field. <para> Current usage: (1) C# field reference expression. (2) VB field reference expression. </para> </summary> </Comments> <Property Name="Field" Type="IFieldSymbol"> <Comments> <summary>Referenced field.</summary> </Comments> </Property> <Property Name="IsDeclaration" Type="bool"> <Comments> <summary>If the field reference is also where the field was declared.</summary> <remarks> This is only ever true in CSharp scripts, where a top-level statement creates a new variable in a reference, such as an out variable declaration or a deconstruction declaration. </remarks> </Comments> </Property> </Node> <Node Name="IMethodReferenceOperation" Base="IMemberReferenceOperation" HasType="true"> <Comments> <summary> Represents a reference to a method other than as the target of an invocation. <para> Current usage: (1) C# method reference expression. (2) VB method reference expression. </para> </summary> </Comments> <Property Name="Method" Type="IMethodSymbol"> <Comments> <summary>Referenced method.</summary> </Comments> </Property> <Property Name="IsVirtual" Type="bool"> <Comments> <summary>Indicates whether the reference uses virtual semantics.</summary> </Comments> </Property> </Node> <Node Name="IPropertyReferenceOperation" Base="IMemberReferenceOperation" ChildrenOrder="Instance,Arguments" HasType="true"> <Comments> <summary> Represents a reference to a property. <para> Current usage: (1) C# property reference expression. (2) VB property reference expression. </para> </summary> </Comments> <Property Name="Property" Type="IPropertySymbol"> <Comments> <summary>Referenced property.</summary> </Comments> </Property> <Property Name="Arguments" Type="ImmutableArray&lt;IArgumentOperation&gt;"> <Comments> <summary>Arguments of the indexer property reference, excluding the instance argument. Arguments are in evaluation order.</summary> <remarks> If the invocation is in its expanded form, then params/ParamArray arguments would be collected into arrays. Default values are supplied for optional arguments missing in source. </remarks> </Comments> </Property> </Node> <Node Name="IEventReferenceOperation" Base="IMemberReferenceOperation" HasType="true"> <Comments> <summary> Represents a reference to an event. <para> Current usage: (1) C# event reference expression. (2) VB event reference expression. </para> </summary> </Comments> <Property Name="Event" Type="IEventSymbol"> <Comments> <summary>Referenced event.</summary> </Comments> </Property> </Node> <Node Name="IUnaryOperation" Base="IOperation" VisitorName="VisitUnaryOperator" HasType="true" HasConstantValue="true"> <OperationKind> <Entry Name="Unary" Value="0x1f" /> <Entry Name="UnaryOperator" Value="0x1f" EditorBrowsable="false" ExtraDescription="Use &lt;see cref=&quot;Unary&quot;/&gt; instead." /> </OperationKind> <Comments> <summary> Represents an operation with one operand and a unary operator. <para> Current usage: (1) C# unary operation expression. (2) VB unary operation expression. </para> </summary> </Comments> <Property Name="OperatorKind" Type="UnaryOperatorKind"> <Comments> <summary>Kind of unary operation.</summary> </Comments> </Property> <Property Name="Operand" Type="IOperation"> <Comments> <summary>Operand.</summary> </Comments> </Property> <Property Name="IsLifted" Type="bool"> <Comments> <summary> <see langword="true" /> if this is a 'lifted' unary operator. When there is an operator that is defined to work on a value type, 'lifted' operators are created to work on the <see cref="System.Nullable{T}" /> versions of those value types. </summary> </Comments> </Property> <Property Name="IsChecked" Type="bool"> <Comments> <summary> <see langword="true" /> if overflow checking is performed for the arithmetic operation. </summary> </Comments> </Property> <Property Name="OperatorMethod" Type="IMethodSymbol?"> <Comments> <summary>Operator method used by the operation, null if the operation does not use an operator method.</summary> </Comments> </Property> </Node> <Node Name="IBinaryOperation" Base="IOperation" VisitorName="VisitBinaryOperator" ChildrenOrder="LeftOperand,RightOperand" HasType="true" HasConstantValue="true"> <OperationKind> <Entry Name="Binary" Value="0x20" /> <Entry Name="BinaryOperator" Value="0x20" EditorBrowsable="false" ExtraDescription="Use &lt;see cref=&quot;Binary&quot;/&gt; instead." /> </OperationKind> <Comments> <summary> Represents an operation with two operands and a binary operator that produces a result with a non-null type. <para> Current usage: (1) C# binary operator expression. (2) VB binary operator expression. </para> </summary> </Comments> <Property Name="OperatorKind" Type="BinaryOperatorKind"> <Comments> <summary>Kind of binary operation.</summary> </Comments> </Property> <Property Name="LeftOperand" Type="IOperation"> <Comments> <summary>Left operand.</summary> </Comments> </Property> <Property Name="RightOperand" Type="IOperation"> <Comments> <summary>Right operand.</summary> </Comments> </Property> <Property Name="IsLifted" Type="bool"> <Comments> <summary> <see langword="true" /> if this is a 'lifted' binary operator. When there is an operator that is defined to work on a value type, 'lifted' operators are created to work on the <see cref="System.Nullable{T}" /> versions of those value types. </summary> </Comments> </Property> <Property Name="IsChecked" Type="bool"> <Comments> <summary> <see langword="true" /> if this is a 'checked' binary operator. </summary> </Comments> </Property> <Property Name="IsCompareText" Type="bool"> <Comments> <summary> <see langword="true" /> if the comparison is text based for string or object comparison in VB. </summary> </Comments> </Property> <Property Name="OperatorMethod" Type="IMethodSymbol?"> <Comments> <summary>Operator method used by the operation, null if the operation does not use an operator method.</summary> </Comments> </Property> <Property Name="UnaryOperatorMethod" Type="IMethodSymbol?" Internal="true"> <Comments> <summary> True/False operator method used for short circuiting. https://github.com/dotnet/roslyn/issues/27598 tracks exposing this information through public API </summary> </Comments> </Property> </Node> <Node Name="IConditionalOperation" Base="IOperation" ChildrenOrder="Condition,WhenTrue,WhenFalse" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents a conditional operation with: (1) <see cref="Condition" /> to be tested, (2) <see cref="WhenTrue" /> operation to be executed when <see cref="Condition" /> is true and (3) <see cref="WhenFalse" /> operation to be executed when the <see cref="Condition" /> is false. <para> Current usage: (1) C# ternary expression "a ? b : c" and if statement. (2) VB ternary expression "If(a, b, c)" and If Else statement. </para> </summary> </Comments> <Property Name="Condition" Type="IOperation"> <Comments> <summary>Condition to be tested.</summary> </Comments> </Property> <Property Name="WhenTrue" Type="IOperation"> <Comments> <summary> Operation to be executed if the <see cref="Condition" /> is true. </summary> </Comments> </Property> <Property Name="WhenFalse" Type="IOperation?"> <Comments> <summary> Operation to be executed if the <see cref="Condition" /> is false. </summary> </Comments> </Property> <Property Name="IsRef" Type="bool"> <Comments> <summary>Is result a managed reference</summary> </Comments> </Property> </Node> <Node Name="ICoalesceOperation" Base="IOperation" ChildrenOrder="Value,WhenNull" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents a coalesce operation with two operands: (1) <see cref="Value" />, which is the first operand that is unconditionally evaluated and is the result of the operation if non null. (2) <see cref="WhenNull" />, which is the second operand that is conditionally evaluated and is the result of the operation if <see cref="Value" /> is null. <para> Current usage: (1) C# null-coalescing expression "Value ?? WhenNull". (2) VB binary conditional expression "If(Value, WhenNull)". </para> </summary> </Comments> <Property Name="Value" Type="IOperation"> <Comments> <summary>Operation to be unconditionally evaluated.</summary> </Comments> </Property> <Property Name="WhenNull" Type="IOperation"> <Comments> <summary> Operation to be conditionally evaluated if <see cref="Value" /> evaluates to null/Nothing. </summary> </Comments> </Property> <Property Name="ValueConversion" Type="CommonConversion"> <Comments> <summary> Conversion associated with <see cref="Value" /> when it is not null/Nothing. Identity if result type of the operation is the same as type of <see cref="Value" />. Otherwise, if type of <see cref="Value" /> is nullable, then conversion is applied to an unwrapped <see cref="Value" />, otherwise to the <see cref="Value" /> itself. </summary> </Comments> </Property> </Node> <Node Name="IAnonymousFunctionOperation" Base="IOperation"> <!-- IAnonymousFunctionOperations do not have a type, users must look at the IConversionOperation on top of this node to get the type of lambda, matching SemanticModel.GetType behavior. --> <Comments> <summary> Represents an anonymous function operation. <para> Current usage: (1) C# lambda expression. (2) VB anonymous delegate expression. </para> </summary> </Comments> <Property Name="Symbol" Type="IMethodSymbol"> <Comments> <summary>Symbol of the anonymous function.</summary> </Comments> </Property> <Property Name="Body" Type="IBlockOperation"> <Comments> <summary>Body of the anonymous function.</summary> </Comments> </Property> </Node> <Node Name="IObjectCreationOperation" Base="IOperation" ChildrenOrder="Arguments,Initializer" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents creation of an object instance. <para> Current usage: (1) C# new expression. (2) VB New expression. </para> </summary> </Comments> <Property Name="Constructor" Type="IMethodSymbol?"> <Comments> <summary>Constructor to be invoked on the created instance.</summary> </Comments> </Property> <Property Name="Initializer" Type="IObjectOrCollectionInitializerOperation?"> <Comments> <summary>Object or collection initializer, if any.</summary> </Comments> </Property> <Property Name="Arguments" Type="ImmutableArray&lt;IArgumentOperation&gt;"> <Comments> <summary>Arguments of the object creation, excluding the instance argument. Arguments are in evaluation order.</summary> <remarks> If the invocation is in its expanded form, then params/ParamArray arguments would be collected into arrays. Default values are supplied for optional arguments missing in source. </remarks> </Comments> </Property> </Node> <Node Name="ITypeParameterObjectCreationOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents a creation of a type parameter object, i.e. new T(), where T is a type parameter with new constraint. <para> Current usage: (1) C# type parameter object creation expression. (2) VB type parameter object creation expression. </para> </summary> </Comments> <Property Name="Initializer" Type="IObjectOrCollectionInitializerOperation?"> <Comments> <summary>Object or collection initializer, if any.</summary> </Comments> </Property> </Node> <Node Name="IArrayCreationOperation" Base="IOperation" ChildrenOrder="DimensionSizes,Initializer" HasType="true"> <Comments> <summary> Represents the creation of an array instance. <para> Current usage: (1) C# array creation expression. (2) VB array creation expression. </para> </summary> </Comments> <Property Name="DimensionSizes" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>Sizes of the dimensions of the created array instance.</summary> </Comments> </Property> <Property Name="Initializer" Type="IArrayInitializerOperation?"> <Comments> <summary>Values of elements of the created array instance.</summary> </Comments> </Property> </Node> <Node Name="IInstanceReferenceOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents an implicit/explicit reference to an instance. <para> Current usage: (1) C# this or base expression. (2) VB Me, MyClass, or MyBase expression. (3) C# object or collection or 'with' expression initializers. (4) VB With statements, object or collection initializers. </para> </summary> </Comments> <Property Name="ReferenceKind" Type="InstanceReferenceKind"> <Comments> <summary>The kind of reference that is being made.</summary> </Comments> </Property> </Node> <Node Name="IIsTypeOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents an operation that tests if a value is of a specific type. <para> Current usage: (1) C# "is" operator expression. (2) VB "TypeOf" and "TypeOf IsNot" expression. </para> </summary> </Comments> <Property Name="ValueOperand" Type="IOperation"> <Comments> <summary>Value to test.</summary> </Comments> </Property> <Property Name="TypeOperand" Type="ITypeSymbol"> <Comments> <summary>Type for which to test.</summary> </Comments> </Property> <Property Name="IsNegated" Type="bool"> <Comments> <summary> Flag indicating if this is an "is not" type expression. True for VB "TypeOf ... IsNot ..." expression. False, otherwise. </summary> </Comments> </Property> </Node> <Node Name="IAwaitOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents an await operation. <para> Current usage: (1) C# await expression. (2) VB await expression. </para> </summary> </Comments> <Property Name="Operation" Type="IOperation"> <Comments> <summary>Awaited operation.</summary> </Comments> </Property> </Node> <AbstractNode Name="IAssignmentOperation" Base="IOperation"> <Comments> <summary> Represents a base interface for assignments. <para> Current usage: (1) C# simple, compound and deconstruction assignment expressions. (2) VB simple and compound assignment expressions. </para> </summary> </Comments> <Property Name="Target" Type="IOperation"> <Comments> <summary>Target of the assignment.</summary> </Comments> </Property> <Property Name="Value" Type="IOperation"> <Comments> <summary>Value to be assigned to the target of the assignment.</summary> </Comments> </Property> </AbstractNode> <Node Name="ISimpleAssignmentOperation" Base="IAssignmentOperation" ChildrenOrder="Target,Value" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents a simple assignment operation. <para> Current usage: (1) C# simple assignment expression. (2) VB simple assignment expression. </para> </summary> </Comments> <Property Name="IsRef" Type="bool"> <Comments> <summary>Is this a ref assignment</summary> </Comments> </Property> </Node> <Node Name="ICompoundAssignmentOperation" Base="IAssignmentOperation" ChildrenOrder="Target,Value" HasType="true"> <Comments> <summary> Represents a compound assignment that mutates the target with the result of a binary operation. <para> Current usage: (1) C# compound assignment expression. (2) VB compound assignment expression. </para> </summary> </Comments> <Property Name="InConversion" Type="CommonConversion"> <Comments> <summary> Conversion applied to <see cref="IAssignmentOperation.Target" /> before the operation occurs. </summary> </Comments> </Property> <Property Name="OutConversion" Type="CommonConversion"> <Comments> <summary> Conversion applied to the result of the binary operation, before it is assigned back to <see cref="IAssignmentOperation.Target" />. </summary> </Comments> </Property> <Property Name="OperatorKind" Type="BinaryOperatorKind"> <Comments> <summary>Kind of binary operation.</summary> </Comments> </Property> <Property Name="IsLifted" Type="bool"> <Comments> <summary> <see langword="true" /> if this assignment contains a 'lifted' binary operation. </summary> </Comments> </Property> <Property Name="IsChecked" Type="bool"> <Comments> <summary> <see langword="true" /> if overflow checking is performed for the arithmetic operation. </summary> </Comments> </Property> <Property Name="OperatorMethod" Type="IMethodSymbol?"> <Comments> <summary>Operator method used by the operation, null if the operation does not use an operator method.</summary> </Comments> </Property> </Node> <Node Name="IParenthesizedOperation" Base="IOperation" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents a parenthesized operation. <para> Current usage: (1) VB parenthesized expression. </para> </summary> </Comments> <Property Name="Operand" Type="IOperation"> <Comments> <summary>Operand enclosed in parentheses.</summary> </Comments> </Property> </Node> <Node Name="IEventAssignmentOperation" Base="IOperation" ChildrenOrder="EventReference,HandlerValue" HasType="true"> <Comments> <summary> Represents a binding of an event. <para> Current usage: (1) C# event assignment expression. (2) VB Add/Remove handler statement. </para> </summary> </Comments> <Property Name="EventReference" Type="IOperation"> <Comments> <summary>Reference to the event being bound.</summary> </Comments> </Property> <Property Name="HandlerValue" Type="IOperation"> <Comments> <summary>Handler supplied for the event.</summary> </Comments> </Property> <Property Name="Adds" Type="bool"> <Comments> <summary>True for adding a binding, false for removing one.</summary> </Comments> </Property> </Node> <Node Name="IConditionalAccessOperation" Base="IOperation" ChildrenOrder="Operation,WhenNotNull" HasType="true"> <Comments> <summary> Represents a conditionally accessed operation. Note that <see cref="IConditionalAccessInstanceOperation" /> is used to refer to the value of <see cref="Operation" /> within <see cref="WhenNotNull" />. <para> Current usage: (1) C# conditional access expression (? or ?. operator). (2) VB conditional access expression (? or ?. operator). </para> </summary> </Comments> <Property Name="Operation" Type="IOperation"> <Comments> <summary>Operation that will be evaluated and accessed if non null.</summary> </Comments> </Property> <Property Name="WhenNotNull" Type="IOperation"> <Comments> <summary> Operation to be evaluated if <see cref="Operation" /> is non null. </summary> </Comments> </Property> </Node> <Node Name="IConditionalAccessInstanceOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents the value of a conditionally-accessed operation within <see cref="IConditionalAccessOperation.WhenNotNull" />. For a conditional access operation of the form <c>someExpr?.Member</c>, this operation is used as the InstanceReceiver for the right operation <c>Member</c>. See https://github.com/dotnet/roslyn/issues/21279#issuecomment-323153041 for more details. <para> Current usage: (1) C# conditional access instance expression. (2) VB conditional access instance expression. </para> </summary> </Comments> </Node> <Node Name="IInterpolatedStringOperation" Base="IOperation" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents an interpolated string. <para> Current usage: (1) C# interpolated string expression. (2) VB interpolated string expression. </para> </summary> </Comments> <Property Name="Parts" Type="ImmutableArray&lt;IInterpolatedStringContentOperation&gt;"> <Comments> <summary> Constituent parts of interpolated string, each of which is an <see cref="IInterpolatedStringContentOperation" />. </summary> </Comments> </Property> </Node> <Node Name="IAnonymousObjectCreationOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents a creation of anonymous object. <para> Current usage: (1) C# "new { ... }" expression (2) VB "New With { ... }" expression </para> </summary> </Comments> <Property Name="Initializers" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary> Property initializers. Each initializer is an <see cref="ISimpleAssignmentOperation" />, with an <see cref="IPropertyReferenceOperation" /> as the target whose Instance is an <see cref="IInstanceReferenceOperation" /> with <see cref="InstanceReferenceKind.ImplicitReceiver" /> kind. </summary> </Comments> </Property> </Node> <Node Name="IObjectOrCollectionInitializerOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents an initialization for an object or collection creation. <para> Current usage: (1) C# object or collection initializer expression. (2) VB object or collection initializer expression. For example, object initializer "{ X = x }" within object creation "new Class() { X = x }" and collection initializer "{ x, y, 3 }" within collection creation "new MyList() { x, y, 3 }". </para> </summary> </Comments> <Property Name="Initializers" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>Object member or collection initializers.</summary> </Comments> </Property> </Node> <Node Name="IMemberInitializerOperation" Base="IOperation" ChildrenOrder="InitializedMember,Initializer" HasType="true"> <Comments> <summary> Represents an initialization of member within an object initializer with a nested object or collection initializer. <para> Current usage: (1) C# nested member initializer expression. For example, given an object creation with initializer "new Class() { X = x, Y = { x, y, 3 }, Z = { X = z } }", member initializers for Y and Z, i.e. "Y = { x, y, 3 }", and "Z = { X = z }" are nested member initializers represented by this operation. </para> </summary> </Comments> <Property Name="InitializedMember" Type="IOperation"> <Comments> <summary> Initialized member reference <see cref="IMemberReferenceOperation" /> or an invalid operation for error cases. </summary> </Comments> </Property> <Property Name="Initializer" Type="IObjectOrCollectionInitializerOperation"> <Comments> <summary>Member initializer.</summary> </Comments> </Property> </Node> <Node Name="ICollectionElementInitializerOperation" Base="IOperation" SkipClassGeneration="true"> <Obsolete Error="true">"ICollectionElementInitializerOperation has been replaced with " + nameof(IInvocationOperation) + " and " + nameof(IDynamicInvocationOperation)</Obsolete> <Comments> <summary> Obsolete interface that used to represent a collection element initializer. It has been replaced by <see cref="IInvocationOperation" /> and <see cref="IDynamicInvocationOperation" />, as appropriate. <para> Current usage: None. This API has been obsoleted in favor of <see cref="IInvocationOperation" /> and <see cref="IDynamicInvocationOperation" />. </para> </summary> </Comments> <Property Name="AddMethod" Type="IMethodSymbol" /> <Property Name="Arguments" Type="ImmutableArray&lt;IOperation&gt;" /> <Property Name="IsDynamic" Type="bool" /> </Node> <Node Name="INameOfOperation" Base="IOperation" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents an operation that gets a string value for the <see cref="Argument" /> name. <para> Current usage: (1) C# nameof expression. (2) VB NameOf expression. </para> </summary> </Comments> <Property Name="Argument" Type="IOperation"> <Comments> <summary>Argument to the name of operation.</summary> </Comments> </Property> </Node> <Node Name="ITupleOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents a tuple with one or more elements. <para> Current usage: (1) C# tuple expression. (2) VB tuple expression. </para> </summary> </Comments> <Property Name="Elements" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>Tuple elements.</summary> </Comments> </Property> <Property Name="NaturalType" Type="ITypeSymbol?"> <Comments> <summary> Natural type of the tuple, or null if tuple doesn't have a natural type. Natural type can be different from <see cref="IOperation.Type" /> depending on the conversion context, in which the tuple is used. </summary> </Comments> </Property> </Node> <Node Name="IDynamicObjectCreationOperation" Base="IOperation" SkipClassGeneration="true"> <Comments> <summary> Represents an object creation with a dynamically bound constructor. <para> Current usage: (1) C# "new" expression with dynamic argument(s). (2) VB late bound "New" expression. </para> </summary> </Comments> <Property Name="Initializer" Type="IObjectOrCollectionInitializerOperation?"> <Comments> <summary>Object or collection initializer, if any.</summary> </Comments> </Property> <Property Name="Arguments" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>Dynamically bound arguments, excluding the instance argument.</summary> </Comments> </Property> </Node> <Node Name="IDynamicMemberReferenceOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents a reference to a member of a class, struct, or module that is dynamically bound. <para> Current usage: (1) C# dynamic member reference expression. (2) VB late bound member reference expression. </para> </summary> </Comments> <Property Name="Instance" Type="IOperation?"> <Comments> <summary>Instance receiver, if it exists.</summary> </Comments> </Property> <Property Name="MemberName" Type="string"> <Comments> <summary>Referenced member.</summary> </Comments> </Property> <Property Name="TypeArguments" Type="ImmutableArray&lt;ITypeSymbol&gt;"> <Comments> <summary>Type arguments.</summary> </Comments> </Property> <Property Name="ContainingType" Type="ITypeSymbol?"> <Comments> <summary> The containing type of the referenced member, if different from type of the <see cref="Instance" />. </summary> </Comments> </Property> </Node> <Node Name="IDynamicInvocationOperation" Base="IOperation" SkipClassGeneration="true"> <Comments> <summary> Represents a invocation that is dynamically bound. <para> Current usage: (1) C# dynamic invocation expression. (2) C# dynamic collection element initializer. For example, in the following collection initializer: <code>new C() { do1, do2, do3 }</code> where the doX objects are of type dynamic, we'll have 3 <see cref="IDynamicInvocationOperation" /> with do1, do2, and do3 as their arguments. (3) VB late bound invocation expression. (4) VB dynamic collection element initializer. Similar to the C# example, <code>New C() From {do1, do2, do3}</code> will generate 3 <see cref="IDynamicInvocationOperation" /> nodes with do1, do2, and do3 as their arguments, respectively. </para> </summary> </Comments> <Property Name="Operation" Type="IOperation"> <Comments> <summary>Dynamically or late bound operation.</summary> </Comments> </Property> <Property Name="Arguments" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>Dynamically bound arguments, excluding the instance argument.</summary> </Comments> </Property> </Node> <Node Name="IDynamicIndexerAccessOperation" Base="IOperation" SkipClassGeneration="true"> <Comments> <summary> Represents an indexer access that is dynamically bound. <para> Current usage: (1) C# dynamic indexer access expression. </para> </summary> </Comments> <Property Name="Operation" Type="IOperation"> <Comments> <summary>Dynamically indexed operation.</summary> </Comments> </Property> <Property Name="Arguments" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>Dynamically bound arguments, excluding the instance argument.</summary> </Comments> </Property> </Node> <Node Name="ITranslatedQueryOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents an unrolled/lowered query operation. For example, for a C# query expression "from x in set where x.Name != null select x.Name", the Operation tree has the following shape: ITranslatedQueryExpression IInvocationExpression ('Select' invocation for "select x.Name") IInvocationExpression ('Where' invocation for "where x.Name != null") IInvocationExpression ('From' invocation for "from x in set") <para> Current usage: (1) C# query expression. (2) VB query expression. </para> </summary> </Comments> <Property Name="Operation" Type="IOperation"> <Comments> <summary>Underlying unrolled operation.</summary> </Comments> </Property> </Node> <Node Name="IDelegateCreationOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents a delegate creation. This is created whenever a new delegate is created. <para> Current usage: (1) C# delegate creation expression. (2) VB delegate creation expression. </para> </summary> </Comments> <Property Name="Target" Type="IOperation"> <Comments> <summary>The lambda or method binding that this delegate is created from.</summary> </Comments> </Property> </Node> <Node Name="IDefaultValueOperation" Base="IOperation" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents a default value operation. <para> Current usage: (1) C# default value expression. </para> </summary> </Comments> </Node> <Node Name="ITypeOfOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents an operation that gets <see cref="System.Type" /> for the given <see cref="TypeOperand" />. <para> Current usage: (1) C# typeof expression. (2) VB GetType expression. </para> </summary> </Comments> <Property Name="TypeOperand" Type="ITypeSymbol"> <Comments> <summary>Type operand.</summary> </Comments> </Property> </Node> <Node Name="ISizeOfOperation" Base="IOperation" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents an operation to compute the size of a given type. <para> Current usage: (1) C# sizeof expression. </para> </summary> </Comments> <Property Name="TypeOperand" Type="ITypeSymbol"> <Comments> <summary>Type operand.</summary> </Comments> </Property> </Node> <Node Name="IAddressOfOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents an operation that creates a pointer value by taking the address of a reference. <para> Current usage: (1) C# address of expression </para> </summary> </Comments> <Property Name="Reference" Type="IOperation"> <Comments> <summary>Addressed reference.</summary> </Comments> </Property> </Node> <Node Name="IIsPatternOperation" Base="IOperation" ChildrenOrder="Value,Pattern" HasType="true"> <Comments> <summary> Represents an operation that tests if a value matches a specific pattern. <para> Current usage: (1) C# is pattern expression. For example, "x is int i". </para> </summary> </Comments> <Property Name="Value" Type="IOperation"> <Comments> <summary>Underlying operation to test.</summary> </Comments> </Property> <Property Name="Pattern" Type="IPatternOperation"> <Comments> <summary>Pattern.</summary> </Comments> </Property> </Node> <Node Name="IIncrementOrDecrementOperation" Base="IOperation" HasType="true"> <OperationKind> <Entry Name="Increment" Value="0x42" ExtraDescription="This is used as an increment operator"/> <Entry Name="Decrement" Value="0x44" ExtraDescription="This is used as a decrement operator"/> </OperationKind> <Comments> <summary> Represents an <see cref="OperationKind.Increment" /> or <see cref="OperationKind.Decrement" /> operation. Note that this operation is different from an <see cref="IUnaryOperation" /> as it mutates the <see cref="Target" />, while unary operator expression does not mutate it's operand. <para> Current usage: (1) C# increment expression or decrement expression. </para> </summary> </Comments> <Property Name="IsPostfix" Type="bool"> <Comments> <summary> <see langword="true" /> if this is a postfix expression. <see langword="false" /> if this is a prefix expression. </summary> </Comments> </Property> <Property Name="IsLifted" Type="bool"> <Comments> <summary> <see langword="true" /> if this is a 'lifted' increment operator. When there is an operator that is defined to work on a value type, 'lifted' operators are created to work on the <see cref="System.Nullable{T}" /> versions of those value types. </summary> </Comments> </Property> <Property Name="IsChecked" Type="bool"> <Comments> <summary> <see langword="true" /> if overflow checking is performed for the arithmetic operation. </summary> </Comments> </Property> <Property Name="Target" Type="IOperation"> <Comments> <summary>Target of the assignment.</summary> </Comments> </Property> <Property Name="OperatorMethod" Type="IMethodSymbol?"> <Comments> <summary>Operator method used by the operation, null if the operation does not use an operator method.</summary> </Comments> </Property> </Node> <Node Name="IThrowOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents an operation to throw an exception. <para> Current usage: (1) C# throw expression. (2) C# throw statement. (2) VB Throw statement. </para> </summary> </Comments> <Property Name="Exception" Type="IOperation?"> <Comments> <summary>Instance of an exception being thrown.</summary> </Comments> </Property> </Node> <Node Name="IDeconstructionAssignmentOperation" Base="IAssignmentOperation" ChildrenOrder="Target,Value" HasType="true"> <Comments> <summary> Represents a assignment with a deconstruction. <para> Current usage: (1) C# deconstruction assignment expression. </para> </summary> </Comments> </Node> <Node Name="IDeclarationExpressionOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents a declaration expression operation. Unlike a regular variable declaration <see cref="IVariableDeclaratorOperation" /> and <see cref="IVariableDeclarationOperation" />, this operation represents an "expression" declaring a variable. <para> Current usage: (1) C# declaration expression. For example, (a) "var (x, y)" is a deconstruction declaration expression with variables x and y. (b) "(var x, var y)" is a tuple expression with two declaration expressions. (c) "M(out var x);" is an invocation expression with an out "var x" declaration expression. </para> </summary> </Comments> <Property Name="Expression" Type="IOperation"> <Comments> <summary>Underlying expression.</summary> </Comments> </Property> </Node> <Node Name="IOmittedArgumentOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents an argument value that has been omitted in an invocation. <para> Current usage: (1) VB omitted argument in an invocation expression. </para> </summary> </Comments> </Node> <AbstractNode Name="ISymbolInitializerOperation" Base="IOperation"> <Comments> <summary> Represents an initializer for a field, property, parameter or a local variable declaration. <para> Current usage: (1) C# field, property, parameter or local variable initializer. (2) VB field(s), property, parameter or local variable initializer. </para> </summary> </Comments> <Property Name="Locals" Type="ImmutableArray&lt;ILocalSymbol&gt;"> <Comments> <summary> Local declared in and scoped to the <see cref="Value" />. </summary> </Comments> </Property> <Property Name="Value" Type="IOperation"> <Comments> <summary>Underlying initializer value.</summary> </Comments> </Property> </AbstractNode> <Node Name="IFieldInitializerOperation" Base="ISymbolInitializerOperation"> <Comments> <summary> Represents an initialization of a field. <para> Current usage: (1) C# field initializer with equals value clause. (2) VB field(s) initializer with equals value clause or AsNew clause. Multiple fields can be initialized with AsNew clause in VB. </para> </summary> </Comments> <Property Name="InitializedFields" Type="ImmutableArray&lt;IFieldSymbol&gt;"> <Comments> <summary>Initialized fields. There can be multiple fields for Visual Basic fields declared with AsNew clause.</summary> </Comments> </Property> </Node> <Node Name="IVariableInitializerOperation" Base="ISymbolInitializerOperation"> <Comments> <summary> Represents an initialization of a local variable. <para> Current usage: (1) C# local variable initializer with equals value clause. (2) VB local variable initializer with equals value clause or AsNew clause. </para> </summary> </Comments> </Node> <Node Name="IPropertyInitializerOperation" Base="ISymbolInitializerOperation"> <Comments> <summary> Represents an initialization of a property. <para> Current usage: (1) C# property initializer with equals value clause. (2) VB property initializer with equals value clause or AsNew clause. Multiple properties can be initialized with 'WithEvents' declaration with AsNew clause in VB. </para> </summary> </Comments> <Property Name="InitializedProperties" Type="ImmutableArray&lt;IPropertySymbol&gt;"> <Comments> <summary>Initialized properties. There can be multiple properties for Visual Basic 'WithEvents' declaration with AsNew clause.</summary> </Comments> </Property> </Node> <Node Name="IParameterInitializerOperation" Base="ISymbolInitializerOperation"> <Comments> <summary> Represents an initialization of a parameter at the point of declaration. <para> Current usage: (1) C# parameter initializer with equals value clause. (2) VB parameter initializer with equals value clause. </para> </summary> </Comments> <Property Name="Parameter" Type="IParameterSymbol"> <Comments> <summary>Initialized parameter.</summary> </Comments> </Property> </Node> <Node Name="IArrayInitializerOperation" Base="IOperation"> <Comments> <summary> Represents the initialization of an array instance. <para> Current usage: (1) C# array initializer. (2) VB array initializer. </para> </summary> </Comments> <Property Name="ElementValues" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>Values to initialize array elements.</summary> </Comments> </Property> </Node> <Node Name="IVariableDeclaratorOperation" Base="IOperation" ChildrenOrder="IgnoredArguments,Initializer"> <Comments> <summary>Represents a single variable declarator and initializer.</summary> <para> Current Usage: (1) C# variable declarator (2) C# catch variable declaration (3) VB single variable declaration (4) VB catch variable declaration </para> <remarks> In VB, the initializer for this node is only ever used for explicit array bounds initializers. This node corresponds to the VariableDeclaratorSyntax in C# and the ModifiedIdentifierSyntax in VB. </remarks> </Comments> <Property Name="Symbol" Type="ILocalSymbol"> <Comments> <summary>Symbol declared by this variable declaration</summary> </Comments> </Property> <Property Name="Initializer" Type="IVariableInitializerOperation?"> <Comments> <summary>Optional initializer of the variable.</summary> <remarks> If this variable is in an <see cref="IVariableDeclarationOperation" />, the initializer may be located in the parent operation. Call <see cref="OperationExtensions.GetVariableInitializer(IVariableDeclaratorOperation)" /> to check in all locations. It is only possible to have initializers in both locations in VB invalid code scenarios. </remarks> </Comments> </Property> <Property Name="IgnoredArguments" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary> Additional arguments supplied to the declarator in error cases, ignored by the compiler. This only used for the C# case of DeclaredArgumentSyntax nodes on a VariableDeclaratorSyntax. </summary> </Comments> </Property> </Node> <Node Name="IVariableDeclarationOperation" Base="IOperation" ChildrenOrder="IgnoredDimensions,Declarators,Initializer"> <Comments> <summary>Represents a declarator that declares multiple individual variables.</summary> <para> Current Usage: (1) C# VariableDeclaration (2) C# fixed declarations (3) VB Dim statement declaration groups (4) VB Using statement variable declarations </para> <remarks> The initializer of this node is applied to all individual declarations in <see cref="Declarators" />. There cannot be initializers in both locations except in invalid code scenarios. In C#, this node will never have an initializer. This corresponds to the VariableDeclarationSyntax in C#, and the VariableDeclaratorSyntax in Visual Basic. </remarks> </Comments> <Property Name="Declarators" Type="ImmutableArray&lt;IVariableDeclaratorOperation&gt;"> <Comments> <summary>Individual variable declarations declared by this multiple declaration.</summary> <remarks> All <see cref="IVariableDeclarationGroupOperation" /> will have at least 1 <see cref="IVariableDeclarationOperation" />, even if the declaration group only declares 1 variable. </remarks> </Comments> </Property> <Property Name="Initializer" Type="IVariableInitializerOperation?"> <Comments> <summary>Optional initializer of the variable.</summary> <remarks>In C#, this will always be null.</remarks> </Comments> </Property> <Property Name="IgnoredDimensions" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary> Array dimensions supplied to an array declaration in error cases, ignored by the compiler. This is only used for the C# case of RankSpecifierSyntax nodes on an ArrayTypeSyntax. </summary> </Comments> </Property> </Node> <Node Name="IArgumentOperation" Base="IOperation"> <Comments> <summary> Represents an argument to a method invocation. <para> Current usage: (1) C# argument to an invocation expression, object creation expression, etc. (2) VB argument to an invocation expression, object creation expression, etc. </para> </summary> </Comments> <Property Name="ArgumentKind" Type="ArgumentKind"> <Comments> <summary>Kind of argument.</summary> </Comments> </Property> <Property Name="Parameter" Type="IParameterSymbol?"> <Comments> <summary>Parameter the argument matches. This can be null for __arglist parameters.</summary> </Comments> </Property> <Property Name="Value" Type="IOperation"> <Comments> <summary>Value supplied for the argument.</summary> </Comments> </Property> <Property Name="InConversion" Type="CommonConversion"> <Comments> <summary>Information of the conversion applied to the argument value passing it into the target method. Applicable only to VB Reference arguments.</summary> </Comments> </Property> <Property Name="OutConversion" Type="CommonConversion"> <Comments> <summary>Information of the conversion applied to the argument value after the invocation. Applicable only to VB Reference arguments.</summary> </Comments> </Property> </Node> <Node Name="ICatchClauseOperation" Base="IOperation" ChildrenOrder="ExceptionDeclarationOrExpression,Filter,Handler"> <Comments> <summary> Represents a catch clause. <para> Current usage: (1) C# catch clause. (2) VB Catch clause. </para> </summary> </Comments> <Property Name="ExceptionDeclarationOrExpression" Type="IOperation?"> <Comments> <summary> Optional source for exception. This could be any of the following operation: 1. Declaration for the local catch variable bound to the caught exception (C# and VB) OR 2. Null, indicating no declaration or expression (C# and VB) 3. Reference to an existing local or parameter (VB) OR 4. Other expression for error scenarios (VB) </summary> </Comments> </Property> <Property Name="ExceptionType" Type="ITypeSymbol"> <Comments> <summary>Type of the exception handled by the catch clause.</summary> </Comments> </Property> <Property Name="Locals" Type="ImmutableArray&lt;ILocalSymbol&gt;"> <Comments> <summary> Locals declared by the <see cref="ExceptionDeclarationOrExpression" /> and/or <see cref="Filter" /> clause. </summary> </Comments> </Property> <Property Name="Filter" Type="IOperation?"> <Comments> <summary>Filter operation to be executed to determine whether to handle the exception.</summary> </Comments> </Property> <Property Name="Handler" Type="IBlockOperation"> <Comments> <summary>Body of the exception handler.</summary> </Comments> </Property> </Node> <Node Name="ISwitchCaseOperation" Base="IOperation" ChildrenOrder="Clauses,Body"> <Comments> <summary> Represents a switch case section with one or more case clauses to match and one or more operations to execute within the section. <para> Current usage: (1) C# switch section for one or more case clause and set of statements to execute. (2) VB case block with a case statement for one or more case clause and set of statements to execute. </para> </summary> </Comments> <Property Name="Clauses" Type="ImmutableArray&lt;ICaseClauseOperation&gt;"> <Comments> <summary>Clauses of the case.</summary> </Comments> </Property> <Property Name="Body" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>One or more operations to execute within the switch section.</summary> </Comments> </Property> <Property Name="Locals" Type="ImmutableArray&lt;ILocalSymbol&gt;"> <Comments> <summary>Locals declared within the switch case section scoped to the section.</summary> </Comments> </Property> <Property Name="Condition" Type="IOperation?" Internal="true"> <Comments> <summary> Optional combined logical condition that accounts for all <see cref="Clauses"/>. An instance of <see cref="IPlaceholderOperation"/> with kind <see cref="PlaceholderKind.SwitchOperationExpression"/> is used to refer to the <see cref="ISwitchOperation.Value"/> in context of this expression. It is not part of <see cref="Children"/> list and likely contains duplicate nodes for nodes exposed by <see cref="Clauses"/>, like <see cref="ISingleValueCaseClauseOperation.Value"/>, etc. Never set for C# at the moment. </summary> </Comments> </Property> </Node> <AbstractNode Name="ICaseClauseOperation" Base="IOperation"> <OperationKind Include="true" ExtraDescription="This is further differentiated by &lt;see cref=&quot;ICaseClauseOperation.CaseKind&quot;/&gt;." /> <Comments> <summary> Represents a case clause. <para> Current usage: (1) C# case clause. (2) VB Case clause. </para> </summary> </Comments> <Property Name="CaseKind" Type="CaseKind" MakeAbstract="true"> <Comments> <summary>Kind of the clause.</summary> </Comments> </Property> <Property Name="Label" Type="ILabelSymbol?"> <Comments> <summary>Label associated with the case clause, if any.</summary> </Comments> </Property> </AbstractNode> <Node Name="IDefaultCaseClauseOperation" Base="ICaseClauseOperation"> <OperationKind Include="false" /> <Comments> <summary> Represents a default case clause. <para> Current usage: (1) C# default clause. (2) VB Case Else clause. </para> </summary> </Comments> </Node> <Node Name="IPatternCaseClauseOperation" Base="ICaseClauseOperation" ChildrenOrder="Pattern,Guard"> <OperationKind Include="false" /> <Comments> <summary> Represents a case clause with a pattern and an optional guard operation. <para> Current usage: (1) C# pattern case clause. </para> </summary> </Comments> <Property Name="Label" Type="ILabelSymbol" New="true"> <Comments> <!-- It would be a binary breaking change to remove this --> <summary> Label associated with the case clause. </summary> </Comments> </Property> <Property Name="Pattern" Type="IPatternOperation"> <Comments> <summary>Pattern associated with case clause.</summary> </Comments> </Property> <Property Name="Guard" Type="IOperation?"> <Comments> <summary>Guard associated with the pattern case clause.</summary> </Comments> </Property> </Node> <Node Name="IRangeCaseClauseOperation" Base="ICaseClauseOperation" ChildrenOrder="MinimumValue,MaximumValue"> <OperationKind Include="false" /> <Comments> <summary> Represents a case clause with range of values for comparison. <para> Current usage: (1) VB range case clause of the form "Case x To y". </para> </summary> </Comments> <Property Name="MinimumValue" Type="IOperation"> <Comments> <summary>Minimum value of the case range.</summary> </Comments> </Property> <Property Name="MaximumValue" Type="IOperation"> <Comments> <summary>Maximum value of the case range.</summary> </Comments> </Property> </Node> <Node Name="IRelationalCaseClauseOperation" Base="ICaseClauseOperation"> <OperationKind Include="false" /> <Comments> <summary> Represents a case clause with custom relational operator for comparison. <para> Current usage: (1) VB relational case clause of the form "Case Is op x". </para> </summary> </Comments> <Property Name="Value" Type="IOperation"> <Comments> <summary>Case value.</summary> </Comments> </Property> <Property Name="Relation" Type="BinaryOperatorKind"> <Comments> <summary>Relational operator used to compare the switch value with the case value.</summary> </Comments> </Property> </Node> <Node Name="ISingleValueCaseClauseOperation" Base="ICaseClauseOperation"> <OperationKind Include="false" /> <Comments> <summary> Represents a case clause with a single value for comparison. <para> Current usage: (1) C# case clause of the form "case x" (2) VB case clause of the form "Case x". </para> </summary> </Comments> <Property Name="Value" Type="IOperation"> <Comments> <summary>Case value.</summary> </Comments> </Property> </Node> <AbstractNode Name="IInterpolatedStringContentOperation" Base="IOperation"> <Comments> <summary> Represents a constituent part of an interpolated string. <para> Current usage: (1) C# interpolated string content. (2) VB interpolated string content. </para> </summary> </Comments> </AbstractNode> <Node Name="IInterpolatedStringTextOperation" Base="IInterpolatedStringContentOperation"> <Comments> <summary> Represents a constituent string literal part of an interpolated string operation. <para> Current usage: (1) C# interpolated string text. (2) VB interpolated string text. </para> </summary> </Comments> <Property Name="Text" Type="IOperation"> <Comments> <summary>Text content.</summary> </Comments> </Property> </Node> <Node Name="IInterpolationOperation" Base="IInterpolatedStringContentOperation" ChildrenOrder="Expression,Alignment,FormatString"> <Comments> <summary> Represents a constituent interpolation part of an interpolated string operation. <para> Current usage: (1) C# interpolation part. (2) VB interpolation part. </para> </summary> </Comments> <Property Name="Expression" Type="IOperation"> <Comments> <summary>Expression of the interpolation.</summary> </Comments> </Property> <Property Name="Alignment" Type="IOperation?"> <Comments> <summary>Optional alignment of the interpolation.</summary> </Comments> </Property> <Property Name="FormatString" Type="IOperation?"> <Comments> <summary>Optional format string of the interpolation.</summary> </Comments> </Property> </Node> <AbstractNode Name="IPatternOperation" Base="IOperation"> <Comments> <summary> Represents a pattern matching operation. <para> Current usage: (1) C# pattern. </para> </summary> </Comments> <Property Name="InputType" Type="ITypeSymbol"> <Comments> <summary>The input type to the pattern-matching operation.</summary> </Comments> </Property> <Property Name="NarrowedType" Type="ITypeSymbol"> <Comments> <summary>The narrowed type of the pattern-matching operation.</summary> </Comments> </Property> </AbstractNode> <Node Name="IConstantPatternOperation" Base="IPatternOperation"> <Comments> <summary> Represents a pattern with a constant value. <para> Current usage: (1) C# constant pattern. </para> </summary> </Comments> <Property Name="Value" Type="IOperation"> <Comments> <summary>Constant value of the pattern operation.</summary> </Comments> </Property> </Node> <Node Name="IDeclarationPatternOperation" Base="IPatternOperation"> <Comments> <summary> Represents a pattern that declares a symbol. <para> Current usage: (1) C# declaration pattern. </para> </summary> </Comments> <Property Name="MatchedType" Type="ITypeSymbol?"> <Comments> <summary> The type explicitly specified, or null if it was inferred (e.g. using <code>var</code> in C#). </summary> </Comments> </Property> <Property Name="MatchesNull" Type="bool"> <Comments> <summary> True if the pattern is of a form that accepts null. For example, in C# the pattern `var x` will match a null input, while the pattern `string x` will not. </summary> </Comments> </Property> <Property Name="DeclaredSymbol" Type="ISymbol?"> <Comments> <summary>Symbol declared by the pattern, if any.</summary> </Comments> </Property> </Node> <Node Name="ITupleBinaryOperation" Base="IOperation" VisitorName="VisitTupleBinaryOperator" ChildrenOrder="LeftOperand,RightOperand" HasType="true"> <OperationKind> <Entry Name="TupleBinary" Value="0x57" /> <Entry Name="TupleBinaryOperator" Value="0x57" EditorBrowsable="false" ExtraDescription="Use &lt;see cref=&quot;TupleBinary&quot;/&gt; instead." /> </OperationKind> <Comments> <summary> Represents a comparison of two operands that returns a bool type. <para> Current usage: (1) C# tuple binary operator expression. </para> </summary> </Comments> <Property Name="OperatorKind" Type="BinaryOperatorKind"> <Comments> <summary>Kind of binary operation.</summary> </Comments> </Property> <Property Name="LeftOperand" Type="IOperation"> <Comments> <summary>Left operand.</summary> </Comments> </Property> <Property Name="RightOperand" Type="IOperation"> <Comments> <summary>Right operand.</summary> </Comments> </Property> </Node> <AbstractNode Name="IMethodBodyBaseOperation" Base="IOperation"> <Comments> <summary> Represents a method body operation. <para> Current usage: (1) C# method body </para> </summary> </Comments> <Property Name="BlockBody" Type="IBlockOperation?"> <Comments> <summary>Method body corresponding to BaseMethodDeclarationSyntax.Body or AccessorDeclarationSyntax.Body</summary> </Comments> </Property> <Property Name="ExpressionBody" Type="IBlockOperation?"> <Comments> <summary>Method body corresponding to BaseMethodDeclarationSyntax.ExpressionBody or AccessorDeclarationSyntax.ExpressionBody</summary> </Comments> </Property> </AbstractNode> <Node Name="IMethodBodyOperation" Base="IMethodBodyBaseOperation" VisitorName="VisitMethodBodyOperation" ChildrenOrder="BlockBody,ExpressionBody"> <OperationKind> <Entry Name="MethodBody" Value="0x58" /> <Entry Name="MethodBodyOperation" Value="0x58" EditorBrowsable="false" ExtraDescription="Use &lt;see cref=&quot;MethodBody&quot;/&gt; instead." /> </OperationKind> <Comments> <summary> Represents a method body operation. <para> Current usage: (1) C# method body for non-constructor </para> </summary> </Comments> </Node> <Node Name="IConstructorBodyOperation" Base="IMethodBodyBaseOperation" VisitorName="VisitConstructorBodyOperation" ChildrenOrder="Initializer,BlockBody,ExpressionBody"> <OperationKind> <Entry Name="ConstructorBody" Value="0x59" /> <Entry Name="ConstructorBodyOperation" Value="0x59" EditorBrowsable="false" ExtraDescription="Use &lt;see cref=&quot;ConstructorBody&quot;/&gt; instead." /> </OperationKind> <Comments> <summary> Represents a constructor method body operation. <para> Current usage: (1) C# method body for constructor declaration </para> </summary> </Comments> <Property Name="Locals" Type="ImmutableArray&lt;ILocalSymbol&gt;"> <Comments> <summary>Local declarations contained within the <see cref="Initializer" />.</summary> </Comments> </Property> <Property Name="Initializer" Type="IOperation?"> <Comments> <summary>Constructor initializer, if any.</summary> </Comments> </Property> </Node> <Node Name="IDiscardOperation" Base="IOperation" VisitorName="VisitDiscardOperation" HasType="true"> <Comments> <summary> Represents a discard operation. <para> Current usage: C# discard expressions </para> </summary> </Comments> <Property Name="DiscardSymbol" Type="IDiscardSymbol"> <Comments> <summary>The symbol of the discard operation.</summary> </Comments> </Property> </Node> <Node Name="IFlowCaptureOperation" Base="IOperation" Namespace="FlowAnalysis" SkipInCloner="true"> <Comments> <summary> Represents that an intermediate result is being captured. This node is produced only as part of a <see cref="ControlFlowGraph" />. </summary> </Comments> <Property Name="Id" Type="CaptureId"> <Comments> <summary>An id used to match references to the same intermediate result.</summary> </Comments> </Property> <Property Name="Value" Type="IOperation"> <Comments> <summary>Value to be captured.</summary> </Comments> </Property> </Node> <Node Name="IFlowCaptureReferenceOperation" Base="IOperation" Namespace="FlowAnalysis" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents a point of use of an intermediate result captured earlier. The fact of capturing the result is represented by <see cref="IFlowCaptureOperation" />. This node is produced only as part of a <see cref="ControlFlowGraph" />. </summary> </Comments> <Property Name="Id" Type="CaptureId"> <Comments> <summary>An id used to match references to the same intermediate result.</summary> </Comments> </Property> </Node> <Node Name="IIsNullOperation" Base="IOperation" Namespace="FlowAnalysis" SkipInCloner="true" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents result of checking whether the <see cref="Operand" /> is null. For reference types this checks if the <see cref="Operand" /> is a null reference, for nullable types this checks if the <see cref="Operand" /> doesn’t have a value. The node is produced as part of a flow graph during rewrite of <see cref="ICoalesceOperation" /> and <see cref="IConditionalAccessOperation" /> nodes. </summary> </Comments> <Property Name="Operand" Type="IOperation"> <Comments> <summary>Value to check.</summary> </Comments> </Property> </Node> <Node Name="ICaughtExceptionOperation" Base="IOperation" Namespace="FlowAnalysis" SkipInCloner="true" HasType="true"> <Comments> <summary> Represents a exception instance passed by an execution environment to an exception filter or handler. This node is produced only as part of a <see cref="ControlFlowGraph" />. </summary> </Comments> </Node> <Node Name="IStaticLocalInitializationSemaphoreOperation" Base="IOperation" Namespace="FlowAnalysis" SkipInCloner="true" HasType="true"> <Comments> <summary> Represents the check during initialization of a VB static local that is initialized on the first call of the function, and never again. If the semaphore operation returns true, the static local has not yet been initialized, and the initializer will be run. If it returns false, then the local has already been initialized, and the static local initializer region will be skipped. This node is produced only as part of a <see cref="ControlFlowGraph" />. </summary> </Comments> <Property Name="Local" Type="ILocalSymbol"> <Comments> <summary>The static local variable that is possibly initialized.</summary> </Comments> </Property> </Node> <Node Name="IFlowAnonymousFunctionOperation" Base="IOperation" Namespace="FlowAnalysis" SkipClassGeneration="true"> <Comments> <summary> Represents an anonymous function operation in context of a <see cref="ControlFlowGraph" />. <para> Current usage: (1) C# lambda expression. (2) VB anonymous delegate expression. </para> A <see cref="ControlFlowGraph" /> for the body of the anonymous function is available from the enclosing <see cref="ControlFlowGraph" />. </summary> </Comments> <Property Name="Symbol" Type="IMethodSymbol"> <Comments> <summary>Symbol of the anonymous function.</summary> </Comments> </Property> </Node> <Node Name="ICoalesceAssignmentOperation" Base="IAssignmentOperation" ChildrenOrder="Target,Value" HasType="true"> <Comments> <summary> Represents a coalesce assignment operation with a target and a conditionally-evaluated value: (1) <see cref="IAssignmentOperation.Target" /> is evaluated for null. If it is null, <see cref="IAssignmentOperation.Value" /> is evaluated and assigned to target. (2) <see cref="IAssignmentOperation.Value" /> is conditionally evaluated if <see cref="IAssignmentOperation.Target" /> is null, and the result is assigned into <see cref="IAssignmentOperation.Target" />. The result of the entire expression is<see cref="IAssignmentOperation.Target" />, which is only evaluated once. <para> Current usage: (1) C# null-coalescing assignment operation <code>Target ??= Value</code>. </para> </summary> </Comments> </Node> <Node Name="IRangeOperation" Base="IOperation" VisitorName="VisitRangeOperation" ChildrenOrder="LeftOperand,RightOperand" HasType="true"> <Comments> <summary> Represents a range operation. <para> Current usage: (1) C# range expressions </para> </summary> </Comments> <Property Name="LeftOperand" Type="IOperation?"> <Comments> <summary>Left operand.</summary> </Comments> </Property> <Property Name="RightOperand" Type="IOperation?"> <Comments> <summary>Right operand.</summary> </Comments> </Property> <Property Name="IsLifted" Type="bool"> <Comments> <summary> <code>true</code> if this is a 'lifted' range operation. When there is an operator that is defined to work on a value type, 'lifted' operators are created to work on the <see cref="System.Nullable{T}" /> versions of those value types. </summary> </Comments> </Property> <Property Name="Method" Type="IMethodSymbol?"> <Comments> <summary> Factory method used to create this Range value. Can be null if appropriate symbol was not found. </summary> </Comments> </Property> </Node> <Node Name="IReDimOperation" Base="IOperation"> <Comments> <summary> Represents the ReDim operation to re-allocate storage space for array variables. <para> Current usage: (1) VB ReDim statement. </para> </summary> </Comments> <Property Name="Clauses" Type="ImmutableArray&lt;IReDimClauseOperation&gt;"> <Comments> <summary>Individual clauses of the ReDim operation.</summary> </Comments> </Property> <Property Name="Preserve" Type="bool"> <Comments> <summary>Modifier used to preserve the data in the existing array when you change the size of only the last dimension.</summary> </Comments> </Property> </Node> <Node Name="IReDimClauseOperation" Base="IOperation" ChildrenOrder="Operand,DimensionSizes"> <Comments> <summary> Represents an individual clause of an <see cref="IReDimOperation" /> to re-allocate storage space for a single array variable. <para> Current usage: (1) VB ReDim clause. </para> </summary> </Comments> <Property Name="Operand" Type="IOperation"> <Comments> <summary>Operand whose storage space needs to be re-allocated.</summary> </Comments> </Property> <Property Name="DimensionSizes" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>Sizes of the dimensions of the created array instance.</summary> </Comments> </Property> </Node> <Node Name="IRecursivePatternOperation" Base="IPatternOperation" ChildrenOrder="DeconstructionSubpatterns,PropertySubpatterns"> <Comments> <summary>Represents a C# recursive pattern.</summary> </Comments> <Property Name="MatchedType" Type="ITypeSymbol"> <Comments> <summary>The type accepted for the recursive pattern.</summary> </Comments> </Property> <Property Name="DeconstructSymbol" Type="ISymbol?"> <Comments> <summary> The symbol, if any, used for the fetching values for subpatterns. This is either a <code>Deconstruct</code> method, the type <code>System.Runtime.CompilerServices.ITuple</code>, or null (for example, in error cases or when matching a tuple type). </summary> </Comments> </Property> <Property Name="DeconstructionSubpatterns" Type="ImmutableArray&lt;IPatternOperation&gt;"> <Comments> <summary>This contains the patterns contained within a deconstruction or positional subpattern.</summary> </Comments> </Property> <Property Name="PropertySubpatterns" Type="ImmutableArray&lt;IPropertySubpatternOperation&gt;"> <Comments> <summary>This contains the (symbol, property) pairs within a property subpattern.</summary> </Comments> </Property> <Property Name="DeclaredSymbol" Type="ISymbol?"> <Comments> <summary>Symbol declared by the pattern.</summary> </Comments> </Property> </Node> <Node Name="IDiscardPatternOperation" Base="IPatternOperation"> <Comments> <summary> Represents a discard pattern. <para> Current usage: C# discard pattern </para> </summary> </Comments> </Node> <Node Name="ISwitchExpressionOperation" Base="IOperation" ChildrenOrder="Value,Arms" HasType="true"> <Comments> <summary> Represents a switch expression. <para> Current usage: (1) C# switch expression. </para> </summary> </Comments> <Property Name="Value" Type="IOperation"> <Comments> <summary>Value to be switched upon.</summary> </Comments> </Property> <Property Name="Arms" Type="ImmutableArray&lt;ISwitchExpressionArmOperation&gt;"> <Comments> <summary>Arms of the switch expression.</summary> </Comments> </Property> <Property Name="IsExhaustive" Type="bool"> <Comments> <summary>True if the switch expressions arms cover every possible input value.</summary> </Comments> </Property> </Node> <Node Name="ISwitchExpressionArmOperation" Base="IOperation" ChildrenOrder="Pattern,Guard,Value"> <Comments> <summary>Represents one arm of a switch expression.</summary> </Comments> <Property Name="Pattern" Type="IPatternOperation"> <Comments> <summary>The pattern to match.</summary> </Comments> </Property> <Property Name="Guard" Type="IOperation?"> <Comments> <summary>Guard (when clause expression) associated with the switch arm, if any.</summary> </Comments> </Property> <Property Name="Value" Type="IOperation"> <Comments> <summary>Result value of the enclosing switch expression when this arm matches.</summary> </Comments> </Property> <Property Name="Locals" Type="ImmutableArray&lt;ILocalSymbol&gt;"> <Comments> <summary>Locals declared within the switch arm (e.g. pattern locals and locals declared in the guard) scoped to the arm.</summary> </Comments> </Property> </Node> <Node Name="IPropertySubpatternOperation" Base="IOperation" ChildrenOrder="Member,Pattern"> <Comments> <summary> Represents an element of a property subpattern, which identifies a member to be matched and the pattern to match it against. </summary> </Comments> <Property Name="Member" Type="IOperation"> <Comments> <summary> The member being matched in a property subpattern. This can be a <see cref="IMemberReferenceOperation" /> in non-error cases, or an <see cref="IInvalidOperation" /> in error cases. </summary> </Comments> </Property> <Property Name="Pattern" Type="IPatternOperation"> <Comments> <summary>The pattern to which the member is matched in a property subpattern.</summary> </Comments> </Property> </Node> <Node Name="IAggregateQueryOperation" Base="IOperation" Internal="true" ChildrenOrder="Group,Aggregation" HasType="true"> <Comments> <summary>Represents a standalone VB query Aggregate operation with more than one item in Into clause.</summary> </Comments> <Property Name="Group" Type="IOperation" /> <Property Name="Aggregation" Type="IOperation" /> </Node> <Node Name="IFixedOperation" Base="IOperation" Internal="true" SkipInVisitor="true" ChildrenOrder="Variables,Body"> <!-- Making this public is tracked by https://github.com/dotnet/roslyn/issues/21281 --> <Comments> <summary>Represents a C# fixed statement.</summary> </Comments> <Property Name="Locals" Type="ImmutableArray&lt;ILocalSymbol&gt;"> <Comments> <summary>Locals declared.</summary> </Comments> </Property> <Property Name="Variables" Type="IVariableDeclarationGroupOperation"> <Comments> <summary>Variables to be fixed.</summary> </Comments> </Property> <Property Name="Body" Type="IOperation"> <Comments> <summary>Body of the fixed, over which the variables are fixed.</summary> </Comments> </Property> </Node> <Node Name="INoPiaObjectCreationOperation" Base="IOperation" Internal="true" HasType="true"> <Comments> <summary> Represents a creation of an instance of a NoPia interface, i.e. new I(), where I is an embedded NoPia interface. <para> Current usage: (1) C# NoPia interface instance creation expression. (2) VB NoPia interface instance creation expression. </para> </summary> </Comments> <Property Name="Initializer" Type="IObjectOrCollectionInitializerOperation?"> <Comments> <summary>Object or collection initializer, if any.</summary> </Comments> </Property> </Node> <Node Name="IPlaceholderOperation" Base="IOperation" Internal="true" HasType="true"> <Comments> <summary> Represents a general placeholder when no more specific kind of placeholder is available. A placeholder is an expression whose meaning is inferred from context. </summary> </Comments> <Property Name="PlaceholderKind" Type="PlaceholderKind" /> </Node> <Node Name="IPointerIndirectionReferenceOperation" Base="IOperation" SkipClassGeneration="true" Internal="true" HasType="true"> <Comments> <summary> Represents a reference through a pointer. <para> Current usage: (1) C# pointer indirection reference expression. </para> </summary> </Comments> <Property Name="Pointer" Type="IOperation"> <Comments> <summary>Pointer to be dereferenced.</summary> </Comments> </Property> </Node> <Node Name="IWithStatementOperation" Base="IOperation" Internal="true" ChildrenOrder="Value,Body"> <Comments> <summary> Represents a <see cref="Body" /> of operations that are executed with implicit reference to the <see cref="Value" /> for member references. <para> Current usage: (1) VB With statement. </para> </summary> </Comments> <Property Name="Body" Type="IOperation"> <Comments> <summary>Body of the with.</summary> </Comments> </Property> <Property Name="Value" Type="IOperation"> <Comments> <summary>Value to whose members leading-dot-qualified references within the with body bind.</summary> </Comments> </Property> </Node> <Node Name="IUsingDeclarationOperation" Base="IOperation"> <Comments> <summary> Represents using variable declaration, with scope spanning across the parent <see cref="IBlockOperation"/>. <para> Current Usage: (1) C# using declaration (1) C# asynchronous using declaration </para> </summary> </Comments> <Property Name="DeclarationGroup" Type="IVariableDeclarationGroupOperation"> <Comments> <summary>The variables declared by this using declaration.</summary> </Comments> </Property> <Property Name="IsAsynchronous" Type="bool"> <Comments> <summary>True if this is an asynchronous using declaration.</summary> </Comments> </Property> <Property Name="DisposeInfo" Type="DisposeOperationInfo" Internal="true"> <Comments> <summary>Information about the method that will be invoked to dispose the declared instances when pattern based disposal is used.</summary> </Comments> </Property> </Node> <Node Name="INegatedPatternOperation" Base="IPatternOperation"> <Comments> <summary> Represents a negated pattern. <para> Current usage: (1) C# negated pattern. </para> </summary> </Comments> <Property Name="Pattern" Type="IPatternOperation"> <Comments> <summary>The negated pattern.</summary> </Comments> </Property> </Node> <Node Name="IBinaryPatternOperation" Base="IPatternOperation" ChildrenOrder="LeftPattern,RightPattern"> <Comments> <summary> Represents a binary ("and" or "or") pattern. <para> Current usage: (1) C# "and" and "or" patterns. </para> </summary> </Comments> <Property Name="OperatorKind" Type="BinaryOperatorKind"> <Comments> <summary>Kind of binary pattern; either <see cref="BinaryOperatorKind.And"/> or <see cref="BinaryOperatorKind.Or"/>.</summary> </Comments> </Property> <Property Name="LeftPattern" Type="IPatternOperation"> <Comments> <summary>The pattern on the left.</summary> </Comments> </Property> <Property Name="RightPattern" Type="IPatternOperation"> <Comments> <summary>The pattern on the right.</summary> </Comments> </Property> </Node> <Node Name="ITypePatternOperation" Base="IPatternOperation"> <Comments> <summary> Represents a pattern comparing the input with a given type. <para> Current usage: (1) C# type pattern. </para> </summary> </Comments> <Property Name="MatchedType" Type="ITypeSymbol"> <Comments> <summary> The type explicitly specified, or null if it was inferred (e.g. using <code>var</code> in C#). </summary> </Comments> </Property> </Node> <Node Name="IRelationalPatternOperation" Base="IPatternOperation"> <Comments> <summary> Represents a pattern comparing the input with a constant value using a relational operator. <para> Current usage: (1) C# relational pattern. </para> </summary> </Comments> <Property Name="OperatorKind" Type="BinaryOperatorKind"> <Comments> <summary>The kind of the relational operator.</summary> </Comments> </Property> <Property Name="Value" Type="IOperation"> <Comments> <summary>Constant value of the pattern operation.</summary> </Comments> </Property> </Node> <Node Name="IWithOperation" Base="IOperation" ChildrenOrder="Operand,Initializer" HasType="true"> <Comments> <summary> Represents cloning of an object instance. <para> Current usage: (1) C# with expression. </para> </summary> </Comments> <Property Name="Operand" Type="IOperation"> <Comments> <summary>Operand to be cloned.</summary> </Comments> </Property> <Property Name="CloneMethod" Type="IMethodSymbol?"> <Comments> <summary>Clone method to be invoked on the value. This can be null in error scenarios.</summary> </Comments> </Property> <Property Name="Initializer" Type="IObjectOrCollectionInitializerOperation"> <Comments> <summary>With collection initializer.</summary> </Comments> </Property> </Node> </Tree>
<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. --> <Tree Root="IOperation"> <!-- To regenerate the operation nodes, run eng/generate-compiler-code.cmd The operations in this file are _ordered_! If you change the order in here, you will affect the ordering in the generated OperationKind enum, which will break the public api analyzer. All new types should be put at the end of this file in order to ensure that the kind does not continue to change. UnusedOperationKinds indicates kinds that are currently skipped by the OperationKind enum. They can be used by future nodes by inserting those nodes at the correct point in the list. When implementing new operations, run tests with additional IOperation validation enabled. You can test with `Build.cmd -testIOperation`. Or to repro in VS, you can do `set ROSLYN_TEST_IOPERATION=true` then `devenv`. --> <UnusedOperationKinds> <Entry Value="0x1D"/> <Entry Value="0x62"/> <Entry Value="0x64"/> </UnusedOperationKinds> <Node Name="IInvalidOperation" Base="IOperation" SkipClassGeneration="true"> <Comments> <summary> Represents an invalid operation with one or more child operations. <para> Current usage: (1) C# invalid expression or invalid statement. (2) VB invalid expression or invalid statement. </para> </summary> </Comments> </Node> <Node Name="IBlockOperation" Base="IOperation"> <Comments> <summary> Represents a block containing a sequence of operations and local declarations. <para> Current usage: (1) C# "{ ... }" block statement. (2) VB implicit block statement for method bodies and other block scoped statements. </para> </summary> </Comments> <Property Name="Operations" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>Operations contained within the block.</summary> </Comments> </Property> <Property Name="Locals" Type="ImmutableArray&lt;ILocalSymbol&gt;"> <Comments> <summary>Local declarations contained within the block.</summary> </Comments> </Property> </Node> <Node Name="IVariableDeclarationGroupOperation" Base="IOperation"> <Comments> <summary>Represents a variable declaration statement.</summary> <para> Current Usage: (1) C# local declaration statement (2) C# fixed statement (3) C# using statement (4) C# using declaration (5) VB Dim statement (6) VB Using statement </para> </Comments> <Property Name="Declarations" Type="ImmutableArray&lt;IVariableDeclarationOperation&gt;"> <Comments> <summary>Variable declaration in the statement.</summary> <remarks> In C#, this will always be a single declaration, with all variables in <see cref="IVariableDeclarationOperation.Declarators" />. </remarks> </Comments> </Property> </Node> <Node Name="ISwitchOperation" Base="IOperation" ChildrenOrder="Value,Cases"> <Comments> <summary> Represents a switch operation with a value to be switched upon and switch cases. <para> Current usage: (1) C# switch statement. (2) VB Select Case statement. </para> </summary> </Comments> <Property Name="Locals" Type="ImmutableArray&lt;ILocalSymbol&gt;"> <Comments> <summary> Locals declared within the switch operation with scope spanning across all <see cref="Cases" />. </summary> </Comments> </Property> <Property Name="Value" Type="IOperation"> <Comments> <summary>Value to be switched upon.</summary> </Comments> </Property> <Property Name="Cases" Type="ImmutableArray&lt;ISwitchCaseOperation&gt;"> <Comments> <summary>Cases of the switch.</summary> </Comments> </Property> <Property Name="ExitLabel" Type="ILabelSymbol"> <Comments> <summary>Exit label for the switch statement.</summary> </Comments> </Property> </Node> <AbstractNode Name="ILoopOperation" Base="IOperation"> <OperationKind Include="true" ExtraDescription="This is further differentiated by &lt;see cref=&quot;ILoopOperation.LoopKind&quot;/&gt;." /> <Comments> <summary> Represents a loop operation. <para> Current usage: (1) C# 'while', 'for', 'foreach' and 'do' loop statements (2) VB 'While', 'ForTo', 'ForEach', 'Do While' and 'Do Until' loop statements </para> </summary> </Comments> <Property Name="LoopKind" Type="LoopKind" MakeAbstract="true"> <Comments> <summary>Kind of the loop.</summary> </Comments> </Property> <Property Name="Body" Type="IOperation"> <Comments> <summary>Body of the loop.</summary> </Comments> </Property> <Property Name="Locals" Type="ImmutableArray&lt;ILocalSymbol&gt;"> <Comments> <summary>Declared locals.</summary> </Comments> </Property> <Property Name="ContinueLabel" Type="ILabelSymbol"> <Comments> <summary>Loop continue label.</summary> </Comments> </Property> <Property Name="ExitLabel" Type="ILabelSymbol"> <Comments> <summary>Loop exit/break label.</summary> </Comments> </Property> </AbstractNode> <Node Name="IForEachLoopOperation" Base="ILoopOperation" ChildrenOrder="Collection,LoopControlVariable,Body,NextVariables"> <OperationKind Include="false" /> <Comments> <summary> Represents a for each loop. <para> Current usage: (1) C# 'foreach' loop statement (2) VB 'For Each' loop statement </para> </summary> </Comments> <Property Name="LoopControlVariable" Type="IOperation"> <Comments> <summary>Refers to the operation for declaring a new local variable or reference an existing variable or an expression.</summary> </Comments> </Property> <Property Name="Collection" Type="IOperation"> <Comments> <summary>Collection value over which the loop iterates.</summary> </Comments> </Property> <Property Name="NextVariables" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary> Optional list of comma separated next variables at loop bottom in VB. This list is always empty for C#. </summary> </Comments> </Property> <Property Name="Info" Type="ForEachLoopOperationInfo?" Internal="true" /> <Property Name="IsAsynchronous" Type="bool"> <Comments> <summary> Whether this for each loop is asynchronous. Always false for VB. </summary> </Comments> </Property> </Node> <Node Name="IForLoopOperation" Base="ILoopOperation" ChildrenOrder="Before,Condition,Body,AtLoopBottom"> <OperationKind Include="false" /> <Comments> <summary> Represents a for loop. <para> Current usage: (1) C# 'for' loop statement </para> </summary> </Comments> <Property Name="Before" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>List of operations to execute before entry to the loop. For C#, this comes from the first clause of the for statement.</summary> </Comments> </Property> <Property Name="ConditionLocals" Type="ImmutableArray&lt;ILocalSymbol&gt;"> <Comments> <summary> Locals declared within the loop Condition and are in scope throughout the <see cref="Condition" />, <see cref="ILoopOperation.Body" /> and <see cref="AtLoopBottom" />. They are considered to be declared per iteration. </summary> </Comments> </Property> <Property Name="Condition" Type="IOperation?"> <Comments> <summary>Condition of the loop. For C#, this comes from the second clause of the for statement.</summary> </Comments> </Property> <Property Name="AtLoopBottom" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>List of operations to execute at the bottom of the loop. For C#, this comes from the third clause of the for statement.</summary> </Comments> </Property> </Node> <Node Name="IForToLoopOperation" Base="ILoopOperation" ChildrenOrder="LoopControlVariable,InitialValue,LimitValue,StepValue,Body,NextVariables"> <OperationKind Include="false" /> <Comments> <summary> Represents a for to loop with loop control variable and initial, limit and step values for the control variable. <para> Current usage: (1) VB 'For ... To ... Step' loop statement </para> </summary> </Comments> <Property Name="LoopControlVariable" Type="IOperation"> <Comments> <summary>Refers to the operation for declaring a new local variable or reference an existing variable or an expression.</summary> </Comments> </Property> <Property Name="InitialValue" Type="IOperation"> <Comments> <summary>Operation for setting the initial value of the loop control variable. This comes from the expression between the 'For' and 'To' keywords.</summary> </Comments> </Property> <Property Name="LimitValue" Type="IOperation"> <Comments> <summary>Operation for the limit value of the loop control variable. This comes from the expression after the 'To' keyword.</summary> </Comments> </Property> <Property Name="StepValue" Type="IOperation"> <Comments> <summary> Operation for the step value of the loop control variable. This comes from the expression after the 'Step' keyword, or inferred by the compiler if 'Step' clause is omitted. </summary> </Comments> </Property> <Property Name="IsChecked" Type="bool"> <Comments> <summary> <code>true</code> if arithmetic operations behind this loop are 'checked'.</summary> </Comments> </Property> <Property Name="NextVariables" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>Optional list of comma separated next variables at loop bottom.</summary> </Comments> </Property> <Property Name="Info" Type="(ILocalSymbol LoopObject, ForToLoopOperationUserDefinedInfo UserDefinedInfo)" Internal="true" /> </Node> <Node Name="IWhileLoopOperation" Base="ILoopOperation" SkipChildrenGeneration="true"> <OperationKind Include="false" /> <Comments> <summary> Represents a while or do while loop. <para> Current usage: (1) C# 'while' and 'do while' loop statements. (2) VB 'While', 'Do While' and 'Do Until' loop statements. </para> </summary> </Comments> <Property Name="Condition" Type="IOperation?"> <Comments> <summary>Condition of the loop. This can only be null in error scenarios.</summary> </Comments> </Property> <Property Name="ConditionIsTop" Type="bool"> <Comments> <summary> True if the <see cref="Condition" /> is evaluated at start of each loop iteration. False if it is evaluated at the end of each loop iteration. </summary> </Comments> </Property> <Property Name="ConditionIsUntil" Type="bool"> <Comments> <summary>True if the loop has 'Until' loop semantics and the loop is executed while <see cref="Condition" /> is false.</summary> </Comments> </Property> <Property Name="IgnoredCondition" Type="IOperation?"> <Comments> <summary> Additional conditional supplied for loop in error cases, which is ignored by the compiler. For example, for VB 'Do While' or 'Do Until' loop with syntax errors where both the top and bottom conditions are provided. The top condition is preferred and exposed as <see cref="Condition" /> and the bottom condition is ignored and exposed by this property. This property should be null for all non-error cases. </summary> </Comments> </Property> </Node> <Node Name="ILabeledOperation" Base="IOperation"> <Comments> <summary> Represents an operation with a label. <para> Current usage: (1) C# labeled statement. (2) VB label statement. </para> </summary> </Comments> <Property Name="Label" Type="ILabelSymbol"> <Comments> <summary>Label that can be the target of branches.</summary> </Comments> </Property> <Property Name="Operation" Type="IOperation?"> <Comments> <summary>Operation that has been labeled. In VB, this is always null.</summary> </Comments> </Property> </Node> <Node Name="IBranchOperation" Base="IOperation"> <Comments> <summary> Represents a branch operation. <para> Current usage: (1) C# goto, break, or continue statement. (2) VB GoTo, Exit ***, or Continue *** statement. </para> </summary> </Comments> <Property Name="Target" Type="ILabelSymbol"> <Comments> <summary>Label that is the target of the branch.</summary> </Comments> </Property> <Property Name="BranchKind" Type="BranchKind"> <Comments> <summary>Kind of the branch.</summary> </Comments> </Property> </Node> <Node Name="IEmptyOperation" Base="IOperation"> <Comments> <summary> Represents an empty or no-op operation. <para> Current usage: (1) C# empty statement. </para> </summary> </Comments> </Node> <Node Name="IReturnOperation" Base="IOperation"> <OperationKind> <Entry Name="Return" Value="0x9"/> <Entry Name="YieldBreak" Value="0xa" ExtraDescription="This has yield break semantics."/> <Entry Name="YieldReturn" Value="0xe" ExtraDescription="This has yield return semantics."/> </OperationKind> <Comments> <summary> Represents a return from the method with an optional return value. <para> Current usage: (1) C# return statement and yield statement. (2) VB Return statement. </para> </summary> </Comments> <Property Name="ReturnedValue" Type="IOperation?"> <Comments> <summary>Value to be returned.</summary> </Comments> </Property> </Node> <Node Name="ILockOperation" Base="IOperation" ChildrenOrder="LockedValue,Body"> <Comments> <summary> Represents a <see cref="Body" /> of operations that are executed while holding a lock onto the <see cref="LockedValue" />. <para> Current usage: (1) C# lock statement. (2) VB SyncLock statement. </para> </summary> </Comments> <Property Name="LockedValue" Type="IOperation"> <Comments> <summary>Operation producing a value to be locked.</summary> </Comments> </Property> <Property Name="Body" Type="IOperation"> <Comments> <summary>Body of the lock, to be executed while holding the lock.</summary> </Comments> </Property> <Property Name="LockTakenSymbol" Type="ILocalSymbol?" Internal="true"/> </Node> <Node Name="ITryOperation" Base="IOperation" ChildrenOrder="Body,Catches,Finally"> <Comments> <summary> Represents a try operation for exception handling code with a body, catch clauses and a finally handler. <para> Current usage: (1) C# try statement. (2) VB Try statement. </para> </summary> </Comments> <Property Name="Body" Type="IBlockOperation"> <Comments> <summary>Body of the try, over which the handlers are active.</summary> </Comments> </Property> <Property Name="Catches" Type="ImmutableArray&lt;ICatchClauseOperation&gt;"> <Comments> <summary>Catch clauses of the try.</summary> </Comments> </Property> <Property Name="Finally" Type="IBlockOperation?"> <Comments> <summary>Finally handler of the try.</summary> </Comments> </Property> <Property Name="ExitLabel" Type="ILabelSymbol?"> <Comments> <summary>Exit label for the try. This will always be null for C#.</summary> </Comments> </Property> </Node> <Node Name="IUsingOperation" Base="IOperation" ChildrenOrder="Resources,Body"> <Comments> <summary> Represents a <see cref="Body" /> of operations that are executed while using disposable <see cref="Resources" />. <para> Current usage: (1) C# using statement. (2) VB Using statement. </para> </summary> </Comments> <Property Name="Resources" Type="IOperation"> <Comments> <summary>Declaration introduced or resource held by the using.</summary> </Comments> </Property> <Property Name="Body" Type="IOperation"> <Comments> <summary>Body of the using, over which the resources of the using are maintained.</summary> </Comments> </Property> <Property Name="Locals" Type="ImmutableArray&lt;ILocalSymbol&gt;"> <Comments> <summary> Locals declared within the <see cref="Resources" /> with scope spanning across this entire <see cref="IUsingOperation" />. </summary> </Comments> </Property> <Property Name="IsAsynchronous" Type="bool"> <Comments> <summary> Whether this using is asynchronous. Always false for VB. </summary> </Comments> </Property> <Property Name="DisposeInfo" Type="DisposeOperationInfo" Internal="true"> <Comments> <summary>Information about the method that will be invoked to dispose the <see cref="Resources" /> when pattern based disposal is used.</summary> </Comments> </Property> </Node> <Node Name="IExpressionStatementOperation" Base="IOperation"> <Comments> <summary> Represents an operation that drops the resulting value and the type of the underlying wrapped <see cref="Operation" />. <para> Current usage: (1) C# expression statement. (2) VB expression statement. </para> </summary> </Comments> <Property Name="Operation" Type="IOperation"> <Comments> <summary>Underlying operation with a value and type.</summary> </Comments> </Property> </Node> <Node Name="ILocalFunctionOperation" Base="IOperation" ChildrenOrder="Body,IgnoredBody"> <Comments> <summary> Represents a local function defined within a method. <para> Current usage: (1) C# local function statement. </para> </summary> </Comments> <Property Name="Symbol" Type="IMethodSymbol"> <Comments> <summary>Local function symbol.</summary> </Comments> </Property> <Property Name="Body" Type="IBlockOperation?"> <Comments> <summary>Body of the local function.</summary> <remarks>This can be null in error scenarios, or when the method is an extern method.</remarks> </Comments> </Property> <Property Name="IgnoredBody" Type="IBlockOperation?"> <Comments> <summary>An extra body for the local function, if both a block body and expression body are specified in source.</summary> <remarks>This is only ever non-null in error situations.</remarks> </Comments> </Property> </Node> <Node Name="IStopOperation" Base="IOperation"> <Comments> <summary> Represents an operation to stop or suspend execution of code. <para> Current usage: (1) VB Stop statement. </para> </summary> </Comments> </Node> <Node Name="IEndOperation" Base="IOperation"> <Comments> <summary> Represents an operation that stops the execution of code abruptly. <para> Current usage: (1) VB End Statement. </para> </summary> </Comments> </Node> <Node Name="IRaiseEventOperation" Base="IOperation" ChildrenOrder="EventReference,Arguments"> <Comments> <summary> Represents an operation for raising an event. <para> Current usage: (1) VB raise event statement. </para> </summary> </Comments> <Property Name="EventReference" Type="IEventReferenceOperation"> <Comments> <summary>Reference to the event to be raised.</summary> </Comments> </Property> <Property Name="Arguments" Type="ImmutableArray&lt;IArgumentOperation&gt;"> <Comments> <summary>Arguments of the invocation, excluding the instance argument. Arguments are in evaluation order.</summary> <remarks> If the invocation is in its expanded form, then params/ParamArray arguments would be collected into arrays. Default values are supplied for optional arguments missing in source. </remarks> </Comments> </Property> </Node> <Node Name="ILiteralOperation" Base="IOperation" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents a textual literal numeric, string, etc. <para> Current usage: (1) C# literal expression. (2) VB literal expression. </para> </summary> </Comments> </Node> <Node Name="IConversionOperation" Base="IOperation" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents a type conversion. <para> Current usage: (1) C# conversion expression. (2) VB conversion expression. </para> </summary> </Comments> <Property Name="Operand" Type="IOperation"> <Comments> <summary>Value to be converted.</summary> </Comments> </Property> <Property Name="OperatorMethod" Type="IMethodSymbol?" SkipGeneration="true"> <Comments> <summary>Operator method used by the operation, null if the operation does not use an operator method.</summary> </Comments> </Property> <Property Name="Conversion" Type="CommonConversion"> <Comments> <summary>Gets the underlying common conversion information.</summary> <remarks> If you need conversion information that is language specific, use either <see cref="T:Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetConversion(IConversionOperation)" /> or <see cref="T:Microsoft.CodeAnalysis.VisualBasic.VisualBasicExtensions.GetConversion(IConversionOperation)" />. </remarks> </Comments> </Property> <Property Name="IsTryCast" Type="bool"> <Comments> <summary> False if the conversion will fail with a <see cref="InvalidCastException" /> at runtime if the cast fails. This is true for C#'s <c>as</c> operator and for VB's <c>TryCast</c> operator. </summary> </Comments> </Property> <Property Name="IsChecked" Type="bool"> <Comments> <summary>True if the conversion can fail at runtime with an overflow exception. This corresponds to C# checked and unchecked blocks.</summary> </Comments> </Property> </Node> <Node Name="IInvocationOperation" Base="IOperation" ChildrenOrder="Instance,Arguments" HasType="true"> <Comments> <summary> Represents an invocation of a method. <para> Current usage: (1) C# method invocation expression. (2) C# collection element initializer. For example, in the following collection initializer: <code>new C() { 1, 2, 3 }</code>, we will have 3 <see cref="IInvocationOperation" /> nodes, each of which will be a call to the corresponding Add method with either 1, 2, 3 as the argument. (3) VB method invocation expression. (4) VB collection element initializer. Similar to the C# example, <code>New C() From {1, 2, 3}</code> will have 3 <see cref="IInvocationOperation" /> nodes with 1, 2, and 3 as their arguments, respectively. </para> </summary> </Comments> <Property Name="TargetMethod" Type="IMethodSymbol"> <Comments> <summary>Method to be invoked.</summary> </Comments> </Property> <Property Name="Instance" Type="IOperation?"> <Comments> <summary>'This' or 'Me' instance to be supplied to the method, or null if the method is static.</summary> </Comments> </Property> <Property Name="IsVirtual" Type="bool"> <Comments> <summary>True if the invocation uses a virtual mechanism, and false otherwise.</summary> </Comments> </Property> <Property Name="Arguments" Type="ImmutableArray&lt;IArgumentOperation&gt;"> <Comments> <summary>Arguments of the invocation, excluding the instance argument. Arguments are in evaluation order.</summary> <remarks> If the invocation is in its expanded form, then params/ParamArray arguments would be collected into arrays. Default values are supplied for optional arguments missing in source. </remarks> </Comments> </Property> </Node> <Node Name="IArrayElementReferenceOperation" Base="IOperation" ChildrenOrder="ArrayReference,Indices" HasType="true"> <Comments> <summary> Represents a reference to an array element. <para> Current usage: (1) C# array element reference expression. (2) VB array element reference expression. </para> </summary> </Comments> <Property Name="ArrayReference" Type="IOperation"> <Comments> <summary>Array to be indexed.</summary> </Comments> </Property> <Property Name="Indices" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>Indices that specify an individual element.</summary> </Comments> </Property> </Node> <Node Name="ILocalReferenceOperation" Base="IOperation" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents a reference to a declared local variable. <para> Current usage: (1) C# local reference expression. (2) VB local reference expression. </para> </summary> </Comments> <Property Name="Local" Type="ILocalSymbol"> <Comments> <summary>Referenced local variable.</summary> </Comments> </Property> <Property Name="IsDeclaration" Type="bool"> <Comments> <summary> True if this reference is also the declaration site of this variable. This is true in out variable declarations and in deconstruction operations where a new variable is being declared. </summary> </Comments> </Property> </Node> <Node Name="IParameterReferenceOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents a reference to a parameter. <para> Current usage: (1) C# parameter reference expression. (2) VB parameter reference expression. </para> </summary> </Comments> <Property Name="Parameter" Type="IParameterSymbol"> <Comments> <summary>Referenced parameter.</summary> </Comments> </Property> </Node> <AbstractNode Name="IMemberReferenceOperation" Base="IOperation" > <Comments> <summary> Represents a reference to a member of a class, struct, or interface. <para> Current usage: (1) C# member reference expression. (2) VB member reference expression. </para> </summary> </Comments> <Property Name="Instance" Type="IOperation?"> <Comments> <summary>Instance of the type. Null if the reference is to a static/shared member.</summary> </Comments> </Property> <Property Name="Member" Type="ISymbol" SkipGeneration="true"> <Comments> <summary>Referenced member.</summary> </Comments> </Property> </AbstractNode> <Node Name="IFieldReferenceOperation" Base="IMemberReferenceOperation" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents a reference to a field. <para> Current usage: (1) C# field reference expression. (2) VB field reference expression. </para> </summary> </Comments> <Property Name="Field" Type="IFieldSymbol"> <Comments> <summary>Referenced field.</summary> </Comments> </Property> <Property Name="IsDeclaration" Type="bool"> <Comments> <summary>If the field reference is also where the field was declared.</summary> <remarks> This is only ever true in CSharp scripts, where a top-level statement creates a new variable in a reference, such as an out variable declaration or a deconstruction declaration. </remarks> </Comments> </Property> </Node> <Node Name="IMethodReferenceOperation" Base="IMemberReferenceOperation" HasType="true"> <Comments> <summary> Represents a reference to a method other than as the target of an invocation. <para> Current usage: (1) C# method reference expression. (2) VB method reference expression. </para> </summary> </Comments> <Property Name="Method" Type="IMethodSymbol"> <Comments> <summary>Referenced method.</summary> </Comments> </Property> <Property Name="IsVirtual" Type="bool"> <Comments> <summary>Indicates whether the reference uses virtual semantics.</summary> </Comments> </Property> </Node> <Node Name="IPropertyReferenceOperation" Base="IMemberReferenceOperation" ChildrenOrder="Instance,Arguments" HasType="true"> <Comments> <summary> Represents a reference to a property. <para> Current usage: (1) C# property reference expression. (2) VB property reference expression. </para> </summary> </Comments> <Property Name="Property" Type="IPropertySymbol"> <Comments> <summary>Referenced property.</summary> </Comments> </Property> <Property Name="Arguments" Type="ImmutableArray&lt;IArgumentOperation&gt;"> <Comments> <summary>Arguments of the indexer property reference, excluding the instance argument. Arguments are in evaluation order.</summary> <remarks> If the invocation is in its expanded form, then params/ParamArray arguments would be collected into arrays. Default values are supplied for optional arguments missing in source. </remarks> </Comments> </Property> </Node> <Node Name="IEventReferenceOperation" Base="IMemberReferenceOperation" HasType="true"> <Comments> <summary> Represents a reference to an event. <para> Current usage: (1) C# event reference expression. (2) VB event reference expression. </para> </summary> </Comments> <Property Name="Event" Type="IEventSymbol"> <Comments> <summary>Referenced event.</summary> </Comments> </Property> </Node> <Node Name="IUnaryOperation" Base="IOperation" VisitorName="VisitUnaryOperator" HasType="true" HasConstantValue="true"> <OperationKind> <Entry Name="Unary" Value="0x1f" /> <Entry Name="UnaryOperator" Value="0x1f" EditorBrowsable="false" ExtraDescription="Use &lt;see cref=&quot;Unary&quot;/&gt; instead." /> </OperationKind> <Comments> <summary> Represents an operation with one operand and a unary operator. <para> Current usage: (1) C# unary operation expression. (2) VB unary operation expression. </para> </summary> </Comments> <Property Name="OperatorKind" Type="UnaryOperatorKind"> <Comments> <summary>Kind of unary operation.</summary> </Comments> </Property> <Property Name="Operand" Type="IOperation"> <Comments> <summary>Operand.</summary> </Comments> </Property> <Property Name="IsLifted" Type="bool"> <Comments> <summary> <see langword="true" /> if this is a 'lifted' unary operator. When there is an operator that is defined to work on a value type, 'lifted' operators are created to work on the <see cref="System.Nullable{T}" /> versions of those value types. </summary> </Comments> </Property> <Property Name="IsChecked" Type="bool"> <Comments> <summary> <see langword="true" /> if overflow checking is performed for the arithmetic operation. </summary> </Comments> </Property> <Property Name="OperatorMethod" Type="IMethodSymbol?"> <Comments> <summary>Operator method used by the operation, null if the operation does not use an operator method.</summary> </Comments> </Property> </Node> <Node Name="IBinaryOperation" Base="IOperation" VisitorName="VisitBinaryOperator" ChildrenOrder="LeftOperand,RightOperand" HasType="true" HasConstantValue="true"> <OperationKind> <Entry Name="Binary" Value="0x20" /> <Entry Name="BinaryOperator" Value="0x20" EditorBrowsable="false" ExtraDescription="Use &lt;see cref=&quot;Binary&quot;/&gt; instead." /> </OperationKind> <Comments> <summary> Represents an operation with two operands and a binary operator that produces a result with a non-null type. <para> Current usage: (1) C# binary operator expression. (2) VB binary operator expression. </para> </summary> </Comments> <Property Name="OperatorKind" Type="BinaryOperatorKind"> <Comments> <summary>Kind of binary operation.</summary> </Comments> </Property> <Property Name="LeftOperand" Type="IOperation"> <Comments> <summary>Left operand.</summary> </Comments> </Property> <Property Name="RightOperand" Type="IOperation"> <Comments> <summary>Right operand.</summary> </Comments> </Property> <Property Name="IsLifted" Type="bool"> <Comments> <summary> <see langword="true" /> if this is a 'lifted' binary operator. When there is an operator that is defined to work on a value type, 'lifted' operators are created to work on the <see cref="System.Nullable{T}" /> versions of those value types. </summary> </Comments> </Property> <Property Name="IsChecked" Type="bool"> <Comments> <summary> <see langword="true" /> if this is a 'checked' binary operator. </summary> </Comments> </Property> <Property Name="IsCompareText" Type="bool"> <Comments> <summary> <see langword="true" /> if the comparison is text based for string or object comparison in VB. </summary> </Comments> </Property> <Property Name="OperatorMethod" Type="IMethodSymbol?"> <Comments> <summary>Operator method used by the operation, null if the operation does not use an operator method.</summary> </Comments> </Property> <Property Name="UnaryOperatorMethod" Type="IMethodSymbol?" Internal="true"> <Comments> <summary> True/False operator method used for short circuiting. https://github.com/dotnet/roslyn/issues/27598 tracks exposing this information through public API </summary> </Comments> </Property> </Node> <Node Name="IConditionalOperation" Base="IOperation" ChildrenOrder="Condition,WhenTrue,WhenFalse" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents a conditional operation with: (1) <see cref="Condition" /> to be tested, (2) <see cref="WhenTrue" /> operation to be executed when <see cref="Condition" /> is true and (3) <see cref="WhenFalse" /> operation to be executed when the <see cref="Condition" /> is false. <para> Current usage: (1) C# ternary expression "a ? b : c" and if statement. (2) VB ternary expression "If(a, b, c)" and If Else statement. </para> </summary> </Comments> <Property Name="Condition" Type="IOperation"> <Comments> <summary>Condition to be tested.</summary> </Comments> </Property> <Property Name="WhenTrue" Type="IOperation"> <Comments> <summary> Operation to be executed if the <see cref="Condition" /> is true. </summary> </Comments> </Property> <Property Name="WhenFalse" Type="IOperation?"> <Comments> <summary> Operation to be executed if the <see cref="Condition" /> is false. </summary> </Comments> </Property> <Property Name="IsRef" Type="bool"> <Comments> <summary>Is result a managed reference</summary> </Comments> </Property> </Node> <Node Name="ICoalesceOperation" Base="IOperation" ChildrenOrder="Value,WhenNull" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents a coalesce operation with two operands: (1) <see cref="Value" />, which is the first operand that is unconditionally evaluated and is the result of the operation if non null. (2) <see cref="WhenNull" />, which is the second operand that is conditionally evaluated and is the result of the operation if <see cref="Value" /> is null. <para> Current usage: (1) C# null-coalescing expression "Value ?? WhenNull". (2) VB binary conditional expression "If(Value, WhenNull)". </para> </summary> </Comments> <Property Name="Value" Type="IOperation"> <Comments> <summary>Operation to be unconditionally evaluated.</summary> </Comments> </Property> <Property Name="WhenNull" Type="IOperation"> <Comments> <summary> Operation to be conditionally evaluated if <see cref="Value" /> evaluates to null/Nothing. </summary> </Comments> </Property> <Property Name="ValueConversion" Type="CommonConversion"> <Comments> <summary> Conversion associated with <see cref="Value" /> when it is not null/Nothing. Identity if result type of the operation is the same as type of <see cref="Value" />. Otherwise, if type of <see cref="Value" /> is nullable, then conversion is applied to an unwrapped <see cref="Value" />, otherwise to the <see cref="Value" /> itself. </summary> </Comments> </Property> </Node> <Node Name="IAnonymousFunctionOperation" Base="IOperation"> <!-- IAnonymousFunctionOperations do not have a type, users must look at the IConversionOperation on top of this node to get the type of lambda, matching SemanticModel.GetType behavior. --> <Comments> <summary> Represents an anonymous function operation. <para> Current usage: (1) C# lambda expression. (2) VB anonymous delegate expression. </para> </summary> </Comments> <Property Name="Symbol" Type="IMethodSymbol"> <Comments> <summary>Symbol of the anonymous function.</summary> </Comments> </Property> <Property Name="Body" Type="IBlockOperation"> <Comments> <summary>Body of the anonymous function.</summary> </Comments> </Property> </Node> <Node Name="IObjectCreationOperation" Base="IOperation" ChildrenOrder="Arguments,Initializer" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents creation of an object instance. <para> Current usage: (1) C# new expression. (2) VB New expression. </para> </summary> </Comments> <Property Name="Constructor" Type="IMethodSymbol?"> <Comments> <summary>Constructor to be invoked on the created instance.</summary> </Comments> </Property> <Property Name="Initializer" Type="IObjectOrCollectionInitializerOperation?"> <Comments> <summary>Object or collection initializer, if any.</summary> </Comments> </Property> <Property Name="Arguments" Type="ImmutableArray&lt;IArgumentOperation&gt;"> <Comments> <summary>Arguments of the object creation, excluding the instance argument. Arguments are in evaluation order.</summary> <remarks> If the invocation is in its expanded form, then params/ParamArray arguments would be collected into arrays. Default values are supplied for optional arguments missing in source. </remarks> </Comments> </Property> </Node> <Node Name="ITypeParameterObjectCreationOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents a creation of a type parameter object, i.e. new T(), where T is a type parameter with new constraint. <para> Current usage: (1) C# type parameter object creation expression. (2) VB type parameter object creation expression. </para> </summary> </Comments> <Property Name="Initializer" Type="IObjectOrCollectionInitializerOperation?"> <Comments> <summary>Object or collection initializer, if any.</summary> </Comments> </Property> </Node> <Node Name="IArrayCreationOperation" Base="IOperation" ChildrenOrder="DimensionSizes,Initializer" HasType="true"> <Comments> <summary> Represents the creation of an array instance. <para> Current usage: (1) C# array creation expression. (2) VB array creation expression. </para> </summary> </Comments> <Property Name="DimensionSizes" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>Sizes of the dimensions of the created array instance.</summary> </Comments> </Property> <Property Name="Initializer" Type="IArrayInitializerOperation?"> <Comments> <summary>Values of elements of the created array instance.</summary> </Comments> </Property> </Node> <Node Name="IInstanceReferenceOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents an implicit/explicit reference to an instance. <para> Current usage: (1) C# this or base expression. (2) VB Me, MyClass, or MyBase expression. (3) C# object or collection or 'with' expression initializers. (4) VB With statements, object or collection initializers. </para> </summary> </Comments> <Property Name="ReferenceKind" Type="InstanceReferenceKind"> <Comments> <summary>The kind of reference that is being made.</summary> </Comments> </Property> </Node> <Node Name="IIsTypeOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents an operation that tests if a value is of a specific type. <para> Current usage: (1) C# "is" operator expression. (2) VB "TypeOf" and "TypeOf IsNot" expression. </para> </summary> </Comments> <Property Name="ValueOperand" Type="IOperation"> <Comments> <summary>Value to test.</summary> </Comments> </Property> <Property Name="TypeOperand" Type="ITypeSymbol"> <Comments> <summary>Type for which to test.</summary> </Comments> </Property> <Property Name="IsNegated" Type="bool"> <Comments> <summary> Flag indicating if this is an "is not" type expression. True for VB "TypeOf ... IsNot ..." expression. False, otherwise. </summary> </Comments> </Property> </Node> <Node Name="IAwaitOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents an await operation. <para> Current usage: (1) C# await expression. (2) VB await expression. </para> </summary> </Comments> <Property Name="Operation" Type="IOperation"> <Comments> <summary>Awaited operation.</summary> </Comments> </Property> </Node> <AbstractNode Name="IAssignmentOperation" Base="IOperation"> <Comments> <summary> Represents a base interface for assignments. <para> Current usage: (1) C# simple, compound and deconstruction assignment expressions. (2) VB simple and compound assignment expressions. </para> </summary> </Comments> <Property Name="Target" Type="IOperation"> <Comments> <summary>Target of the assignment.</summary> </Comments> </Property> <Property Name="Value" Type="IOperation"> <Comments> <summary>Value to be assigned to the target of the assignment.</summary> </Comments> </Property> </AbstractNode> <Node Name="ISimpleAssignmentOperation" Base="IAssignmentOperation" ChildrenOrder="Target,Value" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents a simple assignment operation. <para> Current usage: (1) C# simple assignment expression. (2) VB simple assignment expression. </para> </summary> </Comments> <Property Name="IsRef" Type="bool"> <Comments> <summary>Is this a ref assignment</summary> </Comments> </Property> </Node> <Node Name="ICompoundAssignmentOperation" Base="IAssignmentOperation" ChildrenOrder="Target,Value" HasType="true"> <Comments> <summary> Represents a compound assignment that mutates the target with the result of a binary operation. <para> Current usage: (1) C# compound assignment expression. (2) VB compound assignment expression. </para> </summary> </Comments> <Property Name="InConversion" Type="CommonConversion"> <Comments> <summary> Conversion applied to <see cref="IAssignmentOperation.Target" /> before the operation occurs. </summary> </Comments> </Property> <Property Name="OutConversion" Type="CommonConversion"> <Comments> <summary> Conversion applied to the result of the binary operation, before it is assigned back to <see cref="IAssignmentOperation.Target" />. </summary> </Comments> </Property> <Property Name="OperatorKind" Type="BinaryOperatorKind"> <Comments> <summary>Kind of binary operation.</summary> </Comments> </Property> <Property Name="IsLifted" Type="bool"> <Comments> <summary> <see langword="true" /> if this assignment contains a 'lifted' binary operation. </summary> </Comments> </Property> <Property Name="IsChecked" Type="bool"> <Comments> <summary> <see langword="true" /> if overflow checking is performed for the arithmetic operation. </summary> </Comments> </Property> <Property Name="OperatorMethod" Type="IMethodSymbol?"> <Comments> <summary>Operator method used by the operation, null if the operation does not use an operator method.</summary> </Comments> </Property> </Node> <Node Name="IParenthesizedOperation" Base="IOperation" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents a parenthesized operation. <para> Current usage: (1) VB parenthesized expression. </para> </summary> </Comments> <Property Name="Operand" Type="IOperation"> <Comments> <summary>Operand enclosed in parentheses.</summary> </Comments> </Property> </Node> <Node Name="IEventAssignmentOperation" Base="IOperation" ChildrenOrder="EventReference,HandlerValue" HasType="true"> <Comments> <summary> Represents a binding of an event. <para> Current usage: (1) C# event assignment expression. (2) VB Add/Remove handler statement. </para> </summary> </Comments> <Property Name="EventReference" Type="IOperation"> <Comments> <summary>Reference to the event being bound.</summary> </Comments> </Property> <Property Name="HandlerValue" Type="IOperation"> <Comments> <summary>Handler supplied for the event.</summary> </Comments> </Property> <Property Name="Adds" Type="bool"> <Comments> <summary>True for adding a binding, false for removing one.</summary> </Comments> </Property> </Node> <Node Name="IConditionalAccessOperation" Base="IOperation" ChildrenOrder="Operation,WhenNotNull" HasType="true"> <Comments> <summary> Represents a conditionally accessed operation. Note that <see cref="IConditionalAccessInstanceOperation" /> is used to refer to the value of <see cref="Operation" /> within <see cref="WhenNotNull" />. <para> Current usage: (1) C# conditional access expression (? or ?. operator). (2) VB conditional access expression (? or ?. operator). </para> </summary> </Comments> <Property Name="Operation" Type="IOperation"> <Comments> <summary>Operation that will be evaluated and accessed if non null.</summary> </Comments> </Property> <Property Name="WhenNotNull" Type="IOperation"> <Comments> <summary> Operation to be evaluated if <see cref="Operation" /> is non null. </summary> </Comments> </Property> </Node> <Node Name="IConditionalAccessInstanceOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents the value of a conditionally-accessed operation within <see cref="IConditionalAccessOperation.WhenNotNull" />. For a conditional access operation of the form <c>someExpr?.Member</c>, this operation is used as the InstanceReceiver for the right operation <c>Member</c>. See https://github.com/dotnet/roslyn/issues/21279#issuecomment-323153041 for more details. <para> Current usage: (1) C# conditional access instance expression. (2) VB conditional access instance expression. </para> </summary> </Comments> </Node> <Node Name="IInterpolatedStringOperation" Base="IOperation" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents an interpolated string. <para> Current usage: (1) C# interpolated string expression. (2) VB interpolated string expression. </para> </summary> </Comments> <Property Name="Parts" Type="ImmutableArray&lt;IInterpolatedStringContentOperation&gt;"> <Comments> <summary> Constituent parts of interpolated string, each of which is an <see cref="IInterpolatedStringContentOperation" />. </summary> </Comments> </Property> </Node> <Node Name="IAnonymousObjectCreationOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents a creation of anonymous object. <para> Current usage: (1) C# "new { ... }" expression (2) VB "New With { ... }" expression </para> </summary> </Comments> <Property Name="Initializers" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary> Property initializers. Each initializer is an <see cref="ISimpleAssignmentOperation" />, with an <see cref="IPropertyReferenceOperation" /> as the target whose Instance is an <see cref="IInstanceReferenceOperation" /> with <see cref="InstanceReferenceKind.ImplicitReceiver" /> kind. </summary> </Comments> </Property> </Node> <Node Name="IObjectOrCollectionInitializerOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents an initialization for an object or collection creation. <para> Current usage: (1) C# object or collection initializer expression. (2) VB object or collection initializer expression. For example, object initializer "{ X = x }" within object creation "new Class() { X = x }" and collection initializer "{ x, y, 3 }" within collection creation "new MyList() { x, y, 3 }". </para> </summary> </Comments> <Property Name="Initializers" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>Object member or collection initializers.</summary> </Comments> </Property> </Node> <Node Name="IMemberInitializerOperation" Base="IOperation" ChildrenOrder="InitializedMember,Initializer" HasType="true"> <Comments> <summary> Represents an initialization of member within an object initializer with a nested object or collection initializer. <para> Current usage: (1) C# nested member initializer expression. For example, given an object creation with initializer "new Class() { X = x, Y = { x, y, 3 }, Z = { X = z } }", member initializers for Y and Z, i.e. "Y = { x, y, 3 }", and "Z = { X = z }" are nested member initializers represented by this operation. </para> </summary> </Comments> <Property Name="InitializedMember" Type="IOperation"> <Comments> <summary> Initialized member reference <see cref="IMemberReferenceOperation" /> or an invalid operation for error cases. </summary> </Comments> </Property> <Property Name="Initializer" Type="IObjectOrCollectionInitializerOperation"> <Comments> <summary>Member initializer.</summary> </Comments> </Property> </Node> <Node Name="ICollectionElementInitializerOperation" Base="IOperation" SkipClassGeneration="true"> <Obsolete Error="true">"ICollectionElementInitializerOperation has been replaced with " + nameof(IInvocationOperation) + " and " + nameof(IDynamicInvocationOperation)</Obsolete> <Comments> <summary> Obsolete interface that used to represent a collection element initializer. It has been replaced by <see cref="IInvocationOperation" /> and <see cref="IDynamicInvocationOperation" />, as appropriate. <para> Current usage: None. This API has been obsoleted in favor of <see cref="IInvocationOperation" /> and <see cref="IDynamicInvocationOperation" />. </para> </summary> </Comments> <Property Name="AddMethod" Type="IMethodSymbol" /> <Property Name="Arguments" Type="ImmutableArray&lt;IOperation&gt;" /> <Property Name="IsDynamic" Type="bool" /> </Node> <Node Name="INameOfOperation" Base="IOperation" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents an operation that gets a string value for the <see cref="Argument" /> name. <para> Current usage: (1) C# nameof expression. (2) VB NameOf expression. </para> </summary> </Comments> <Property Name="Argument" Type="IOperation"> <Comments> <summary>Argument to the name of operation.</summary> </Comments> </Property> </Node> <Node Name="ITupleOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents a tuple with one or more elements. <para> Current usage: (1) C# tuple expression. (2) VB tuple expression. </para> </summary> </Comments> <Property Name="Elements" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>Tuple elements.</summary> </Comments> </Property> <Property Name="NaturalType" Type="ITypeSymbol?"> <Comments> <summary> Natural type of the tuple, or null if tuple doesn't have a natural type. Natural type can be different from <see cref="IOperation.Type" /> depending on the conversion context, in which the tuple is used. </summary> </Comments> </Property> </Node> <Node Name="IDynamicObjectCreationOperation" Base="IOperation" SkipClassGeneration="true"> <Comments> <summary> Represents an object creation with a dynamically bound constructor. <para> Current usage: (1) C# "new" expression with dynamic argument(s). (2) VB late bound "New" expression. </para> </summary> </Comments> <Property Name="Initializer" Type="IObjectOrCollectionInitializerOperation?"> <Comments> <summary>Object or collection initializer, if any.</summary> </Comments> </Property> <Property Name="Arguments" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>Dynamically bound arguments, excluding the instance argument.</summary> </Comments> </Property> </Node> <Node Name="IDynamicMemberReferenceOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents a reference to a member of a class, struct, or module that is dynamically bound. <para> Current usage: (1) C# dynamic member reference expression. (2) VB late bound member reference expression. </para> </summary> </Comments> <Property Name="Instance" Type="IOperation?"> <Comments> <summary>Instance receiver, if it exists.</summary> </Comments> </Property> <Property Name="MemberName" Type="string"> <Comments> <summary>Referenced member.</summary> </Comments> </Property> <Property Name="TypeArguments" Type="ImmutableArray&lt;ITypeSymbol&gt;"> <Comments> <summary>Type arguments.</summary> </Comments> </Property> <Property Name="ContainingType" Type="ITypeSymbol?"> <Comments> <summary> The containing type of the referenced member, if different from type of the <see cref="Instance" />. </summary> </Comments> </Property> </Node> <Node Name="IDynamicInvocationOperation" Base="IOperation" SkipClassGeneration="true"> <Comments> <summary> Represents a invocation that is dynamically bound. <para> Current usage: (1) C# dynamic invocation expression. (2) C# dynamic collection element initializer. For example, in the following collection initializer: <code>new C() { do1, do2, do3 }</code> where the doX objects are of type dynamic, we'll have 3 <see cref="IDynamicInvocationOperation" /> with do1, do2, and do3 as their arguments. (3) VB late bound invocation expression. (4) VB dynamic collection element initializer. Similar to the C# example, <code>New C() From {do1, do2, do3}</code> will generate 3 <see cref="IDynamicInvocationOperation" /> nodes with do1, do2, and do3 as their arguments, respectively. </para> </summary> </Comments> <Property Name="Operation" Type="IOperation"> <Comments> <summary>Dynamically or late bound operation.</summary> </Comments> </Property> <Property Name="Arguments" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>Dynamically bound arguments, excluding the instance argument.</summary> </Comments> </Property> </Node> <Node Name="IDynamicIndexerAccessOperation" Base="IOperation" SkipClassGeneration="true"> <Comments> <summary> Represents an indexer access that is dynamically bound. <para> Current usage: (1) C# dynamic indexer access expression. </para> </summary> </Comments> <Property Name="Operation" Type="IOperation"> <Comments> <summary>Dynamically indexed operation.</summary> </Comments> </Property> <Property Name="Arguments" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>Dynamically bound arguments, excluding the instance argument.</summary> </Comments> </Property> </Node> <Node Name="ITranslatedQueryOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents an unrolled/lowered query operation. For example, for a C# query expression "from x in set where x.Name != null select x.Name", the Operation tree has the following shape: ITranslatedQueryExpression IInvocationExpression ('Select' invocation for "select x.Name") IInvocationExpression ('Where' invocation for "where x.Name != null") IInvocationExpression ('From' invocation for "from x in set") <para> Current usage: (1) C# query expression. (2) VB query expression. </para> </summary> </Comments> <Property Name="Operation" Type="IOperation"> <Comments> <summary>Underlying unrolled operation.</summary> </Comments> </Property> </Node> <Node Name="IDelegateCreationOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents a delegate creation. This is created whenever a new delegate is created. <para> Current usage: (1) C# delegate creation expression. (2) VB delegate creation expression. </para> </summary> </Comments> <Property Name="Target" Type="IOperation"> <Comments> <summary>The lambda or method binding that this delegate is created from.</summary> </Comments> </Property> </Node> <Node Name="IDefaultValueOperation" Base="IOperation" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents a default value operation. <para> Current usage: (1) C# default value expression. </para> </summary> </Comments> </Node> <Node Name="ITypeOfOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents an operation that gets <see cref="System.Type" /> for the given <see cref="TypeOperand" />. <para> Current usage: (1) C# typeof expression. (2) VB GetType expression. </para> </summary> </Comments> <Property Name="TypeOperand" Type="ITypeSymbol"> <Comments> <summary>Type operand.</summary> </Comments> </Property> </Node> <Node Name="ISizeOfOperation" Base="IOperation" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents an operation to compute the size of a given type. <para> Current usage: (1) C# sizeof expression. </para> </summary> </Comments> <Property Name="TypeOperand" Type="ITypeSymbol"> <Comments> <summary>Type operand.</summary> </Comments> </Property> </Node> <Node Name="IAddressOfOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents an operation that creates a pointer value by taking the address of a reference. <para> Current usage: (1) C# address of expression </para> </summary> </Comments> <Property Name="Reference" Type="IOperation"> <Comments> <summary>Addressed reference.</summary> </Comments> </Property> </Node> <Node Name="IIsPatternOperation" Base="IOperation" ChildrenOrder="Value,Pattern" HasType="true"> <Comments> <summary> Represents an operation that tests if a value matches a specific pattern. <para> Current usage: (1) C# is pattern expression. For example, "x is int i". </para> </summary> </Comments> <Property Name="Value" Type="IOperation"> <Comments> <summary>Underlying operation to test.</summary> </Comments> </Property> <Property Name="Pattern" Type="IPatternOperation"> <Comments> <summary>Pattern.</summary> </Comments> </Property> </Node> <Node Name="IIncrementOrDecrementOperation" Base="IOperation" HasType="true"> <OperationKind> <Entry Name="Increment" Value="0x42" ExtraDescription="This is used as an increment operator"/> <Entry Name="Decrement" Value="0x44" ExtraDescription="This is used as a decrement operator"/> </OperationKind> <Comments> <summary> Represents an <see cref="OperationKind.Increment" /> or <see cref="OperationKind.Decrement" /> operation. Note that this operation is different from an <see cref="IUnaryOperation" /> as it mutates the <see cref="Target" />, while unary operator expression does not mutate it's operand. <para> Current usage: (1) C# increment expression or decrement expression. </para> </summary> </Comments> <Property Name="IsPostfix" Type="bool"> <Comments> <summary> <see langword="true" /> if this is a postfix expression. <see langword="false" /> if this is a prefix expression. </summary> </Comments> </Property> <Property Name="IsLifted" Type="bool"> <Comments> <summary> <see langword="true" /> if this is a 'lifted' increment operator. When there is an operator that is defined to work on a value type, 'lifted' operators are created to work on the <see cref="System.Nullable{T}" /> versions of those value types. </summary> </Comments> </Property> <Property Name="IsChecked" Type="bool"> <Comments> <summary> <see langword="true" /> if overflow checking is performed for the arithmetic operation. </summary> </Comments> </Property> <Property Name="Target" Type="IOperation"> <Comments> <summary>Target of the assignment.</summary> </Comments> </Property> <Property Name="OperatorMethod" Type="IMethodSymbol?"> <Comments> <summary>Operator method used by the operation, null if the operation does not use an operator method.</summary> </Comments> </Property> </Node> <Node Name="IThrowOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents an operation to throw an exception. <para> Current usage: (1) C# throw expression. (2) C# throw statement. (2) VB Throw statement. </para> </summary> </Comments> <Property Name="Exception" Type="IOperation?"> <Comments> <summary>Instance of an exception being thrown.</summary> </Comments> </Property> </Node> <Node Name="IDeconstructionAssignmentOperation" Base="IAssignmentOperation" ChildrenOrder="Target,Value" HasType="true"> <Comments> <summary> Represents a assignment with a deconstruction. <para> Current usage: (1) C# deconstruction assignment expression. </para> </summary> </Comments> </Node> <Node Name="IDeclarationExpressionOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents a declaration expression operation. Unlike a regular variable declaration <see cref="IVariableDeclaratorOperation" /> and <see cref="IVariableDeclarationOperation" />, this operation represents an "expression" declaring a variable. <para> Current usage: (1) C# declaration expression. For example, (a) "var (x, y)" is a deconstruction declaration expression with variables x and y. (b) "(var x, var y)" is a tuple expression with two declaration expressions. (c) "M(out var x);" is an invocation expression with an out "var x" declaration expression. </para> </summary> </Comments> <Property Name="Expression" Type="IOperation"> <Comments> <summary>Underlying expression.</summary> </Comments> </Property> </Node> <Node Name="IOmittedArgumentOperation" Base="IOperation" HasType="true"> <Comments> <summary> Represents an argument value that has been omitted in an invocation. <para> Current usage: (1) VB omitted argument in an invocation expression. </para> </summary> </Comments> </Node> <AbstractNode Name="ISymbolInitializerOperation" Base="IOperation"> <Comments> <summary> Represents an initializer for a field, property, parameter or a local variable declaration. <para> Current usage: (1) C# field, property, parameter or local variable initializer. (2) VB field(s), property, parameter or local variable initializer. </para> </summary> </Comments> <Property Name="Locals" Type="ImmutableArray&lt;ILocalSymbol&gt;"> <Comments> <summary> Local declared in and scoped to the <see cref="Value" />. </summary> </Comments> </Property> <Property Name="Value" Type="IOperation"> <Comments> <summary>Underlying initializer value.</summary> </Comments> </Property> </AbstractNode> <Node Name="IFieldInitializerOperation" Base="ISymbolInitializerOperation"> <Comments> <summary> Represents an initialization of a field. <para> Current usage: (1) C# field initializer with equals value clause. (2) VB field(s) initializer with equals value clause or AsNew clause. Multiple fields can be initialized with AsNew clause in VB. </para> </summary> </Comments> <Property Name="InitializedFields" Type="ImmutableArray&lt;IFieldSymbol&gt;"> <Comments> <summary>Initialized fields. There can be multiple fields for Visual Basic fields declared with AsNew clause.</summary> </Comments> </Property> </Node> <Node Name="IVariableInitializerOperation" Base="ISymbolInitializerOperation"> <Comments> <summary> Represents an initialization of a local variable. <para> Current usage: (1) C# local variable initializer with equals value clause. (2) VB local variable initializer with equals value clause or AsNew clause. </para> </summary> </Comments> </Node> <Node Name="IPropertyInitializerOperation" Base="ISymbolInitializerOperation"> <Comments> <summary> Represents an initialization of a property. <para> Current usage: (1) C# property initializer with equals value clause. (2) VB property initializer with equals value clause or AsNew clause. Multiple properties can be initialized with 'WithEvents' declaration with AsNew clause in VB. </para> </summary> </Comments> <Property Name="InitializedProperties" Type="ImmutableArray&lt;IPropertySymbol&gt;"> <Comments> <summary>Initialized properties. There can be multiple properties for Visual Basic 'WithEvents' declaration with AsNew clause.</summary> </Comments> </Property> </Node> <Node Name="IParameterInitializerOperation" Base="ISymbolInitializerOperation"> <Comments> <summary> Represents an initialization of a parameter at the point of declaration. <para> Current usage: (1) C# parameter initializer with equals value clause. (2) VB parameter initializer with equals value clause. </para> </summary> </Comments> <Property Name="Parameter" Type="IParameterSymbol"> <Comments> <summary>Initialized parameter.</summary> </Comments> </Property> </Node> <Node Name="IArrayInitializerOperation" Base="IOperation"> <Comments> <summary> Represents the initialization of an array instance. <para> Current usage: (1) C# array initializer. (2) VB array initializer. </para> </summary> </Comments> <Property Name="ElementValues" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>Values to initialize array elements.</summary> </Comments> </Property> </Node> <Node Name="IVariableDeclaratorOperation" Base="IOperation" ChildrenOrder="IgnoredArguments,Initializer"> <Comments> <summary>Represents a single variable declarator and initializer.</summary> <para> Current Usage: (1) C# variable declarator (2) C# catch variable declaration (3) VB single variable declaration (4) VB catch variable declaration </para> <remarks> In VB, the initializer for this node is only ever used for explicit array bounds initializers. This node corresponds to the VariableDeclaratorSyntax in C# and the ModifiedIdentifierSyntax in VB. </remarks> </Comments> <Property Name="Symbol" Type="ILocalSymbol"> <Comments> <summary>Symbol declared by this variable declaration</summary> </Comments> </Property> <Property Name="Initializer" Type="IVariableInitializerOperation?"> <Comments> <summary>Optional initializer of the variable.</summary> <remarks> If this variable is in an <see cref="IVariableDeclarationOperation" />, the initializer may be located in the parent operation. Call <see cref="OperationExtensions.GetVariableInitializer(IVariableDeclaratorOperation)" /> to check in all locations. It is only possible to have initializers in both locations in VB invalid code scenarios. </remarks> </Comments> </Property> <Property Name="IgnoredArguments" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary> Additional arguments supplied to the declarator in error cases, ignored by the compiler. This only used for the C# case of DeclaredArgumentSyntax nodes on a VariableDeclaratorSyntax. </summary> </Comments> </Property> </Node> <Node Name="IVariableDeclarationOperation" Base="IOperation" ChildrenOrder="IgnoredDimensions,Declarators,Initializer"> <Comments> <summary>Represents a declarator that declares multiple individual variables.</summary> <para> Current Usage: (1) C# VariableDeclaration (2) C# fixed declarations (3) VB Dim statement declaration groups (4) VB Using statement variable declarations </para> <remarks> The initializer of this node is applied to all individual declarations in <see cref="Declarators" />. There cannot be initializers in both locations except in invalid code scenarios. In C#, this node will never have an initializer. This corresponds to the VariableDeclarationSyntax in C#, and the VariableDeclaratorSyntax in Visual Basic. </remarks> </Comments> <Property Name="Declarators" Type="ImmutableArray&lt;IVariableDeclaratorOperation&gt;"> <Comments> <summary>Individual variable declarations declared by this multiple declaration.</summary> <remarks> All <see cref="IVariableDeclarationGroupOperation" /> will have at least 1 <see cref="IVariableDeclarationOperation" />, even if the declaration group only declares 1 variable. </remarks> </Comments> </Property> <Property Name="Initializer" Type="IVariableInitializerOperation?"> <Comments> <summary>Optional initializer of the variable.</summary> <remarks>In C#, this will always be null.</remarks> </Comments> </Property> <Property Name="IgnoredDimensions" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary> Array dimensions supplied to an array declaration in error cases, ignored by the compiler. This is only used for the C# case of RankSpecifierSyntax nodes on an ArrayTypeSyntax. </summary> </Comments> </Property> </Node> <Node Name="IArgumentOperation" Base="IOperation"> <Comments> <summary> Represents an argument to a method invocation. <para> Current usage: (1) C# argument to an invocation expression, object creation expression, etc. (2) VB argument to an invocation expression, object creation expression, etc. </para> </summary> </Comments> <Property Name="ArgumentKind" Type="ArgumentKind"> <Comments> <summary>Kind of argument.</summary> </Comments> </Property> <Property Name="Parameter" Type="IParameterSymbol?"> <Comments> <summary>Parameter the argument matches. This can be null for __arglist parameters.</summary> </Comments> </Property> <Property Name="Value" Type="IOperation"> <Comments> <summary>Value supplied for the argument.</summary> </Comments> </Property> <Property Name="InConversion" Type="CommonConversion"> <Comments> <summary>Information of the conversion applied to the argument value passing it into the target method. Applicable only to VB Reference arguments.</summary> </Comments> </Property> <Property Name="OutConversion" Type="CommonConversion"> <Comments> <summary>Information of the conversion applied to the argument value after the invocation. Applicable only to VB Reference arguments.</summary> </Comments> </Property> </Node> <Node Name="ICatchClauseOperation" Base="IOperation" ChildrenOrder="ExceptionDeclarationOrExpression,Filter,Handler"> <Comments> <summary> Represents a catch clause. <para> Current usage: (1) C# catch clause. (2) VB Catch clause. </para> </summary> </Comments> <Property Name="ExceptionDeclarationOrExpression" Type="IOperation?"> <Comments> <summary> Optional source for exception. This could be any of the following operation: 1. Declaration for the local catch variable bound to the caught exception (C# and VB) OR 2. Null, indicating no declaration or expression (C# and VB) 3. Reference to an existing local or parameter (VB) OR 4. Other expression for error scenarios (VB) </summary> </Comments> </Property> <Property Name="ExceptionType" Type="ITypeSymbol"> <Comments> <summary>Type of the exception handled by the catch clause.</summary> </Comments> </Property> <Property Name="Locals" Type="ImmutableArray&lt;ILocalSymbol&gt;"> <Comments> <summary> Locals declared by the <see cref="ExceptionDeclarationOrExpression" /> and/or <see cref="Filter" /> clause. </summary> </Comments> </Property> <Property Name="Filter" Type="IOperation?"> <Comments> <summary>Filter operation to be executed to determine whether to handle the exception.</summary> </Comments> </Property> <Property Name="Handler" Type="IBlockOperation"> <Comments> <summary>Body of the exception handler.</summary> </Comments> </Property> </Node> <Node Name="ISwitchCaseOperation" Base="IOperation" ChildrenOrder="Clauses,Body"> <Comments> <summary> Represents a switch case section with one or more case clauses to match and one or more operations to execute within the section. <para> Current usage: (1) C# switch section for one or more case clause and set of statements to execute. (2) VB case block with a case statement for one or more case clause and set of statements to execute. </para> </summary> </Comments> <Property Name="Clauses" Type="ImmutableArray&lt;ICaseClauseOperation&gt;"> <Comments> <summary>Clauses of the case.</summary> </Comments> </Property> <Property Name="Body" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>One or more operations to execute within the switch section.</summary> </Comments> </Property> <Property Name="Locals" Type="ImmutableArray&lt;ILocalSymbol&gt;"> <Comments> <summary>Locals declared within the switch case section scoped to the section.</summary> </Comments> </Property> <Property Name="Condition" Type="IOperation?" Internal="true"> <Comments> <summary> Optional combined logical condition that accounts for all <see cref="Clauses"/>. An instance of <see cref="IPlaceholderOperation"/> with kind <see cref="PlaceholderKind.SwitchOperationExpression"/> is used to refer to the <see cref="ISwitchOperation.Value"/> in context of this expression. It is not part of <see cref="Children"/> list and likely contains duplicate nodes for nodes exposed by <see cref="Clauses"/>, like <see cref="ISingleValueCaseClauseOperation.Value"/>, etc. Never set for C# at the moment. </summary> </Comments> </Property> </Node> <AbstractNode Name="ICaseClauseOperation" Base="IOperation"> <OperationKind Include="true" ExtraDescription="This is further differentiated by &lt;see cref=&quot;ICaseClauseOperation.CaseKind&quot;/&gt;." /> <Comments> <summary> Represents a case clause. <para> Current usage: (1) C# case clause. (2) VB Case clause. </para> </summary> </Comments> <Property Name="CaseKind" Type="CaseKind" MakeAbstract="true"> <Comments> <summary>Kind of the clause.</summary> </Comments> </Property> <Property Name="Label" Type="ILabelSymbol?"> <Comments> <summary>Label associated with the case clause, if any.</summary> </Comments> </Property> </AbstractNode> <Node Name="IDefaultCaseClauseOperation" Base="ICaseClauseOperation"> <OperationKind Include="false" /> <Comments> <summary> Represents a default case clause. <para> Current usage: (1) C# default clause. (2) VB Case Else clause. </para> </summary> </Comments> </Node> <Node Name="IPatternCaseClauseOperation" Base="ICaseClauseOperation" ChildrenOrder="Pattern,Guard"> <OperationKind Include="false" /> <Comments> <summary> Represents a case clause with a pattern and an optional guard operation. <para> Current usage: (1) C# pattern case clause. </para> </summary> </Comments> <Property Name="Label" Type="ILabelSymbol" New="true"> <Comments> <!-- It would be a binary breaking change to remove this --> <summary> Label associated with the case clause. </summary> </Comments> </Property> <Property Name="Pattern" Type="IPatternOperation"> <Comments> <summary>Pattern associated with case clause.</summary> </Comments> </Property> <Property Name="Guard" Type="IOperation?"> <Comments> <summary>Guard associated with the pattern case clause.</summary> </Comments> </Property> </Node> <Node Name="IRangeCaseClauseOperation" Base="ICaseClauseOperation" ChildrenOrder="MinimumValue,MaximumValue"> <OperationKind Include="false" /> <Comments> <summary> Represents a case clause with range of values for comparison. <para> Current usage: (1) VB range case clause of the form "Case x To y". </para> </summary> </Comments> <Property Name="MinimumValue" Type="IOperation"> <Comments> <summary>Minimum value of the case range.</summary> </Comments> </Property> <Property Name="MaximumValue" Type="IOperation"> <Comments> <summary>Maximum value of the case range.</summary> </Comments> </Property> </Node> <Node Name="IRelationalCaseClauseOperation" Base="ICaseClauseOperation"> <OperationKind Include="false" /> <Comments> <summary> Represents a case clause with custom relational operator for comparison. <para> Current usage: (1) VB relational case clause of the form "Case Is op x". </para> </summary> </Comments> <Property Name="Value" Type="IOperation"> <Comments> <summary>Case value.</summary> </Comments> </Property> <Property Name="Relation" Type="BinaryOperatorKind"> <Comments> <summary>Relational operator used to compare the switch value with the case value.</summary> </Comments> </Property> </Node> <Node Name="ISingleValueCaseClauseOperation" Base="ICaseClauseOperation"> <OperationKind Include="false" /> <Comments> <summary> Represents a case clause with a single value for comparison. <para> Current usage: (1) C# case clause of the form "case x" (2) VB case clause of the form "Case x". </para> </summary> </Comments> <Property Name="Value" Type="IOperation"> <Comments> <summary>Case value.</summary> </Comments> </Property> </Node> <AbstractNode Name="IInterpolatedStringContentOperation" Base="IOperation"> <Comments> <summary> Represents a constituent part of an interpolated string. <para> Current usage: (1) C# interpolated string content. (2) VB interpolated string content. </para> </summary> </Comments> </AbstractNode> <Node Name="IInterpolatedStringTextOperation" Base="IInterpolatedStringContentOperation"> <Comments> <summary> Represents a constituent string literal part of an interpolated string operation. <para> Current usage: (1) C# interpolated string text. (2) VB interpolated string text. </para> </summary> </Comments> <Property Name="Text" Type="IOperation"> <Comments> <summary>Text content.</summary> </Comments> </Property> </Node> <Node Name="IInterpolationOperation" Base="IInterpolatedStringContentOperation" ChildrenOrder="Expression,Alignment,FormatString"> <Comments> <summary> Represents a constituent interpolation part of an interpolated string operation. <para> Current usage: (1) C# interpolation part. (2) VB interpolation part. </para> </summary> </Comments> <Property Name="Expression" Type="IOperation"> <Comments> <summary>Expression of the interpolation.</summary> </Comments> </Property> <Property Name="Alignment" Type="IOperation?"> <Comments> <summary>Optional alignment of the interpolation.</summary> </Comments> </Property> <Property Name="FormatString" Type="IOperation?"> <Comments> <summary>Optional format string of the interpolation.</summary> </Comments> </Property> </Node> <AbstractNode Name="IPatternOperation" Base="IOperation"> <Comments> <summary> Represents a pattern matching operation. <para> Current usage: (1) C# pattern. </para> </summary> </Comments> <Property Name="InputType" Type="ITypeSymbol"> <Comments> <summary>The input type to the pattern-matching operation.</summary> </Comments> </Property> <Property Name="NarrowedType" Type="ITypeSymbol"> <Comments> <summary>The narrowed type of the pattern-matching operation.</summary> </Comments> </Property> </AbstractNode> <Node Name="IConstantPatternOperation" Base="IPatternOperation"> <Comments> <summary> Represents a pattern with a constant value. <para> Current usage: (1) C# constant pattern. </para> </summary> </Comments> <Property Name="Value" Type="IOperation"> <Comments> <summary>Constant value of the pattern operation.</summary> </Comments> </Property> </Node> <Node Name="IDeclarationPatternOperation" Base="IPatternOperation"> <Comments> <summary> Represents a pattern that declares a symbol. <para> Current usage: (1) C# declaration pattern. </para> </summary> </Comments> <Property Name="MatchedType" Type="ITypeSymbol?"> <Comments> <summary> The type explicitly specified, or null if it was inferred (e.g. using <code>var</code> in C#). </summary> </Comments> </Property> <Property Name="MatchesNull" Type="bool"> <Comments> <summary> True if the pattern is of a form that accepts null. For example, in C# the pattern `var x` will match a null input, while the pattern `string x` will not. </summary> </Comments> </Property> <Property Name="DeclaredSymbol" Type="ISymbol?"> <Comments> <summary>Symbol declared by the pattern, if any.</summary> </Comments> </Property> </Node> <Node Name="ITupleBinaryOperation" Base="IOperation" VisitorName="VisitTupleBinaryOperator" ChildrenOrder="LeftOperand,RightOperand" HasType="true"> <OperationKind> <Entry Name="TupleBinary" Value="0x57" /> <Entry Name="TupleBinaryOperator" Value="0x57" EditorBrowsable="false" ExtraDescription="Use &lt;see cref=&quot;TupleBinary&quot;/&gt; instead." /> </OperationKind> <Comments> <summary> Represents a comparison of two operands that returns a bool type. <para> Current usage: (1) C# tuple binary operator expression. </para> </summary> </Comments> <Property Name="OperatorKind" Type="BinaryOperatorKind"> <Comments> <summary>Kind of binary operation.</summary> </Comments> </Property> <Property Name="LeftOperand" Type="IOperation"> <Comments> <summary>Left operand.</summary> </Comments> </Property> <Property Name="RightOperand" Type="IOperation"> <Comments> <summary>Right operand.</summary> </Comments> </Property> </Node> <AbstractNode Name="IMethodBodyBaseOperation" Base="IOperation"> <Comments> <summary> Represents a method body operation. <para> Current usage: (1) C# method body </para> </summary> </Comments> <Property Name="BlockBody" Type="IBlockOperation?"> <Comments> <summary>Method body corresponding to BaseMethodDeclarationSyntax.Body or AccessorDeclarationSyntax.Body</summary> </Comments> </Property> <Property Name="ExpressionBody" Type="IBlockOperation?"> <Comments> <summary>Method body corresponding to BaseMethodDeclarationSyntax.ExpressionBody or AccessorDeclarationSyntax.ExpressionBody</summary> </Comments> </Property> </AbstractNode> <Node Name="IMethodBodyOperation" Base="IMethodBodyBaseOperation" VisitorName="VisitMethodBodyOperation" ChildrenOrder="BlockBody,ExpressionBody"> <OperationKind> <Entry Name="MethodBody" Value="0x58" /> <Entry Name="MethodBodyOperation" Value="0x58" EditorBrowsable="false" ExtraDescription="Use &lt;see cref=&quot;MethodBody&quot;/&gt; instead." /> </OperationKind> <Comments> <summary> Represents a method body operation. <para> Current usage: (1) C# method body for non-constructor </para> </summary> </Comments> </Node> <Node Name="IConstructorBodyOperation" Base="IMethodBodyBaseOperation" VisitorName="VisitConstructorBodyOperation" ChildrenOrder="Initializer,BlockBody,ExpressionBody"> <OperationKind> <Entry Name="ConstructorBody" Value="0x59" /> <Entry Name="ConstructorBodyOperation" Value="0x59" EditorBrowsable="false" ExtraDescription="Use &lt;see cref=&quot;ConstructorBody&quot;/&gt; instead." /> </OperationKind> <Comments> <summary> Represents a constructor method body operation. <para> Current usage: (1) C# method body for constructor declaration </para> </summary> </Comments> <Property Name="Locals" Type="ImmutableArray&lt;ILocalSymbol&gt;"> <Comments> <summary>Local declarations contained within the <see cref="Initializer" />.</summary> </Comments> </Property> <Property Name="Initializer" Type="IOperation?"> <Comments> <summary>Constructor initializer, if any.</summary> </Comments> </Property> </Node> <Node Name="IDiscardOperation" Base="IOperation" VisitorName="VisitDiscardOperation" HasType="true"> <Comments> <summary> Represents a discard operation. <para> Current usage: C# discard expressions </para> </summary> </Comments> <Property Name="DiscardSymbol" Type="IDiscardSymbol"> <Comments> <summary>The symbol of the discard operation.</summary> </Comments> </Property> </Node> <Node Name="IFlowCaptureOperation" Base="IOperation" Namespace="FlowAnalysis" SkipInCloner="true"> <Comments> <summary> Represents that an intermediate result is being captured. This node is produced only as part of a <see cref="ControlFlowGraph" />. </summary> </Comments> <Property Name="Id" Type="CaptureId"> <Comments> <summary>An id used to match references to the same intermediate result.</summary> </Comments> </Property> <Property Name="Value" Type="IOperation"> <Comments> <summary>Value to be captured.</summary> </Comments> </Property> </Node> <Node Name="IFlowCaptureReferenceOperation" Base="IOperation" Namespace="FlowAnalysis" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents a point of use of an intermediate result captured earlier. The fact of capturing the result is represented by <see cref="IFlowCaptureOperation" />. This node is produced only as part of a <see cref="ControlFlowGraph" />. </summary> </Comments> <Property Name="Id" Type="CaptureId"> <Comments> <summary>An id used to match references to the same intermediate result.</summary> </Comments> </Property> </Node> <Node Name="IIsNullOperation" Base="IOperation" Namespace="FlowAnalysis" SkipInCloner="true" HasType="true" HasConstantValue="true"> <Comments> <summary> Represents result of checking whether the <see cref="Operand" /> is null. For reference types this checks if the <see cref="Operand" /> is a null reference, for nullable types this checks if the <see cref="Operand" /> doesn’t have a value. The node is produced as part of a flow graph during rewrite of <see cref="ICoalesceOperation" /> and <see cref="IConditionalAccessOperation" /> nodes. </summary> </Comments> <Property Name="Operand" Type="IOperation"> <Comments> <summary>Value to check.</summary> </Comments> </Property> </Node> <Node Name="ICaughtExceptionOperation" Base="IOperation" Namespace="FlowAnalysis" SkipInCloner="true" HasType="true"> <Comments> <summary> Represents a exception instance passed by an execution environment to an exception filter or handler. This node is produced only as part of a <see cref="ControlFlowGraph" />. </summary> </Comments> </Node> <Node Name="IStaticLocalInitializationSemaphoreOperation" Base="IOperation" Namespace="FlowAnalysis" SkipInCloner="true" HasType="true"> <Comments> <summary> Represents the check during initialization of a VB static local that is initialized on the first call of the function, and never again. If the semaphore operation returns true, the static local has not yet been initialized, and the initializer will be run. If it returns false, then the local has already been initialized, and the static local initializer region will be skipped. This node is produced only as part of a <see cref="ControlFlowGraph" />. </summary> </Comments> <Property Name="Local" Type="ILocalSymbol"> <Comments> <summary>The static local variable that is possibly initialized.</summary> </Comments> </Property> </Node> <Node Name="IFlowAnonymousFunctionOperation" Base="IOperation" Namespace="FlowAnalysis" SkipClassGeneration="true"> <Comments> <summary> Represents an anonymous function operation in context of a <see cref="ControlFlowGraph" />. <para> Current usage: (1) C# lambda expression. (2) VB anonymous delegate expression. </para> A <see cref="ControlFlowGraph" /> for the body of the anonymous function is available from the enclosing <see cref="ControlFlowGraph" />. </summary> </Comments> <Property Name="Symbol" Type="IMethodSymbol"> <Comments> <summary>Symbol of the anonymous function.</summary> </Comments> </Property> </Node> <Node Name="ICoalesceAssignmentOperation" Base="IAssignmentOperation" ChildrenOrder="Target,Value" HasType="true"> <Comments> <summary> Represents a coalesce assignment operation with a target and a conditionally-evaluated value: (1) <see cref="IAssignmentOperation.Target" /> is evaluated for null. If it is null, <see cref="IAssignmentOperation.Value" /> is evaluated and assigned to target. (2) <see cref="IAssignmentOperation.Value" /> is conditionally evaluated if <see cref="IAssignmentOperation.Target" /> is null, and the result is assigned into <see cref="IAssignmentOperation.Target" />. The result of the entire expression is<see cref="IAssignmentOperation.Target" />, which is only evaluated once. <para> Current usage: (1) C# null-coalescing assignment operation <code>Target ??= Value</code>. </para> </summary> </Comments> </Node> <Node Name="IRangeOperation" Base="IOperation" VisitorName="VisitRangeOperation" ChildrenOrder="LeftOperand,RightOperand" HasType="true"> <Comments> <summary> Represents a range operation. <para> Current usage: (1) C# range expressions </para> </summary> </Comments> <Property Name="LeftOperand" Type="IOperation?"> <Comments> <summary>Left operand.</summary> </Comments> </Property> <Property Name="RightOperand" Type="IOperation?"> <Comments> <summary>Right operand.</summary> </Comments> </Property> <Property Name="IsLifted" Type="bool"> <Comments> <summary> <code>true</code> if this is a 'lifted' range operation. When there is an operator that is defined to work on a value type, 'lifted' operators are created to work on the <see cref="System.Nullable{T}" /> versions of those value types. </summary> </Comments> </Property> <Property Name="Method" Type="IMethodSymbol?"> <Comments> <summary> Factory method used to create this Range value. Can be null if appropriate symbol was not found. </summary> </Comments> </Property> </Node> <Node Name="IReDimOperation" Base="IOperation"> <Comments> <summary> Represents the ReDim operation to re-allocate storage space for array variables. <para> Current usage: (1) VB ReDim statement. </para> </summary> </Comments> <Property Name="Clauses" Type="ImmutableArray&lt;IReDimClauseOperation&gt;"> <Comments> <summary>Individual clauses of the ReDim operation.</summary> </Comments> </Property> <Property Name="Preserve" Type="bool"> <Comments> <summary>Modifier used to preserve the data in the existing array when you change the size of only the last dimension.</summary> </Comments> </Property> </Node> <Node Name="IReDimClauseOperation" Base="IOperation" ChildrenOrder="Operand,DimensionSizes"> <Comments> <summary> Represents an individual clause of an <see cref="IReDimOperation" /> to re-allocate storage space for a single array variable. <para> Current usage: (1) VB ReDim clause. </para> </summary> </Comments> <Property Name="Operand" Type="IOperation"> <Comments> <summary>Operand whose storage space needs to be re-allocated.</summary> </Comments> </Property> <Property Name="DimensionSizes" Type="ImmutableArray&lt;IOperation&gt;"> <Comments> <summary>Sizes of the dimensions of the created array instance.</summary> </Comments> </Property> </Node> <Node Name="IRecursivePatternOperation" Base="IPatternOperation" ChildrenOrder="DeconstructionSubpatterns,PropertySubpatterns"> <Comments> <summary>Represents a C# recursive pattern.</summary> </Comments> <Property Name="MatchedType" Type="ITypeSymbol"> <Comments> <summary>The type accepted for the recursive pattern.</summary> </Comments> </Property> <Property Name="DeconstructSymbol" Type="ISymbol?"> <Comments> <summary> The symbol, if any, used for the fetching values for subpatterns. This is either a <code>Deconstruct</code> method, the type <code>System.Runtime.CompilerServices.ITuple</code>, or null (for example, in error cases or when matching a tuple type). </summary> </Comments> </Property> <Property Name="DeconstructionSubpatterns" Type="ImmutableArray&lt;IPatternOperation&gt;"> <Comments> <summary>This contains the patterns contained within a deconstruction or positional subpattern.</summary> </Comments> </Property> <Property Name="PropertySubpatterns" Type="ImmutableArray&lt;IPropertySubpatternOperation&gt;"> <Comments> <summary>This contains the (symbol, property) pairs within a property subpattern.</summary> </Comments> </Property> <Property Name="DeclaredSymbol" Type="ISymbol?"> <Comments> <summary>Symbol declared by the pattern.</summary> </Comments> </Property> </Node> <Node Name="IDiscardPatternOperation" Base="IPatternOperation"> <Comments> <summary> Represents a discard pattern. <para> Current usage: C# discard pattern </para> </summary> </Comments> </Node> <Node Name="ISwitchExpressionOperation" Base="IOperation" ChildrenOrder="Value,Arms" HasType="true"> <Comments> <summary> Represents a switch expression. <para> Current usage: (1) C# switch expression. </para> </summary> </Comments> <Property Name="Value" Type="IOperation"> <Comments> <summary>Value to be switched upon.</summary> </Comments> </Property> <Property Name="Arms" Type="ImmutableArray&lt;ISwitchExpressionArmOperation&gt;"> <Comments> <summary>Arms of the switch expression.</summary> </Comments> </Property> <Property Name="IsExhaustive" Type="bool"> <Comments> <summary>True if the switch expressions arms cover every possible input value.</summary> </Comments> </Property> </Node> <Node Name="ISwitchExpressionArmOperation" Base="IOperation" ChildrenOrder="Pattern,Guard,Value"> <Comments> <summary>Represents one arm of a switch expression.</summary> </Comments> <Property Name="Pattern" Type="IPatternOperation"> <Comments> <summary>The pattern to match.</summary> </Comments> </Property> <Property Name="Guard" Type="IOperation?"> <Comments> <summary>Guard (when clause expression) associated with the switch arm, if any.</summary> </Comments> </Property> <Property Name="Value" Type="IOperation"> <Comments> <summary>Result value of the enclosing switch expression when this arm matches.</summary> </Comments> </Property> <Property Name="Locals" Type="ImmutableArray&lt;ILocalSymbol&gt;"> <Comments> <summary>Locals declared within the switch arm (e.g. pattern locals and locals declared in the guard) scoped to the arm.</summary> </Comments> </Property> </Node> <Node Name="IPropertySubpatternOperation" Base="IOperation" ChildrenOrder="Member,Pattern"> <Comments> <summary> Represents an element of a property subpattern, which identifies a member to be matched and the pattern to match it against. </summary> </Comments> <Property Name="Member" Type="IOperation"> <Comments> <summary> The member being matched in a property subpattern. This can be a <see cref="IMemberReferenceOperation" /> in non-error cases, or an <see cref="IInvalidOperation" /> in error cases. </summary> </Comments> </Property> <Property Name="Pattern" Type="IPatternOperation"> <Comments> <summary>The pattern to which the member is matched in a property subpattern.</summary> </Comments> </Property> </Node> <Node Name="IAggregateQueryOperation" Base="IOperation" Internal="true" ChildrenOrder="Group,Aggregation" HasType="true"> <Comments> <summary>Represents a standalone VB query Aggregate operation with more than one item in Into clause.</summary> </Comments> <Property Name="Group" Type="IOperation" /> <Property Name="Aggregation" Type="IOperation" /> </Node> <Node Name="IFixedOperation" Base="IOperation" Internal="true" SkipInVisitor="true" ChildrenOrder="Variables,Body"> <!-- Making this public is tracked by https://github.com/dotnet/roslyn/issues/21281 --> <Comments> <summary>Represents a C# fixed statement.</summary> </Comments> <Property Name="Locals" Type="ImmutableArray&lt;ILocalSymbol&gt;"> <Comments> <summary>Locals declared.</summary> </Comments> </Property> <Property Name="Variables" Type="IVariableDeclarationGroupOperation"> <Comments> <summary>Variables to be fixed.</summary> </Comments> </Property> <Property Name="Body" Type="IOperation"> <Comments> <summary>Body of the fixed, over which the variables are fixed.</summary> </Comments> </Property> </Node> <Node Name="INoPiaObjectCreationOperation" Base="IOperation" Internal="true" HasType="true"> <Comments> <summary> Represents a creation of an instance of a NoPia interface, i.e. new I(), where I is an embedded NoPia interface. <para> Current usage: (1) C# NoPia interface instance creation expression. (2) VB NoPia interface instance creation expression. </para> </summary> </Comments> <Property Name="Initializer" Type="IObjectOrCollectionInitializerOperation?"> <Comments> <summary>Object or collection initializer, if any.</summary> </Comments> </Property> </Node> <Node Name="IPlaceholderOperation" Base="IOperation" Internal="true" HasType="true"> <Comments> <summary> Represents a general placeholder when no more specific kind of placeholder is available. A placeholder is an expression whose meaning is inferred from context. </summary> </Comments> <Property Name="PlaceholderKind" Type="PlaceholderKind" /> </Node> <Node Name="IPointerIndirectionReferenceOperation" Base="IOperation" SkipClassGeneration="true" Internal="true" HasType="true"> <Comments> <summary> Represents a reference through a pointer. <para> Current usage: (1) C# pointer indirection reference expression. </para> </summary> </Comments> <Property Name="Pointer" Type="IOperation"> <Comments> <summary>Pointer to be dereferenced.</summary> </Comments> </Property> </Node> <Node Name="IWithStatementOperation" Base="IOperation" Internal="true" ChildrenOrder="Value,Body"> <Comments> <summary> Represents a <see cref="Body" /> of operations that are executed with implicit reference to the <see cref="Value" /> for member references. <para> Current usage: (1) VB With statement. </para> </summary> </Comments> <Property Name="Body" Type="IOperation"> <Comments> <summary>Body of the with.</summary> </Comments> </Property> <Property Name="Value" Type="IOperation"> <Comments> <summary>Value to whose members leading-dot-qualified references within the with body bind.</summary> </Comments> </Property> </Node> <Node Name="IUsingDeclarationOperation" Base="IOperation"> <Comments> <summary> Represents using variable declaration, with scope spanning across the parent <see cref="IBlockOperation"/>. <para> Current Usage: (1) C# using declaration (1) C# asynchronous using declaration </para> </summary> </Comments> <Property Name="DeclarationGroup" Type="IVariableDeclarationGroupOperation"> <Comments> <summary>The variables declared by this using declaration.</summary> </Comments> </Property> <Property Name="IsAsynchronous" Type="bool"> <Comments> <summary>True if this is an asynchronous using declaration.</summary> </Comments> </Property> <Property Name="DisposeInfo" Type="DisposeOperationInfo" Internal="true"> <Comments> <summary>Information about the method that will be invoked to dispose the declared instances when pattern based disposal is used.</summary> </Comments> </Property> </Node> <Node Name="INegatedPatternOperation" Base="IPatternOperation"> <Comments> <summary> Represents a negated pattern. <para> Current usage: (1) C# negated pattern. </para> </summary> </Comments> <Property Name="Pattern" Type="IPatternOperation"> <Comments> <summary>The negated pattern.</summary> </Comments> </Property> </Node> <Node Name="IBinaryPatternOperation" Base="IPatternOperation" ChildrenOrder="LeftPattern,RightPattern"> <Comments> <summary> Represents a binary ("and" or "or") pattern. <para> Current usage: (1) C# "and" and "or" patterns. </para> </summary> </Comments> <Property Name="OperatorKind" Type="BinaryOperatorKind"> <Comments> <summary>Kind of binary pattern; either <see cref="BinaryOperatorKind.And"/> or <see cref="BinaryOperatorKind.Or"/>.</summary> </Comments> </Property> <Property Name="LeftPattern" Type="IPatternOperation"> <Comments> <summary>The pattern on the left.</summary> </Comments> </Property> <Property Name="RightPattern" Type="IPatternOperation"> <Comments> <summary>The pattern on the right.</summary> </Comments> </Property> </Node> <Node Name="ITypePatternOperation" Base="IPatternOperation"> <Comments> <summary> Represents a pattern comparing the input with a given type. <para> Current usage: (1) C# type pattern. </para> </summary> </Comments> <Property Name="MatchedType" Type="ITypeSymbol"> <Comments> <summary> The type explicitly specified, or null if it was inferred (e.g. using <code>var</code> in C#). </summary> </Comments> </Property> </Node> <Node Name="IRelationalPatternOperation" Base="IPatternOperation"> <Comments> <summary> Represents a pattern comparing the input with a constant value using a relational operator. <para> Current usage: (1) C# relational pattern. </para> </summary> </Comments> <Property Name="OperatorKind" Type="BinaryOperatorKind"> <Comments> <summary>The kind of the relational operator.</summary> </Comments> </Property> <Property Name="Value" Type="IOperation"> <Comments> <summary>Constant value of the pattern operation.</summary> </Comments> </Property> </Node> <Node Name="IWithOperation" Base="IOperation" ChildrenOrder="Operand,Initializer" HasType="true"> <Comments> <summary> Represents cloning of an object instance. <para> Current usage: (1) C# with expression. </para> </summary> </Comments> <Property Name="Operand" Type="IOperation"> <Comments> <summary>Operand to be cloned.</summary> </Comments> </Property> <Property Name="CloneMethod" Type="IMethodSymbol?"> <Comments> <summary>Clone method to be invoked on the value. This can be null in error scenarios.</summary> </Comments> </Property> <Property Name="Initializer" Type="IObjectOrCollectionInitializerOperation"> <Comments> <summary>With collection initializer.</summary> </Comments> </Property> </Node> </Tree>
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Scripting/VisualBasicTest/My Project/launchSettings.json
{ "profiles": { "xUnit.net Console (32-bit)": { "commandName": "Executable", "executablePath": "$(NuGetPackageRoot)xunit.runner.console\\$(XUnitVersion)\\tools\\net452\\xunit.console.x86.exe", "commandLineArgs": "$(TargetPath) -noshadow -verbose" }, "xUnit.net Console (64-bit)": { "commandName": "Executable", "executablePath": "$(NuGetPackageRoot)xunit.runner.console\\$(XUnitVersion)\\tools\\net452\\xunit.console.exe", "commandLineArgs": "$(TargetPath) -noshadow -verbose" } } }
{ "profiles": { "xUnit.net Console (32-bit)": { "commandName": "Executable", "executablePath": "$(NuGetPackageRoot)xunit.runner.console\\$(XUnitVersion)\\tools\\net452\\xunit.console.x86.exe", "commandLineArgs": "$(TargetPath) -noshadow -verbose" }, "xUnit.net Console (64-bit)": { "commandName": "Executable", "executablePath": "$(NuGetPackageRoot)xunit.runner.console\\$(XUnitVersion)\\tools\\net452\\xunit.console.exe", "commandLineArgs": "$(TargetPath) -noshadow -verbose" } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Setup/Installer/tools/uninstall.ps1
[CmdletBinding(PositionalBinding=$false)] param ( [string][Alias("hive")]$rootSuffix = "" ) Set-StrictMode -version 2.0 $ErrorActionPreference="Stop" try { . (Join-Path $PSScriptRoot "utils.ps1") # Find VS Instance $vsInstances = Get-VisualStudioInstances # Uninstall VSIX from all instances Write-Host "Uninstalling Roslyn Preview ..." -ForegroundColor Green foreach ($vsInstance in $vsInstances) { $vsDir = $vsInstance.installationPath.Trim("\") $vsId = $vsInstance.instanceId $vsMajorVersion = $vsInstance.installationVersion.Split(".")[0] $vsLocalDir = Get-VisualStudioLocalDir -vsMajorVersion $vsMajorVersion -vsId $vsId -rootSuffix $rootSuffix Stop-Processes $vsDir $vsLocalDir Uninstall-VsixViaTool -vsDir $vsDir -vsId $vsId -rootSuffix $rootSuffix # Clear MEF Cache Write-Host "Refreshing MEF Cache" -ForegroundColor Gray $mefCacheFolder = Get-MefCacheDir $vsLocalDir if (Test-Path $mefCacheFolder) { Get-ChildItem -Path $mefCacheFolder -Include *.* -File -Recurse | foreach { Remove-Item $_ } } $vsExe = Join-Path $vsDir "Common7\IDE\devenv.exe" $args = "/updateconfiguration" Exec-Console $vsExe $args } Write-Host "Uninstall Succeeded" -ForegroundColor Green exit 0 } catch { Write-Host $_ -ForegroundColor Red Write-Host $_.Exception -ForegroundColor Red Write-Host $_.ScriptStackTrace -ForegroundColor Red exit 1 }
[CmdletBinding(PositionalBinding=$false)] param ( [string][Alias("hive")]$rootSuffix = "" ) Set-StrictMode -version 2.0 $ErrorActionPreference="Stop" try { . (Join-Path $PSScriptRoot "utils.ps1") # Find VS Instance $vsInstances = Get-VisualStudioInstances # Uninstall VSIX from all instances Write-Host "Uninstalling Roslyn Preview ..." -ForegroundColor Green foreach ($vsInstance in $vsInstances) { $vsDir = $vsInstance.installationPath.Trim("\") $vsId = $vsInstance.instanceId $vsMajorVersion = $vsInstance.installationVersion.Split(".")[0] $vsLocalDir = Get-VisualStudioLocalDir -vsMajorVersion $vsMajorVersion -vsId $vsId -rootSuffix $rootSuffix Stop-Processes $vsDir $vsLocalDir Uninstall-VsixViaTool -vsDir $vsDir -vsId $vsId -rootSuffix $rootSuffix # Clear MEF Cache Write-Host "Refreshing MEF Cache" -ForegroundColor Gray $mefCacheFolder = Get-MefCacheDir $vsLocalDir if (Test-Path $mefCacheFolder) { Get-ChildItem -Path $mefCacheFolder -Include *.* -File -Recurse | foreach { Remove-Item $_ } } $vsExe = Join-Path $vsDir "Common7\IDE\devenv.exe" $args = "/updateconfiguration" Exec-Console $vsExe $args } Write-Host "Uninstall Succeeded" -ForegroundColor Green exit 0 } catch { Write-Host $_ -ForegroundColor Red Write-Host $_.Exception -ForegroundColor Red Write-Host $_.ScriptStackTrace -ForegroundColor Red exit 1 }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/common/native/find-native-compiler.sh
#!/usr/bin/env bash # # This file locates the native compiler with the given name and version and sets the environment variables to locate it. # 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 )" if [ $# -lt 0 ] then echo "Usage..." echo "find-native-compiler.sh <compiler> <compiler major version> <compiler minor version>" echo "Specify the name of compiler (clang or gcc)." echo "Specify the major version of compiler." echo "Specify the minor version of compiler." exit 1 fi . $scriptroot/../pipeline-logging-functions.sh compiler="$1" cxxCompiler="$compiler++" majorVersion="$2" minorVersion="$3" if [ "$compiler" = "gcc" ]; then cxxCompiler="g++"; fi check_version_exists() { desired_version=-1 # Set up the environment to be used for building with the desired compiler. if command -v "$compiler-$1.$2" > /dev/null; then desired_version="-$1.$2" elif command -v "$compiler$1$2" > /dev/null; then desired_version="$1$2" elif command -v "$compiler-$1$2" > /dev/null; then desired_version="-$1$2" fi echo "$desired_version" } 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=( 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 ) elif [ "$compiler" = "gcc" ]; then versions=( 9 8 7 6 5 4.9 ); fi for version in "${versions[@]}"; do parts=(${version//./ }) desired_version="$(check_version_exists "${parts[0]}" "${parts[1]}")" if [ "$desired_version" != "-1" ]; then majorVersion="${parts[0]}"; break; fi done if [ -z "$majorVersion" ]; then if command -v "$compiler" > /dev/null; then if [ "$(uname)" != "Darwin" ]; then Write-PipelineTelemetryError -category "Build" -type "warning" "Specific version of $compiler not found, falling back to use the one in PATH." fi export CC="$(command -v "$compiler")" export CXX="$(command -v "$cxxCompiler")" else Write-PipelineTelemetryError -category "Build" "No usable version of $compiler found." exit 1 fi else if [ "$compiler" = "clang" ] && [ "$majorVersion" -lt 5 ]; then if [ "$build_arch" = "arm" ] || [ "$build_arch" = "armel" ]; then if command -v "$compiler" > /dev/null; then Write-PipelineTelemetryError -category "Build" -type "warning" "Found clang version $majorVersion which is not supported on arm/armel architectures, falling back to use clang from PATH." export CC="$(command -v "$compiler")" export CXX="$(command -v "$cxxCompiler")" else Write-PipelineTelemetryError -category "Build" "Found clang version $majorVersion which is not supported on arm/armel architectures, and there is no clang in PATH." exit 1 fi fi fi fi else desired_version="$(check_version_exists "$majorVersion" "$minorVersion")" if [ "$desired_version" = "-1" ]; then Write-PipelineTelemetryError -category "Build" "Could not find specific version of $compiler: $majorVersion $minorVersion." exit 1 fi fi if [ -z "$CC" ]; then export CC="$(command -v "$compiler$desired_version")" export CXX="$(command -v "$cxxCompiler$desired_version")" if [ -z "$CXX" ]; then export CXX="$(command -v "$cxxCompiler")"; fi fi else if [ ! -f "$CLR_CC" ]; then Write-PipelineTelemetryError -category "Build" "CLR_CC is set but path '$CLR_CC' does not exist" exit 1 fi export CC="$CLR_CC" export CXX="$CLR_CXX" fi if [ -z "$CC" ]; then Write-PipelineTelemetryError -category "Build" "Unable to find $compiler." exit 1 fi export CCC_CC="$CC" export CCC_CXX="$CXX" export SCAN_BUILD_COMMAND="$(command -v "scan-build$desired_version")"
#!/usr/bin/env bash # # This file locates the native compiler with the given name and version and sets the environment variables to locate it. # 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 )" if [ $# -lt 0 ] then echo "Usage..." echo "find-native-compiler.sh <compiler> <compiler major version> <compiler minor version>" echo "Specify the name of compiler (clang or gcc)." echo "Specify the major version of compiler." echo "Specify the minor version of compiler." exit 1 fi . $scriptroot/../pipeline-logging-functions.sh compiler="$1" cxxCompiler="$compiler++" majorVersion="$2" minorVersion="$3" if [ "$compiler" = "gcc" ]; then cxxCompiler="g++"; fi check_version_exists() { desired_version=-1 # Set up the environment to be used for building with the desired compiler. if command -v "$compiler-$1.$2" > /dev/null; then desired_version="-$1.$2" elif command -v "$compiler$1$2" > /dev/null; then desired_version="$1$2" elif command -v "$compiler-$1$2" > /dev/null; then desired_version="-$1$2" fi echo "$desired_version" } 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=( 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 ) elif [ "$compiler" = "gcc" ]; then versions=( 9 8 7 6 5 4.9 ); fi for version in "${versions[@]}"; do parts=(${version//./ }) desired_version="$(check_version_exists "${parts[0]}" "${parts[1]}")" if [ "$desired_version" != "-1" ]; then majorVersion="${parts[0]}"; break; fi done if [ -z "$majorVersion" ]; then if command -v "$compiler" > /dev/null; then if [ "$(uname)" != "Darwin" ]; then Write-PipelineTelemetryError -category "Build" -type "warning" "Specific version of $compiler not found, falling back to use the one in PATH." fi export CC="$(command -v "$compiler")" export CXX="$(command -v "$cxxCompiler")" else Write-PipelineTelemetryError -category "Build" "No usable version of $compiler found." exit 1 fi else if [ "$compiler" = "clang" ] && [ "$majorVersion" -lt 5 ]; then if [ "$build_arch" = "arm" ] || [ "$build_arch" = "armel" ]; then if command -v "$compiler" > /dev/null; then Write-PipelineTelemetryError -category "Build" -type "warning" "Found clang version $majorVersion which is not supported on arm/armel architectures, falling back to use clang from PATH." export CC="$(command -v "$compiler")" export CXX="$(command -v "$cxxCompiler")" else Write-PipelineTelemetryError -category "Build" "Found clang version $majorVersion which is not supported on arm/armel architectures, and there is no clang in PATH." exit 1 fi fi fi fi else desired_version="$(check_version_exists "$majorVersion" "$minorVersion")" if [ "$desired_version" = "-1" ]; then Write-PipelineTelemetryError -category "Build" "Could not find specific version of $compiler: $majorVersion $minorVersion." exit 1 fi fi if [ -z "$CC" ]; then export CC="$(command -v "$compiler$desired_version")" export CXX="$(command -v "$cxxCompiler$desired_version")" if [ -z "$CXX" ]; then export CXX="$(command -v "$cxxCompiler")"; fi fi else if [ ! -f "$CLR_CC" ]; then Write-PipelineTelemetryError -category "Build" "CLR_CC is set but path '$CLR_CC' does not exist" exit 1 fi export CC="$CLR_CC" export CXX="$CLR_CXX" fi if [ -z "$CC" ]; then Write-PipelineTelemetryError -category "Build" "Unable to find $compiler." exit 1 fi export CCC_CC="$CC" export CCC_CXX="$CXX" export SCAN_BUILD_COMMAND="$(command -v "scan-build$desired_version")"
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/common/post-build/add-build-to-channel.ps1
param( [Parameter(Mandatory=$true)][int] $BuildId, [Parameter(Mandatory=$true)][int] $ChannelId, [Parameter(Mandatory=$true)][string] $MaestroApiAccessToken, [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro-prod.westus2.cloudapp.azure.com', [Parameter(Mandatory=$false)][string] $MaestroApiVersion = '2019-01-16' ) try { . $PSScriptRoot\post-build-utils.ps1 # Check that the channel we are going to promote the build to exist $channelInfo = Get-MaestroChannel -ChannelId $ChannelId if (!$channelInfo) { Write-PipelineTelemetryCategory -Category 'PromoteBuild' -Message "Channel with BAR ID $ChannelId was not found in BAR!" ExitWithExitCode 1 } # Get info about which channel(s) the build has already been promoted to $buildInfo = Get-MaestroBuild -BuildId $BuildId if (!$buildInfo) { Write-PipelineTelemetryError -Category 'PromoteBuild' -Message "Build with BAR ID $BuildId was not found in BAR!" ExitWithExitCode 1 } # Find whether the build is already assigned to the channel or not if ($buildInfo.channels) { foreach ($channel in $buildInfo.channels) { if ($channel.Id -eq $ChannelId) { Write-Host "The build with BAR ID $BuildId is already on channel $ChannelId!" ExitWithExitCode 0 } } } Write-Host "Promoting build '$BuildId' to channel '$ChannelId'." Assign-BuildToChannel -BuildId $BuildId -ChannelId $ChannelId Write-Host 'done.' } catch { Write-Host $_ Write-PipelineTelemetryError -Category 'PromoteBuild' -Message "There was an error while trying to promote build '$BuildId' to channel '$ChannelId'" ExitWithExitCode 1 }
param( [Parameter(Mandatory=$true)][int] $BuildId, [Parameter(Mandatory=$true)][int] $ChannelId, [Parameter(Mandatory=$true)][string] $MaestroApiAccessToken, [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro-prod.westus2.cloudapp.azure.com', [Parameter(Mandatory=$false)][string] $MaestroApiVersion = '2019-01-16' ) try { . $PSScriptRoot\post-build-utils.ps1 # Check that the channel we are going to promote the build to exist $channelInfo = Get-MaestroChannel -ChannelId $ChannelId if (!$channelInfo) { Write-PipelineTelemetryCategory -Category 'PromoteBuild' -Message "Channel with BAR ID $ChannelId was not found in BAR!" ExitWithExitCode 1 } # Get info about which channel(s) the build has already been promoted to $buildInfo = Get-MaestroBuild -BuildId $BuildId if (!$buildInfo) { Write-PipelineTelemetryError -Category 'PromoteBuild' -Message "Build with BAR ID $BuildId was not found in BAR!" ExitWithExitCode 1 } # Find whether the build is already assigned to the channel or not if ($buildInfo.channels) { foreach ($channel in $buildInfo.channels) { if ($channel.Id -eq $ChannelId) { Write-Host "The build with BAR ID $BuildId is already on channel $ChannelId!" ExitWithExitCode 0 } } } Write-Host "Promoting build '$BuildId' to channel '$ChannelId'." Assign-BuildToChannel -BuildId $BuildId -ChannelId $ChannelId Write-Host 'done.' } catch { Write-Host $_ Write-PipelineTelemetryError -Category 'PromoteBuild' -Message "There was an error while trying to promote build '$BuildId' to channel '$ChannelId'" ExitWithExitCode 1 }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/common/templates/job/publish-build-assets.yml
parameters: configuration: 'Debug' # Optional: condition for the job to run condition: '' # Optional: 'true' if future jobs should run even if this job fails continueOnError: false # Optional: dependencies of the job dependsOn: '' # Optional: Include PublishBuildArtifacts task enablePublishBuildArtifacts: false # Optional: A defined YAML pool - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#pool pool: {} # Optional: should run as a public build even in the internal project # if 'true', the build won't run any of the internal only steps, even if it is running in non-public projects. runAsPublic: false # Optional: whether the build's artifacts will be published using release pipelines or direct feed publishing publishUsingPipelines: false jobs: - job: Asset_Registry_Publish dependsOn: ${{ parameters.dependsOn }} displayName: Publish to Build Asset Registry pool: ${{ parameters.pool }} variables: - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - name: _BuildConfig value: ${{ parameters.configuration }} - group: Publish-Build-Assets - group: AzureDevOps-Artifact-Feeds-Pats # Skip component governance and codesign validation for SDL. These jobs # create no content. - name: skipComponentGovernanceDetection value: true - name: runCodesignValidationInjection value: false steps: - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - task: DownloadBuildArtifacts@0 displayName: Download artifact inputs: artifactName: AssetManifests downloadPath: '$(Build.StagingDirectory)/Download' checkDownloadedFiles: true condition: ${{ parameters.condition }} continueOnError: ${{ parameters.continueOnError }} - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - task: NuGetAuthenticate@0 - task: PowerShell@2 displayName: Enable cross-org NuGet feed authentication inputs: filePath: $(Build.SourcesDirectory)/eng/common/enable-cross-org-publishing.ps1 arguments: -token $(dn-bot-all-orgs-artifact-feeds-rw) - task: PowerShell@2 displayName: Publish Build Assets inputs: filePath: eng\common\sdk-task.ps1 arguments: -task PublishBuildAssets -restore -msbuildEngine dotnet /p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests' /p:BuildAssetRegistryToken=$(MaestroAccessToken) /p:MaestroApiEndpoint=https://maestro-prod.westus2.cloudapp.azure.com /p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }} /p:Configuration=$(_BuildConfig) /p:OfficialBuildId=$(Build.BuildNumber) condition: ${{ parameters.condition }} continueOnError: ${{ parameters.continueOnError }} - task: powershell@2 displayName: Create ReleaseConfigs Artifact inputs: targetType: inline script: | Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value $(BARBuildId) Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value "$(DefaultChannels)" Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value $(IsStableBuild) - task: PublishBuildArtifacts@1 displayName: Publish ReleaseConfigs Artifact inputs: PathtoPublish: '$(Build.StagingDirectory)/ReleaseConfigs.txt' PublishLocation: Container ArtifactName: ReleaseConfigs - task: powershell@2 displayName: Check if SymbolPublishingExclusionsFile.txt exists inputs: targetType: inline script: | $symbolExclusionfile = "$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt" if(Test-Path -Path $symbolExclusionfile) { Write-Host "SymbolExclusionFile exists" Write-Host "##vso[task.setvariable variable=SymbolExclusionFile]true" } else{ Write-Host "Symbols Exclusion file does not exists" Write-Host "##vso[task.setvariable variable=SymbolExclusionFile]false" } - task: PublishBuildArtifacts@1 displayName: Publish SymbolPublishingExclusionsFile Artifact condition: eq(variables['SymbolExclusionFile'], 'true') inputs: PathtoPublish: '$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt' PublishLocation: Container ArtifactName: ReleaseConfigs - ${{ if eq(parameters.enablePublishBuildArtifacts, 'true') }}: - template: /eng/common/templates/steps/publish-logs.yml parameters: JobLabel: 'Publish_Artifacts_Logs'
parameters: configuration: 'Debug' # Optional: condition for the job to run condition: '' # Optional: 'true' if future jobs should run even if this job fails continueOnError: false # Optional: dependencies of the job dependsOn: '' # Optional: Include PublishBuildArtifacts task enablePublishBuildArtifacts: false # Optional: A defined YAML pool - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#pool pool: {} # Optional: should run as a public build even in the internal project # if 'true', the build won't run any of the internal only steps, even if it is running in non-public projects. runAsPublic: false # Optional: whether the build's artifacts will be published using release pipelines or direct feed publishing publishUsingPipelines: false jobs: - job: Asset_Registry_Publish dependsOn: ${{ parameters.dependsOn }} displayName: Publish to Build Asset Registry pool: ${{ parameters.pool }} variables: - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - name: _BuildConfig value: ${{ parameters.configuration }} - group: Publish-Build-Assets - group: AzureDevOps-Artifact-Feeds-Pats # Skip component governance and codesign validation for SDL. These jobs # create no content. - name: skipComponentGovernanceDetection value: true - name: runCodesignValidationInjection value: false steps: - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - task: DownloadBuildArtifacts@0 displayName: Download artifact inputs: artifactName: AssetManifests downloadPath: '$(Build.StagingDirectory)/Download' checkDownloadedFiles: true condition: ${{ parameters.condition }} continueOnError: ${{ parameters.continueOnError }} - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - task: NuGetAuthenticate@0 - task: PowerShell@2 displayName: Enable cross-org NuGet feed authentication inputs: filePath: $(Build.SourcesDirectory)/eng/common/enable-cross-org-publishing.ps1 arguments: -token $(dn-bot-all-orgs-artifact-feeds-rw) - task: PowerShell@2 displayName: Publish Build Assets inputs: filePath: eng\common\sdk-task.ps1 arguments: -task PublishBuildAssets -restore -msbuildEngine dotnet /p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests' /p:BuildAssetRegistryToken=$(MaestroAccessToken) /p:MaestroApiEndpoint=https://maestro-prod.westus2.cloudapp.azure.com /p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }} /p:Configuration=$(_BuildConfig) /p:OfficialBuildId=$(Build.BuildNumber) condition: ${{ parameters.condition }} continueOnError: ${{ parameters.continueOnError }} - task: powershell@2 displayName: Create ReleaseConfigs Artifact inputs: targetType: inline script: | Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value $(BARBuildId) Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value "$(DefaultChannels)" Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value $(IsStableBuild) - task: PublishBuildArtifacts@1 displayName: Publish ReleaseConfigs Artifact inputs: PathtoPublish: '$(Build.StagingDirectory)/ReleaseConfigs.txt' PublishLocation: Container ArtifactName: ReleaseConfigs - task: powershell@2 displayName: Check if SymbolPublishingExclusionsFile.txt exists inputs: targetType: inline script: | $symbolExclusionfile = "$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt" if(Test-Path -Path $symbolExclusionfile) { Write-Host "SymbolExclusionFile exists" Write-Host "##vso[task.setvariable variable=SymbolExclusionFile]true" } else{ Write-Host "Symbols Exclusion file does not exists" Write-Host "##vso[task.setvariable variable=SymbolExclusionFile]false" } - task: PublishBuildArtifacts@1 displayName: Publish SymbolPublishingExclusionsFile Artifact condition: eq(variables['SymbolExclusionFile'], 'true') inputs: PathtoPublish: '$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt' PublishLocation: Container ArtifactName: ReleaseConfigs - ${{ if eq(parameters.enablePublishBuildArtifacts, 'true') }}: - template: /eng/common/templates/steps/publish-logs.yml parameters: JobLabel: 'Publish_Artifacts_Logs'
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./scripts/vscode-build.ps1
param ( [Parameter(Mandatory = $true)][string]$filePath, [string]$msbuildEngine = "vs", [string]$framework = "" ) Set-StrictMode -version 3.0 $ErrorActionPreference = "Stop" . (Join-Path $PSScriptRoot "../eng/build-utils.ps1") $fileInfo = Get-ItemProperty $filePath $projectFileInfo = Get-ProjectFile $fileInfo if ($projectFileInfo) { $buildTool = InitializeBuildTool $frameworkArg = if ($framework -ne "") { " -p:TargetFramework=$framework" } else { "" } $buildArgs = "$($buildTool.Command) -v:m -m -p:RunAnalyzersDuringBuild=false -p:GenerateFullPaths=true$frameworkArg $($projectFileInfo.FullName)" Write-Host "$($buildTool.Path) $buildArgs" Exec-Console $buildTool.Path $buildArgs exit 0 } else { Write-Host "Failed to build project. $fileInfo is not part of a C# / VB project." exit 1 }
param ( [Parameter(Mandatory = $true)][string]$filePath, [string]$msbuildEngine = "vs", [string]$framework = "" ) Set-StrictMode -version 3.0 $ErrorActionPreference = "Stop" . (Join-Path $PSScriptRoot "../eng/build-utils.ps1") $fileInfo = Get-ItemProperty $filePath $projectFileInfo = Get-ProjectFile $fileInfo if ($projectFileInfo) { $buildTool = InitializeBuildTool $frameworkArg = if ($framework -ne "") { " -p:TargetFramework=$framework" } else { "" } $buildArgs = "$($buildTool.Command) -v:m -m -p:RunAnalyzersDuringBuild=false -p:GenerateFullPaths=true$frameworkArg $($projectFileInfo.FullName)" Write-Host "$($buildTool.Path) $buildArgs" Exec-Console $buildTool.Path $buildArgs exit 0 } else { Write-Host "Failed to build project. $fileInfo is not part of a C# / VB project." exit 1 }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/CodeStyle/VisualBasic/Tests/My Project/launchSettings.json
{ "profiles": { "xUnit.net Console (32-bit)": { "commandName": "Executable", "executablePath": "$(NuGetPackageRoot)xunit.runner.console\\$(XUnitVersion)\\tools\\net452\\xunit.console.x86.exe", "commandLineArgs": "$(TargetPath) -noshadow -verbose" }, "xUnit.net Console (64-bit)": { "commandName": "Executable", "executablePath": "$(NuGetPackageRoot)xunit.runner.console\\$(XUnitVersion)\\tools\\net452\\xunit.console.exe", "commandLineArgs": "$(TargetPath) -noshadow -verbose" } } }
{ "profiles": { "xUnit.net Console (32-bit)": { "commandName": "Executable", "executablePath": "$(NuGetPackageRoot)xunit.runner.console\\$(XUnitVersion)\\tools\\net452\\xunit.console.x86.exe", "commandLineArgs": "$(TargetPath) -noshadow -verbose" }, "xUnit.net Console (64-bit)": { "commandName": "Executable", "executablePath": "$(NuGetPackageRoot)xunit.runner.console\\$(XUnitVersion)\\tools\\net452\\xunit.console.exe", "commandLineArgs": "$(TargetPath) -noshadow -verbose" } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/pipelines/build-windows-job.yml
# Build on windows desktop parameters: - name: jobName type: string default: '' - name: testArtifactName type: string default: '' - name: configuration type: string default: 'Debug' - name: queueName type: string default: '' - name: vmImageName type: string default: '' - name: buildArguments type: string default: '' jobs: - job: ${{ parameters.jobName }} pool: ${{ if ne(parameters.queueName, '') }}: name: NetCorePublic-Pool queue: ${{ parameters.queueName }} ${{ if ne(parameters.vmImageName, '') }}: vmImage: ${{ parameters.vmImageName }} timeoutInMinutes: 40 steps: - template: checkout-windows-task.yml - task: PowerShell@2 displayName: Restore inputs: filePath: eng/build.ps1 arguments: -configuration ${{ parameters.configuration }} -prepareMachine -ci -restore -binaryLog - task: PowerShell@2 displayName: Build inputs: filePath: eng/build.ps1 arguments: -configuration ${{ parameters.configuration }} -prepareMachine -ci -build -publish -binaryLog -skipDocumentation ${{ parameters.buildArguments }} - task: PowerShell@2 displayName: Prepare Unit Tests inputs: filePath: eng/prepare-tests.ps1 arguments: -configuration ${{ parameters.configuration }} - task: PublishPipelineArtifact@1 displayName: Publish Test Payload inputs: targetPath: '$(Build.SourcesDirectory)\artifacts\testPayload' artifactName: ${{ parameters.testArtifactName }} - template: publish-logs.yml parameters: configuration: ${{ parameters.configuration }} jobName: ${{ parameters.jobName }}
# Build on windows desktop parameters: - name: jobName type: string default: '' - name: testArtifactName type: string default: '' - name: configuration type: string default: 'Debug' - name: queueName type: string default: '' - name: vmImageName type: string default: '' - name: buildArguments type: string default: '' jobs: - job: ${{ parameters.jobName }} pool: ${{ if ne(parameters.queueName, '') }}: name: NetCorePublic-Pool queue: ${{ parameters.queueName }} ${{ if ne(parameters.vmImageName, '') }}: vmImage: ${{ parameters.vmImageName }} timeoutInMinutes: 40 steps: - template: checkout-windows-task.yml - task: PowerShell@2 displayName: Restore inputs: filePath: eng/build.ps1 arguments: -configuration ${{ parameters.configuration }} -prepareMachine -ci -restore -binaryLog - task: PowerShell@2 displayName: Build inputs: filePath: eng/build.ps1 arguments: -configuration ${{ parameters.configuration }} -prepareMachine -ci -build -publish -binaryLog -skipDocumentation ${{ parameters.buildArguments }} - task: PowerShell@2 displayName: Prepare Unit Tests inputs: filePath: eng/prepare-tests.ps1 arguments: -configuration ${{ parameters.configuration }} - task: PublishPipelineArtifact@1 displayName: Publish Test Payload inputs: targetPath: '$(Build.SourcesDirectory)\artifacts\testPayload' artifactName: ${{ parameters.testArtifactName }} - template: publish-logs.yml parameters: configuration: ${{ parameters.configuration }} jobName: ${{ parameters.jobName }}
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/prepare-tests.ps1
[CmdletBinding(PositionalBinding=$false)] param ([string]$configuration = "Debug") Set-StrictMode -version 2.0 $ErrorActionPreference="Stop" try { . (Join-Path $PSScriptRoot "build-utils.ps1") Push-Location $RepoRoot $dotnet = Ensure-DotnetSdk # permissions issues make this a pain to do in PrepareTests itself. Remove-Item -Recurse -Force "$RepoRoot\artifacts\testPayload" -ErrorAction SilentlyContinue Exec-Console $dotnet "$RepoRoot\artifacts\bin\PrepareTests\$configuration\net5.0\PrepareTests.dll --source $RepoRoot --destination $RepoRoot\artifacts\testPayload" exit 0 } catch { Write-Host $_ exit 1 } finally { Pop-Location }
[CmdletBinding(PositionalBinding=$false)] param ([string]$configuration = "Debug") Set-StrictMode -version 2.0 $ErrorActionPreference="Stop" try { . (Join-Path $PSScriptRoot "build-utils.ps1") Push-Location $RepoRoot $dotnet = Ensure-DotnetSdk # permissions issues make this a pain to do in PrepareTests itself. Remove-Item -Recurse -Force "$RepoRoot\artifacts\testPayload" -ErrorAction SilentlyContinue Exec-Console $dotnet "$RepoRoot\artifacts\bin\PrepareTests\$configuration\net5.0\PrepareTests.dll --source $RepoRoot --destination $RepoRoot\artifacts\testPayload" exit 0 } catch { Write-Host $_ exit 1 } finally { Pop-Location }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/cibuild.sh
#!/usr/bin/env bash 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)" echo "Building this commit:" git show --no-patch --pretty=raw HEAD . "$scriptroot/build.sh" --ci --restore --build --bootstrap --pack --publish --binaryLog "$@"
#!/usr/bin/env bash 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)" echo "Building this commit:" git show --no-patch --pretty=raw HEAD . "$scriptroot/build.sh" --ci --restore --build --bootstrap --pack --publish --binaryLog "$@"
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Compilers/CSharp/Portable/Syntax/Syntax.xml
<?xml version="1.0" encoding="utf-8"?> <!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. --> <!-- To re-generate source from this file, run eng/generate-compiler-code.cmd --> <Tree Root="SyntaxNode"> <PredefinedNode Name="CSharpSyntaxNode" Base="SyntaxNode"/> <PredefinedNode Name="SyntaxToken" Base="CSharpSyntaxNode"/> <PredefinedNode Name="StructuredTriviaSyntax" Base="CSharpSyntaxNode"/> <!-- Names --> <AbstractNode Name="NameSyntax" Base="TypeSyntax"> <TypeComment> <summary>Provides the base class from which the classes that represent name syntax nodes are derived. This is an abstract class.</summary> </TypeComment> </AbstractNode> <AbstractNode Name="SimpleNameSyntax" Base="NameSyntax"> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>SyntaxToken representing the identifier of the simple name.</summary> </PropertyComment> <Kind Name="IdentifierToken" /> </Field> <TypeComment> <summary>Provides the base class from which the classes that represent simple name syntax nodes are derived. This is an abstract class.</summary> </TypeComment> </AbstractNode> <Node Name="IdentifierNameSyntax" Base="SimpleNameSyntax"> <Kind Name="IdentifierName"/> <Field Name="Identifier" Type="SyntaxToken" Override="true"> <Kind Name="IdentifierToken"/> <Kind Name="GlobalKeyword"/> <PropertyComment> <summary>SyntaxToken representing the keyword for the kind of the identifier name.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for identifier name.</summary> </TypeComment> <FactoryComment> <summary>Creates an IdentifierNameSyntax node.</summary> </FactoryComment> </Node> <Node Name="QualifiedNameSyntax" Base="NameSyntax"> <Kind Name="QualifiedName"/> <Field Name="Left" Type="NameSyntax"> <PropertyComment> <summary>NameSyntax node representing the name on the left side of the dot token of the qualified name.</summary> </PropertyComment> </Field> <Field Name="DotToken" Type="SyntaxToken"> <Kind Name="DotToken"/> <PropertyComment> <summary>SyntaxToken representing the dot.</summary> </PropertyComment> </Field> <Field Name="Right" Type="SimpleNameSyntax"> <PropertyComment> <summary>SimpleNameSyntax node representing the name on the right side of the dot token of the qualified name.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for qualified name.</summary> </TypeComment> <FactoryComment> <summary>Creates a QualifiedNameSyntax node.</summary> </FactoryComment> </Node> <Node Name="GenericNameSyntax" Base="SimpleNameSyntax"> <Kind Name="GenericName"/> <Field Name="Identifier" Type="SyntaxToken" Override="true"> <Kind Name="IdentifierToken"/> <PropertyComment> <summary>SyntaxToken representing the name of the identifier of the generic name.</summary> </PropertyComment> </Field> <Field Name="TypeArgumentList" Type="TypeArgumentListSyntax"> <PropertyComment> <summary>TypeArgumentListSyntax node representing the list of type arguments of the generic name.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for generic name.</summary> </TypeComment> <FactoryComment> <summary>Creates a GenericNameSyntax node.</summary> </FactoryComment> </Node> <Node Name="TypeArgumentListSyntax" Base="CSharpSyntaxNode"> <Kind Name="TypeArgumentList"/> <Field Name="LessThanToken" Type="SyntaxToken"> <Kind Name="LessThanToken" /> <PropertyComment> <summary>SyntaxToken representing less than.</summary> </PropertyComment> </Field> <Field Name="Arguments" Type="SeparatedSyntaxList&lt;TypeSyntax&gt;"> <PropertyComment> <summary>SeparatedSyntaxList of TypeSyntax node representing the type arguments.</summary> </PropertyComment> </Field> <Field Name="GreaterThanToken" Type="SyntaxToken"> <Kind Name="GreaterThanToken"/> <PropertyComment> <summary>SyntaxToken representing greater than.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for type argument list.</summary> </TypeComment> <FactoryComment> <summary>Creates a TypeArgumentListSyntax node.</summary> </FactoryComment> </Node> <Node Name="AliasQualifiedNameSyntax" Base="NameSyntax"> <Kind Name="AliasQualifiedName"/> <Field Name="Alias" Type="IdentifierNameSyntax"> <PropertyComment> <summary>IdentifierNameSyntax node representing the name of the alias</summary> </PropertyComment> </Field> <Field Name="ColonColonToken" Type="SyntaxToken"> <Kind Name="ColonColonToken"/> <PropertyComment> <summary>SyntaxToken representing colon colon.</summary> </PropertyComment> </Field> <Field Name="Name" Type="SimpleNameSyntax"> <PropertyComment> <summary>SimpleNameSyntax node representing the name that is being alias qualified.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for alias qualified name.</summary> </TypeComment> <FactoryComment> <summary>Creates an AliasQualifiedNameSyntax node.</summary> </FactoryComment> </Node> <!-- Type names --> <AbstractNode Name="TypeSyntax" Base="ExpressionSyntax"> <TypeComment> <summary>Provides the base class from which the classes that represent type syntax nodes are derived. This is an abstract class.</summary> </TypeComment> </AbstractNode> <Node Name="PredefinedTypeSyntax" Base="TypeSyntax"> <Kind Name="PredefinedType"/> <Field Name="Keyword" Type="SyntaxToken"> <Kind Name="BoolKeyword"/> <Kind Name="ByteKeyword"/> <Kind Name="SByteKeyword"/> <Kind Name="IntKeyword"/> <Kind Name="UIntKeyword"/> <Kind Name="ShortKeyword"/> <Kind Name="UShortKeyword"/> <Kind Name="LongKeyword"/> <Kind Name="ULongKeyword"/> <Kind Name="FloatKeyword"/> <Kind Name="DoubleKeyword"/> <Kind Name="DecimalKeyword"/> <Kind Name="StringKeyword"/> <Kind Name="CharKeyword"/> <Kind Name="ObjectKeyword"/> <Kind Name="VoidKeyword"/> <PropertyComment> <summary>SyntaxToken which represents the keyword corresponding to the predefined type.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for predefined types.</summary> </TypeComment> <FactoryComment> <summary>Creates a PredefinedTypeSyntax node.</summary> </FactoryComment> </Node> <Node Name="ArrayTypeSyntax" Base="TypeSyntax"> <Kind Name="ArrayType"/> <Field Name="ElementType" Type="TypeSyntax"> <PropertyComment> <summary>TypeSyntax node representing the type of the element of the array.</summary> </PropertyComment> </Field> <Field Name="RankSpecifiers" Type="SyntaxList&lt;ArrayRankSpecifierSyntax&gt;" MinCount="1"> <PropertyComment> <summary>SyntaxList of ArrayRankSpecifierSyntax nodes representing the list of rank specifiers for the array.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for the array type.</summary> </TypeComment> <FactoryComment> <summary>Creates an ArrayTypeSyntax node.</summary> </FactoryComment> </Node> <Node Name="ArrayRankSpecifierSyntax" Base="CSharpSyntaxNode"> <Kind Name="ArrayRankSpecifier" /> <Field Name="OpenBracketToken" Type="SyntaxToken"> <Kind Name="OpenBracketToken"/> </Field> <Field Name="Sizes" Type="SeparatedSyntaxList&lt;ExpressionSyntax&gt;"/> <Field Name="CloseBracketToken" Type="SyntaxToken"> <Kind Name="CloseBracketToken"/> </Field> </Node> <Node Name="PointerTypeSyntax" Base="TypeSyntax"> <Kind Name="PointerType"/> <Field Name="ElementType" Type="TypeSyntax"> <PropertyComment> <summary>TypeSyntax node that represents the element type of the pointer.</summary> </PropertyComment> </Field> <Field Name="AsteriskToken" Type="SyntaxToken"> <Kind Name="AsteriskToken"/> <PropertyComment> <summary>SyntaxToken representing the asterisk.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for pointer type.</summary> </TypeComment> <FactoryComment> <summary>Creates a PointerTypeSyntax node.</summary> </FactoryComment> </Node> <Node Name="FunctionPointerTypeSyntax" Base="TypeSyntax"> <Kind Name="FunctionPointerType"/> <Field Name="DelegateKeyword" Type="SyntaxToken"> <Kind Name="DelegateKeyword"/> <PropertyComment> <summary>SyntaxToken representing the delegate keyword.</summary> </PropertyComment> </Field> <Field Name="AsteriskToken" Type="SyntaxToken"> <Kind Name="AsteriskToken"/> <PropertyComment> <summary>SyntaxToken representing the asterisk.</summary> </PropertyComment> </Field> <Field Name="CallingConvention" Type="FunctionPointerCallingConventionSyntax" Optional="true"> <PropertyComment> <summary>Node representing the optional calling convention.</summary> </PropertyComment> </Field> <Field Name="ParameterList" Type="FunctionPointerParameterListSyntax"> <PropertyComment> <summary>List of the parameter types and return type of the function pointer.</summary> </PropertyComment> </Field> </Node> <Node Name="FunctionPointerParameterListSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Function pointer parameter list syntax.</summary> </TypeComment> <Kind Name="FunctionPointerParameterList"/> <Field Name="LessThanToken" Type="SyntaxToken"> <Kind Name="LessThanToken"/> <PropertyComment> <summary>SyntaxToken representing the less than token.</summary> </PropertyComment> </Field> <Field Name="Parameters" Type="SeparatedSyntaxList&lt;FunctionPointerParameterSyntax&gt;" MinCount="1"> <PropertyComment> <summary>SeparatedSyntaxList of ParameterSyntaxes representing the list of parameters and return type.</summary> </PropertyComment> </Field> <Field Name="GreaterThanToken" Type="SyntaxToken"> <Kind Name="GreaterThanToken"/> <PropertyComment> <summary>SyntaxToken representing the greater than token.</summary> </PropertyComment> </Field> </Node> <Node Name="FunctionPointerCallingConventionSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Function pointer calling convention syntax.</summary> </TypeComment> <Kind Name="FunctionPointerCallingConvention"/> <Field Name="ManagedOrUnmanagedKeyword" Type="SyntaxToken"> <Kind Name="ManagedKeyword"/> <Kind Name="UnmanagedKeyword"/> <PropertyComment> <summary>SyntaxToken representing whether the calling convention is managed or unmanaged.</summary> </PropertyComment> </Field> <Field Name="UnmanagedCallingConventionList" Type="FunctionPointerUnmanagedCallingConventionListSyntax" Optional="true"> <PropertyComment> <summary>Optional list of identifiers that will contribute to an unmanaged calling convention.</summary> </PropertyComment> </Field> </Node> <Node Name="FunctionPointerUnmanagedCallingConventionListSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Function pointer calling convention syntax.</summary> </TypeComment> <Kind Name="FunctionPointerUnmanagedCallingConventionList"/> <Field Name="OpenBracketToken" Type="SyntaxToken"> <Kind Name="OpenBracketToken"/> <PropertyComment> <summary>SyntaxToken representing open bracket.</summary> </PropertyComment> </Field> <Field Name="CallingConventions" Type="SeparatedSyntaxList&lt;FunctionPointerUnmanagedCallingConventionSyntax&gt;" MinCount="1"> <PropertyComment> <summary>SeparatedSyntaxList of calling convention identifiers.</summary> </PropertyComment> </Field> <Field Name="CloseBracketToken" Type="SyntaxToken"> <Kind Name="CloseBracketToken"/> <PropertyComment> <summary>SyntaxToken representing close bracket.</summary> </PropertyComment> </Field> </Node> <Node Name="FunctionPointerUnmanagedCallingConventionSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Individual function pointer unmanaged calling convention.</summary> </TypeComment> <Kind Name="FunctionPointerUnmanagedCallingConvention"/> <Field Name="Name" Type="SyntaxToken"> <Kind Name="IdentifierToken"/> <PropertyComment> <summary>SyntaxToken representing the calling convention identifier.</summary> </PropertyComment> </Field> </Node> <Node Name="NullableTypeSyntax" Base="TypeSyntax"> <Kind Name="NullableType"/> <Field Name="ElementType" Type="TypeSyntax"> <PropertyComment> <summary>TypeSyntax node representing the type of the element.</summary> </PropertyComment> </Field> <Field Name="QuestionToken" Type="SyntaxToken"> <Kind Name="QuestionToken"/> <PropertyComment> <summary>SyntaxToken representing the question mark.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for a nullable type.</summary> </TypeComment> <FactoryComment> <summary>Creates a NullableTypeSyntax node.</summary> </FactoryComment> </Node> <Node Name="TupleTypeSyntax" Base="TypeSyntax"> <Kind Name="TupleType"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing the open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Elements" Type="SeparatedSyntaxList&lt;TupleElementSyntax&gt;" MinCount="2"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing the close parenthesis.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for tuple type.</summary> </TypeComment> <FactoryComment> <summary>Creates a TupleTypeSyntax node.</summary> </FactoryComment> </Node> <Node Name="TupleElementSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Tuple type element.</summary> </TypeComment> <Kind Name="TupleElement"/> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>Gets the type of the tuple element.</summary> </PropertyComment> </Field> <Field Name="Identifier" Type="SyntaxToken" Optional="true"> <PropertyComment> <summary>Gets the name of the tuple element.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> </Node> <Node Name="OmittedTypeArgumentSyntax" Base="TypeSyntax"> <Kind Name="OmittedTypeArgument"/> <Field Name="OmittedTypeArgumentToken" Type="SyntaxToken"> <Kind Name="OmittedTypeArgumentToken"/> <PropertyComment> <summary>SyntaxToken representing the omitted type argument.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents a placeholder in the type argument list of an unbound generic type.</summary> </TypeComment> <FactoryComment> <summary>Creates an OmittedTypeArgumentSyntax node.</summary> </FactoryComment> </Node> <Node Name="RefTypeSyntax" Base="TypeSyntax"> <TypeComment> <summary>The ref modifier of a method's return value or a local.</summary> </TypeComment> <Kind Name="RefType"/> <Field Name="RefKeyword" Type="SyntaxToken"> <Kind Name="RefKeyword"/> </Field> <Field Name="ReadOnlyKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="ReadOnlyKeyword"/> <PropertyComment> <summary>Gets the optional "readonly" keyword.</summary> </PropertyComment> </Field> <Field Name="Type" Type="TypeSyntax"/> </Node> <!-- Expressions --> <AbstractNode Name="ExpressionOrPatternSyntax" Base="CSharpSyntaxNode" /> <AbstractNode Name="ExpressionSyntax" Base="ExpressionOrPatternSyntax"> <TypeComment> <summary>Provides the base class from which the classes that represent expression syntax nodes are derived. This is an abstract class.</summary> </TypeComment> </AbstractNode> <Node Name="ParenthesizedExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="ParenthesizedExpression"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing the open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the expression enclosed within the parenthesis.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing the close parenthesis.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for parenthesized expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a ParenthesizedExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="TupleExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="TupleExpression"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing the open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Arguments" Type="SeparatedSyntaxList&lt;ArgumentSyntax&gt;" MinCount="2"> <PropertyComment> <summary>SeparatedSyntaxList of ArgumentSyntax representing the list of arguments.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing the close parenthesis.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for tuple expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a TupleExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="PrefixUnaryExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="UnaryPlusExpression"/> <Kind Name="UnaryMinusExpression"/> <Kind Name="BitwiseNotExpression"/> <Kind Name="LogicalNotExpression"/> <Kind Name="PreIncrementExpression"/> <Kind Name="PreDecrementExpression"/> <Kind Name="AddressOfExpression"/> <Kind Name="PointerIndirectionExpression"/> <Kind Name="IndexExpression"/> <Field Name="OperatorToken" Type="SyntaxToken"> <Kind Name="PlusToken"/> <Kind Name="MinusToken"/> <Kind Name="TildeToken"/> <Kind Name="ExclamationToken"/> <Kind Name="PlusPlusToken"/> <Kind Name="MinusMinusToken"/> <Kind Name="AmpersandToken"/> <Kind Name="AsteriskToken"/> <Kind Name="CaretToken"/>" <PropertyComment> <summary>SyntaxToken representing the kind of the operator of the prefix unary expression.</summary> </PropertyComment> </Field> <Field Name="Operand" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax representing the operand of the prefix unary expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for prefix unary expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a PrefixUnaryExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="AwaitExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="AwaitExpression"/> <Field Name="AwaitKeyword" Type="SyntaxToken"> <Kind Name="AwaitKeyword"/> <PropertyComment> <summary>SyntaxToken representing the kind "await" keyword.</summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax representing the operand of the "await" operator.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for an "await" expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an AwaitExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="PostfixUnaryExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="PostIncrementExpression"/> <Kind Name="PostDecrementExpression"/> <Kind Name="SuppressNullableWarningExpression"/> <Field Name="Operand" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax representing the operand of the postfix unary expression.</summary> </PropertyComment> </Field> <Field Name="OperatorToken" Type="SyntaxToken"> <Kind Name="PlusPlusToken"/> <Kind Name="MinusMinusToken"/> <Kind Name="ExclamationToken"/> <PropertyComment> <summary>SyntaxToken representing the kind of the operator of the postfix unary expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for postfix unary expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a PostfixUnaryExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="MemberAccessExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="SimpleMemberAccessExpression"/> <Kind Name="PointerMemberAccessExpression"/> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the object that the member belongs to.</summary> </PropertyComment> </Field> <Field Name="OperatorToken" Type="SyntaxToken"> <Kind Name="DotToken"/> <Kind Name="MinusGreaterThanToken"/> <PropertyComment> <summary>SyntaxToken representing the kind of the operator in the member access expression.</summary> </PropertyComment> </Field> <Field Name="Name" Type="SimpleNameSyntax"> <PropertyComment> <summary>SimpleNameSyntax node representing the member being accessed.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for member access expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a MemberAccessExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="ConditionalAccessExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="ConditionalAccessExpression"/> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the object conditionally accessed.</summary> </PropertyComment> </Field> <Field Name="OperatorToken" Type="SyntaxToken"> <Kind Name="QuestionToken"/> <PropertyComment> <summary>SyntaxToken representing the question mark.</summary> </PropertyComment> </Field> <Field Name="WhenNotNull" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the access expression to be executed when the object is not null.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for conditional access expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a ConditionalAccessExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="MemberBindingExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="MemberBindingExpression"/> <Field Name="OperatorToken" Type="SyntaxToken"> <Kind Name="DotToken"/> <PropertyComment> <summary>SyntaxToken representing dot.</summary> </PropertyComment> </Field> <Field Name="Name" Type="SimpleNameSyntax"> <PropertyComment> <summary>SimpleNameSyntax node representing the member being bound to.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for member binding expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a MemberBindingExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="ElementBindingExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="ElementBindingExpression"/> <Field Name="ArgumentList" Type="BracketedArgumentListSyntax"> <PropertyComment> <summary>BracketedArgumentListSyntax node representing the list of arguments of the element binding expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for element binding expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an ElementBindingExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="RangeExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="RangeExpression"/> <Field Name="LeftOperand" Type="ExpressionSyntax" Optional="true"> <PropertyComment> <summary>ExpressionSyntax node representing the expression on the left of the range operator.</summary> </PropertyComment> </Field> <Field Name="OperatorToken" Type="SyntaxToken"> <Kind Name="DotDotToken"/> <PropertyComment> <summary>SyntaxToken representing the operator of the range expression.</summary> </PropertyComment> </Field> <Field Name="RightOperand" Type="ExpressionSyntax" Optional="true"> <PropertyComment> <summary>ExpressionSyntax node representing the expression on the right of the range operator.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for a range expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an RangeExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="ImplicitElementAccessSyntax" Base="ExpressionSyntax"> <Kind Name="ImplicitElementAccess"/> <Field Name="ArgumentList" Type="BracketedArgumentListSyntax"> <PropertyComment> <summary>BracketedArgumentListSyntax node representing the list of arguments of the implicit element access expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for implicit element access expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an ImplicitElementAccessSyntax node.</summary> </FactoryComment> </Node> <Node Name="BinaryExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="AddExpression"/> <Kind Name="SubtractExpression"/> <Kind Name="MultiplyExpression"/> <Kind Name="DivideExpression"/> <Kind Name="ModuloExpression"/> <Kind Name="LeftShiftExpression"/> <Kind Name="RightShiftExpression"/> <Kind Name="LogicalOrExpression"/> <Kind Name="LogicalAndExpression"/> <Kind Name="BitwiseOrExpression"/> <Kind Name="BitwiseAndExpression"/> <Kind Name="ExclusiveOrExpression"/> <Kind Name="EqualsExpression"/> <Kind Name="NotEqualsExpression"/> <Kind Name="LessThanExpression"/> <Kind Name="LessThanOrEqualExpression"/> <Kind Name="GreaterThanExpression"/> <Kind Name="GreaterThanOrEqualExpression"/> <Kind Name="IsExpression"/> <Kind Name="AsExpression"/> <Kind Name="CoalesceExpression"/> <Field Name="Left" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the expression on the left of the binary operator.</summary> </PropertyComment> </Field> <Field Name="OperatorToken" Type="SyntaxToken"> <Kind Name="PlusToken"/> <Kind Name="MinusToken"/> <Kind Name="AsteriskToken"/> <Kind Name="SlashToken"/> <Kind Name="PercentToken"/> <Kind Name="LessThanLessThanToken"/> <Kind Name="GreaterThanGreaterThanToken"/> <Kind Name="BarBarToken"/> <Kind Name="AmpersandAmpersandToken"/> <Kind Name="BarToken"/> <Kind Name="AmpersandToken"/> <Kind Name="CaretToken"/> <Kind Name="EqualsEqualsToken"/> <Kind Name="ExclamationEqualsToken"/> <Kind Name="LessThanToken"/> <Kind Name="LessThanEqualsToken"/> <Kind Name="GreaterThanToken"/> <Kind Name="GreaterThanEqualsToken"/> <Kind Name="IsKeyword"/> <Kind Name="AsKeyword"/> <Kind Name="QuestionQuestionToken"/> <PropertyComment> <summary>SyntaxToken representing the operator of the binary expression.</summary> </PropertyComment> </Field> <Field Name="Right" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the expression on the right of the binary operator.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents an expression that has a binary operator.</summary> </TypeComment> <FactoryComment> <summary>Creates a BinaryExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="AssignmentExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="SimpleAssignmentExpression"/> <Kind Name="AddAssignmentExpression"/> <Kind Name="SubtractAssignmentExpression"/> <Kind Name="MultiplyAssignmentExpression"/> <Kind Name="DivideAssignmentExpression"/> <Kind Name="ModuloAssignmentExpression"/> <Kind Name="AndAssignmentExpression"/> <Kind Name="ExclusiveOrAssignmentExpression"/> <Kind Name="OrAssignmentExpression"/> <Kind Name="LeftShiftAssignmentExpression"/> <Kind Name="RightShiftAssignmentExpression"/> <Kind Name="CoalesceAssignmentExpression" /> <Field Name="Left" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the expression on the left of the assignment operator.</summary> </PropertyComment> </Field> <Field Name="OperatorToken" Type="SyntaxToken"> <Kind Name="EqualsToken"/> <Kind Name="PlusEqualsToken"/> <Kind Name="MinusEqualsToken"/> <Kind Name="AsteriskEqualsToken"/> <Kind Name="SlashEqualsToken"/> <Kind Name="PercentEqualsToken"/> <Kind Name="AmpersandEqualsToken"/> <Kind Name="CaretEqualsToken"/> <Kind Name="BarEqualsToken"/> <Kind Name="LessThanLessThanEqualsToken"/> <Kind Name="GreaterThanGreaterThanEqualsToken"/> <Kind Name="QuestionQuestionEqualsToken" /> <PropertyComment> <summary>SyntaxToken representing the operator of the assignment expression.</summary> </PropertyComment> </Field> <Field Name="Right" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the expression on the right of the assignment operator.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents an expression that has an assignment operator.</summary> </TypeComment> <FactoryComment> <summary>Creates an AssignmentExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="ConditionalExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="ConditionalExpression"/> <Field Name="Condition" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the condition of the conditional expression.</summary> </PropertyComment> </Field> <Field Name="QuestionToken" Type="SyntaxToken"> <Kind Name="QuestionToken"/> <PropertyComment> <summary>SyntaxToken representing the question mark.</summary> </PropertyComment> </Field> <Field Name="WhenTrue" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the expression to be executed when the condition is true.</summary> </PropertyComment> </Field> <Field Name="ColonToken" Type="SyntaxToken"> <Kind Name="ColonToken"/> <PropertyComment> <summary>SyntaxToken representing the colon.</summary> </PropertyComment> </Field> <Field Name="WhenFalse" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the expression to be executed when the condition is false.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for conditional expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a ConditionalExpressionSyntax node.</summary> </FactoryComment> </Node> <AbstractNode Name="InstanceExpressionSyntax" Base="ExpressionSyntax"> <TypeComment> <summary>Provides the base class from which the classes that represent instance expression syntax nodes are derived. This is an abstract class.</summary> </TypeComment> </AbstractNode> <Node Name="ThisExpressionSyntax" Base="InstanceExpressionSyntax"> <Kind Name="ThisExpression"/> <Field Name="Token" Type="SyntaxToken"> <Kind Name="ThisKeyword"/> <PropertyComment> <summary>SyntaxToken representing the this keyword.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for a this expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a ThisExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="BaseExpressionSyntax" Base="InstanceExpressionSyntax"> <Kind Name="BaseExpression"/> <Field Name="Token" Type="SyntaxToken"> <Kind Name="BaseKeyword"/> <PropertyComment> <summary>SyntaxToken representing the base keyword.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for a base expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a BaseExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="LiteralExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="ArgListExpression"/> <Kind Name="NumericLiteralExpression"/> <Kind Name="StringLiteralExpression"/> <Kind Name="CharacterLiteralExpression"/> <Kind Name="TrueLiteralExpression"/> <Kind Name="FalseLiteralExpression"/> <Kind Name="NullLiteralExpression"/> <Kind Name="DefaultLiteralExpression"/> <Field Name="Token" Type="SyntaxToken"> <Kind Name="ArgListKeyword"/> <Kind Name="NumericLiteralToken"/> <Kind Name="StringLiteralToken"/> <Kind Name="CharacterLiteralToken"/> <Kind Name="TrueKeyword"/> <Kind Name="FalseKeyword"/> <Kind Name="NullKeyword"/> <Kind Name="DefaultKeyword"/> <PropertyComment> <summary>SyntaxToken representing the keyword corresponding to the kind of the literal expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for a literal expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a LiteralExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="MakeRefExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="MakeRefExpression"/> <Field Name="Keyword" Type="SyntaxToken"> <Kind Name="MakeRefKeyword"/> <PropertyComment> <summary>SyntaxToken representing the MakeRefKeyword.</summary> </PropertyComment> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>Argument of the primary function.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing close parenthesis.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for MakeRef expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a MakeRefExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="RefTypeExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="RefTypeExpression"/> <Field Name="Keyword" Type="SyntaxToken"> <Kind Name="RefTypeKeyword"/> <PropertyComment> <summary>SyntaxToken representing the RefTypeKeyword.</summary> </PropertyComment> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>Argument of the primary function.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing close parenthesis.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for RefType expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a RefTypeExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="RefValueExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="RefValueExpression"/> <Field Name="Keyword" Type="SyntaxToken"> <Kind Name="RefValueKeyword"/> <PropertyComment> <summary>SyntaxToken representing the RefValueKeyword.</summary> </PropertyComment> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>Typed reference expression.</summary> </PropertyComment> </Field> <Field Name="Comma" Type="SyntaxToken"> <Kind Name="CommaToken"/> <PropertyComment> <summary>Comma separating the arguments.</summary> </PropertyComment> </Field> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>The type of the value.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing close parenthesis.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for RefValue expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a RefValueExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="CheckedExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="CheckedExpression"/> <Kind Name="UncheckedExpression"/> <Field Name="Keyword" Type="SyntaxToken"> <Kind Name="CheckedKeyword"/> <Kind Name="UncheckedKeyword"/> <PropertyComment> <summary>SyntaxToken representing the checked or unchecked keyword.</summary> </PropertyComment> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>Argument of the primary function.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing close parenthesis.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for Checked or Unchecked expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a CheckedExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="DefaultExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="DefaultExpression"/> <Field Name="Keyword" Type="SyntaxToken"> <Kind Name="DefaultKeyword"/> <PropertyComment> <summary>SyntaxToken representing the DefaultKeyword.</summary> </PropertyComment> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>Argument of the primary function.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing close parenthesis.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for Default expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a DefaultExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="TypeOfExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="TypeOfExpression"/> <Field Name="Keyword" Type="SyntaxToken"> <Kind Name="TypeOfKeyword"/> <PropertyComment> <summary>SyntaxToken representing the TypeOfKeyword.</summary> </PropertyComment> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>The expression to return type of.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing close parenthesis.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for TypeOf expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a TypeOfExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="SizeOfExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="SizeOfExpression"/> <Field Name="Keyword" Type="SyntaxToken"> <Kind Name="SizeOfKeyword"/> <PropertyComment> <summary>SyntaxToken representing the SizeOfKeyword.</summary> </PropertyComment> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>Argument of the primary function.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing close parenthesis.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for SizeOf expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a SizeOfExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="InvocationExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="InvocationExpression"/> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the expression part of the invocation.</summary> </PropertyComment> </Field> <Field Name="ArgumentList" Type="ArgumentListSyntax"> <PropertyComment> <summary>ArgumentListSyntax node representing the list of arguments of the invocation expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for invocation expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an InvocationExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="ElementAccessExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="ElementAccessExpression"/> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the expression which is accessing the element.</summary> </PropertyComment> </Field> <Field Name="ArgumentList" Type="BracketedArgumentListSyntax"> <PropertyComment> <summary>BracketedArgumentListSyntax node representing the list of arguments of the element access expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for element access expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an ElementAccessExpressionSyntax node.</summary> </FactoryComment> </Node> <AbstractNode Name="BaseArgumentListSyntax" Base="CSharpSyntaxNode"> <Field Name="Arguments" Type="SeparatedSyntaxList&lt;ArgumentSyntax&gt;"> <PropertyComment> <summary>SeparatedSyntaxList of ArgumentSyntax nodes representing the list of arguments.</summary> </PropertyComment> </Field> <TypeComment> <summary>Provides the base class from which the classes that represent argument list syntax nodes are derived. This is an abstract class.</summary> </TypeComment> </AbstractNode> <Node Name="ArgumentListSyntax" Base="BaseArgumentListSyntax"> <Kind Name="ArgumentList"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Arguments" Type="SeparatedSyntaxList&lt;ArgumentSyntax&gt;" Override="true"> <PropertyComment> <summary>SeparatedSyntaxList of ArgumentSyntax representing the list of arguments.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing close parenthesis.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for the list of arguments.</summary> </TypeComment> <FactoryComment> <summary>Creates an ArgumentListSyntax node.</summary> </FactoryComment> </Node> <Node Name="BracketedArgumentListSyntax" Base="BaseArgumentListSyntax"> <Kind Name="BracketedArgumentList"/> <Field Name="OpenBracketToken" Type="SyntaxToken"> <Kind Name="OpenBracketToken"/> <PropertyComment> <summary>SyntaxToken representing open bracket.</summary> </PropertyComment> </Field> <Field Name="Arguments" Type="SeparatedSyntaxList&lt;ArgumentSyntax&gt;" Override="true" MinCount="1"> <PropertyComment> <summary>SeparatedSyntaxList of ArgumentSyntax representing the list of arguments.</summary> </PropertyComment> </Field> <Field Name="CloseBracketToken" Type="SyntaxToken"> <Kind Name="CloseBracketToken"/> <PropertyComment> <summary>SyntaxToken representing close bracket.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for bracketed argument list.</summary> </TypeComment> <FactoryComment> <summary>Creates a BracketedArgumentListSyntax node.</summary> </FactoryComment> </Node> <Node Name="ArgumentSyntax" Base="CSharpSyntaxNode"> <Kind Name="Argument"/> <Field Name="NameColon" Type="NameColonSyntax" Optional="true"> <PropertyComment> <summary>NameColonSyntax node representing the optional name arguments.</summary> </PropertyComment> </Field> <Field Name="RefKindKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="RefKeyword"/> <Kind Name="OutKeyword"/> <Kind Name="InKeyword"/> <PropertyComment> <summary>SyntaxToken representing the optional ref or out keyword.</summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the argument.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for argument.</summary> </TypeComment> <FactoryComment> <summary>Creates an ArgumentSyntax node.</summary> </FactoryComment> </Node> <AbstractNode Name="BaseExpressionColonSyntax" Base="CSharpSyntaxNode"> <Field Name="Expression" Type="ExpressionSyntax"/> <Field Name="ColonToken" Type="SyntaxToken"> <Kind Name="ColonToken"/> </Field> </AbstractNode> <Node Name="ExpressionColonSyntax" Base="BaseExpressionColonSyntax"> <Kind Name="ExpressionColon"/> <Field Name="Expression" Type="ExpressionSyntax" Override="true"/> <Field Name="ColonToken" Type="SyntaxToken" Override="true"/> </Node> <Node Name="NameColonSyntax" Base="BaseExpressionColonSyntax"> <Kind Name="NameColon"/> <Field Name="Name" Type="IdentifierNameSyntax"> <Kind Name="IdentifierName"/> <PropertyComment> <summary>IdentifierNameSyntax representing the identifier name.</summary> </PropertyComment> </Field> <Field Name="ColonToken" Type="SyntaxToken" Override="true"> <PropertyComment> <summary>SyntaxToken representing colon.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for name colon syntax.</summary> </TypeComment> <FactoryComment> <summary>Creates a NameColonSyntax node.</summary> </FactoryComment> </Node> <Node Name="DeclarationExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="DeclarationExpression"/> <Field Name="Type" Type="TypeSyntax"/> <Field Name="Designation" Type="VariableDesignationSyntax"> <PropertyComment> <summary>Declaration representing the variable declared in an out parameter or deconstruction.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for the variable declaration in an out var declaration or a deconstruction declaration.</summary> </TypeComment> <FactoryComment> <summary>Creates a DeclarationExpression node.</summary> </FactoryComment> </Node> <Node Name="CastExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="CastExpression"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing the open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>TypeSyntax node representing the type to which the expression is being cast.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing the close parenthesis.</summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the expression that is being casted.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for cast expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a CastExpressionSyntax node.</summary> </FactoryComment> </Node> <AbstractNode Name="AnonymousFunctionExpressionSyntax" Base="ExpressionSyntax"> <TypeComment> <summary>Provides the base class from which the classes that represent anonymous function expressions are derived.</summary> </TypeComment> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;"/> <Choice> <Field Name="Block" Type="BlockSyntax"> <PropertyComment> <summary> BlockSyntax node representing the body of the anonymous function. Only one of Block or ExpressionBody will be non-null. </summary> </PropertyComment> </Field> <Field Name="ExpressionBody" Type="ExpressionSyntax"> <PropertyComment> <summary> ExpressionSyntax node representing the body of the anonymous function. Only one of Block or ExpressionBody will be non-null. </summary> </PropertyComment> </Field> </Choice> </AbstractNode> <Node Name="AnonymousMethodExpressionSyntax" Base="AnonymousFunctionExpressionSyntax" SkipConvenienceFactories="true"> <Kind Name="AnonymousMethodExpression"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="DelegateKeyword" Type="SyntaxToken"> <Kind Name="DelegateKeyword"/> <PropertyComment> <summary>SyntaxToken representing the delegate keyword.</summary> </PropertyComment> </Field> <Field Name="ParameterList" Type="ParameterListSyntax" Optional="true"> <PropertyComment> <summary>List of parameters of the anonymous method expression, or null if there no parameters are specified.</summary> </PropertyComment> </Field> <Field Name="Block" Type="BlockSyntax" Override="true"> <PropertyComment> <summary> BlockSyntax node representing the body of the anonymous function. This will never be null. </summary> </PropertyComment> </Field> <Field Name="ExpressionBody" Type="ExpressionSyntax" Optional="true" Override="true"> <PropertyComment> <summary> Inherited from AnonymousFunctionExpressionSyntax, but not used for AnonymousMethodExpressionSyntax. This will always be null. </summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for anonymous method expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an AnonymousMethodExpressionSyntax node.</summary> </FactoryComment> </Node> <AbstractNode Name="LambdaExpressionSyntax" Base="AnonymousFunctionExpressionSyntax"> <TypeComment> <summary>Provides the base class from which the classes that represent lambda expressions are derived.</summary> </TypeComment> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;"/> <Field Name="ArrowToken" Type="SyntaxToken"> <!-- should be EqualsGreaterThanToken --> <Kind Name="EqualsGreaterThanToken"/> <PropertyComment> <summary>SyntaxToken representing equals greater than.</summary> </PropertyComment> </Field> </AbstractNode> <Node Name="SimpleLambdaExpressionSyntax" Base="LambdaExpressionSyntax"> <Kind Name="SimpleLambdaExpression"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="Parameter" Type="ParameterSyntax"> <Kind Name="Parameter"/> <PropertyComment> <summary>ParameterSyntax node representing the parameter of the lambda expression.</summary> </PropertyComment> </Field> <Field Name="ArrowToken" Type="SyntaxToken" Override="true"> <!-- should be EqualsGreaterThanToken --> <Kind Name="EqualsGreaterThanToken"/> <PropertyComment> <summary>SyntaxToken representing equals greater than.</summary> </PropertyComment> </Field> <Choice> <Field Name="Block" Type="BlockSyntax" Override="true"> <PropertyComment> <summary> BlockSyntax node representing the body of the lambda. Only one of Block or ExpressionBody will be non-null. </summary> </PropertyComment> </Field> <Field Name="ExpressionBody" Type="ExpressionSyntax" Override="true"> <PropertyComment> <summary> ExpressionSyntax node representing the body of the lambda. Only one of Block or ExpressionBody will be non-null. </summary> </PropertyComment> </Field> </Choice> <TypeComment> <summary>Class which represents the syntax node for a simple lambda expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a SimpleLambdaExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="RefExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="RefExpression"/> <Field Name="RefKeyword" Type="SyntaxToken"> <Kind Name="RefKeyword"/> </Field> <Field Name="Expression" Type="ExpressionSyntax"/> </Node> <Node Name="ParenthesizedLambdaExpressionSyntax" Base="LambdaExpressionSyntax"> <Kind Name="ParenthesizedLambdaExpression"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="ReturnType" Type="TypeSyntax" Optional="true"/> <Field Name="ParameterList" Type="ParameterListSyntax"> <PropertyComment> <summary>ParameterListSyntax node representing the list of parameters for the lambda expression.</summary> </PropertyComment> </Field> <Field Name="ArrowToken" Type="SyntaxToken" Override="true"> <!-- should be EqualsGreaterThanToken --> <Kind Name="EqualsGreaterThanToken"/> <PropertyComment> <summary>SyntaxToken representing equals greater than.</summary> </PropertyComment> </Field> <Choice> <Field Name="Block" Type="BlockSyntax" Override="true"> <PropertyComment> <summary> BlockSyntax node representing the body of the lambda. Only one of Block or ExpressionBody will be non-null. </summary> </PropertyComment> </Field> <Field Name="ExpressionBody" Type="ExpressionSyntax" Override="true"> <PropertyComment> <summary> ExpressionSyntax node representing the body of the lambda. Only one of Block or ExpressionBody will be non-null. </summary> </PropertyComment> </Field> </Choice> <TypeComment> <summary>Class which represents the syntax node for parenthesized lambda expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a ParenthesizedLambdaExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="InitializerExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="ObjectInitializerExpression"/> <Kind Name="CollectionInitializerExpression"/> <Kind Name="ArrayInitializerExpression"/> <Kind Name="ComplexElementInitializerExpression"/> <Kind Name="WithInitializerExpression" /> <Field Name="OpenBraceToken" Type="SyntaxToken"> <Kind Name="OpenBraceToken"/> <PropertyComment> <summary>SyntaxToken representing the open brace.</summary> </PropertyComment> </Field> <Field Name="Expressions" Type="SeparatedSyntaxList&lt;ExpressionSyntax&gt;" AllowTrailingSeparator="true"> <PropertyComment> <summary>SeparatedSyntaxList of ExpressionSyntax representing the list of expressions in the initializer expression.</summary> </PropertyComment> </Field> <Field Name="CloseBraceToken" Type="SyntaxToken"> <Kind Name="CloseBraceToken"/> <PropertyComment> <summary>SyntaxToken representing the close brace.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for initializer expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an InitializerExpressionSyntax node.</summary> </FactoryComment> </Node> <AbstractNode Name="BaseObjectCreationExpressionSyntax" Base="ExpressionSyntax"> <Field Name="NewKeyword" Type="SyntaxToken"> <Kind Name="NewKeyword"/> <PropertyComment> <summary>SyntaxToken representing the new keyword.</summary> </PropertyComment> </Field> <Field Name="ArgumentList" Type="ArgumentListSyntax" Optional="true"> <PropertyComment> <summary>ArgumentListSyntax representing the list of arguments passed as part of the object creation expression.</summary> </PropertyComment> </Field> <Field Name="Initializer" Type="InitializerExpressionSyntax" Optional="true"> <PropertyComment> <summary>InitializerExpressionSyntax representing the initializer expression for the object being created.</summary> </PropertyComment> </Field> </AbstractNode> <Node Name="ImplicitObjectCreationExpressionSyntax" Base="BaseObjectCreationExpressionSyntax"> <Kind Name="ImplicitObjectCreationExpression"/> <Field Name="NewKeyword" Type="SyntaxToken" Override="true"> <Kind Name="NewKeyword"/> <PropertyComment> <summary>SyntaxToken representing the new keyword.</summary> </PropertyComment> </Field> <Field Name="ArgumentList" Type="ArgumentListSyntax" Optional="false" Override="true"> <PropertyComment> <summary>ArgumentListSyntax representing the list of arguments passed as part of the object creation expression.</summary> </PropertyComment> </Field> <Field Name="Initializer" Type="InitializerExpressionSyntax" Optional="true" Override="true"> <PropertyComment> <summary>InitializerExpressionSyntax representing the initializer expression for the object being created.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for implicit object creation expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an ImplicitObjectCreationExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="ObjectCreationExpressionSyntax" Base="BaseObjectCreationExpressionSyntax"> <Kind Name="ObjectCreationExpression"/> <Field Name="NewKeyword" Type="SyntaxToken" Override="true"> <Kind Name="NewKeyword"/> <PropertyComment> <summary>SyntaxToken representing the new keyword.</summary> </PropertyComment> </Field> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>TypeSyntax representing the type of the object being created.</summary> </PropertyComment> </Field> <Field Name="ArgumentList" Type="ArgumentListSyntax" Optional="true" Override="true"> <PropertyComment> <summary>ArgumentListSyntax representing the list of arguments passed as part of the object creation expression.</summary> </PropertyComment> </Field> <Field Name="Initializer" Type="InitializerExpressionSyntax" Optional="true" Override="true"> <PropertyComment> <summary>InitializerExpressionSyntax representing the initializer expression for the object being created.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for object creation expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an ObjectCreationExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="WithExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="WithExpression"/> <Field Name="Expression" Type="ExpressionSyntax" /> <Field Name="WithKeyword" Type="SyntaxToken"> <Kind Name="WithKeyword" /> </Field> <Field Name="Initializer" Type="InitializerExpressionSyntax"> <PropertyComment> <summary>InitializerExpressionSyntax representing the initializer expression for the with expression.</summary> </PropertyComment> </Field> </Node> <Node Name="AnonymousObjectMemberDeclaratorSyntax" Base="CSharpSyntaxNode"> <Kind Name="AnonymousObjectMemberDeclarator"/> <Field Name="NameEquals" Type="NameEqualsSyntax" Optional="true"> <PropertyComment> <summary>NameEqualsSyntax representing the optional name of the member being initialized.</summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax representing the value the member is initialized with.</summary> </PropertyComment> </Field> <FactoryComment> <summary>Creates an AnonymousObjectMemberDeclaratorSyntax node.</summary> </FactoryComment> </Node> <Node Name="AnonymousObjectCreationExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="AnonymousObjectCreationExpression"/> <Field Name="NewKeyword" Type="SyntaxToken"> <Kind Name="NewKeyword"/> <PropertyComment> <summary>SyntaxToken representing the new keyword.</summary> </PropertyComment> </Field> <Field Name="OpenBraceToken" Type="SyntaxToken"> <Kind Name="OpenBraceToken"/> <PropertyComment> <summary>SyntaxToken representing the open brace.</summary> </PropertyComment> </Field> <Field Name="Initializers" Type="SeparatedSyntaxList&lt;AnonymousObjectMemberDeclaratorSyntax&gt;" AllowTrailingSeparator="true"> <PropertyComment> <summary>SeparatedSyntaxList of AnonymousObjectMemberDeclaratorSyntax representing the list of object member initializers.</summary> </PropertyComment> </Field> <Field Name="CloseBraceToken" Type="SyntaxToken"> <Kind Name="CloseBraceToken"/> <PropertyComment> <summary>SyntaxToken representing the close brace.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for anonymous object creation expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an AnonymousObjectCreationExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="ArrayCreationExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="ArrayCreationExpression"/> <Field Name="NewKeyword" Type="SyntaxToken"> <Kind Name="NewKeyword"/> <PropertyComment> <summary>SyntaxToken representing the new keyword.</summary> </PropertyComment> </Field> <Field Name="Type" Type="ArrayTypeSyntax"> <PropertyComment> <summary>ArrayTypeSyntax node representing the type of the array.</summary> </PropertyComment> </Field> <Field Name="Initializer" Type="InitializerExpressionSyntax" Optional="true"> <PropertyComment> <summary>InitializerExpressionSyntax node representing the initializer of the array creation expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for array creation expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an ArrayCreationExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="ImplicitArrayCreationExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="ImplicitArrayCreationExpression"/> <Field Name="NewKeyword" Type="SyntaxToken"> <Kind Name="NewKeyword"/> <PropertyComment> <summary>SyntaxToken representing the new keyword.</summary> </PropertyComment> </Field> <Field Name="OpenBracketToken" Type="SyntaxToken"> <Kind Name="OpenBracketToken"/> <PropertyComment> <summary>SyntaxToken representing the open bracket.</summary> </PropertyComment> </Field> <Field Name="Commas" Type="SyntaxList&lt;SyntaxToken&gt;"> <PropertyComment> <summary>SyntaxList of SyntaxToken representing the commas in the implicit array creation expression.</summary> </PropertyComment> </Field> <Field Name="CloseBracketToken" Type="SyntaxToken"> <Kind Name="CloseBracketToken"/> <PropertyComment> <summary>SyntaxToken representing the close bracket.</summary> </PropertyComment> </Field> <Field Name="Initializer" Type="InitializerExpressionSyntax"> <PropertyComment> <summary>InitializerExpressionSyntax representing the initializer expression of the implicit array creation expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for implicit array creation expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an ImplicitArrayCreationExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="StackAllocArrayCreationExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="StackAllocArrayCreationExpression"/> <Field Name="StackAllocKeyword" Type="SyntaxToken"> <Kind Name="StackAllocKeyword"/> <PropertyComment> <summary>SyntaxToken representing the stackalloc keyword.</summary> </PropertyComment> </Field> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>TypeSyntax node representing the type of the stackalloc array.</summary> </PropertyComment> </Field> <Field Name="Initializer" Type="InitializerExpressionSyntax" Optional="true"> <PropertyComment> <summary>InitializerExpressionSyntax node representing the initializer of the stackalloc array creation expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for stackalloc array creation expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a StackAllocArrayCreationExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="ImplicitStackAllocArrayCreationExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="ImplicitStackAllocArrayCreationExpression"/> <Field Name="StackAllocKeyword" Type="SyntaxToken"> <Kind Name="StackAllocKeyword"/> <PropertyComment> <summary>SyntaxToken representing the stackalloc keyword.</summary> </PropertyComment> </Field> <Field Name="OpenBracketToken" Type="SyntaxToken"> <Kind Name="OpenBracketToken"/> <PropertyComment> <summary>SyntaxToken representing the open bracket.</summary> </PropertyComment> </Field> <Field Name="CloseBracketToken" Type="SyntaxToken"> <Kind Name="CloseBracketToken"/> <PropertyComment> <summary>SyntaxToken representing the close bracket.</summary> </PropertyComment> </Field> <Field Name="Initializer" Type="InitializerExpressionSyntax"> <PropertyComment> <summary>InitializerExpressionSyntax representing the initializer expression of the implicit stackalloc array creation expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for implicit stackalloc array creation expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an ImplicitStackAllocArrayCreationExpressionSyntax node.</summary> </FactoryComment> </Node> <AbstractNode Name="QueryClauseSyntax" Base="CSharpSyntaxNode"> </AbstractNode> <AbstractNode Name="SelectOrGroupClauseSyntax" Base="CSharpSyntaxNode"> </AbstractNode> <Node Name="QueryExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="QueryExpression"/> <Field Name="FromClause" Type="FromClauseSyntax"/> <Field Name="Body" Type="QueryBodySyntax"/> </Node> <Node Name="QueryBodySyntax" Base="CSharpSyntaxNode"> <Kind Name="QueryBody"/> <Field Name="Clauses" Type="SyntaxList&lt;QueryClauseSyntax&gt;" MinCount="1"/> <Field Name="SelectOrGroup" Type="SelectOrGroupClauseSyntax"/> <Field Name="Continuation" Type="QueryContinuationSyntax" Optional="true"/> </Node> <Node Name="FromClauseSyntax" Base="QueryClauseSyntax"> <Kind Name="FromClause"/> <Field Name="FromKeyword" Type="SyntaxToken"> <Kind Name="FromKeyword"/> </Field> <Field Name="Type" Type="TypeSyntax" Optional="true"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="InKeyword" Type="SyntaxToken"> <Kind Name="InKeyword"/> </Field> <Field Name="Expression" Type="ExpressionSyntax"/> </Node> <Node Name="LetClauseSyntax" Base="QueryClauseSyntax"> <Kind Name="LetClause"/> <Field Name="LetKeyword" Type="SyntaxToken"> <Kind Name="LetKeyword"/> </Field> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="EqualsToken" Type="SyntaxToken"> <Kind Name="EqualsToken"/> </Field> <Field Name="Expression" Type="ExpressionSyntax"/> </Node> <Node Name="JoinClauseSyntax" Base="QueryClauseSyntax"> <Kind Name="JoinClause"/> <Field Name="JoinKeyword" Type="SyntaxToken"> <Kind Name="JoinKeyword"/> </Field> <Field Name="Type" Type="TypeSyntax" Optional="true"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="InKeyword" Type="SyntaxToken"> <Kind Name="InKeyword"/> </Field> <Field Name="InExpression" Type="ExpressionSyntax"/> <Field Name="OnKeyword" Type="SyntaxToken"> <Kind Name="OnKeyword"/> </Field> <Field Name="LeftExpression" Type="ExpressionSyntax"/> <Field Name="EqualsKeyword" Type="SyntaxToken"> <Kind Name="EqualsKeyword"/> </Field> <Field Name="RightExpression" Type="ExpressionSyntax"/> <Field Name="Into" Type="JoinIntoClauseSyntax" Optional="true"/> </Node> <Node Name="JoinIntoClauseSyntax" Base="CSharpSyntaxNode"> <Kind Name="JoinIntoClause"/> <Field Name="IntoKeyword" Type="SyntaxToken"> <Kind Name="IntoKeyword"/> </Field> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> </Node> <Node Name="WhereClauseSyntax" Base="QueryClauseSyntax"> <Kind Name="WhereClause"/> <Field Name="WhereKeyword" Type="SyntaxToken"> <Kind Name="WhereKeyword"/> </Field> <Field Name="Condition" Type="ExpressionSyntax"/> </Node> <Node Name="OrderByClauseSyntax" Base="QueryClauseSyntax"> <Kind Name="OrderByClause"/> <Field Name="OrderByKeyword" Type="SyntaxToken"> <Kind Name="OrderByKeyword"/> </Field> <Field Name="Orderings" Type="SeparatedSyntaxList&lt;OrderingSyntax&gt;" MinCount="1"/> </Node> <Node Name="OrderingSyntax" Base="CSharpSyntaxNode"> <Kind Name="AscendingOrdering"/> <Kind Name="DescendingOrdering"/> <Field Name="Expression" Type="ExpressionSyntax"/> <Field Name="AscendingOrDescendingKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="AscendingKeyword"/> <Kind Name="DescendingKeyword"/> </Field> </Node> <Node Name="SelectClauseSyntax" Base="SelectOrGroupClauseSyntax"> <Kind Name="SelectClause"/> <Field Name="SelectKeyword" Type="SyntaxToken"> <Kind Name="SelectKeyword"/> </Field> <Field Name="Expression" Type="ExpressionSyntax"/> </Node> <Node Name="GroupClauseSyntax" Base="SelectOrGroupClauseSyntax"> <Kind Name="GroupClause"/> <Field Name="GroupKeyword" Type="SyntaxToken"> <Kind Name="GroupKeyword"/> </Field> <Field Name="GroupExpression" Type="ExpressionSyntax"/> <Field Name="ByKeyword" Type="SyntaxToken"> <Kind Name="ByKeyword"/> </Field> <Field Name="ByExpression" Type="ExpressionSyntax"/> </Node> <Node Name="QueryContinuationSyntax" Base="CSharpSyntaxNode"> <Kind Name="QueryContinuation"/> <Field Name="IntoKeyword" Type="SyntaxToken"> <Kind Name="IntoKeyword"/> </Field> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="Body" Type="QueryBodySyntax"/> </Node> <Node Name="OmittedArraySizeExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="OmittedArraySizeExpression"/> <Field Name="OmittedArraySizeExpressionToken" Type="SyntaxToken"> <Kind Name="OmittedArraySizeExpressionToken"/> <PropertyComment> <summary>SyntaxToken representing the omitted array size expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents a placeholder in an array size list.</summary> </TypeComment> <FactoryComment> <summary>Creates an OmittedArraySizeExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="InterpolatedStringExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="InterpolatedStringExpression"/> <Field Name="StringStartToken" Type="SyntaxToken"> <Kind Name="InterpolatedStringStartToken"/> <Kind Name="InterpolatedVerbatimStringStartToken"/> <PropertyComment> <summary>The first part of an interpolated string, $" or $@"</summary> </PropertyComment> </Field> <Field Name="Contents" Type="SyntaxList&lt;InterpolatedStringContentSyntax&gt;" > <PropertyComment> <summary>List of parts of the interpolated string, each one is either a literal part or an interpolation.</summary> </PropertyComment> </Field> <Field Name="StringEndToken" Type="SyntaxToken"> <Kind Name="InterpolatedStringEndToken"/> <PropertyComment> <summary>The closing quote of the interpolated string.</summary> </PropertyComment> </Field> </Node> <Node Name="IsPatternExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="IsPatternExpression"/> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the expression on the left of the "is" operator.</summary> </PropertyComment> </Field> <Field Name="IsKeyword" Type="SyntaxToken"> <Kind Name="IsKeyword"/> </Field> <Field Name="Pattern" Type="PatternSyntax"> <PropertyComment> <summary>PatternSyntax node representing the pattern on the right of the "is" operator.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents a simple pattern-matching expression using the "is" keyword.</summary> </TypeComment> <FactoryComment> <summary>Creates an IsPatternExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="ThrowExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="ThrowExpression" /> <Field Name="ThrowKeyword" Type="SyntaxToken" Optional="false"> <Kind Name="ThrowKeyword"/> </Field> <Field Name="Expression" Type="ExpressionSyntax" Optional="false"/> </Node> <Node Name="WhenClauseSyntax" Base="CSharpSyntaxNode"> <Kind Name="WhenClause" /> <Field Name="WhenKeyword" Type="SyntaxToken"> <Kind Name="WhenKeyword"/> </Field> <Field Name="Condition" Type="ExpressionSyntax"/> </Node> <AbstractNode Name="PatternSyntax" Base="ExpressionOrPatternSyntax" /> <Node Name="DiscardPatternSyntax" Base="PatternSyntax"> <Kind Name="DiscardPattern" /> <Field Name="UnderscoreToken" Type="SyntaxToken"> <Kind Name="UnderscoreToken"/> </Field> </Node> <Node Name="DeclarationPatternSyntax" Base="PatternSyntax"> <Kind Name="DeclarationPattern" /> <Field Name="Type" Type="TypeSyntax"/> <Field Name="Designation" Type="VariableDesignationSyntax"> <Kind Name="SingleVariableDesignation"/> <Kind Name="DiscardDesignation"/> </Field> </Node> <Node Name="VarPatternSyntax" Base="PatternSyntax"> <Kind Name="VarPattern" /> <Field Name="VarKeyword" Type="SyntaxToken"> <Kind Name="VarKeyword"/> </Field> <Field Name="Designation" Type="VariableDesignationSyntax"/> </Node> <Node Name="RecursivePatternSyntax" Base="PatternSyntax"> <Kind Name="RecursivePattern" /> <Field Name="Type" Type="TypeSyntax" Optional="true" /> <Field Name="PositionalPatternClause" Type="PositionalPatternClauseSyntax" Optional="true" /> <Field Name="PropertyPatternClause" Type="PropertyPatternClauseSyntax" Optional="true" /> <Field Name="Designation" Type="VariableDesignationSyntax" Optional="true"> <Kind Name="SingleVariableDesignation"/> <Kind Name="DiscardDesignation"/> </Field> </Node> <Node Name="PositionalPatternClauseSyntax" Base="CSharpSyntaxNode"> <Kind Name="PositionalPatternClause"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <Field Name="Subpatterns" Type="SeparatedSyntaxList&lt;SubpatternSyntax&gt;"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> </Node> <Node Name="PropertyPatternClauseSyntax" Base="CSharpSyntaxNode"> <Kind Name="PropertyPatternClause"/> <Field Name="OpenBraceToken" Type="SyntaxToken"> <Kind Name="OpenBraceToken"/> </Field> <Field Name="Subpatterns" Type="SeparatedSyntaxList&lt;SubpatternSyntax&gt;" AllowTrailingSeparator="true"/> <Field Name="CloseBraceToken" Type="SyntaxToken"> <Kind Name="CloseBraceToken"/> </Field> </Node> <Node Name="SubpatternSyntax" Base="CSharpSyntaxNode"> <Kind Name="Subpattern"/> <Field Name="ExpressionColon" Type="BaseExpressionColonSyntax" Optional="true"/> <Field Name="Pattern" Type="PatternSyntax" /> </Node> <Node Name="ConstantPatternSyntax" Base="PatternSyntax"> <Kind Name="ConstantPattern"/> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the constant expression.</summary> </PropertyComment> </Field> </Node> <!-- Pattern forms added for C# 9.0 --> <Node Name="ParenthesizedPatternSyntax" Base="PatternSyntax"> <Kind Name="ParenthesizedPattern"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <Field Name="Pattern" Type="PatternSyntax" /> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> </Node> <Node Name="RelationalPatternSyntax" Base="PatternSyntax"> <Kind Name="RelationalPattern"/> <Field Name="OperatorToken" Type="SyntaxToken"> <Kind Name="EqualsEqualsToken"/> <Kind Name="ExclamationEqualsToken"/> <Kind Name="LessThanToken"/> <Kind Name="LessThanEqualsToken"/> <Kind Name="GreaterThanToken"/> <Kind Name="GreaterThanEqualsToken"/> <PropertyComment> <summary>SyntaxToken representing the operator of the relational pattern.</summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax" /> </Node> <Node Name="TypePatternSyntax" Base="PatternSyntax"> <Kind Name="TypePattern"/> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>The type for the type pattern.</summary> </PropertyComment> </Field> </Node> <Node Name="BinaryPatternSyntax" Base="PatternSyntax"> <Kind Name="OrPattern"/> <Kind Name="AndPattern"/> <Field Name="Left" Type="PatternSyntax" /> <Field Name="OperatorToken" Type="SyntaxToken"> <Kind Name="OrKeyword"/> <Kind Name="AndKeyword"/> </Field> <Field Name="Right" Type="PatternSyntax" /> </Node> <Node Name="UnaryPatternSyntax" Base="PatternSyntax"> <Kind Name="NotPattern"/> <Field Name="OperatorToken" Type="SyntaxToken"> <Kind Name="NotKeyword"/> </Field> <Field Name="Pattern" Type="PatternSyntax" /> </Node> <AbstractNode Name="InterpolatedStringContentSyntax" Base="CSharpSyntaxNode" /> <Node Name="InterpolatedStringTextSyntax" Base="InterpolatedStringContentSyntax"> <Kind Name="InterpolatedStringText"/> <Field Name="TextToken" Type="SyntaxToken"> <Kind Name="InterpolatedStringTextToken"/> <PropertyComment> <summary>The text contents of a part of the interpolated string.</summary> </PropertyComment> </Field> </Node> <Node Name="InterpolationSyntax" Base="InterpolatedStringContentSyntax"> <Kind Name="Interpolation"/> <Field Name="OpenBraceToken" Type="SyntaxToken"> <Kind Name="OpenBraceToken"/> </Field> <Field Name="Expression" Type="ExpressionSyntax"/> <Field Name="AlignmentClause" Type="InterpolationAlignmentClauseSyntax" Optional="true"/> <Field Name="FormatClause" Type="InterpolationFormatClauseSyntax" Optional="true"/> <Field Name="CloseBraceToken" Type="SyntaxToken"> <Kind Name="CloseBraceToken"/> </Field> </Node> <Node Name="InterpolationAlignmentClauseSyntax" Base="CSharpSyntaxNode"> <Kind Name="InterpolationAlignmentClause"/> <Field Name="CommaToken" Type="SyntaxToken"/> <Field Name="Value" Type="ExpressionSyntax"/> </Node> <Node Name="InterpolationFormatClauseSyntax" Base="CSharpSyntaxNode"> <Kind Name="InterpolationFormatClause"/> <Field Name="ColonToken" Type="SyntaxToken"/> <Field Name="FormatStringToken" Type="SyntaxToken"> <Kind Name="InterpolatedStringTextToken"/> <PropertyComment> <summary>The text contents of the format specifier for an interpolation.</summary> </PropertyComment> </Field> </Node> <!-- Statements --> <Node Name="GlobalStatementSyntax" Base="MemberDeclarationSyntax"> <Kind Name="GlobalStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"> <summary>Always empty on a global statement.</summary> </Field> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"> <summary>Always empty on a global statement.</summary> </Field> <Field Name="Statement" Type="StatementSyntax"/> </Node> <AbstractNode Name="StatementSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Represents the base class for all statements syntax classes.</summary> </TypeComment> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;"/> </AbstractNode> <Node Name="BlockSyntax" Base="StatementSyntax"> <Kind Name="Block"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="OpenBraceToken" Type="SyntaxToken"> <Kind Name="OpenBraceToken"/> </Field> <Field Name="Statements" Type="SyntaxList&lt;StatementSyntax&gt;"/> <Field Name="CloseBraceToken" Type="SyntaxToken"> <Kind Name="CloseBraceToken"/> </Field> </Node> <Node Name="LocalFunctionStatementSyntax" Base="StatementSyntax"> <Kind Name="LocalFunctionStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;"/> <Field Name="ReturnType" Type="TypeSyntax"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="TypeParameterList" Type="TypeParameterListSyntax" Optional="true"/> <Field Name="ParameterList" Type="ParameterListSyntax"/> <Field Name="ConstraintClauses" Type="SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;"/> <Choice> <Field Name="Body" Type="BlockSyntax"/> <Sequence> <Field Name="ExpressionBody" Type="ArrowExpressionClauseSyntax"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the optional semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </Sequence> </Choice> </Node> <Node Name="LocalDeclarationStatementSyntax" Base="StatementSyntax"> <Kind Name="LocalDeclarationStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="AwaitKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="AwaitKeyword"/> </Field> <Field Name="UsingKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="UsingKeyword"/> </Field> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;"> <PropertyComment> <summary>Gets the modifier list.</summary> </PropertyComment> </Field> <Field Name="Declaration" Type="VariableDeclarationSyntax"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="VariableDeclarationSyntax" Base="CSharpSyntaxNode"> <Kind Name="VariableDeclaration"/> <Field Name="Type" Type="TypeSyntax"/> <Field Name="Variables" Type="SeparatedSyntaxList&lt;VariableDeclaratorSyntax&gt;" MinCount="1"/> </Node> <Node Name="VariableDeclaratorSyntax" Base="CSharpSyntaxNode"> <Kind Name="VariableDeclarator"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="ArgumentList" Type="BracketedArgumentListSyntax" Optional="true"/> <Field Name="Initializer" Type="EqualsValueClauseSyntax" Optional="true"/> </Node> <Node Name="EqualsValueClauseSyntax" Base="CSharpSyntaxNode"> <Kind Name="EqualsValueClause"/> <Field Name="EqualsToken" Type="SyntaxToken"> <Kind Name="EqualsToken"/> </Field> <Field Name="Value" Type="ExpressionSyntax"/> </Node> <AbstractNode Name="VariableDesignationSyntax" Base="CSharpSyntaxNode"> </AbstractNode> <Node Name="SingleVariableDesignationSyntax" Base="VariableDesignationSyntax"> <Kind Name="SingleVariableDesignation"/> <Field Name="Identifier" Type="SyntaxToken"> <Kind Name="IdentifierToken"/> </Field> </Node> <Node Name="DiscardDesignationSyntax" Base="VariableDesignationSyntax"> <Kind Name="DiscardDesignation"/> <Field Name="UnderscoreToken" Type="SyntaxToken"> <Kind Name="UnderscoreToken"/> </Field> </Node> <Node Name="ParenthesizedVariableDesignationSyntax" Base="VariableDesignationSyntax"> <Kind Name="ParenthesizedVariableDesignation"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <Field Name="Variables" Type="SeparatedSyntaxList&lt;VariableDesignationSyntax&gt;"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> </Node> <Node Name="ExpressionStatementSyntax" Base="StatementSyntax"> <Kind Name="ExpressionStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Expression" Type="ExpressionSyntax"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="EmptyStatementSyntax" Base="StatementSyntax"> <Kind Name="EmptyStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="LabeledStatementSyntax" Base="StatementSyntax"> <Kind Name="LabeledStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="ColonToken" Type="SyntaxToken"> <Kind Name="ColonToken"/> <PropertyComment> <summary>Gets a SyntaxToken that represents the colon following the statement's label.</summary> </PropertyComment> </Field> <Field Name="Statement" Type="StatementSyntax"/> <TypeComment> <summary>Represents a labeled statement syntax.</summary> </TypeComment> <FactoryComment> <summary>Creates a LabeledStatementSyntax node</summary> </FactoryComment> </Node> <Node Name="GotoStatementSyntax" Base="StatementSyntax"> <Kind Name="GotoStatement"/> <Kind Name="GotoCaseStatement"/> <Kind Name="GotoDefaultStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="GotoKeyword" Type="SyntaxToken"> <Kind Name="GotoKeyword"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the goto keyword. </summary> </PropertyComment> </Field> <Field Name="CaseOrDefaultKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="CaseKeyword"/> <Kind Name="DefaultKeyword"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the case or default keywords if any exists. </summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax" Optional="true"> <PropertyComment> <summary> Gets a constant expression for a goto case statement. </summary> </PropertyComment> </Field> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the semi-colon at the end of the statement. </summary> </PropertyComment> </Field> <TypeComment> <summary> Represents a goto statement syntax </summary> </TypeComment> <FactoryComment> <summary> Creates a GotoStatementSyntax node. </summary> </FactoryComment> </Node> <Node Name="BreakStatementSyntax" Base="StatementSyntax"> <Kind Name="BreakStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="BreakKeyword" Type="SyntaxToken"> <Kind Name="BreakKeyword"/> </Field> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="ContinueStatementSyntax" Base="StatementSyntax"> <Kind Name="ContinueStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="ContinueKeyword" Type="SyntaxToken"> <Kind Name="ContinueKeyword"/> </Field> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="ReturnStatementSyntax" Base="StatementSyntax"> <Kind Name="ReturnStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="ReturnKeyword" Type="SyntaxToken"> <Kind Name="ReturnKeyword"/> </Field> <Field Name="Expression" Type="ExpressionSyntax" Optional="true"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="ThrowStatementSyntax" Base="StatementSyntax"> <Kind Name="ThrowStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="ThrowKeyword" Type="SyntaxToken"> <Kind Name="ThrowKeyword"/> </Field> <Field Name="Expression" Type="ExpressionSyntax" Optional="true"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="YieldStatementSyntax" Base="StatementSyntax"> <Kind Name="YieldReturnStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Kind Name="YieldBreakStatement"/> <Field Name="YieldKeyword" Type="SyntaxToken"> <Kind Name="YieldKeyword"/> </Field> <Field Name="ReturnOrBreakKeyword" Type="SyntaxToken"> <Kind Name="ReturnKeyword"/> <Kind Name="BreakKeyword"/> </Field> <Field Name="Expression" Type="ExpressionSyntax" Optional="true"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="WhileStatementSyntax" Base="StatementSyntax"> <Kind Name="WhileStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="WhileKeyword" Type="SyntaxToken"> <Kind Name="WhileKeyword"/> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <Field Name="Condition" Type="ExpressionSyntax"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> <Field Name="Statement" Type="StatementSyntax"/> </Node> <Node Name="DoStatementSyntax" Base="StatementSyntax"> <Kind Name="DoStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="DoKeyword" Type="SyntaxToken"> <Kind Name="DoKeyword"/> </Field> <Field Name="Statement" Type="StatementSyntax"/> <Field Name="WhileKeyword" Type="SyntaxToken"> <Kind Name="WhileKeyword"/> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <Field Name="Condition" Type="ExpressionSyntax"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="ForStatementSyntax" Base="StatementSyntax"> <Kind Name="ForStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="ForKeyword" Type="SyntaxToken"> <Kind Name="ForKeyword"/> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <!-- Declaration and Initializers are mutually exclusive. --> <Choice> <Field Name="Declaration" Type="VariableDeclarationSyntax" Optional="true"/> <Field Name="Initializers" Type="SeparatedSyntaxList&lt;ExpressionSyntax&gt;"/> </Choice> <Field Name="FirstSemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> <Field Name="Condition" Type="ExpressionSyntax" Optional="true"/> <Field Name="SecondSemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> <Field Name="Incrementors" Type="SeparatedSyntaxList&lt;ExpressionSyntax&gt;"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> <Field Name="Statement" Type="StatementSyntax"/> </Node> <!-- Because there are two forms of the foreach loop, we make an abstract base. --> <AbstractNode Name="CommonForEachStatementSyntax" Base="StatementSyntax"> <Field Name="AwaitKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="AwaitKeyword"/> </Field> <Field Name="ForEachKeyword" Type="SyntaxToken"> <Kind Name="ForEachKeyword"/> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <!-- At this point one of two declaration forms appears --> <Field Name="InKeyword" Type="SyntaxToken"> <Kind Name="InKeyword"/> </Field> <Field Name="Expression" Type="ExpressionSyntax"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> <Field Name="Statement" Type="StatementSyntax"/> </AbstractNode> <Node Name="ForEachStatementSyntax" Base="CommonForEachStatementSyntax"> <!-- This is the existing C# 6 node. --> <Kind Name="ForEachStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="AwaitKeyword" Type="SyntaxToken" Optional="true" Override="true"> <Kind Name="AwaitKeyword"/> </Field> <Field Name="ForEachKeyword" Type="SyntaxToken" Override="true"> <Kind Name="ForEachKeyword"/> </Field> <Field Name="OpenParenToken" Type="SyntaxToken" Override="true"> <Kind Name="OpenParenToken"/> </Field> <Field Name="Type" Type="TypeSyntax"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="InKeyword" Type="SyntaxToken" Override="true"> <Kind Name="InKeyword"/> </Field> <Field Name="Expression" Type="ExpressionSyntax" Override="true"/> <Field Name="CloseParenToken" Type="SyntaxToken" Override="true"> <Kind Name="CloseParenToken"/> </Field> <Field Name="Statement" Type="StatementSyntax" Override="true"/> </Node> <!-- We name this "DeclarationForEachStatementSyntax" because it can express existing foreach loops. We may elect to represent all foreach loops using this node and deprecate (stop parsing into) the old one. --> <Node Name="ForEachVariableStatementSyntax" Base="CommonForEachStatementSyntax"> <Kind Name="ForEachVariableStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="AwaitKeyword" Type="SyntaxToken" Optional="true" Override="true"> <Kind Name="AwaitKeyword"/> </Field> <Field Name="ForEachKeyword" Type="SyntaxToken" Override="true"> <Kind Name="ForEachKeyword"/> </Field> <Field Name="OpenParenToken" Type="SyntaxToken" Override="true"> <Kind Name="OpenParenToken"/> </Field> <Field Name="Variable" Type="ExpressionSyntax"> <PropertyComment> <summary> The variable(s) of the loop. In correct code this is a tuple literal, declaration expression with a tuple designator, or a discard syntax in the form of a simple identifier. In broken code it could be something else. </summary> </PropertyComment> </Field> <Field Name="InKeyword" Type="SyntaxToken" Override="true"> <Kind Name="InKeyword"/> </Field> <Field Name="Expression" Type="ExpressionSyntax" Override="true"/> <Field Name="CloseParenToken" Type="SyntaxToken" Override="true"> <Kind Name="CloseParenToken"/> </Field> <Field Name="Statement" Type="StatementSyntax" Override="true"/> </Node> <!-- - using (...) { ... } - await using (...) { ... } --> <Node Name="UsingStatementSyntax" Base="StatementSyntax"> <Kind Name="UsingStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="AwaitKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="AwaitKeyword"/> </Field> <Field Name="UsingKeyword" Type="SyntaxToken"> <Kind Name="UsingKeyword"/> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <Choice> <Field Name="Declaration" Type="VariableDeclarationSyntax"/> <Field Name="Expression" Type="ExpressionSyntax"/> </Choice> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> <Field Name="Statement" Type="StatementSyntax"/> </Node> <Node Name="FixedStatementSyntax" Base="StatementSyntax"> <Kind Name="FixedStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="FixedKeyword" Type="SyntaxToken"> <Kind Name="FixedKeyword"/> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <Field Name="Declaration" Type="VariableDeclarationSyntax"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> <Field Name="Statement" Type="StatementSyntax"/> </Node> <Node Name="CheckedStatementSyntax" Base="StatementSyntax"> <Kind Name="CheckedStatement"/> <Kind Name="UncheckedStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Keyword" Type="SyntaxToken"> <Kind Name="CheckedKeyword"/> <Kind Name="UncheckedKeyword"/> </Field> <Field Name="Block" Type="BlockSyntax"/> </Node> <Node Name="UnsafeStatementSyntax" Base="StatementSyntax"> <Kind Name="UnsafeStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="UnsafeKeyword" Type="SyntaxToken"> <Kind Name="UnsafeKeyword"/> </Field> <Field Name="Block" Type="BlockSyntax"/> </Node> <Node Name="LockStatementSyntax" Base="StatementSyntax"> <Kind Name="LockStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="LockKeyword" Type="SyntaxToken"> <Kind Name="LockKeyword"/> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <Field Name="Expression" Type="ExpressionSyntax"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> <Field Name="Statement" Type="StatementSyntax"/> </Node> <Node Name="IfStatementSyntax" Base="StatementSyntax"> <Kind Name="IfStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="IfKeyword" Type="SyntaxToken"> <Kind Name="IfKeyword"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the if keyword. </summary> </PropertyComment> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the open parenthesis before the if statement's condition expression. </summary> </PropertyComment> </Field> <Field Name="Condition" Type="ExpressionSyntax"> <PropertyComment> <summary> Gets an ExpressionSyntax that represents the condition of the if statement. </summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the close parenthesis after the if statement's condition expression. </summary> </PropertyComment> </Field> <Field Name="Statement" Type="StatementSyntax"> <PropertyComment> <summary> Gets a StatementSyntax the represents the statement to be executed when the condition is true. </summary> </PropertyComment> </Field> <Field Name="Else" Type="ElseClauseSyntax" Optional="true"> <PropertyComment> <summary> Gets an ElseClauseSyntax that represents the statement to be executed when the condition is false if such statement exists. </summary> </PropertyComment> </Field> <TypeComment> <summary> Represents an if statement syntax. </summary> </TypeComment> <FactoryComment> <summary>Creates an IfStatementSyntax node</summary> </FactoryComment> </Node> <Node Name="ElseClauseSyntax" Base="CSharpSyntaxNode"> <Kind Name="ElseClause"/> <Field Name="ElseKeyword" Type="SyntaxToken"> <Kind Name="ElseKeyword"/> <PropertyComment> <summary> Gets a syntax token </summary> </PropertyComment> </Field> <Field Name="Statement" Type="StatementSyntax"/> <TypeComment> <summary>Represents an else statement syntax.</summary> </TypeComment> <FactoryComment> <summary>Creates a ElseClauseSyntax node</summary> </FactoryComment> </Node> <Node Name="SwitchStatementSyntax" Base="StatementSyntax" SkipConvenienceFactories="true"> <Kind Name="SwitchStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="SwitchKeyword" Type="SyntaxToken"> <Kind Name="SwitchKeyword"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the switch keyword. </summary> </PropertyComment> </Field> <Field Name="OpenParenToken" Type="SyntaxToken" Optional="true"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the open parenthesis preceding the switch governing expression. </summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary> Gets an ExpressionSyntax representing the expression of the switch statement. </summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken" Optional="true"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the close parenthesis following the switch governing expression. </summary> </PropertyComment> </Field> <Field Name="OpenBraceToken" Type="SyntaxToken"> <Kind Name="OpenBraceToken"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the open braces preceding the switch sections. </summary> </PropertyComment> </Field> <Field Name="Sections" Type="SyntaxList&lt;SwitchSectionSyntax&gt;"> <PropertyComment> <summary> Gets a SyntaxList of SwitchSectionSyntax's that represents the switch sections of the switch statement. </summary> </PropertyComment> </Field> <Field Name="CloseBraceToken" Type="SyntaxToken"> <Kind Name="CloseBraceToken"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the open braces following the switch sections. </summary> </PropertyComment> </Field> <TypeComment> <summary>Represents a switch statement syntax.</summary> </TypeComment> <FactoryComment> <summary>Creates a SwitchStatementSyntax node.</summary> </FactoryComment> </Node> <Node Name="SwitchSectionSyntax" Base="CSharpSyntaxNode"> <Kind Name="SwitchSection"/> <Field Name="Labels" Type="SyntaxList&lt;SwitchLabelSyntax&gt;" MinCount="1"> <PropertyComment> <summary> Gets a SyntaxList of SwitchLabelSyntax's the represents the possible labels that control can transfer to within the section. </summary> </PropertyComment> </Field> <Field Name="Statements" Type="SyntaxList&lt;StatementSyntax&gt;" MinCount="1"> <PropertyComment> <summary> Gets a SyntaxList of StatementSyntax's the represents the statements to be executed when control transfer to a label the belongs to the section. </summary> </PropertyComment> </Field> <TypeComment> <summary>Represents a switch section syntax of a switch statement.</summary> </TypeComment> <FactoryComment> <summary>Creates a SwitchSectionSyntax node.</summary> </FactoryComment> </Node> <AbstractNode Name="SwitchLabelSyntax" Base="CSharpSyntaxNode"> <Field Name="Keyword" Type="SyntaxToken"> <PropertyComment> <summary> Gets a SyntaxToken that represents a case or default keyword that belongs to a switch label. </summary> </PropertyComment> </Field> <Field Name="ColonToken" Type="SyntaxToken"> <Kind Name="ColonToken"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the colon that terminates the switch label. </summary> </PropertyComment> </Field> <TypeComment> <summary>Represents a switch label within a switch statement.</summary> </TypeComment> </AbstractNode> <Node Name="CasePatternSwitchLabelSyntax" Base="SwitchLabelSyntax"> <Kind Name="CasePatternSwitchLabel"/> <Field Name="Keyword" Type="SyntaxToken" Override="true"> <Kind Name="CaseKeyword"/> <PropertyComment> <summary>Gets the case keyword token.</summary> </PropertyComment> </Field> <Field Name="Pattern" Type="PatternSyntax"> <PropertyComment> <summary> Gets a PatternSyntax that represents the pattern that gets matched for the case label. </summary> </PropertyComment> </Field> <Field Name="WhenClause" Type="WhenClauseSyntax" Optional="true"/> <Field Name="ColonToken" Type="SyntaxToken" Override="true"/> <TypeComment> <summary>Represents a case label within a switch statement.</summary> </TypeComment> <FactoryComment> <summary>Creates a CaseMatchLabelSyntax node.</summary> </FactoryComment> </Node> <Node Name="CaseSwitchLabelSyntax" Base="SwitchLabelSyntax"> <Kind Name="CaseSwitchLabel"/> <Field Name="Keyword" Type="SyntaxToken" Override="true"> <Kind Name="CaseKeyword"/> <PropertyComment> <summary>Gets the case keyword token.</summary> </PropertyComment> </Field> <Field Name="Value" Type="ExpressionSyntax"> <PropertyComment> <summary> Gets an ExpressionSyntax that represents the constant expression that gets matched for the case label. </summary> </PropertyComment> </Field> <Field Name="ColonToken" Type="SyntaxToken" Override="true"/> <TypeComment> <summary>Represents a case label within a switch statement.</summary> </TypeComment> <FactoryComment> <summary>Creates a CaseSwitchLabelSyntax node.</summary> </FactoryComment> </Node> <Node Name="DefaultSwitchLabelSyntax" Base="SwitchLabelSyntax"> <Kind Name="DefaultSwitchLabel"/> <Field Name="Keyword" Type="SyntaxToken" Override="true"> <Kind Name="DefaultKeyword"/> <PropertyComment> <summary>Gets the default keyword token.</summary> </PropertyComment> </Field> <Field Name="ColonToken" Type="SyntaxToken" Override="true"/> <TypeComment> <summary>Represents a default label within a switch statement.</summary> </TypeComment> <FactoryComment> <summary>Creates a DefaultSwitchLabelSyntax node.</summary> </FactoryComment> </Node> <Node Name="SwitchExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="SwitchExpression"/> <Field Name="GoverningExpression" Type="ExpressionSyntax"/> <Field Name="SwitchKeyword" Type="SyntaxToken"> <Kind Name="SwitchKeyword"/> </Field> <Field Name="OpenBraceToken" Type="SyntaxToken"> <Kind Name="OpenBraceToken"/> </Field> <Field Name="Arms" Type="SeparatedSyntaxList&lt;SwitchExpressionArmSyntax&gt;" AllowTrailingSeparator="true"/> <Field Name="CloseBraceToken" Type="SyntaxToken"> <Kind Name="CloseBraceToken"/> </Field> </Node> <Node Name="SwitchExpressionArmSyntax" Base="CSharpSyntaxNode"> <Kind Name="SwitchExpressionArm"/> <Field Name="Pattern" Type="PatternSyntax"/> <Field Name="WhenClause" Type="WhenClauseSyntax" Optional="true"/> <Field Name="EqualsGreaterThanToken" Type="SyntaxToken"> <Kind Name="EqualsGreaterThanToken"/> </Field> <Field Name="Expression" Type="ExpressionSyntax"/> </Node> <Node Name="TryStatementSyntax" Base="StatementSyntax"> <Kind Name="TryStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="TryKeyword" Type="SyntaxToken"> <Kind Name="TryKeyword"/> </Field> <Field Name="Block" Type="BlockSyntax"/> <Field Name="Catches" Type="SyntaxList&lt;CatchClauseSyntax&gt;"/> <Field Name="Finally" Type="FinallyClauseSyntax" Optional="true"/> </Node> <Node Name="CatchClauseSyntax" Base="CSharpSyntaxNode"> <Kind Name="CatchClause"/> <Field Name="CatchKeyword" Type="SyntaxToken"> <Kind Name="CatchKeyword"/> </Field> <Field Name="Declaration" Type="CatchDeclarationSyntax" Optional="true"/> <Field Name="Filter" Type="CatchFilterClauseSyntax" Optional="true"/> <Field Name="Block" Type="BlockSyntax"/> </Node> <Node Name="CatchDeclarationSyntax" Base="CSharpSyntaxNode"> <Kind Name="CatchDeclaration"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <Field Name="Type" Type="TypeSyntax"/> <Field Name="Identifier" Type="SyntaxToken" Optional="true"> <Kind Name="IdentifierToken"/> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> </Node> <Node Name="CatchFilterClauseSyntax" Base="CSharpSyntaxNode"> <Kind Name="CatchFilterClause"/> <Field Name="WhenKeyword" Type="SyntaxToken"> <Kind Name="WhenKeyword"/> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <Field Name="FilterExpression" Type="ExpressionSyntax"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> </Node> <Node Name="FinallyClauseSyntax" Base="CSharpSyntaxNode"> <Kind Name="FinallyClause"/> <Field Name="FinallyKeyword" Type="SyntaxToken"> <Kind Name="FinallyKeyword"/> </Field> <Field Name="Block" Type="BlockSyntax"/> </Node> <!-- Declarations --> <Node Name="CompilationUnitSyntax" Base="CSharpSyntaxNode"> <Kind Name="CompilationUnit"/> <Field Name="Externs" Type="SyntaxList&lt;ExternAliasDirectiveSyntax&gt;"/> <Field Name="Usings" Type="SyntaxList&lt;UsingDirectiveSyntax&gt;"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;"> <PropertyComment> <summary>Gets the attribute declaration list.</summary> </PropertyComment> </Field> <Field Name="Members" Type="SyntaxList&lt;MemberDeclarationSyntax&gt;"/> <Field Name="EndOfFileToken" Type="SyntaxToken"> <Kind Name="EndOfFileToken"/> </Field> </Node> <Node Name="ExternAliasDirectiveSyntax" Base="CSharpSyntaxNode"> <Kind Name="ExternAliasDirective"/> <Field Name="ExternKeyword" Type="SyntaxToken"> <Kind Name="ExternKeyword"/> <PropertyComment> <summary>SyntaxToken representing the extern keyword.</summary> </PropertyComment> </Field> <Field Name="AliasKeyword" Type="SyntaxToken"> <Kind Name="AliasKeyword"/> <PropertyComment> <summary>SyntaxToken representing the alias keyword.</summary> </PropertyComment> </Field> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> <PropertyComment> <summary>SyntaxToken representing the semicolon token.</summary> </PropertyComment> </Field> <TypeComment> <summary> Represents an ExternAlias directive syntax, e.g. &quot;extern alias MyAlias;&quot; with specifying &quot;/r:MyAlias=SomeAssembly.dll &quot; on the compiler command line. </summary> </TypeComment> <FactoryComment> <summary>Creates an ExternAliasDirectiveSyntax node</summary> </FactoryComment> </Node> <Node Name="UsingDirectiveSyntax" Base="CSharpSyntaxNode"> <Kind Name="UsingDirective"/> <Field Name="GlobalKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="GlobalKeyword"/> </Field> <Field Name="UsingKeyword" Type="SyntaxToken"> <Kind Name="UsingKeyword"/> </Field> <Choice Optional="true"> <Field Name="StaticKeyword" Type="SyntaxToken"/> <Field Name="Alias" Type="NameEqualsSyntax"/> </Choice> <Field Name="Name" Type="NameSyntax"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Node> <AbstractNode Name="MemberDeclarationSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Member declaration syntax.</summary> </TypeComment> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;"> <PropertyComment> <summary>Gets the attribute declaration list.</summary> </PropertyComment> </Field> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;"> <PropertyComment> <summary>Gets the modifier list.</summary> </PropertyComment> </Field> </AbstractNode> <AbstractNode Name="BaseNamespaceDeclarationSyntax" Base="MemberDeclarationSyntax"> <Field Name="NamespaceKeyword" Type="SyntaxToken"> <Kind Name="NamespaceKeyword"/> </Field> <Field Name="Name" Type="NameSyntax"/> <Field Name="Externs" Type="SyntaxList&lt;ExternAliasDirectiveSyntax&gt;"/> <Field Name="Usings" Type="SyntaxList&lt;UsingDirectiveSyntax&gt;"/> <Field Name="Members" Type="SyntaxList&lt;MemberDeclarationSyntax&gt;"/> </AbstractNode> <Node Name="NamespaceDeclarationSyntax" Base="BaseNamespaceDeclarationSyntax"> <Kind Name="NamespaceDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="NamespaceKeyword" Type="SyntaxToken" Override="true"> <Kind Name="NamespaceKeyword"/> </Field> <Field Name="Name" Type="NameSyntax" Override="true"/> <Field Name="OpenBraceToken" Type="SyntaxToken"> <Kind Name="OpenBraceToken"/> </Field> <Field Name="Externs" Type="SyntaxList&lt;ExternAliasDirectiveSyntax&gt;" Override="true"/> <Field Name="Usings" Type="SyntaxList&lt;UsingDirectiveSyntax&gt;" Override="true"/> <Field Name="Members" Type="SyntaxList&lt;MemberDeclarationSyntax&gt;" Override="true"/> <Field Name="CloseBraceToken" Type="SyntaxToken"> <Kind Name="CloseBraceToken"/> </Field> <Field Name="SemicolonToken" Type="SyntaxToken" Optional="true"> <PropertyComment> <summary>Gets the optional semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="FileScopedNamespaceDeclarationSyntax" Base="BaseNamespaceDeclarationSyntax"> <Kind Name="FileScopedNamespaceDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="NamespaceKeyword" Type="SyntaxToken" Override="true"> <Kind Name="NamespaceKeyword"/> </Field> <Field Name="Name" Type="NameSyntax" Override="true"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> <Field Name="Externs" Type="SyntaxList&lt;ExternAliasDirectiveSyntax&gt;" Override="true"/> <Field Name="Usings" Type="SyntaxList&lt;UsingDirectiveSyntax&gt;" Override="true"/> <Field Name="Members" Type="SyntaxList&lt;MemberDeclarationSyntax&gt;" Override="true"/> </Node> <Node Name="AttributeListSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Class representing one or more attributes applied to a language construct.</summary> </TypeComment> <Kind Name="AttributeList"/> <Field Name="OpenBracketToken" Type="SyntaxToken"> <Kind Name="OpenBracketToken"/> <PropertyComment> <summary>Gets the open bracket token.</summary> </PropertyComment> </Field> <Field Name="Target" Type="AttributeTargetSpecifierSyntax" Optional="true"> <PropertyComment> <summary>Gets the optional construct targeted by the attribute.</summary> </PropertyComment> </Field> <Field Name="Attributes" Type="SeparatedSyntaxList&lt;AttributeSyntax&gt;" MinCount="1"> <PropertyComment> <summary>Gets the attribute declaration list.</summary> </PropertyComment> </Field> <Field Name="CloseBracketToken" Type="SyntaxToken"> <Kind Name="CloseBracketToken"/> <PropertyComment> <summary>Gets the close bracket token.</summary> </PropertyComment> </Field> </Node> <Node Name="AttributeTargetSpecifierSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Class representing what language construct an attribute targets.</summary> </TypeComment> <Kind Name="AttributeTargetSpecifier"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> </Field> <Field Name="ColonToken" Type="SyntaxToken"> <Kind Name="ColonToken"/> <PropertyComment> <summary>Gets the colon token.</summary> </PropertyComment> </Field> </Node> <Node Name="AttributeSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Attribute syntax.</summary> </TypeComment> <Kind Name="Attribute"/> <Field Name="Name" Type="NameSyntax"> <PropertyComment> <summary>Gets the name.</summary> </PropertyComment> </Field> <Field Name="ArgumentList" Type="AttributeArgumentListSyntax" Optional="true"/> </Node> <Node Name="AttributeArgumentListSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Attribute argument list syntax.</summary> </TypeComment> <Kind Name="AttributeArgumentList"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the open paren token.</summary> </PropertyComment> <Kind Name="OpenParenToken"/> </Field> <Field Name="Arguments" Type="SeparatedSyntaxList&lt;AttributeArgumentSyntax&gt;"> <PropertyComment> <summary>Gets the arguments syntax list.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the close paren token.</summary> </PropertyComment> <Kind Name="CloseParenToken"/> </Field> </Node> <Node Name="AttributeArgumentSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Attribute argument syntax.</summary> </TypeComment> <Kind Name="AttributeArgument"/> <Choice> <Field Name="NameEquals" Type="NameEqualsSyntax" Optional="true"/> <Field Name="NameColon" Type="NameColonSyntax" Optional="true"/> </Choice> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>Gets the expression.</summary> </PropertyComment> </Field> </Node> <Node Name="NameEqualsSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Class representing an identifier name followed by an equals token.</summary> </TypeComment> <Kind Name="NameEquals"/> <Field Name="Name" Type="IdentifierNameSyntax"> <PropertyComment> <summary>Gets the identifier name.</summary> </PropertyComment> <Kind Name="IdentifierName"/> </Field> <Field Name="EqualsToken" Type="SyntaxToken"> <Kind Name="EqualsToken"/> </Field> </Node> <Node Name="TypeParameterListSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Type parameter list syntax.</summary> </TypeComment> <Kind Name="TypeParameterList"/> <Field Name="LessThanToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the &lt; token.</summary> </PropertyComment> <Kind Name="LessThanToken"/> </Field> <Field Name="Parameters" Type="SeparatedSyntaxList&lt;TypeParameterSyntax&gt;" MinCount="1"> <PropertyComment> <summary>Gets the parameter list.</summary> </PropertyComment> </Field> <Field Name="GreaterThanToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the &gt; token.</summary> </PropertyComment> <Kind Name="GreaterThanToken"/> </Field> </Node> <Node Name="TypeParameterSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Type parameter syntax.</summary> </TypeComment> <Kind Name="TypeParameter"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;"> <PropertyComment> <summary>Gets the attribute declaration list.</summary> </PropertyComment> </Field> <Field Name="VarianceKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="InKeyword"/> <Kind Name="OutKeyword"/> </Field> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> </Node> <AbstractNode Name="BaseTypeDeclarationSyntax" Base="MemberDeclarationSyntax"> <TypeComment> <summary>Base class for type declaration syntax.</summary> </TypeComment> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="BaseList" Type="BaseListSyntax" Optional="true"> <PropertyComment> <summary>Gets the base type list.</summary> </PropertyComment> </Field> <Field Name="OpenBraceToken" Type="SyntaxToken" Optional="true"> <PropertyComment> <summary>Gets the open brace token.</summary> </PropertyComment> <Kind Name="OpenBraceToken"/> </Field> <Field Name="CloseBraceToken" Type="SyntaxToken" Optional="true"> <PropertyComment> <summary>Gets the close brace token.</summary> </PropertyComment> <Kind Name="CloseBraceToken"/> </Field> <Field Name="SemicolonToken" Type="SyntaxToken" Optional="true"> <PropertyComment> <summary>Gets the optional semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </AbstractNode> <AbstractNode Name="TypeDeclarationSyntax" Base="BaseTypeDeclarationSyntax"> <TypeComment> <summary>Base class for type declaration syntax (class, struct, interface, record).</summary> </TypeComment> <Field Name="Keyword" Type="SyntaxToken"> <PropertyComment> <summary>Gets the type keyword token ("class", "struct", "interface", "record").</summary> </PropertyComment> </Field> <Field Name="TypeParameterList" Type="TypeParameterListSyntax" Optional="true"/> <Field Name="ConstraintClauses" Type="SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;"> <PropertyComment> <summary>Gets the type constraint list.</summary> </PropertyComment> </Field> <Field Name="Members" Type="SyntaxList&lt;MemberDeclarationSyntax&gt;"> <PropertyComment> <summary>Gets the member declarations.</summary> </PropertyComment> </Field> </AbstractNode> <Node Name="ClassDeclarationSyntax" Base="TypeDeclarationSyntax"> <TypeComment> <summary>Class type declaration syntax.</summary> </TypeComment> <Kind Name="ClassDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="Keyword" Type="SyntaxToken" Override="true"> <PropertyComment> <summary>Gets the class keyword token.</summary> </PropertyComment> <Kind Name="ClassKeyword"/> </Field> <Field Name="Identifier" Type="SyntaxToken" Override="true"> <Kind Name="IdentifierToken"/> </Field> <Field Name="TypeParameterList" Type="TypeParameterListSyntax" Optional="true" Override="true"/> <Field Name="BaseList" Type="BaseListSyntax" Optional="true" Override="true"/> <Field Name="ConstraintClauses" Type="SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;" Override="true"/> <Field Name="OpenBraceToken" Type="SyntaxToken" Override="true"> <Kind Name="OpenBraceToken"/> </Field> <Field Name="Members" Type="SyntaxList&lt;MemberDeclarationSyntax&gt;" Override="true"/> <Field Name="CloseBraceToken" Type="SyntaxToken" Override="true"> <Kind Name="CloseBraceToken"/> </Field> <Field Name="SemicolonToken" Type="SyntaxToken" Optional="true" Override="true"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="StructDeclarationSyntax" Base="TypeDeclarationSyntax"> <TypeComment> <summary>Struct type declaration syntax.</summary> </TypeComment> <Kind Name="StructDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="Keyword" Type="SyntaxToken" Override="true"> <PropertyComment> <summary>Gets the struct keyword token.</summary> </PropertyComment> <Kind Name="StructKeyword"/> </Field> <Field Name="Identifier" Type="SyntaxToken" Override="true"> <Kind Name="IdentifierToken"/> </Field> <Field Name="TypeParameterList" Type="TypeParameterListSyntax" Optional="true" Override="true"/> <Field Name="BaseList" Type="BaseListSyntax" Optional="true" Override="true"/> <Field Name="ConstraintClauses" Type="SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;" Override="true"/> <Field Name="OpenBraceToken" Type="SyntaxToken" Override="true"> <Kind Name="OpenBraceToken"/> </Field> <Field Name="Members" Type="SyntaxList&lt;MemberDeclarationSyntax&gt;" Override="true"/> <Field Name="CloseBraceToken" Type="SyntaxToken" Override="true"> <Kind Name="CloseBraceToken"/> </Field> <Field Name="SemicolonToken" Type="SyntaxToken" Optional="true" Override="true"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="InterfaceDeclarationSyntax" Base="TypeDeclarationSyntax"> <TypeComment> <summary>Interface type declaration syntax.</summary> </TypeComment> <Kind Name="InterfaceDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="Keyword" Type="SyntaxToken" Override="true"> <PropertyComment> <summary>Gets the interface keyword token.</summary> </PropertyComment> <Kind Name="InterfaceKeyword"/> </Field> <Field Name="Identifier" Type="SyntaxToken" Override="true"> <Kind Name="IdentifierToken"/> </Field> <Field Name="TypeParameterList" Type="TypeParameterListSyntax" Optional="true" Override="true"/> <Field Name="BaseList" Type="BaseListSyntax" Optional="true" Override="true"/> <Field Name="ConstraintClauses" Type="SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;" Override="true"/> <Field Name="OpenBraceToken" Type="SyntaxToken" Override="true"> <Kind Name="OpenBraceToken"/> </Field> <Field Name="Members" Type="SyntaxList&lt;MemberDeclarationSyntax&gt;" Override="true"/> <Field Name="CloseBraceToken" Type="SyntaxToken" Override="true"> <Kind Name="CloseBraceToken"/> </Field> <Field Name="SemicolonToken" Type="SyntaxToken" Optional="true" Override="true"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="RecordDeclarationSyntax" Base="TypeDeclarationSyntax"> <Kind Name="RecordDeclaration" /> <Kind Name="RecordStructDeclaration" /> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="Keyword" Type="SyntaxToken" Override="true"> <ContextualKind Name="RecordKeyword"/> </Field> <Field Name="ClassOrStructKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="ClassKeyword"/> <Kind Name="StructKeyword"/> </Field> <Field Name="Identifier" Type="SyntaxToken" Override="true"> <Kind Name="IdentifierToken"/> </Field> <Field Name="TypeParameterList" Type="TypeParameterListSyntax" Optional="true" Override="true"/> <Field Name="ParameterList" Type="ParameterListSyntax" Optional="true" /> <Field Name="BaseList" Type="BaseListSyntax" Optional="true" Override="true"/> <Field Name="ConstraintClauses" Type="SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;" Override="true"/> <Field Name="OpenBraceToken" Type="SyntaxToken" Override="true" Optional="true"> <Kind Name="OpenBraceToken"/> </Field> <Field Name="Members" Type="SyntaxList&lt;MemberDeclarationSyntax&gt;" Override="true"/> <Field Name="CloseBraceToken" Type="SyntaxToken" Override="true" Optional="true"> <Kind Name="CloseBraceToken"/> </Field> <Field Name="SemicolonToken" Type="SyntaxToken" Optional="true" Override="true"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="EnumDeclarationSyntax" Base="BaseTypeDeclarationSyntax"> <TypeComment> <summary>Enum type declaration syntax.</summary> </TypeComment> <Kind Name="EnumDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="EnumKeyword" Type="SyntaxToken"> <PropertyComment> <summary>Gets the enum keyword token.</summary> </PropertyComment> <Kind Name="EnumKeyword"/> </Field> <Field Name="Identifier" Type="SyntaxToken" Override="true"> <Kind Name="IdentifierToken"/> </Field> <Field Name="BaseList" Type="BaseListSyntax" Optional="true" Override="true"> </Field> <Field Name="OpenBraceToken" Type="SyntaxToken" Override="true"> <Kind Name="OpenBraceToken"/> </Field> <Field Name="Members" Type="SeparatedSyntaxList&lt;EnumMemberDeclarationSyntax&gt;" AllowTrailingSeparator="true"> <PropertyComment> <summary>Gets the members declaration list.</summary> </PropertyComment> </Field> <Field Name="CloseBraceToken" Type="SyntaxToken" Override="true"> <Kind Name="CloseBraceToken"/> </Field> <Field Name="SemicolonToken" Type="SyntaxToken" Optional="true" Override="true"> <PropertyComment> <summary>Gets the optional semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="DelegateDeclarationSyntax" Base="MemberDeclarationSyntax"> <TypeComment> <summary>Delegate declaration syntax.</summary> </TypeComment> <Kind Name="DelegateDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="DelegateKeyword" Type="SyntaxToken"> <PropertyComment> <summary>Gets the "delegate" keyword.</summary> </PropertyComment> <Kind Name="DelegateKeyword"/> </Field> <Field Name="ReturnType" Type="TypeSyntax"> <PropertyComment> <summary>Gets the return type.</summary> </PropertyComment> </Field> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="TypeParameterList" Type="TypeParameterListSyntax" Optional="true"/> <Field Name="ParameterList" Type="ParameterListSyntax"> <PropertyComment> <summary>Gets the parameter list.</summary> </PropertyComment> </Field> <Field Name="ConstraintClauses" Type="SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;"> <PropertyComment> <summary>Gets the constraint clause list.</summary> </PropertyComment> </Field> <Field Name="SemicolonToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="EnumMemberDeclarationSyntax" Base="MemberDeclarationSyntax"> <Kind Name="EnumMemberDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="EqualsValue" Type="EqualsValueClauseSyntax" Optional="true"/> </Node> <Node Name="BaseListSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Base list syntax.</summary> </TypeComment> <Kind Name="BaseList"/> <Field Name="ColonToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the colon token.</summary> </PropertyComment> <Kind Name="ColonToken"/> </Field> <Field Name="Types" Type="SeparatedSyntaxList&lt;BaseTypeSyntax&gt;" MinCount="1"> <PropertyComment> <summary>Gets the base type references.</summary> </PropertyComment> </Field> </Node> <AbstractNode Name="BaseTypeSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Provides the base class from which the classes that represent base type syntax nodes are derived. This is an abstract class.</summary> </TypeComment> <Field Name="Type" Type="TypeSyntax"> </Field> </AbstractNode> <Node Name="SimpleBaseTypeSyntax" Base="BaseTypeSyntax"> <Kind Name="SimpleBaseType"/> <Field Name="Type" Type="TypeSyntax" Override="true"> </Field> </Node> <Node Name="PrimaryConstructorBaseTypeSyntax" Base="BaseTypeSyntax"> <Kind Name="PrimaryConstructorBaseType"/> <Field Name="Type" Type="TypeSyntax" Override="true"/> <Field Name="ArgumentList" Type="ArgumentListSyntax"/> </Node> <Node Name="TypeParameterConstraintClauseSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Type parameter constraint clause.</summary> </TypeComment> <Kind Name="TypeParameterConstraintClause"/> <Field Name="WhereKeyword" Type="SyntaxToken"> <Kind Name="WhereKeyword"/> </Field> <Field Name="Name" Type="IdentifierNameSyntax"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierName"/> </Field> <Field Name="ColonToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the colon token.</summary> </PropertyComment> <Kind Name="ColonToken"/> </Field> <Field Name="Constraints" Type="SeparatedSyntaxList&lt;TypeParameterConstraintSyntax&gt;" MinCount="1"> <PropertyComment> <summary>Gets the constraints list.</summary> </PropertyComment> </Field> </Node> <AbstractNode Name="TypeParameterConstraintSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Base type for type parameter constraint syntax.</summary> </TypeComment> </AbstractNode> <Node Name="ConstructorConstraintSyntax" Base="TypeParameterConstraintSyntax"> <TypeComment> <summary>Constructor constraint syntax.</summary> </TypeComment> <Kind Name="ConstructorConstraint"/> <Field Name="NewKeyword" Type="SyntaxToken"> <PropertyComment> <summary>Gets the "new" keyword.</summary> </PropertyComment> <Kind Name="NewKeyword"/> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the open paren keyword.</summary> </PropertyComment> <Kind Name="OpenParenToken"/> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the close paren keyword.</summary> </PropertyComment> <Kind Name="CloseParenToken"/> </Field> </Node> <Node Name="ClassOrStructConstraintSyntax" Base="TypeParameterConstraintSyntax"> <TypeComment> <summary>Class or struct constraint syntax.</summary> </TypeComment> <Kind Name="ClassConstraint"/> <Kind Name="StructConstraint"/> <Field Name="ClassOrStructKeyword" Type="SyntaxToken"> <PropertyComment> <summary>Gets the constraint keyword ("class" or "struct").</summary> </PropertyComment> <Kind Name="ClassKeyword"/> <Kind Name="StructKeyword"/> </Field> <Field Name="QuestionToken" Type="SyntaxToken" Optional="true"> <Kind Name="QuestionToken"/> <PropertyComment> <summary>SyntaxToken representing the question mark.</summary> </PropertyComment> </Field> </Node> <Node Name="TypeConstraintSyntax" Base="TypeParameterConstraintSyntax"> <TypeComment> <summary>Type constraint syntax.</summary> </TypeComment> <Kind Name="TypeConstraint"/> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>Gets the type syntax.</summary> </PropertyComment> </Field> </Node> <Node Name="DefaultConstraintSyntax" Base="TypeParameterConstraintSyntax"> <TypeComment> <summary>Default constraint syntax.</summary> </TypeComment> <Kind Name="DefaultConstraint"/> <Field Name="DefaultKeyword" Type="SyntaxToken"> <PropertyComment> <summary>Gets the "default" keyword.</summary> </PropertyComment> <Kind Name="DefaultKeyword"/> </Field> </Node> <AbstractNode Name="BaseFieldDeclarationSyntax" Base="MemberDeclarationSyntax"> <Field Name="Declaration" Type="VariableDeclarationSyntax"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </AbstractNode> <Node Name="FieldDeclarationSyntax" Base="BaseFieldDeclarationSyntax"> <Kind Name="FieldDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="Declaration" Type="VariableDeclarationSyntax" Override="true"/> <Field Name="SemicolonToken" Type="SyntaxToken" Override="true"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="EventFieldDeclarationSyntax" Base="BaseFieldDeclarationSyntax"> <Kind Name="EventFieldDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="EventKeyword" Type="SyntaxToken"> <Kind Name="EventKeyword"/> </Field> <Field Name="Declaration" Type="VariableDeclarationSyntax" Override="true"/> <Field Name="SemicolonToken" Type="SyntaxToken" Override="true"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="ExplicitInterfaceSpecifierSyntax" Base="CSharpSyntaxNode"> <Kind Name="ExplicitInterfaceSpecifier"/> <Field Name="Name" Type="NameSyntax"/> <Field Name="DotToken" Type="SyntaxToken"> <Kind Name="DotToken"/> </Field> </Node> <AbstractNode Name="BaseMethodDeclarationSyntax" Base="MemberDeclarationSyntax"> <TypeComment> <summary>Base type for method declaration syntax.</summary> </TypeComment> <Field Name="ParameterList" Type="ParameterListSyntax"> <PropertyComment> <summary>Gets the parameter list.</summary> </PropertyComment> </Field> <Choice> <Field Name="Body" Type="BlockSyntax"/> <Sequence> <Field Name="ExpressionBody" Type="ArrowExpressionClauseSyntax"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the optional semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </Sequence> </Choice> </AbstractNode> <Node Name="MethodDeclarationSyntax" Base="BaseMethodDeclarationSyntax"> <TypeComment> <summary>Method declaration syntax.</summary> </TypeComment> <Kind Name="MethodDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="ReturnType" Type="TypeSyntax"> <PropertyComment> <summary>Gets the return type syntax.</summary> </PropertyComment> </Field> <Field Name="ExplicitInterfaceSpecifier" Type="ExplicitInterfaceSpecifierSyntax" Optional="true"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="TypeParameterList" Type="TypeParameterListSyntax" Optional="true"/> <Field Name="ParameterList" Type="ParameterListSyntax" Override="true"/> <Field Name="ConstraintClauses" Type="SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;"> <PropertyComment> <summary>Gets the constraint clause list.</summary> </PropertyComment> </Field> <Choice> <Field Name="Body" Type="BlockSyntax" Override="true"/> <Sequence> <Field Name="ExpressionBody" Type="ArrowExpressionClauseSyntax" Override="true"/> <Field Name="SemicolonToken" Type="SyntaxToken" Override="true"> <PropertyComment> <summary>Gets the optional semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </Sequence> </Choice> </Node> <Node Name="OperatorDeclarationSyntax" Base="BaseMethodDeclarationSyntax"> <!-- should be multiple kinds? --> <TypeComment> <summary>Operator declaration syntax.</summary> </TypeComment> <Kind Name="OperatorDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="ReturnType" Type="TypeSyntax"> <PropertyComment> <summary>Gets the return type.</summary> </PropertyComment> </Field> <Field Name="ExplicitInterfaceSpecifier" Type="ExplicitInterfaceSpecifierSyntax" Optional="true"/> <Field Name="OperatorKeyword" Type="SyntaxToken"> <PropertyComment> <summary>Gets the "operator" keyword.</summary> </PropertyComment> <Kind Name="OperatorKeyword"/> </Field> <Field Name="OperatorToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the operator token.</summary> </PropertyComment> <Kind Name="PlusToken"/> <Kind Name="MinusToken"/> <Kind Name="ExclamationToken"/> <Kind Name="TildeToken"/> <Kind Name="PlusPlusToken"/> <Kind Name="MinusMinusToken"/> <Kind Name="AsteriskToken"/> <Kind Name="SlashToken"/> <Kind Name="PercentToken"/> <Kind Name="LessThanLessThanToken"/> <Kind Name="GreaterThanGreaterThanToken"/> <Kind Name="BarToken"/> <Kind Name="AmpersandToken"/> <Kind Name="CaretToken"/> <Kind Name="EqualsEqualsToken"/> <Kind Name="ExclamationEqualsToken"/> <Kind Name="LessThanToken"/> <Kind Name="LessThanEqualsToken"/> <Kind Name="GreaterThanToken"/> <Kind Name="GreaterThanEqualsToken"/> <Kind Name="FalseKeyword"/> <Kind Name="TrueKeyword"/> <Kind Name="IsKeyword"/> </Field> <Field Name="ParameterList" Type="ParameterListSyntax" Override="true"/> <Choice> <Field Name="Body" Type="BlockSyntax" Override="true"/> <Sequence> <Field Name="ExpressionBody" Type="ArrowExpressionClauseSyntax" Override="true"/> <Field Name="SemicolonToken" Type="SyntaxToken" Override="true"> <PropertyComment> <summary>Gets the optional semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </Sequence> </Choice> </Node> <Node Name="ConversionOperatorDeclarationSyntax" Base="BaseMethodDeclarationSyntax"> <!-- should be split into two kinds--> <TypeComment> <summary>Conversion operator declaration syntax.</summary> </TypeComment> <Kind Name="ConversionOperatorDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="ImplicitOrExplicitKeyword" Type="SyntaxToken"> <PropertyComment> <summary>Gets the "implicit" or "explicit" token.</summary> </PropertyComment> <Kind Name="ImplicitKeyword"/> <Kind Name="ExplicitKeyword"/> </Field> <Field Name="ExplicitInterfaceSpecifier" Type="ExplicitInterfaceSpecifierSyntax" Optional="true"/> <Field Name="OperatorKeyword" Type="SyntaxToken"> <PropertyComment> <summary>Gets the "operator" token.</summary> </PropertyComment> <Kind Name="OperatorKeyword"/> </Field> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>Gets the type.</summary> </PropertyComment> </Field> <Field Name="ParameterList" Type="ParameterListSyntax" Override="true"/> <Choice> <Field Name="Body" Type="BlockSyntax" Override="true"/> <Sequence> <Field Name="ExpressionBody" Type="ArrowExpressionClauseSyntax" Override="true"/> <Field Name="SemicolonToken" Type="SyntaxToken" Override="true"> <PropertyComment> <summary>Gets the optional semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </Sequence> </Choice> </Node> <Node Name="ConstructorDeclarationSyntax" Base="BaseMethodDeclarationSyntax"> <TypeComment> <summary>Constructor declaration syntax.</summary> </TypeComment> <Kind Name="ConstructorDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="ParameterList" Type="ParameterListSyntax" Override="true"/> <Field Name="Initializer" Type="ConstructorInitializerSyntax" Optional="true"/> <Choice> <Field Name="Body" Type="BlockSyntax" Override="true"/> <Sequence> <Field Name="ExpressionBody" Type="ArrowExpressionClauseSyntax" Override="true"/> <Field Name="SemicolonToken" Type="SyntaxToken" Override="true"> <PropertyComment> <summary>Gets the optional semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </Sequence> </Choice> </Node> <Node Name="ConstructorInitializerSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Constructor initializer syntax.</summary> </TypeComment> <Kind Name="BaseConstructorInitializer"/> <Kind Name="ThisConstructorInitializer"/> <Field Name="ColonToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the colon token.</summary> </PropertyComment> <Kind Name="ColonToken"/> </Field> <Field Name="ThisOrBaseKeyword" Type="SyntaxToken" > <PropertyComment> <summary>Gets the "this" or "base" keyword.</summary> </PropertyComment> <Kind Name="BaseKeyword"/> <Kind Name="ThisKeyword"/> </Field> <Field Name="ArgumentList" Type="ArgumentListSyntax"/> </Node> <Node Name="DestructorDeclarationSyntax" Base="BaseMethodDeclarationSyntax"> <TypeComment> <summary>Destructor declaration syntax.</summary> </TypeComment> <Kind Name="DestructorDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="TildeToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the tilde token.</summary> </PropertyComment> <Kind Name="TildeToken"/> </Field> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="ParameterList" Type="ParameterListSyntax" Override="true"/> <Choice> <Field Name="Body" Type="BlockSyntax" Override="true"/> <Sequence> <Field Name="ExpressionBody" Type="ArrowExpressionClauseSyntax" Override="true"/> <Field Name="SemicolonToken" Type="SyntaxToken" Override="true"> <PropertyComment> <summary>Gets the optional semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </Sequence> </Choice> </Node> <AbstractNode Name="BasePropertyDeclarationSyntax" Base="MemberDeclarationSyntax"> <TypeComment> <summary>Base type for property declaration syntax.</summary> </TypeComment> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>Gets the type syntax.</summary> </PropertyComment> </Field> <Field Name="ExplicitInterfaceSpecifier" Type="ExplicitInterfaceSpecifierSyntax" Optional="true"> <PropertyComment> <summary>Gets the optional explicit interface specifier.</summary> </PropertyComment> </Field> <Field Name="AccessorList" Type="AccessorListSyntax" Optional="true" /> </AbstractNode> <Node Name="PropertyDeclarationSyntax" Base="BasePropertyDeclarationSyntax"> <Kind Name="PropertyDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="Type" Type="TypeSyntax" Override="true"/> <Field Name="ExplicitInterfaceSpecifier" Type="ExplicitInterfaceSpecifierSyntax" Optional="true" Override="true"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Choice> <Field Name="AccessorList" Type="AccessorListSyntax" Override="true" /> <Sequence> <Choice> <Field Name="ExpressionBody" Type="ArrowExpressionClauseSyntax" /> <Field Name="Initializer" Type="EqualsValueClauseSyntax" /> </Choice> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken" /> </Field> </Sequence> </Choice> </Node> <Node Name="ArrowExpressionClauseSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>The syntax for the expression body of an expression-bodied member.</summary> </TypeComment> <Kind Name="ArrowExpressionClause" /> <Field Name="ArrowToken" Type="SyntaxToken"> <Kind Name="EqualsGreaterThanToken" /> </Field> <Field Name="Expression" Type="ExpressionSyntax" /> </Node> <Node Name="EventDeclarationSyntax" Base="BasePropertyDeclarationSyntax"> <Kind Name="EventDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="EventKeyword" Type="SyntaxToken"> <Kind Name="EventKeyword"/> </Field> <Field Name="Type" Type="TypeSyntax" Override="true"/> <Field Name="ExplicitInterfaceSpecifier" Type="ExplicitInterfaceSpecifierSyntax" Optional="true" Override="true"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Choice> <Field Name="AccessorList" Type="AccessorListSyntax" Override="true"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Choice> </Node> <Node Name="IndexerDeclarationSyntax" Base="BasePropertyDeclarationSyntax"> <Kind Name="IndexerDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="Type" Type="TypeSyntax" Override="true"/> <Field Name="ExplicitInterfaceSpecifier" Type="ExplicitInterfaceSpecifierSyntax" Optional="true" Override="true"/> <Field Name="ThisKeyword" Type="SyntaxToken"> <Kind Name="ThisKeyword"/> </Field> <Field Name="ParameterList" Type="BracketedParameterListSyntax"> <PropertyComment> <summary>Gets the parameter list.</summary> </PropertyComment> </Field> <Choice> <Field Name="AccessorList" Type="AccessorListSyntax" Override="true"/> <Sequence> <Field Name="ExpressionBody" Type="ArrowExpressionClauseSyntax"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Sequence> </Choice> </Node> <Node Name="AccessorListSyntax" Base="CSharpSyntaxNode"> <Kind Name="AccessorList"/> <Field Name="OpenBraceToken" Type="SyntaxToken"> <Kind Name="OpenBraceToken"/> </Field> <Field Name="Accessors" Type="SyntaxList&lt;AccessorDeclarationSyntax&gt;"/> <Field Name="CloseBraceToken" Type="SyntaxToken"> <Kind Name="CloseBraceToken"/> </Field> </Node> <Node Name="AccessorDeclarationSyntax" Base="CSharpSyntaxNode"> <Kind Name="GetAccessorDeclaration"/> <Kind Name="SetAccessorDeclaration"/> <Kind Name="InitAccessorDeclaration"/> <Kind Name="AddAccessorDeclaration"/> <Kind Name="RemoveAccessorDeclaration"/> <Kind Name="UnknownAccessorDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;"> <PropertyComment> <summary>Gets the attribute declaration list.</summary> </PropertyComment> </Field> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;"> <PropertyComment> <summary>Gets the modifier list.</summary> </PropertyComment> </Field> <Field Name="Keyword" Type="SyntaxToken"> <Kind Name="GetKeyword"/> <Kind Name="SetKeyword"/> <Kind Name="InitKeyword"/> <Kind Name="AddKeyword"/> <Kind Name="RemoveKeyword"/> <Kind Name="IdentifierToken"/> <PropertyComment> <summary>Gets the keyword token, or identifier if an erroneous accessor declaration.</summary> </PropertyComment> </Field> <Choice> <Field Name="Body" Type="BlockSyntax"> <PropertyComment> <summary>Gets the optional body block which may be empty, but it is null if there are no braces.</summary> </PropertyComment> </Field> <Sequence> <Field Name="ExpressionBody" Type="ArrowExpressionClauseSyntax"> <PropertyComment> <summary>Gets the optional expression body.</summary> </PropertyComment> </Field> <Field Name="SemicolonToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the optional semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </Sequence> </Choice> </Node> <AbstractNode Name="BaseParameterListSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Base type for parameter list syntax.</summary> </TypeComment> <Field Name="Parameters" Type="SeparatedSyntaxList&lt;ParameterSyntax&gt;"> <PropertyComment> <summary>Gets the parameter list.</summary> </PropertyComment> </Field> </AbstractNode> <Node Name="ParameterListSyntax" Base="BaseParameterListSyntax"> <TypeComment> <summary>Parameter list syntax.</summary> </TypeComment> <Kind Name="ParameterList"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the open paren token.</summary> </PropertyComment> <Kind Name="OpenParenToken"/> </Field> <Field Name="Parameters" Type="SeparatedSyntaxList&lt;ParameterSyntax&gt;" Override="true"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the close paren token.</summary> </PropertyComment> <Kind Name="CloseParenToken"/> </Field> </Node> <Node Name="BracketedParameterListSyntax" Base="BaseParameterListSyntax"> <TypeComment> <summary>Parameter list syntax with surrounding brackets.</summary> </TypeComment> <Kind Name="BracketedParameterList"/> <Field Name="OpenBracketToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the open bracket token.</summary> </PropertyComment> <Kind Name="OpenBracketToken"/> </Field> <Field Name="Parameters" Type="SeparatedSyntaxList&lt;ParameterSyntax&gt;" Override="true" MinCount="1"/> <Field Name="CloseBracketToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the close bracket token.</summary> </PropertyComment> <Kind Name="CloseBracketToken"/> </Field> </Node> <AbstractNode Name="BaseParameterSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Base parameter syntax.</summary> </TypeComment> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;"> <PropertyComment> <summary>Gets the attribute declaration list.</summary> </PropertyComment> </Field> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;"> <PropertyComment> <summary>Gets the modifier list.</summary> </PropertyComment> </Field> <Field Name="Type" Type="TypeSyntax" Optional="true"/> </AbstractNode> <Node Name="ParameterSyntax" Base="BaseParameterSyntax"> <TypeComment> <summary>Parameter syntax.</summary> </TypeComment> <Kind Name="Parameter"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"> <PropertyComment> <summary>Gets the attribute declaration list.</summary> </PropertyComment> </Field> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"> <PropertyComment> <summary>Gets the modifier list.</summary> </PropertyComment> </Field> <Field Name="Type" Type="TypeSyntax" Optional="true" Override="true"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> <Kind Name="ArgListKeyword"/> </Field> <Field Name="Default" Type="EqualsValueClauseSyntax" Optional="true"/> </Node> <Node Name="FunctionPointerParameterSyntax" Base="BaseParameterSyntax"> <TypeComment> <summary>Parameter syntax.</summary> </TypeComment> <Kind Name="FunctionPointerParameter"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"> <PropertyComment> <summary>Gets the attribute declaration list.</summary> </PropertyComment> </Field> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"> <PropertyComment> <summary>Gets the modifier list.</summary> </PropertyComment> </Field> <Field Name="Type" Type="TypeSyntax" Optional="false" Override="true"/> </Node> <Node Name="IncompleteMemberSyntax" Base="MemberDeclarationSyntax"> <Kind Name="IncompleteMember"/>n <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="Type" Type="TypeSyntax" Optional="true"/> </Node> <Node Name="SkippedTokensTriviaSyntax" Base="StructuredTriviaSyntax"> <Kind Name="SkippedTokensTrivia"/> <Field Name="Tokens" Type="SyntaxList&lt;SyntaxToken&gt;"/> </Node> <!-- <Node Name="BadNamespaceMemberDeclarationSyntax" Base="MemberDeclarationSyntax"> <Kind Name="BadNamespaceMemberDeclaration"/> <Field Name="Nodes" Type="SyntaxNodeOrTokenList"/> </Node> --> <!-- Xml --> <Node Name="DocumentationCommentTriviaSyntax" Base="StructuredTriviaSyntax"> <Kind Name="SingleLineDocumentationCommentTrivia"/> <Kind Name="MultiLineDocumentationCommentTrivia"/> <Field Name="Content" Type="SyntaxList&lt;XmlNodeSyntax&gt;"/> <Field Name="EndOfComment" Type="SyntaxToken"> <!-- should be renamed to EndOfCommentToken --> <Kind Name="EndOfDocumentationCommentToken"/> </Field> </Node> <AbstractNode Name="CrefSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary> A symbol referenced by a cref attribute (e.g. in a &lt;see&gt; or &lt;seealso&gt; documentation comment tag). For example, the M in &lt;see cref="M" /&gt;. </summary> </TypeComment> </AbstractNode> <Node Name="TypeCrefSyntax" Base="CrefSyntax"> <TypeComment> <summary> A symbol reference that definitely refers to a type. For example, "int", "A::B", "A.B", "A&lt;T&gt;", but not "M()" (has parameter list) or "this" (indexer). NOTE: TypeCrefSyntax, QualifiedCrefSyntax, and MemberCrefSyntax overlap. The syntax in a TypeCrefSyntax will always be bound as type, so it's safer to use QualifiedCrefSyntax or MemberCrefSyntax if the symbol might be a non-type member. </summary> </TypeComment> <Kind Name="TypeCref"/> <Field Name="Type" Type="TypeSyntax"/> </Node> <Node Name="QualifiedCrefSyntax" Base="CrefSyntax"> <TypeComment> <summary> A symbol reference to a type or non-type member that is qualified by an enclosing type or namespace. For example, cref="System.String.ToString()". NOTE: TypeCrefSyntax, QualifiedCrefSyntax, and MemberCrefSyntax overlap. The syntax in a TypeCrefSyntax will always be bound as type, so it's safer to use QualifiedCrefSyntax or MemberCrefSyntax if the symbol might be a non-type member. </summary> </TypeComment> <Kind Name="QualifiedCref"/> <Field Name="Container" Type="TypeSyntax"/> <Field Name="DotToken" Type="SyntaxToken"> <Kind Name="DotToken"/> </Field> <Field Name="Member" Type="MemberCrefSyntax"/> </Node> <AbstractNode Name="MemberCrefSyntax" Base="CrefSyntax"> <TypeComment> <summary> The unqualified part of a CrefSyntax. For example, "ToString()" in "object.ToString()". NOTE: TypeCrefSyntax, QualifiedCrefSyntax, and MemberCrefSyntax overlap. The syntax in a TypeCrefSyntax will always be bound as type, so it's safer to use QualifiedCrefSyntax or MemberCrefSyntax if the symbol might be a non-type member. </summary> </TypeComment> </AbstractNode> <Node Name="NameMemberCrefSyntax" Base="MemberCrefSyntax"> <TypeComment> <summary> A MemberCrefSyntax specified by a name (an identifier, predefined type keyword, or an alias-qualified name, with an optional type parameter list) and an optional parameter list. For example, "M", "M&lt;T&gt;" or "M(int)". Also, "A::B()" or "string()". </summary> </TypeComment> <Kind Name="NameMemberCref"/> <Field Name="Name" Type="TypeSyntax"/> <Field Name="Parameters" Type="CrefParameterListSyntax" Optional="true"/> </Node> <Node Name="IndexerMemberCrefSyntax" Base="MemberCrefSyntax"> <TypeComment> <summary> A MemberCrefSyntax specified by a this keyword and an optional parameter list. For example, "this" or "this[int]". </summary> </TypeComment> <Kind Name="IndexerMemberCref"/> <Field Name="ThisKeyword" Type="SyntaxToken"> <Kind Name="ThisKeyword"/> </Field> <Field Name="Parameters" Type="CrefBracketedParameterListSyntax" Optional="true"/> </Node> <Node Name="OperatorMemberCrefSyntax" Base="MemberCrefSyntax"> <TypeComment> <summary> A MemberCrefSyntax specified by an operator keyword, an operator symbol and an optional parameter list. For example, "operator +" or "operator -[int]". NOTE: the operator must be overloadable. </summary> </TypeComment> <Kind Name="OperatorMemberCref"/> <Field Name="OperatorKeyword" Type="SyntaxToken"> <Kind Name="OperatorKeyword"/> </Field> <Field Name="OperatorToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the operator token.</summary> </PropertyComment> <Kind Name="PlusToken"/> <Kind Name="MinusToken"/> <Kind Name="ExclamationToken"/> <Kind Name="TildeToken"/> <Kind Name="PlusPlusToken"/> <Kind Name="MinusMinusToken"/> <Kind Name="AsteriskToken"/> <Kind Name="SlashToken"/> <Kind Name="PercentToken"/> <Kind Name="LessThanLessThanToken"/> <Kind Name="GreaterThanGreaterThanToken"/> <Kind Name="BarToken"/> <Kind Name="AmpersandToken"/> <Kind Name="CaretToken"/> <Kind Name="EqualsEqualsToken"/> <Kind Name="ExclamationEqualsToken"/> <Kind Name="LessThanToken"/> <Kind Name="LessThanEqualsToken"/> <Kind Name="GreaterThanToken"/> <Kind Name="GreaterThanEqualsToken"/> <Kind Name="FalseKeyword"/> <Kind Name="TrueKeyword"/> </Field> <Field Name="Parameters" Type="CrefParameterListSyntax" Optional="true"/> </Node> <Node Name="ConversionOperatorMemberCrefSyntax" Base="MemberCrefSyntax"> <TypeComment> <summary> A MemberCrefSyntax specified by an implicit or explicit keyword, an operator keyword, a destination type, and an optional parameter list. For example, "implicit operator int" or "explicit operator MyType(int)". </summary> </TypeComment> <Kind Name="ConversionOperatorMemberCref"/> <Field Name="ImplicitOrExplicitKeyword" Type="SyntaxToken"> <Kind Name="ImplicitKeyword"/> <Kind Name="ExplicitKeyword"/> </Field> <Field Name="OperatorKeyword" Type="SyntaxToken"> <Kind Name="OperatorKeyword"/> </Field> <Field Name="Type" Type="TypeSyntax"/> <Field Name="Parameters" Type="CrefParameterListSyntax" Optional="true"/> </Node> <AbstractNode Name="BaseCrefParameterListSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary> A list of cref parameters with surrounding punctuation. Unlike regular parameters, cref parameters do not have names. </summary> </TypeComment> <Field Name="Parameters" Type="SeparatedSyntaxList&lt;CrefParameterSyntax&gt;"> <PropertyComment> <summary>Gets the parameter list.</summary> </PropertyComment> </Field> </AbstractNode> <Node Name="CrefParameterListSyntax" Base="BaseCrefParameterListSyntax"> <TypeComment> <summary> A parenthesized list of cref parameters. </summary> </TypeComment> <Kind Name="CrefParameterList"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the open paren token.</summary> </PropertyComment> <Kind Name="OpenParenToken"/> </Field> <Field Name="Parameters" Type="SeparatedSyntaxList&lt;CrefParameterSyntax&gt;" Override="true"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the close paren token.</summary> </PropertyComment> <Kind Name="CloseParenToken"/> </Field> </Node> <Node Name="CrefBracketedParameterListSyntax" Base="BaseCrefParameterListSyntax"> <TypeComment> <summary> A bracketed list of cref parameters. </summary> </TypeComment> <Kind Name="CrefBracketedParameterList"/> <Field Name="OpenBracketToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the open bracket token.</summary> </PropertyComment> <Kind Name="OpenBracketToken"/> </Field> <Field Name="Parameters" Type="SeparatedSyntaxList&lt;CrefParameterSyntax&gt;" Override="true" MinCount="1"/> <Field Name="CloseBracketToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the close bracket token.</summary> </PropertyComment> <Kind Name="CloseBracketToken"/> </Field> </Node> <Node Name="CrefParameterSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary> An element of a BaseCrefParameterListSyntax. Unlike a regular parameter, a cref parameter has only an optional ref or out keyword and a type - there is no name and there are no attributes or other modifiers. </summary> </TypeComment> <Kind Name="CrefParameter"/> <Field Name="RefKindKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="RefKeyword"/> <Kind Name="OutKeyword"/> <Kind Name="InKeyword"/> </Field> <Field Name="Type" Type="TypeSyntax"/> </Node> <AbstractNode Name="XmlNodeSyntax" Base="CSharpSyntaxNode"> </AbstractNode> <Node Name="XmlElementSyntax" Base="XmlNodeSyntax"> <Kind Name="XmlElement"/> <Field Name="StartTag" Type="XmlElementStartTagSyntax"/> <Field Name="Content" Type="SyntaxList&lt;XmlNodeSyntax&gt;"/> <Field Name="EndTag" Type="XmlElementEndTagSyntax"/> </Node> <Node Name="XmlElementStartTagSyntax" Base="CSharpSyntaxNode"> <Kind Name="XmlElementStartTag"/> <Field Name="LessThanToken" Type="SyntaxToken"> <Kind Name="LessThanToken"/> </Field> <Field Name="Name" Type="XmlNameSyntax"/> <Field Name="Attributes" Type="SyntaxList&lt;XmlAttributeSyntax&gt;"/> <Field Name="GreaterThanToken" Type="SyntaxToken"> <Kind Name="GreaterThanToken"/> </Field> </Node> <Node Name="XmlElementEndTagSyntax" Base="CSharpSyntaxNode"> <Kind Name="XmlElementEndTag"/> <Field Name="LessThanSlashToken" Type="SyntaxToken"> <Kind Name="LessThanSlashToken"/> </Field> <Field Name="Name" Type="XmlNameSyntax"/> <Field Name="GreaterThanToken" Type="SyntaxToken"> <Kind Name="GreaterThanToken"/> </Field> </Node> <Node Name="XmlEmptyElementSyntax" Base="XmlNodeSyntax"> <Kind Name="XmlEmptyElement"/> <Field Name="LessThanToken" Type="SyntaxToken"> <Kind Name="LessThanToken"/> </Field> <Field Name="Name" Type="XmlNameSyntax"/> <Field Name="Attributes" Type="SyntaxList&lt;XmlAttributeSyntax&gt;"/> <Field Name="SlashGreaterThanToken" Type="SyntaxToken"> <Kind Name="SlashGreaterThanToken"/> </Field> </Node> <Node Name="XmlNameSyntax" Base="CSharpSyntaxNode"> <Kind Name="XmlName"/> <Field Name="Prefix" Type="XmlPrefixSyntax" Optional="true"/> <Field Name="LocalName" Type="SyntaxToken"> <Kind Name="IdentifierToken"/> </Field> </Node> <Node Name="XmlPrefixSyntax" Base="CSharpSyntaxNode"> <Kind Name="XmlPrefix"/> <Field Name="Prefix" Type="SyntaxToken"> <Kind Name="IdentifierToken"/> </Field> <Field Name="ColonToken" Type="SyntaxToken"> <Kind Name="ColonToken"/> </Field> </Node> <AbstractNode Name="XmlAttributeSyntax" Base="CSharpSyntaxNode"> <Field Name="Name" Type="XmlNameSyntax"/> <Field Name="EqualsToken" Type="SyntaxToken"> <Kind Name="EqualsToken"/> </Field> <Field Name="StartQuoteToken" Type="SyntaxToken"> <Kind Name="SingleQuoteToken"/> <Kind Name="DoubleQuoteToken"/> </Field> <Field Name="EndQuoteToken" Type="SyntaxToken"> <Kind Name="SingleQuoteToken"/> <Kind Name="DoubleQuoteToken"/> </Field> </AbstractNode> <Node Name="XmlTextAttributeSyntax" Base="XmlAttributeSyntax"> <Kind Name="XmlTextAttribute"/> <Field Name="Name" Type="XmlNameSyntax" Override="true"/> <Field Name="EqualsToken" Type="SyntaxToken" Override="true"> <Kind Name="EqualsToken"/> </Field> <Field Name="StartQuoteToken" Type="SyntaxToken" Override="true"> <Kind Name="SingleQuoteToken"/> <Kind Name="DoubleQuoteToken"/> </Field> <Field Name="TextTokens" Type="SyntaxList&lt;SyntaxToken&gt;"/> <!-- XmlTextLiteralToken or XmlEntityLiteralToken--> <Field Name="EndQuoteToken" Type="SyntaxToken" Override="true"> <Kind Name="SingleQuoteToken"/> <Kind Name="DoubleQuoteToken"/> </Field> </Node> <Node Name="XmlCrefAttributeSyntax" Base="XmlAttributeSyntax"> <Kind Name="XmlCrefAttribute"/> <Field Name="Name" Type="XmlNameSyntax" Override="true"/> <Field Name="EqualsToken" Type="SyntaxToken" Override="true"> <Kind Name="EqualsToken"/> </Field> <Field Name="StartQuoteToken" Type="SyntaxToken" Override="true"> <Kind Name="SingleQuoteToken"/> <Kind Name="DoubleQuoteToken"/> </Field> <Field Name="Cref" Type="CrefSyntax"/> <Field Name="EndQuoteToken" Type="SyntaxToken" Override="true"> <Kind Name="SingleQuoteToken"/> <Kind Name="DoubleQuoteToken"/> </Field> </Node> <Node Name="XmlNameAttributeSyntax" Base="XmlAttributeSyntax"> <Kind Name="XmlNameAttribute"/> <Field Name="Name" Type="XmlNameSyntax" Override="true"/> <Field Name="EqualsToken" Type="SyntaxToken" Override="true"> <Kind Name="EqualsToken"/> </Field> <Field Name="StartQuoteToken" Type="SyntaxToken" Override="true"> <Kind Name="SingleQuoteToken"/> <Kind Name="DoubleQuoteToken"/> </Field> <Field Name="Identifier" Type="IdentifierNameSyntax" /> <Field Name="EndQuoteToken" Type="SyntaxToken" Override="true"> <Kind Name="SingleQuoteToken"/> <Kind Name="DoubleQuoteToken"/> </Field> </Node> <Node Name="XmlTextSyntax" Base="XmlNodeSyntax"> <Kind Name="XmlText"/> <Field Name="TextTokens" Type="SyntaxList&lt;SyntaxToken&gt;"/> <!-- XmlTextLiteralToken or XmlEntityLiteralToken--> </Node> <Node Name="XmlCDataSectionSyntax" Base="XmlNodeSyntax"> <Kind Name="XmlCDataSection"/> <Field Name="StartCDataToken" Type="SyntaxToken"> <Kind Name="XmlCDataStartToken"/> </Field> <Field Name="TextTokens" Type="SyntaxList&lt;SyntaxToken&gt;"/> <!-- XmlTextLiteralToken only --> <Field Name="EndCDataToken" Type="SyntaxToken"> <Kind Name="XmlCDataEndToken"/> </Field> </Node> <Node Name="XmlProcessingInstructionSyntax" Base="XmlNodeSyntax"> <Kind Name="XmlProcessingInstruction"/> <Field Name="StartProcessingInstructionToken" Type="SyntaxToken"> <Kind Name="XmlProcessingInstructionStartToken"/> </Field> <Field Name="Name" Type="XmlNameSyntax" /> <Field Name="TextTokens" Type="SyntaxList&lt;SyntaxToken&gt;"/> <!-- XmlTextLiteralToken only --> <Field Name="EndProcessingInstructionToken" Type="SyntaxToken"> <Kind Name="XmlProcessingInstructionEndToken"/> </Field> </Node> <Node Name="XmlCommentSyntax" Base="XmlNodeSyntax"> <Kind Name="XmlComment"/> <Field Name="LessThanExclamationMinusMinusToken" Type="SyntaxToken"> <Kind Name="XmlCommentStartToken"/> </Field> <Field Name="TextTokens" Type="SyntaxList&lt;SyntaxToken&gt;"/> <!-- XmlTextLiteralToken only --> <Field Name="MinusMinusGreaterThanToken" Type="SyntaxToken"> <Kind Name="XmlCommentEndToken"/> </Field> </Node> <!-- <Node Name="XmlProcessingInstructionSyntax" Base="XmlNodeSyntax"> <Kind Name="XmlProcessingInstruction"/> <Field Name="LessThanQuestionToken" Type="SyntaxToken"/> <Field Name="TextTokens" Type="SyntaxList&lt;SyntaxToken&gt;"/> <Field Name="QuestionGreaterThanToken" Type="SyntaxToken"/> </Node> --> <!-- Preprocessor --> <AbstractNode Name="DirectiveTriviaSyntax" Base="StructuredTriviaSyntax"> <Field Name="IsActive" Type="bool"/> <Field Name="HashToken" Type="SyntaxToken"> <Kind Name="HashToken" /> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken"> <Kind Name="EndOfDirectiveToken" /> </Field> </AbstractNode> <AbstractNode Name="BranchingDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Field Name="BranchTaken" Type="bool"/> </AbstractNode> <AbstractNode Name="ConditionalDirectiveTriviaSyntax" Base="BranchingDirectiveTriviaSyntax"> <Field Name="Condition" Type="ExpressionSyntax"/> <Field Name="ConditionValue" Type="bool"/> </AbstractNode> <Node Name="IfDirectiveTriviaSyntax" Base="ConditionalDirectiveTriviaSyntax"> <Kind Name="IfDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="IfKeyword" Type="SyntaxToken"> <Kind Name="IfKeyword"/> </Field> <Field Name="Condition" Type="ExpressionSyntax" Override="true"/> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> <Field Name="BranchTaken" Type="bool" Override="true"/> <Field Name="ConditionValue" Type="bool" Override="true"/> </Node> <Node Name="ElifDirectiveTriviaSyntax" Base="ConditionalDirectiveTriviaSyntax"> <Kind Name="ElifDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="ElifKeyword" Type="SyntaxToken"> <Kind Name="ElifKeyword"/> </Field> <Field Name="Condition" Type="ExpressionSyntax" Override="true"/> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> <Field Name="BranchTaken" Type="bool" Override="true"/> <Field Name="ConditionValue" Type="bool" Override="true"/> </Node> <Node Name="ElseDirectiveTriviaSyntax" Base="BranchingDirectiveTriviaSyntax"> <Kind Name="ElseDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="ElseKeyword" Type="SyntaxToken"> <Kind Name="ElseKeyword"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> <Field Name="BranchTaken" Type="bool" Override="true"/> </Node> <Node Name="EndIfDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="EndIfDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="EndIfKeyword" Type="SyntaxToken"> <Kind Name="EndIfKeyword"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="RegionDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="RegionDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="RegionKeyword" Type="SyntaxToken"> <Kind Name="RegionKeyword"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="EndRegionDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="EndRegionDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="EndRegionKeyword" Type="SyntaxToken"> <Kind Name="EndRegionKeyword"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="ErrorDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="ErrorDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="ErrorKeyword" Type="SyntaxToken"> <Kind Name="ErrorKeyword"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="WarningDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="WarningDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="WarningKeyword" Type="SyntaxToken"> <Kind Name="WarningKeyword"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="BadDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="BadDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="Identifier" Type="SyntaxToken" /> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="DefineDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="DefineDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="DefineKeyword" Type="SyntaxToken"> <Kind Name="DefineKeyword"/> </Field> <Field Name="Name" Type="SyntaxToken"> <!-- should be identifier --> <Kind Name="IdentifierToken"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="UndefDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="UndefDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="UndefKeyword" Type="SyntaxToken"> <Kind Name="UndefKeyword"/> </Field> <Field Name="Name" Type="SyntaxToken"> <!-- should be identifier --> <Kind Name="IdentifierToken"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <AbstractNode Name="LineOrSpanDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Field Name="LineKeyword" Type="SyntaxToken" /> <Field Name="File" Type="SyntaxToken" Optional="true" /> </AbstractNode> <Node Name="LineDirectiveTriviaSyntax" Base="LineOrSpanDirectiveTriviaSyntax"> <Kind Name="LineDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="LineKeyword" Type="SyntaxToken" Override="true"> <Kind Name="LineKeyword"/> </Field> <Field Name="Line" Type="SyntaxToken"> <Kind Name="NumericLiteralToken"/> <Kind Name="DefaultKeyword"/> <Kind Name="HiddenKeyword"/> </Field> <Field Name="File" Type="SyntaxToken" Optional="true" Override="true"> <Kind Name="StringLiteralToken"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="LineDirectivePositionSyntax" Base="CSharpSyntaxNode"> <Kind Name="LineDirectivePosition"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <Field Name="Line" Type="SyntaxToken"> <Kind Name="NumericLiteralToken"/> </Field> <Field Name="CommaToken" Type="SyntaxToken"> <Kind Name="CommaToken"/> </Field> <Field Name="Character" Type="SyntaxToken"> <Kind Name="NumericLiteralToken"/> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> </Node> <Node Name="LineSpanDirectiveTriviaSyntax" Base="LineOrSpanDirectiveTriviaSyntax"> <Kind Name="LineSpanDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="LineKeyword" Type="SyntaxToken" Override="true"> <Kind Name="LineKeyword"/> </Field> <Field Name="Start" Type="LineDirectivePositionSyntax" /> <Field Name="MinusToken" Type="SyntaxToken"> <Kind Name="MinusToken"/> </Field> <Field Name="End" Type="LineDirectivePositionSyntax" /> <Field Name="CharacterOffset" Type="SyntaxToken" Optional="true"> <Kind Name="NumericLiteralToken"/> </Field> <Field Name="File" Type="SyntaxToken" Override="true"> <Kind Name="StringLiteralToken"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="PragmaWarningDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="PragmaWarningDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="PragmaKeyword" Type="SyntaxToken"> <Kind Name="PragmaKeyword"/> </Field> <Field Name="WarningKeyword" Type="SyntaxToken"> <Kind Name="WarningKeyword"/> </Field> <Field Name="DisableOrRestoreKeyword" Type="SyntaxToken"> <Kind Name="DisableKeyword"/> <Kind Name="RestoreKeyword"/> </Field> <Field Name="ErrorCodes" Type="SeparatedSyntaxList&lt;ExpressionSyntax&gt;"/> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="PragmaChecksumDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="PragmaChecksumDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="PragmaKeyword" Type="SyntaxToken"> <Kind Name="PragmaKeyword"/> </Field> <Field Name="ChecksumKeyword" Type="SyntaxToken"> <Kind Name="ChecksumKeyword"/> </Field> <Field Name="File" Type="SyntaxToken"> <Kind Name="StringLiteralToken"/> </Field> <Field Name="Guid" Type="SyntaxToken"> <Kind Name="StringLiteralToken"/> </Field> <Field Name="Bytes" Type="SyntaxToken"> <Kind Name="StringLiteralToken"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="ReferenceDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="ReferenceDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="ReferenceKeyword" Type="SyntaxToken"> <Kind Name="ReferenceKeyword"/> </Field> <Field Name="File" Type="SyntaxToken"> <Kind Name="StringLiteralToken"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="LoadDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="LoadDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="LoadKeyword" Type="SyntaxToken"> <Kind Name="LoadKeyword"/> </Field> <Field Name="File" Type="SyntaxToken"> <Kind Name="StringLiteralToken"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="ShebangDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="ShebangDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="ExclamationToken" Type="SyntaxToken"> <Kind Name="ExclamationToken"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="NullableDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="NullableDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="NullableKeyword" Type="SyntaxToken"> <Kind Name="NullableKeyword"/> </Field> <Field Name="SettingToken" Type="SyntaxToken"> <Kind Name="EnableKeyword"/> <Kind Name="DisableKeyword"/> <Kind Name="RestoreKeyword"/> </Field> <Field Name="TargetToken" Type="SyntaxToken" Optional="true"> <Kind Name="WarningsKeyword"/> <Kind Name="AnnotationsKeyword"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> </Tree>
<?xml version="1.0" encoding="utf-8"?> <!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. --> <!-- To re-generate source from this file, run eng/generate-compiler-code.cmd --> <Tree Root="SyntaxNode"> <PredefinedNode Name="CSharpSyntaxNode" Base="SyntaxNode"/> <PredefinedNode Name="SyntaxToken" Base="CSharpSyntaxNode"/> <PredefinedNode Name="StructuredTriviaSyntax" Base="CSharpSyntaxNode"/> <!-- Names --> <AbstractNode Name="NameSyntax" Base="TypeSyntax"> <TypeComment> <summary>Provides the base class from which the classes that represent name syntax nodes are derived. This is an abstract class.</summary> </TypeComment> </AbstractNode> <AbstractNode Name="SimpleNameSyntax" Base="NameSyntax"> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>SyntaxToken representing the identifier of the simple name.</summary> </PropertyComment> <Kind Name="IdentifierToken" /> </Field> <TypeComment> <summary>Provides the base class from which the classes that represent simple name syntax nodes are derived. This is an abstract class.</summary> </TypeComment> </AbstractNode> <Node Name="IdentifierNameSyntax" Base="SimpleNameSyntax"> <Kind Name="IdentifierName"/> <Field Name="Identifier" Type="SyntaxToken" Override="true"> <Kind Name="IdentifierToken"/> <Kind Name="GlobalKeyword"/> <PropertyComment> <summary>SyntaxToken representing the keyword for the kind of the identifier name.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for identifier name.</summary> </TypeComment> <FactoryComment> <summary>Creates an IdentifierNameSyntax node.</summary> </FactoryComment> </Node> <Node Name="QualifiedNameSyntax" Base="NameSyntax"> <Kind Name="QualifiedName"/> <Field Name="Left" Type="NameSyntax"> <PropertyComment> <summary>NameSyntax node representing the name on the left side of the dot token of the qualified name.</summary> </PropertyComment> </Field> <Field Name="DotToken" Type="SyntaxToken"> <Kind Name="DotToken"/> <PropertyComment> <summary>SyntaxToken representing the dot.</summary> </PropertyComment> </Field> <Field Name="Right" Type="SimpleNameSyntax"> <PropertyComment> <summary>SimpleNameSyntax node representing the name on the right side of the dot token of the qualified name.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for qualified name.</summary> </TypeComment> <FactoryComment> <summary>Creates a QualifiedNameSyntax node.</summary> </FactoryComment> </Node> <Node Name="GenericNameSyntax" Base="SimpleNameSyntax"> <Kind Name="GenericName"/> <Field Name="Identifier" Type="SyntaxToken" Override="true"> <Kind Name="IdentifierToken"/> <PropertyComment> <summary>SyntaxToken representing the name of the identifier of the generic name.</summary> </PropertyComment> </Field> <Field Name="TypeArgumentList" Type="TypeArgumentListSyntax"> <PropertyComment> <summary>TypeArgumentListSyntax node representing the list of type arguments of the generic name.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for generic name.</summary> </TypeComment> <FactoryComment> <summary>Creates a GenericNameSyntax node.</summary> </FactoryComment> </Node> <Node Name="TypeArgumentListSyntax" Base="CSharpSyntaxNode"> <Kind Name="TypeArgumentList"/> <Field Name="LessThanToken" Type="SyntaxToken"> <Kind Name="LessThanToken" /> <PropertyComment> <summary>SyntaxToken representing less than.</summary> </PropertyComment> </Field> <Field Name="Arguments" Type="SeparatedSyntaxList&lt;TypeSyntax&gt;"> <PropertyComment> <summary>SeparatedSyntaxList of TypeSyntax node representing the type arguments.</summary> </PropertyComment> </Field> <Field Name="GreaterThanToken" Type="SyntaxToken"> <Kind Name="GreaterThanToken"/> <PropertyComment> <summary>SyntaxToken representing greater than.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for type argument list.</summary> </TypeComment> <FactoryComment> <summary>Creates a TypeArgumentListSyntax node.</summary> </FactoryComment> </Node> <Node Name="AliasQualifiedNameSyntax" Base="NameSyntax"> <Kind Name="AliasQualifiedName"/> <Field Name="Alias" Type="IdentifierNameSyntax"> <PropertyComment> <summary>IdentifierNameSyntax node representing the name of the alias</summary> </PropertyComment> </Field> <Field Name="ColonColonToken" Type="SyntaxToken"> <Kind Name="ColonColonToken"/> <PropertyComment> <summary>SyntaxToken representing colon colon.</summary> </PropertyComment> </Field> <Field Name="Name" Type="SimpleNameSyntax"> <PropertyComment> <summary>SimpleNameSyntax node representing the name that is being alias qualified.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for alias qualified name.</summary> </TypeComment> <FactoryComment> <summary>Creates an AliasQualifiedNameSyntax node.</summary> </FactoryComment> </Node> <!-- Type names --> <AbstractNode Name="TypeSyntax" Base="ExpressionSyntax"> <TypeComment> <summary>Provides the base class from which the classes that represent type syntax nodes are derived. This is an abstract class.</summary> </TypeComment> </AbstractNode> <Node Name="PredefinedTypeSyntax" Base="TypeSyntax"> <Kind Name="PredefinedType"/> <Field Name="Keyword" Type="SyntaxToken"> <Kind Name="BoolKeyword"/> <Kind Name="ByteKeyword"/> <Kind Name="SByteKeyword"/> <Kind Name="IntKeyword"/> <Kind Name="UIntKeyword"/> <Kind Name="ShortKeyword"/> <Kind Name="UShortKeyword"/> <Kind Name="LongKeyword"/> <Kind Name="ULongKeyword"/> <Kind Name="FloatKeyword"/> <Kind Name="DoubleKeyword"/> <Kind Name="DecimalKeyword"/> <Kind Name="StringKeyword"/> <Kind Name="CharKeyword"/> <Kind Name="ObjectKeyword"/> <Kind Name="VoidKeyword"/> <PropertyComment> <summary>SyntaxToken which represents the keyword corresponding to the predefined type.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for predefined types.</summary> </TypeComment> <FactoryComment> <summary>Creates a PredefinedTypeSyntax node.</summary> </FactoryComment> </Node> <Node Name="ArrayTypeSyntax" Base="TypeSyntax"> <Kind Name="ArrayType"/> <Field Name="ElementType" Type="TypeSyntax"> <PropertyComment> <summary>TypeSyntax node representing the type of the element of the array.</summary> </PropertyComment> </Field> <Field Name="RankSpecifiers" Type="SyntaxList&lt;ArrayRankSpecifierSyntax&gt;" MinCount="1"> <PropertyComment> <summary>SyntaxList of ArrayRankSpecifierSyntax nodes representing the list of rank specifiers for the array.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for the array type.</summary> </TypeComment> <FactoryComment> <summary>Creates an ArrayTypeSyntax node.</summary> </FactoryComment> </Node> <Node Name="ArrayRankSpecifierSyntax" Base="CSharpSyntaxNode"> <Kind Name="ArrayRankSpecifier" /> <Field Name="OpenBracketToken" Type="SyntaxToken"> <Kind Name="OpenBracketToken"/> </Field> <Field Name="Sizes" Type="SeparatedSyntaxList&lt;ExpressionSyntax&gt;"/> <Field Name="CloseBracketToken" Type="SyntaxToken"> <Kind Name="CloseBracketToken"/> </Field> </Node> <Node Name="PointerTypeSyntax" Base="TypeSyntax"> <Kind Name="PointerType"/> <Field Name="ElementType" Type="TypeSyntax"> <PropertyComment> <summary>TypeSyntax node that represents the element type of the pointer.</summary> </PropertyComment> </Field> <Field Name="AsteriskToken" Type="SyntaxToken"> <Kind Name="AsteriskToken"/> <PropertyComment> <summary>SyntaxToken representing the asterisk.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for pointer type.</summary> </TypeComment> <FactoryComment> <summary>Creates a PointerTypeSyntax node.</summary> </FactoryComment> </Node> <Node Name="FunctionPointerTypeSyntax" Base="TypeSyntax"> <Kind Name="FunctionPointerType"/> <Field Name="DelegateKeyword" Type="SyntaxToken"> <Kind Name="DelegateKeyword"/> <PropertyComment> <summary>SyntaxToken representing the delegate keyword.</summary> </PropertyComment> </Field> <Field Name="AsteriskToken" Type="SyntaxToken"> <Kind Name="AsteriskToken"/> <PropertyComment> <summary>SyntaxToken representing the asterisk.</summary> </PropertyComment> </Field> <Field Name="CallingConvention" Type="FunctionPointerCallingConventionSyntax" Optional="true"> <PropertyComment> <summary>Node representing the optional calling convention.</summary> </PropertyComment> </Field> <Field Name="ParameterList" Type="FunctionPointerParameterListSyntax"> <PropertyComment> <summary>List of the parameter types and return type of the function pointer.</summary> </PropertyComment> </Field> </Node> <Node Name="FunctionPointerParameterListSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Function pointer parameter list syntax.</summary> </TypeComment> <Kind Name="FunctionPointerParameterList"/> <Field Name="LessThanToken" Type="SyntaxToken"> <Kind Name="LessThanToken"/> <PropertyComment> <summary>SyntaxToken representing the less than token.</summary> </PropertyComment> </Field> <Field Name="Parameters" Type="SeparatedSyntaxList&lt;FunctionPointerParameterSyntax&gt;" MinCount="1"> <PropertyComment> <summary>SeparatedSyntaxList of ParameterSyntaxes representing the list of parameters and return type.</summary> </PropertyComment> </Field> <Field Name="GreaterThanToken" Type="SyntaxToken"> <Kind Name="GreaterThanToken"/> <PropertyComment> <summary>SyntaxToken representing the greater than token.</summary> </PropertyComment> </Field> </Node> <Node Name="FunctionPointerCallingConventionSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Function pointer calling convention syntax.</summary> </TypeComment> <Kind Name="FunctionPointerCallingConvention"/> <Field Name="ManagedOrUnmanagedKeyword" Type="SyntaxToken"> <Kind Name="ManagedKeyword"/> <Kind Name="UnmanagedKeyword"/> <PropertyComment> <summary>SyntaxToken representing whether the calling convention is managed or unmanaged.</summary> </PropertyComment> </Field> <Field Name="UnmanagedCallingConventionList" Type="FunctionPointerUnmanagedCallingConventionListSyntax" Optional="true"> <PropertyComment> <summary>Optional list of identifiers that will contribute to an unmanaged calling convention.</summary> </PropertyComment> </Field> </Node> <Node Name="FunctionPointerUnmanagedCallingConventionListSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Function pointer calling convention syntax.</summary> </TypeComment> <Kind Name="FunctionPointerUnmanagedCallingConventionList"/> <Field Name="OpenBracketToken" Type="SyntaxToken"> <Kind Name="OpenBracketToken"/> <PropertyComment> <summary>SyntaxToken representing open bracket.</summary> </PropertyComment> </Field> <Field Name="CallingConventions" Type="SeparatedSyntaxList&lt;FunctionPointerUnmanagedCallingConventionSyntax&gt;" MinCount="1"> <PropertyComment> <summary>SeparatedSyntaxList of calling convention identifiers.</summary> </PropertyComment> </Field> <Field Name="CloseBracketToken" Type="SyntaxToken"> <Kind Name="CloseBracketToken"/> <PropertyComment> <summary>SyntaxToken representing close bracket.</summary> </PropertyComment> </Field> </Node> <Node Name="FunctionPointerUnmanagedCallingConventionSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Individual function pointer unmanaged calling convention.</summary> </TypeComment> <Kind Name="FunctionPointerUnmanagedCallingConvention"/> <Field Name="Name" Type="SyntaxToken"> <Kind Name="IdentifierToken"/> <PropertyComment> <summary>SyntaxToken representing the calling convention identifier.</summary> </PropertyComment> </Field> </Node> <Node Name="NullableTypeSyntax" Base="TypeSyntax"> <Kind Name="NullableType"/> <Field Name="ElementType" Type="TypeSyntax"> <PropertyComment> <summary>TypeSyntax node representing the type of the element.</summary> </PropertyComment> </Field> <Field Name="QuestionToken" Type="SyntaxToken"> <Kind Name="QuestionToken"/> <PropertyComment> <summary>SyntaxToken representing the question mark.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for a nullable type.</summary> </TypeComment> <FactoryComment> <summary>Creates a NullableTypeSyntax node.</summary> </FactoryComment> </Node> <Node Name="TupleTypeSyntax" Base="TypeSyntax"> <Kind Name="TupleType"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing the open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Elements" Type="SeparatedSyntaxList&lt;TupleElementSyntax&gt;" MinCount="2"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing the close parenthesis.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for tuple type.</summary> </TypeComment> <FactoryComment> <summary>Creates a TupleTypeSyntax node.</summary> </FactoryComment> </Node> <Node Name="TupleElementSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Tuple type element.</summary> </TypeComment> <Kind Name="TupleElement"/> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>Gets the type of the tuple element.</summary> </PropertyComment> </Field> <Field Name="Identifier" Type="SyntaxToken" Optional="true"> <PropertyComment> <summary>Gets the name of the tuple element.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> </Node> <Node Name="OmittedTypeArgumentSyntax" Base="TypeSyntax"> <Kind Name="OmittedTypeArgument"/> <Field Name="OmittedTypeArgumentToken" Type="SyntaxToken"> <Kind Name="OmittedTypeArgumentToken"/> <PropertyComment> <summary>SyntaxToken representing the omitted type argument.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents a placeholder in the type argument list of an unbound generic type.</summary> </TypeComment> <FactoryComment> <summary>Creates an OmittedTypeArgumentSyntax node.</summary> </FactoryComment> </Node> <Node Name="RefTypeSyntax" Base="TypeSyntax"> <TypeComment> <summary>The ref modifier of a method's return value or a local.</summary> </TypeComment> <Kind Name="RefType"/> <Field Name="RefKeyword" Type="SyntaxToken"> <Kind Name="RefKeyword"/> </Field> <Field Name="ReadOnlyKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="ReadOnlyKeyword"/> <PropertyComment> <summary>Gets the optional "readonly" keyword.</summary> </PropertyComment> </Field> <Field Name="Type" Type="TypeSyntax"/> </Node> <!-- Expressions --> <AbstractNode Name="ExpressionOrPatternSyntax" Base="CSharpSyntaxNode" /> <AbstractNode Name="ExpressionSyntax" Base="ExpressionOrPatternSyntax"> <TypeComment> <summary>Provides the base class from which the classes that represent expression syntax nodes are derived. This is an abstract class.</summary> </TypeComment> </AbstractNode> <Node Name="ParenthesizedExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="ParenthesizedExpression"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing the open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the expression enclosed within the parenthesis.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing the close parenthesis.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for parenthesized expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a ParenthesizedExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="TupleExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="TupleExpression"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing the open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Arguments" Type="SeparatedSyntaxList&lt;ArgumentSyntax&gt;" MinCount="2"> <PropertyComment> <summary>SeparatedSyntaxList of ArgumentSyntax representing the list of arguments.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing the close parenthesis.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for tuple expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a TupleExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="PrefixUnaryExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="UnaryPlusExpression"/> <Kind Name="UnaryMinusExpression"/> <Kind Name="BitwiseNotExpression"/> <Kind Name="LogicalNotExpression"/> <Kind Name="PreIncrementExpression"/> <Kind Name="PreDecrementExpression"/> <Kind Name="AddressOfExpression"/> <Kind Name="PointerIndirectionExpression"/> <Kind Name="IndexExpression"/> <Field Name="OperatorToken" Type="SyntaxToken"> <Kind Name="PlusToken"/> <Kind Name="MinusToken"/> <Kind Name="TildeToken"/> <Kind Name="ExclamationToken"/> <Kind Name="PlusPlusToken"/> <Kind Name="MinusMinusToken"/> <Kind Name="AmpersandToken"/> <Kind Name="AsteriskToken"/> <Kind Name="CaretToken"/>" <PropertyComment> <summary>SyntaxToken representing the kind of the operator of the prefix unary expression.</summary> </PropertyComment> </Field> <Field Name="Operand" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax representing the operand of the prefix unary expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for prefix unary expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a PrefixUnaryExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="AwaitExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="AwaitExpression"/> <Field Name="AwaitKeyword" Type="SyntaxToken"> <Kind Name="AwaitKeyword"/> <PropertyComment> <summary>SyntaxToken representing the kind "await" keyword.</summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax representing the operand of the "await" operator.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for an "await" expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an AwaitExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="PostfixUnaryExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="PostIncrementExpression"/> <Kind Name="PostDecrementExpression"/> <Kind Name="SuppressNullableWarningExpression"/> <Field Name="Operand" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax representing the operand of the postfix unary expression.</summary> </PropertyComment> </Field> <Field Name="OperatorToken" Type="SyntaxToken"> <Kind Name="PlusPlusToken"/> <Kind Name="MinusMinusToken"/> <Kind Name="ExclamationToken"/> <PropertyComment> <summary>SyntaxToken representing the kind of the operator of the postfix unary expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for postfix unary expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a PostfixUnaryExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="MemberAccessExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="SimpleMemberAccessExpression"/> <Kind Name="PointerMemberAccessExpression"/> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the object that the member belongs to.</summary> </PropertyComment> </Field> <Field Name="OperatorToken" Type="SyntaxToken"> <Kind Name="DotToken"/> <Kind Name="MinusGreaterThanToken"/> <PropertyComment> <summary>SyntaxToken representing the kind of the operator in the member access expression.</summary> </PropertyComment> </Field> <Field Name="Name" Type="SimpleNameSyntax"> <PropertyComment> <summary>SimpleNameSyntax node representing the member being accessed.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for member access expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a MemberAccessExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="ConditionalAccessExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="ConditionalAccessExpression"/> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the object conditionally accessed.</summary> </PropertyComment> </Field> <Field Name="OperatorToken" Type="SyntaxToken"> <Kind Name="QuestionToken"/> <PropertyComment> <summary>SyntaxToken representing the question mark.</summary> </PropertyComment> </Field> <Field Name="WhenNotNull" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the access expression to be executed when the object is not null.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for conditional access expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a ConditionalAccessExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="MemberBindingExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="MemberBindingExpression"/> <Field Name="OperatorToken" Type="SyntaxToken"> <Kind Name="DotToken"/> <PropertyComment> <summary>SyntaxToken representing dot.</summary> </PropertyComment> </Field> <Field Name="Name" Type="SimpleNameSyntax"> <PropertyComment> <summary>SimpleNameSyntax node representing the member being bound to.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for member binding expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a MemberBindingExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="ElementBindingExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="ElementBindingExpression"/> <Field Name="ArgumentList" Type="BracketedArgumentListSyntax"> <PropertyComment> <summary>BracketedArgumentListSyntax node representing the list of arguments of the element binding expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for element binding expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an ElementBindingExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="RangeExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="RangeExpression"/> <Field Name="LeftOperand" Type="ExpressionSyntax" Optional="true"> <PropertyComment> <summary>ExpressionSyntax node representing the expression on the left of the range operator.</summary> </PropertyComment> </Field> <Field Name="OperatorToken" Type="SyntaxToken"> <Kind Name="DotDotToken"/> <PropertyComment> <summary>SyntaxToken representing the operator of the range expression.</summary> </PropertyComment> </Field> <Field Name="RightOperand" Type="ExpressionSyntax" Optional="true"> <PropertyComment> <summary>ExpressionSyntax node representing the expression on the right of the range operator.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for a range expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an RangeExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="ImplicitElementAccessSyntax" Base="ExpressionSyntax"> <Kind Name="ImplicitElementAccess"/> <Field Name="ArgumentList" Type="BracketedArgumentListSyntax"> <PropertyComment> <summary>BracketedArgumentListSyntax node representing the list of arguments of the implicit element access expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for implicit element access expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an ImplicitElementAccessSyntax node.</summary> </FactoryComment> </Node> <Node Name="BinaryExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="AddExpression"/> <Kind Name="SubtractExpression"/> <Kind Name="MultiplyExpression"/> <Kind Name="DivideExpression"/> <Kind Name="ModuloExpression"/> <Kind Name="LeftShiftExpression"/> <Kind Name="RightShiftExpression"/> <Kind Name="LogicalOrExpression"/> <Kind Name="LogicalAndExpression"/> <Kind Name="BitwiseOrExpression"/> <Kind Name="BitwiseAndExpression"/> <Kind Name="ExclusiveOrExpression"/> <Kind Name="EqualsExpression"/> <Kind Name="NotEqualsExpression"/> <Kind Name="LessThanExpression"/> <Kind Name="LessThanOrEqualExpression"/> <Kind Name="GreaterThanExpression"/> <Kind Name="GreaterThanOrEqualExpression"/> <Kind Name="IsExpression"/> <Kind Name="AsExpression"/> <Kind Name="CoalesceExpression"/> <Field Name="Left" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the expression on the left of the binary operator.</summary> </PropertyComment> </Field> <Field Name="OperatorToken" Type="SyntaxToken"> <Kind Name="PlusToken"/> <Kind Name="MinusToken"/> <Kind Name="AsteriskToken"/> <Kind Name="SlashToken"/> <Kind Name="PercentToken"/> <Kind Name="LessThanLessThanToken"/> <Kind Name="GreaterThanGreaterThanToken"/> <Kind Name="BarBarToken"/> <Kind Name="AmpersandAmpersandToken"/> <Kind Name="BarToken"/> <Kind Name="AmpersandToken"/> <Kind Name="CaretToken"/> <Kind Name="EqualsEqualsToken"/> <Kind Name="ExclamationEqualsToken"/> <Kind Name="LessThanToken"/> <Kind Name="LessThanEqualsToken"/> <Kind Name="GreaterThanToken"/> <Kind Name="GreaterThanEqualsToken"/> <Kind Name="IsKeyword"/> <Kind Name="AsKeyword"/> <Kind Name="QuestionQuestionToken"/> <PropertyComment> <summary>SyntaxToken representing the operator of the binary expression.</summary> </PropertyComment> </Field> <Field Name="Right" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the expression on the right of the binary operator.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents an expression that has a binary operator.</summary> </TypeComment> <FactoryComment> <summary>Creates a BinaryExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="AssignmentExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="SimpleAssignmentExpression"/> <Kind Name="AddAssignmentExpression"/> <Kind Name="SubtractAssignmentExpression"/> <Kind Name="MultiplyAssignmentExpression"/> <Kind Name="DivideAssignmentExpression"/> <Kind Name="ModuloAssignmentExpression"/> <Kind Name="AndAssignmentExpression"/> <Kind Name="ExclusiveOrAssignmentExpression"/> <Kind Name="OrAssignmentExpression"/> <Kind Name="LeftShiftAssignmentExpression"/> <Kind Name="RightShiftAssignmentExpression"/> <Kind Name="CoalesceAssignmentExpression" /> <Field Name="Left" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the expression on the left of the assignment operator.</summary> </PropertyComment> </Field> <Field Name="OperatorToken" Type="SyntaxToken"> <Kind Name="EqualsToken"/> <Kind Name="PlusEqualsToken"/> <Kind Name="MinusEqualsToken"/> <Kind Name="AsteriskEqualsToken"/> <Kind Name="SlashEqualsToken"/> <Kind Name="PercentEqualsToken"/> <Kind Name="AmpersandEqualsToken"/> <Kind Name="CaretEqualsToken"/> <Kind Name="BarEqualsToken"/> <Kind Name="LessThanLessThanEqualsToken"/> <Kind Name="GreaterThanGreaterThanEqualsToken"/> <Kind Name="QuestionQuestionEqualsToken" /> <PropertyComment> <summary>SyntaxToken representing the operator of the assignment expression.</summary> </PropertyComment> </Field> <Field Name="Right" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the expression on the right of the assignment operator.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents an expression that has an assignment operator.</summary> </TypeComment> <FactoryComment> <summary>Creates an AssignmentExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="ConditionalExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="ConditionalExpression"/> <Field Name="Condition" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the condition of the conditional expression.</summary> </PropertyComment> </Field> <Field Name="QuestionToken" Type="SyntaxToken"> <Kind Name="QuestionToken"/> <PropertyComment> <summary>SyntaxToken representing the question mark.</summary> </PropertyComment> </Field> <Field Name="WhenTrue" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the expression to be executed when the condition is true.</summary> </PropertyComment> </Field> <Field Name="ColonToken" Type="SyntaxToken"> <Kind Name="ColonToken"/> <PropertyComment> <summary>SyntaxToken representing the colon.</summary> </PropertyComment> </Field> <Field Name="WhenFalse" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the expression to be executed when the condition is false.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for conditional expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a ConditionalExpressionSyntax node.</summary> </FactoryComment> </Node> <AbstractNode Name="InstanceExpressionSyntax" Base="ExpressionSyntax"> <TypeComment> <summary>Provides the base class from which the classes that represent instance expression syntax nodes are derived. This is an abstract class.</summary> </TypeComment> </AbstractNode> <Node Name="ThisExpressionSyntax" Base="InstanceExpressionSyntax"> <Kind Name="ThisExpression"/> <Field Name="Token" Type="SyntaxToken"> <Kind Name="ThisKeyword"/> <PropertyComment> <summary>SyntaxToken representing the this keyword.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for a this expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a ThisExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="BaseExpressionSyntax" Base="InstanceExpressionSyntax"> <Kind Name="BaseExpression"/> <Field Name="Token" Type="SyntaxToken"> <Kind Name="BaseKeyword"/> <PropertyComment> <summary>SyntaxToken representing the base keyword.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for a base expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a BaseExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="LiteralExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="ArgListExpression"/> <Kind Name="NumericLiteralExpression"/> <Kind Name="StringLiteralExpression"/> <Kind Name="CharacterLiteralExpression"/> <Kind Name="TrueLiteralExpression"/> <Kind Name="FalseLiteralExpression"/> <Kind Name="NullLiteralExpression"/> <Kind Name="DefaultLiteralExpression"/> <Field Name="Token" Type="SyntaxToken"> <Kind Name="ArgListKeyword"/> <Kind Name="NumericLiteralToken"/> <Kind Name="StringLiteralToken"/> <Kind Name="CharacterLiteralToken"/> <Kind Name="TrueKeyword"/> <Kind Name="FalseKeyword"/> <Kind Name="NullKeyword"/> <Kind Name="DefaultKeyword"/> <PropertyComment> <summary>SyntaxToken representing the keyword corresponding to the kind of the literal expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for a literal expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a LiteralExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="MakeRefExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="MakeRefExpression"/> <Field Name="Keyword" Type="SyntaxToken"> <Kind Name="MakeRefKeyword"/> <PropertyComment> <summary>SyntaxToken representing the MakeRefKeyword.</summary> </PropertyComment> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>Argument of the primary function.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing close parenthesis.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for MakeRef expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a MakeRefExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="RefTypeExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="RefTypeExpression"/> <Field Name="Keyword" Type="SyntaxToken"> <Kind Name="RefTypeKeyword"/> <PropertyComment> <summary>SyntaxToken representing the RefTypeKeyword.</summary> </PropertyComment> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>Argument of the primary function.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing close parenthesis.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for RefType expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a RefTypeExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="RefValueExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="RefValueExpression"/> <Field Name="Keyword" Type="SyntaxToken"> <Kind Name="RefValueKeyword"/> <PropertyComment> <summary>SyntaxToken representing the RefValueKeyword.</summary> </PropertyComment> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>Typed reference expression.</summary> </PropertyComment> </Field> <Field Name="Comma" Type="SyntaxToken"> <Kind Name="CommaToken"/> <PropertyComment> <summary>Comma separating the arguments.</summary> </PropertyComment> </Field> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>The type of the value.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing close parenthesis.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for RefValue expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a RefValueExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="CheckedExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="CheckedExpression"/> <Kind Name="UncheckedExpression"/> <Field Name="Keyword" Type="SyntaxToken"> <Kind Name="CheckedKeyword"/> <Kind Name="UncheckedKeyword"/> <PropertyComment> <summary>SyntaxToken representing the checked or unchecked keyword.</summary> </PropertyComment> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>Argument of the primary function.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing close parenthesis.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for Checked or Unchecked expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a CheckedExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="DefaultExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="DefaultExpression"/> <Field Name="Keyword" Type="SyntaxToken"> <Kind Name="DefaultKeyword"/> <PropertyComment> <summary>SyntaxToken representing the DefaultKeyword.</summary> </PropertyComment> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>Argument of the primary function.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing close parenthesis.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for Default expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a DefaultExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="TypeOfExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="TypeOfExpression"/> <Field Name="Keyword" Type="SyntaxToken"> <Kind Name="TypeOfKeyword"/> <PropertyComment> <summary>SyntaxToken representing the TypeOfKeyword.</summary> </PropertyComment> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>The expression to return type of.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing close parenthesis.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for TypeOf expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a TypeOfExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="SizeOfExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="SizeOfExpression"/> <Field Name="Keyword" Type="SyntaxToken"> <Kind Name="SizeOfKeyword"/> <PropertyComment> <summary>SyntaxToken representing the SizeOfKeyword.</summary> </PropertyComment> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>Argument of the primary function.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing close parenthesis.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for SizeOf expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a SizeOfExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="InvocationExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="InvocationExpression"/> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the expression part of the invocation.</summary> </PropertyComment> </Field> <Field Name="ArgumentList" Type="ArgumentListSyntax"> <PropertyComment> <summary>ArgumentListSyntax node representing the list of arguments of the invocation expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for invocation expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an InvocationExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="ElementAccessExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="ElementAccessExpression"/> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the expression which is accessing the element.</summary> </PropertyComment> </Field> <Field Name="ArgumentList" Type="BracketedArgumentListSyntax"> <PropertyComment> <summary>BracketedArgumentListSyntax node representing the list of arguments of the element access expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for element access expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an ElementAccessExpressionSyntax node.</summary> </FactoryComment> </Node> <AbstractNode Name="BaseArgumentListSyntax" Base="CSharpSyntaxNode"> <Field Name="Arguments" Type="SeparatedSyntaxList&lt;ArgumentSyntax&gt;"> <PropertyComment> <summary>SeparatedSyntaxList of ArgumentSyntax nodes representing the list of arguments.</summary> </PropertyComment> </Field> <TypeComment> <summary>Provides the base class from which the classes that represent argument list syntax nodes are derived. This is an abstract class.</summary> </TypeComment> </AbstractNode> <Node Name="ArgumentListSyntax" Base="BaseArgumentListSyntax"> <Kind Name="ArgumentList"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Arguments" Type="SeparatedSyntaxList&lt;ArgumentSyntax&gt;" Override="true"> <PropertyComment> <summary>SeparatedSyntaxList of ArgumentSyntax representing the list of arguments.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing close parenthesis.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for the list of arguments.</summary> </TypeComment> <FactoryComment> <summary>Creates an ArgumentListSyntax node.</summary> </FactoryComment> </Node> <Node Name="BracketedArgumentListSyntax" Base="BaseArgumentListSyntax"> <Kind Name="BracketedArgumentList"/> <Field Name="OpenBracketToken" Type="SyntaxToken"> <Kind Name="OpenBracketToken"/> <PropertyComment> <summary>SyntaxToken representing open bracket.</summary> </PropertyComment> </Field> <Field Name="Arguments" Type="SeparatedSyntaxList&lt;ArgumentSyntax&gt;" Override="true" MinCount="1"> <PropertyComment> <summary>SeparatedSyntaxList of ArgumentSyntax representing the list of arguments.</summary> </PropertyComment> </Field> <Field Name="CloseBracketToken" Type="SyntaxToken"> <Kind Name="CloseBracketToken"/> <PropertyComment> <summary>SyntaxToken representing close bracket.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for bracketed argument list.</summary> </TypeComment> <FactoryComment> <summary>Creates a BracketedArgumentListSyntax node.</summary> </FactoryComment> </Node> <Node Name="ArgumentSyntax" Base="CSharpSyntaxNode"> <Kind Name="Argument"/> <Field Name="NameColon" Type="NameColonSyntax" Optional="true"> <PropertyComment> <summary>NameColonSyntax node representing the optional name arguments.</summary> </PropertyComment> </Field> <Field Name="RefKindKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="RefKeyword"/> <Kind Name="OutKeyword"/> <Kind Name="InKeyword"/> <PropertyComment> <summary>SyntaxToken representing the optional ref or out keyword.</summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the argument.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for argument.</summary> </TypeComment> <FactoryComment> <summary>Creates an ArgumentSyntax node.</summary> </FactoryComment> </Node> <AbstractNode Name="BaseExpressionColonSyntax" Base="CSharpSyntaxNode"> <Field Name="Expression" Type="ExpressionSyntax"/> <Field Name="ColonToken" Type="SyntaxToken"> <Kind Name="ColonToken"/> </Field> </AbstractNode> <Node Name="ExpressionColonSyntax" Base="BaseExpressionColonSyntax"> <Kind Name="ExpressionColon"/> <Field Name="Expression" Type="ExpressionSyntax" Override="true"/> <Field Name="ColonToken" Type="SyntaxToken" Override="true"/> </Node> <Node Name="NameColonSyntax" Base="BaseExpressionColonSyntax"> <Kind Name="NameColon"/> <Field Name="Name" Type="IdentifierNameSyntax"> <Kind Name="IdentifierName"/> <PropertyComment> <summary>IdentifierNameSyntax representing the identifier name.</summary> </PropertyComment> </Field> <Field Name="ColonToken" Type="SyntaxToken" Override="true"> <PropertyComment> <summary>SyntaxToken representing colon.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for name colon syntax.</summary> </TypeComment> <FactoryComment> <summary>Creates a NameColonSyntax node.</summary> </FactoryComment> </Node> <Node Name="DeclarationExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="DeclarationExpression"/> <Field Name="Type" Type="TypeSyntax"/> <Field Name="Designation" Type="VariableDesignationSyntax"> <PropertyComment> <summary>Declaration representing the variable declared in an out parameter or deconstruction.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for the variable declaration in an out var declaration or a deconstruction declaration.</summary> </TypeComment> <FactoryComment> <summary>Creates a DeclarationExpression node.</summary> </FactoryComment> </Node> <Node Name="CastExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="CastExpression"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary>SyntaxToken representing the open parenthesis.</summary> </PropertyComment> </Field> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>TypeSyntax node representing the type to which the expression is being cast.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary>SyntaxToken representing the close parenthesis.</summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the expression that is being casted.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for cast expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a CastExpressionSyntax node.</summary> </FactoryComment> </Node> <AbstractNode Name="AnonymousFunctionExpressionSyntax" Base="ExpressionSyntax"> <TypeComment> <summary>Provides the base class from which the classes that represent anonymous function expressions are derived.</summary> </TypeComment> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;"/> <Choice> <Field Name="Block" Type="BlockSyntax"> <PropertyComment> <summary> BlockSyntax node representing the body of the anonymous function. Only one of Block or ExpressionBody will be non-null. </summary> </PropertyComment> </Field> <Field Name="ExpressionBody" Type="ExpressionSyntax"> <PropertyComment> <summary> ExpressionSyntax node representing the body of the anonymous function. Only one of Block or ExpressionBody will be non-null. </summary> </PropertyComment> </Field> </Choice> </AbstractNode> <Node Name="AnonymousMethodExpressionSyntax" Base="AnonymousFunctionExpressionSyntax" SkipConvenienceFactories="true"> <Kind Name="AnonymousMethodExpression"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="DelegateKeyword" Type="SyntaxToken"> <Kind Name="DelegateKeyword"/> <PropertyComment> <summary>SyntaxToken representing the delegate keyword.</summary> </PropertyComment> </Field> <Field Name="ParameterList" Type="ParameterListSyntax" Optional="true"> <PropertyComment> <summary>List of parameters of the anonymous method expression, or null if there no parameters are specified.</summary> </PropertyComment> </Field> <Field Name="Block" Type="BlockSyntax" Override="true"> <PropertyComment> <summary> BlockSyntax node representing the body of the anonymous function. This will never be null. </summary> </PropertyComment> </Field> <Field Name="ExpressionBody" Type="ExpressionSyntax" Optional="true" Override="true"> <PropertyComment> <summary> Inherited from AnonymousFunctionExpressionSyntax, but not used for AnonymousMethodExpressionSyntax. This will always be null. </summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for anonymous method expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an AnonymousMethodExpressionSyntax node.</summary> </FactoryComment> </Node> <AbstractNode Name="LambdaExpressionSyntax" Base="AnonymousFunctionExpressionSyntax"> <TypeComment> <summary>Provides the base class from which the classes that represent lambda expressions are derived.</summary> </TypeComment> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;"/> <Field Name="ArrowToken" Type="SyntaxToken"> <!-- should be EqualsGreaterThanToken --> <Kind Name="EqualsGreaterThanToken"/> <PropertyComment> <summary>SyntaxToken representing equals greater than.</summary> </PropertyComment> </Field> </AbstractNode> <Node Name="SimpleLambdaExpressionSyntax" Base="LambdaExpressionSyntax"> <Kind Name="SimpleLambdaExpression"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="Parameter" Type="ParameterSyntax"> <Kind Name="Parameter"/> <PropertyComment> <summary>ParameterSyntax node representing the parameter of the lambda expression.</summary> </PropertyComment> </Field> <Field Name="ArrowToken" Type="SyntaxToken" Override="true"> <!-- should be EqualsGreaterThanToken --> <Kind Name="EqualsGreaterThanToken"/> <PropertyComment> <summary>SyntaxToken representing equals greater than.</summary> </PropertyComment> </Field> <Choice> <Field Name="Block" Type="BlockSyntax" Override="true"> <PropertyComment> <summary> BlockSyntax node representing the body of the lambda. Only one of Block or ExpressionBody will be non-null. </summary> </PropertyComment> </Field> <Field Name="ExpressionBody" Type="ExpressionSyntax" Override="true"> <PropertyComment> <summary> ExpressionSyntax node representing the body of the lambda. Only one of Block or ExpressionBody will be non-null. </summary> </PropertyComment> </Field> </Choice> <TypeComment> <summary>Class which represents the syntax node for a simple lambda expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a SimpleLambdaExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="RefExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="RefExpression"/> <Field Name="RefKeyword" Type="SyntaxToken"> <Kind Name="RefKeyword"/> </Field> <Field Name="Expression" Type="ExpressionSyntax"/> </Node> <Node Name="ParenthesizedLambdaExpressionSyntax" Base="LambdaExpressionSyntax"> <Kind Name="ParenthesizedLambdaExpression"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="ReturnType" Type="TypeSyntax" Optional="true"/> <Field Name="ParameterList" Type="ParameterListSyntax"> <PropertyComment> <summary>ParameterListSyntax node representing the list of parameters for the lambda expression.</summary> </PropertyComment> </Field> <Field Name="ArrowToken" Type="SyntaxToken" Override="true"> <!-- should be EqualsGreaterThanToken --> <Kind Name="EqualsGreaterThanToken"/> <PropertyComment> <summary>SyntaxToken representing equals greater than.</summary> </PropertyComment> </Field> <Choice> <Field Name="Block" Type="BlockSyntax" Override="true"> <PropertyComment> <summary> BlockSyntax node representing the body of the lambda. Only one of Block or ExpressionBody will be non-null. </summary> </PropertyComment> </Field> <Field Name="ExpressionBody" Type="ExpressionSyntax" Override="true"> <PropertyComment> <summary> ExpressionSyntax node representing the body of the lambda. Only one of Block or ExpressionBody will be non-null. </summary> </PropertyComment> </Field> </Choice> <TypeComment> <summary>Class which represents the syntax node for parenthesized lambda expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a ParenthesizedLambdaExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="InitializerExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="ObjectInitializerExpression"/> <Kind Name="CollectionInitializerExpression"/> <Kind Name="ArrayInitializerExpression"/> <Kind Name="ComplexElementInitializerExpression"/> <Kind Name="WithInitializerExpression" /> <Field Name="OpenBraceToken" Type="SyntaxToken"> <Kind Name="OpenBraceToken"/> <PropertyComment> <summary>SyntaxToken representing the open brace.</summary> </PropertyComment> </Field> <Field Name="Expressions" Type="SeparatedSyntaxList&lt;ExpressionSyntax&gt;" AllowTrailingSeparator="true"> <PropertyComment> <summary>SeparatedSyntaxList of ExpressionSyntax representing the list of expressions in the initializer expression.</summary> </PropertyComment> </Field> <Field Name="CloseBraceToken" Type="SyntaxToken"> <Kind Name="CloseBraceToken"/> <PropertyComment> <summary>SyntaxToken representing the close brace.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for initializer expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an InitializerExpressionSyntax node.</summary> </FactoryComment> </Node> <AbstractNode Name="BaseObjectCreationExpressionSyntax" Base="ExpressionSyntax"> <Field Name="NewKeyword" Type="SyntaxToken"> <Kind Name="NewKeyword"/> <PropertyComment> <summary>SyntaxToken representing the new keyword.</summary> </PropertyComment> </Field> <Field Name="ArgumentList" Type="ArgumentListSyntax" Optional="true"> <PropertyComment> <summary>ArgumentListSyntax representing the list of arguments passed as part of the object creation expression.</summary> </PropertyComment> </Field> <Field Name="Initializer" Type="InitializerExpressionSyntax" Optional="true"> <PropertyComment> <summary>InitializerExpressionSyntax representing the initializer expression for the object being created.</summary> </PropertyComment> </Field> </AbstractNode> <Node Name="ImplicitObjectCreationExpressionSyntax" Base="BaseObjectCreationExpressionSyntax"> <Kind Name="ImplicitObjectCreationExpression"/> <Field Name="NewKeyword" Type="SyntaxToken" Override="true"> <Kind Name="NewKeyword"/> <PropertyComment> <summary>SyntaxToken representing the new keyword.</summary> </PropertyComment> </Field> <Field Name="ArgumentList" Type="ArgumentListSyntax" Optional="false" Override="true"> <PropertyComment> <summary>ArgumentListSyntax representing the list of arguments passed as part of the object creation expression.</summary> </PropertyComment> </Field> <Field Name="Initializer" Type="InitializerExpressionSyntax" Optional="true" Override="true"> <PropertyComment> <summary>InitializerExpressionSyntax representing the initializer expression for the object being created.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for implicit object creation expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an ImplicitObjectCreationExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="ObjectCreationExpressionSyntax" Base="BaseObjectCreationExpressionSyntax"> <Kind Name="ObjectCreationExpression"/> <Field Name="NewKeyword" Type="SyntaxToken" Override="true"> <Kind Name="NewKeyword"/> <PropertyComment> <summary>SyntaxToken representing the new keyword.</summary> </PropertyComment> </Field> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>TypeSyntax representing the type of the object being created.</summary> </PropertyComment> </Field> <Field Name="ArgumentList" Type="ArgumentListSyntax" Optional="true" Override="true"> <PropertyComment> <summary>ArgumentListSyntax representing the list of arguments passed as part of the object creation expression.</summary> </PropertyComment> </Field> <Field Name="Initializer" Type="InitializerExpressionSyntax" Optional="true" Override="true"> <PropertyComment> <summary>InitializerExpressionSyntax representing the initializer expression for the object being created.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for object creation expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an ObjectCreationExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="WithExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="WithExpression"/> <Field Name="Expression" Type="ExpressionSyntax" /> <Field Name="WithKeyword" Type="SyntaxToken"> <Kind Name="WithKeyword" /> </Field> <Field Name="Initializer" Type="InitializerExpressionSyntax"> <PropertyComment> <summary>InitializerExpressionSyntax representing the initializer expression for the with expression.</summary> </PropertyComment> </Field> </Node> <Node Name="AnonymousObjectMemberDeclaratorSyntax" Base="CSharpSyntaxNode"> <Kind Name="AnonymousObjectMemberDeclarator"/> <Field Name="NameEquals" Type="NameEqualsSyntax" Optional="true"> <PropertyComment> <summary>NameEqualsSyntax representing the optional name of the member being initialized.</summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax representing the value the member is initialized with.</summary> </PropertyComment> </Field> <FactoryComment> <summary>Creates an AnonymousObjectMemberDeclaratorSyntax node.</summary> </FactoryComment> </Node> <Node Name="AnonymousObjectCreationExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="AnonymousObjectCreationExpression"/> <Field Name="NewKeyword" Type="SyntaxToken"> <Kind Name="NewKeyword"/> <PropertyComment> <summary>SyntaxToken representing the new keyword.</summary> </PropertyComment> </Field> <Field Name="OpenBraceToken" Type="SyntaxToken"> <Kind Name="OpenBraceToken"/> <PropertyComment> <summary>SyntaxToken representing the open brace.</summary> </PropertyComment> </Field> <Field Name="Initializers" Type="SeparatedSyntaxList&lt;AnonymousObjectMemberDeclaratorSyntax&gt;" AllowTrailingSeparator="true"> <PropertyComment> <summary>SeparatedSyntaxList of AnonymousObjectMemberDeclaratorSyntax representing the list of object member initializers.</summary> </PropertyComment> </Field> <Field Name="CloseBraceToken" Type="SyntaxToken"> <Kind Name="CloseBraceToken"/> <PropertyComment> <summary>SyntaxToken representing the close brace.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for anonymous object creation expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an AnonymousObjectCreationExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="ArrayCreationExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="ArrayCreationExpression"/> <Field Name="NewKeyword" Type="SyntaxToken"> <Kind Name="NewKeyword"/> <PropertyComment> <summary>SyntaxToken representing the new keyword.</summary> </PropertyComment> </Field> <Field Name="Type" Type="ArrayTypeSyntax"> <PropertyComment> <summary>ArrayTypeSyntax node representing the type of the array.</summary> </PropertyComment> </Field> <Field Name="Initializer" Type="InitializerExpressionSyntax" Optional="true"> <PropertyComment> <summary>InitializerExpressionSyntax node representing the initializer of the array creation expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for array creation expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an ArrayCreationExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="ImplicitArrayCreationExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="ImplicitArrayCreationExpression"/> <Field Name="NewKeyword" Type="SyntaxToken"> <Kind Name="NewKeyword"/> <PropertyComment> <summary>SyntaxToken representing the new keyword.</summary> </PropertyComment> </Field> <Field Name="OpenBracketToken" Type="SyntaxToken"> <Kind Name="OpenBracketToken"/> <PropertyComment> <summary>SyntaxToken representing the open bracket.</summary> </PropertyComment> </Field> <Field Name="Commas" Type="SyntaxList&lt;SyntaxToken&gt;"> <PropertyComment> <summary>SyntaxList of SyntaxToken representing the commas in the implicit array creation expression.</summary> </PropertyComment> </Field> <Field Name="CloseBracketToken" Type="SyntaxToken"> <Kind Name="CloseBracketToken"/> <PropertyComment> <summary>SyntaxToken representing the close bracket.</summary> </PropertyComment> </Field> <Field Name="Initializer" Type="InitializerExpressionSyntax"> <PropertyComment> <summary>InitializerExpressionSyntax representing the initializer expression of the implicit array creation expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for implicit array creation expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an ImplicitArrayCreationExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="StackAllocArrayCreationExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="StackAllocArrayCreationExpression"/> <Field Name="StackAllocKeyword" Type="SyntaxToken"> <Kind Name="StackAllocKeyword"/> <PropertyComment> <summary>SyntaxToken representing the stackalloc keyword.</summary> </PropertyComment> </Field> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>TypeSyntax node representing the type of the stackalloc array.</summary> </PropertyComment> </Field> <Field Name="Initializer" Type="InitializerExpressionSyntax" Optional="true"> <PropertyComment> <summary>InitializerExpressionSyntax node representing the initializer of the stackalloc array creation expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for stackalloc array creation expression.</summary> </TypeComment> <FactoryComment> <summary>Creates a StackAllocArrayCreationExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="ImplicitStackAllocArrayCreationExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="ImplicitStackAllocArrayCreationExpression"/> <Field Name="StackAllocKeyword" Type="SyntaxToken"> <Kind Name="StackAllocKeyword"/> <PropertyComment> <summary>SyntaxToken representing the stackalloc keyword.</summary> </PropertyComment> </Field> <Field Name="OpenBracketToken" Type="SyntaxToken"> <Kind Name="OpenBracketToken"/> <PropertyComment> <summary>SyntaxToken representing the open bracket.</summary> </PropertyComment> </Field> <Field Name="CloseBracketToken" Type="SyntaxToken"> <Kind Name="CloseBracketToken"/> <PropertyComment> <summary>SyntaxToken representing the close bracket.</summary> </PropertyComment> </Field> <Field Name="Initializer" Type="InitializerExpressionSyntax"> <PropertyComment> <summary>InitializerExpressionSyntax representing the initializer expression of the implicit stackalloc array creation expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents the syntax node for implicit stackalloc array creation expression.</summary> </TypeComment> <FactoryComment> <summary>Creates an ImplicitStackAllocArrayCreationExpressionSyntax node.</summary> </FactoryComment> </Node> <AbstractNode Name="QueryClauseSyntax" Base="CSharpSyntaxNode"> </AbstractNode> <AbstractNode Name="SelectOrGroupClauseSyntax" Base="CSharpSyntaxNode"> </AbstractNode> <Node Name="QueryExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="QueryExpression"/> <Field Name="FromClause" Type="FromClauseSyntax"/> <Field Name="Body" Type="QueryBodySyntax"/> </Node> <Node Name="QueryBodySyntax" Base="CSharpSyntaxNode"> <Kind Name="QueryBody"/> <Field Name="Clauses" Type="SyntaxList&lt;QueryClauseSyntax&gt;" MinCount="1"/> <Field Name="SelectOrGroup" Type="SelectOrGroupClauseSyntax"/> <Field Name="Continuation" Type="QueryContinuationSyntax" Optional="true"/> </Node> <Node Name="FromClauseSyntax" Base="QueryClauseSyntax"> <Kind Name="FromClause"/> <Field Name="FromKeyword" Type="SyntaxToken"> <Kind Name="FromKeyword"/> </Field> <Field Name="Type" Type="TypeSyntax" Optional="true"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="InKeyword" Type="SyntaxToken"> <Kind Name="InKeyword"/> </Field> <Field Name="Expression" Type="ExpressionSyntax"/> </Node> <Node Name="LetClauseSyntax" Base="QueryClauseSyntax"> <Kind Name="LetClause"/> <Field Name="LetKeyword" Type="SyntaxToken"> <Kind Name="LetKeyword"/> </Field> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="EqualsToken" Type="SyntaxToken"> <Kind Name="EqualsToken"/> </Field> <Field Name="Expression" Type="ExpressionSyntax"/> </Node> <Node Name="JoinClauseSyntax" Base="QueryClauseSyntax"> <Kind Name="JoinClause"/> <Field Name="JoinKeyword" Type="SyntaxToken"> <Kind Name="JoinKeyword"/> </Field> <Field Name="Type" Type="TypeSyntax" Optional="true"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="InKeyword" Type="SyntaxToken"> <Kind Name="InKeyword"/> </Field> <Field Name="InExpression" Type="ExpressionSyntax"/> <Field Name="OnKeyword" Type="SyntaxToken"> <Kind Name="OnKeyword"/> </Field> <Field Name="LeftExpression" Type="ExpressionSyntax"/> <Field Name="EqualsKeyword" Type="SyntaxToken"> <Kind Name="EqualsKeyword"/> </Field> <Field Name="RightExpression" Type="ExpressionSyntax"/> <Field Name="Into" Type="JoinIntoClauseSyntax" Optional="true"/> </Node> <Node Name="JoinIntoClauseSyntax" Base="CSharpSyntaxNode"> <Kind Name="JoinIntoClause"/> <Field Name="IntoKeyword" Type="SyntaxToken"> <Kind Name="IntoKeyword"/> </Field> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> </Node> <Node Name="WhereClauseSyntax" Base="QueryClauseSyntax"> <Kind Name="WhereClause"/> <Field Name="WhereKeyword" Type="SyntaxToken"> <Kind Name="WhereKeyword"/> </Field> <Field Name="Condition" Type="ExpressionSyntax"/> </Node> <Node Name="OrderByClauseSyntax" Base="QueryClauseSyntax"> <Kind Name="OrderByClause"/> <Field Name="OrderByKeyword" Type="SyntaxToken"> <Kind Name="OrderByKeyword"/> </Field> <Field Name="Orderings" Type="SeparatedSyntaxList&lt;OrderingSyntax&gt;" MinCount="1"/> </Node> <Node Name="OrderingSyntax" Base="CSharpSyntaxNode"> <Kind Name="AscendingOrdering"/> <Kind Name="DescendingOrdering"/> <Field Name="Expression" Type="ExpressionSyntax"/> <Field Name="AscendingOrDescendingKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="AscendingKeyword"/> <Kind Name="DescendingKeyword"/> </Field> </Node> <Node Name="SelectClauseSyntax" Base="SelectOrGroupClauseSyntax"> <Kind Name="SelectClause"/> <Field Name="SelectKeyword" Type="SyntaxToken"> <Kind Name="SelectKeyword"/> </Field> <Field Name="Expression" Type="ExpressionSyntax"/> </Node> <Node Name="GroupClauseSyntax" Base="SelectOrGroupClauseSyntax"> <Kind Name="GroupClause"/> <Field Name="GroupKeyword" Type="SyntaxToken"> <Kind Name="GroupKeyword"/> </Field> <Field Name="GroupExpression" Type="ExpressionSyntax"/> <Field Name="ByKeyword" Type="SyntaxToken"> <Kind Name="ByKeyword"/> </Field> <Field Name="ByExpression" Type="ExpressionSyntax"/> </Node> <Node Name="QueryContinuationSyntax" Base="CSharpSyntaxNode"> <Kind Name="QueryContinuation"/> <Field Name="IntoKeyword" Type="SyntaxToken"> <Kind Name="IntoKeyword"/> </Field> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="Body" Type="QueryBodySyntax"/> </Node> <Node Name="OmittedArraySizeExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="OmittedArraySizeExpression"/> <Field Name="OmittedArraySizeExpressionToken" Type="SyntaxToken"> <Kind Name="OmittedArraySizeExpressionToken"/> <PropertyComment> <summary>SyntaxToken representing the omitted array size expression.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents a placeholder in an array size list.</summary> </TypeComment> <FactoryComment> <summary>Creates an OmittedArraySizeExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="InterpolatedStringExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="InterpolatedStringExpression"/> <Field Name="StringStartToken" Type="SyntaxToken"> <Kind Name="InterpolatedStringStartToken"/> <Kind Name="InterpolatedVerbatimStringStartToken"/> <PropertyComment> <summary>The first part of an interpolated string, $" or $@"</summary> </PropertyComment> </Field> <Field Name="Contents" Type="SyntaxList&lt;InterpolatedStringContentSyntax&gt;" > <PropertyComment> <summary>List of parts of the interpolated string, each one is either a literal part or an interpolation.</summary> </PropertyComment> </Field> <Field Name="StringEndToken" Type="SyntaxToken"> <Kind Name="InterpolatedStringEndToken"/> <PropertyComment> <summary>The closing quote of the interpolated string.</summary> </PropertyComment> </Field> </Node> <Node Name="IsPatternExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="IsPatternExpression"/> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the expression on the left of the "is" operator.</summary> </PropertyComment> </Field> <Field Name="IsKeyword" Type="SyntaxToken"> <Kind Name="IsKeyword"/> </Field> <Field Name="Pattern" Type="PatternSyntax"> <PropertyComment> <summary>PatternSyntax node representing the pattern on the right of the "is" operator.</summary> </PropertyComment> </Field> <TypeComment> <summary>Class which represents a simple pattern-matching expression using the "is" keyword.</summary> </TypeComment> <FactoryComment> <summary>Creates an IsPatternExpressionSyntax node.</summary> </FactoryComment> </Node> <Node Name="ThrowExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="ThrowExpression" /> <Field Name="ThrowKeyword" Type="SyntaxToken" Optional="false"> <Kind Name="ThrowKeyword"/> </Field> <Field Name="Expression" Type="ExpressionSyntax" Optional="false"/> </Node> <Node Name="WhenClauseSyntax" Base="CSharpSyntaxNode"> <Kind Name="WhenClause" /> <Field Name="WhenKeyword" Type="SyntaxToken"> <Kind Name="WhenKeyword"/> </Field> <Field Name="Condition" Type="ExpressionSyntax"/> </Node> <AbstractNode Name="PatternSyntax" Base="ExpressionOrPatternSyntax" /> <Node Name="DiscardPatternSyntax" Base="PatternSyntax"> <Kind Name="DiscardPattern" /> <Field Name="UnderscoreToken" Type="SyntaxToken"> <Kind Name="UnderscoreToken"/> </Field> </Node> <Node Name="DeclarationPatternSyntax" Base="PatternSyntax"> <Kind Name="DeclarationPattern" /> <Field Name="Type" Type="TypeSyntax"/> <Field Name="Designation" Type="VariableDesignationSyntax"> <Kind Name="SingleVariableDesignation"/> <Kind Name="DiscardDesignation"/> </Field> </Node> <Node Name="VarPatternSyntax" Base="PatternSyntax"> <Kind Name="VarPattern" /> <Field Name="VarKeyword" Type="SyntaxToken"> <Kind Name="VarKeyword"/> </Field> <Field Name="Designation" Type="VariableDesignationSyntax"/> </Node> <Node Name="RecursivePatternSyntax" Base="PatternSyntax"> <Kind Name="RecursivePattern" /> <Field Name="Type" Type="TypeSyntax" Optional="true" /> <Field Name="PositionalPatternClause" Type="PositionalPatternClauseSyntax" Optional="true" /> <Field Name="PropertyPatternClause" Type="PropertyPatternClauseSyntax" Optional="true" /> <Field Name="Designation" Type="VariableDesignationSyntax" Optional="true"> <Kind Name="SingleVariableDesignation"/> <Kind Name="DiscardDesignation"/> </Field> </Node> <Node Name="PositionalPatternClauseSyntax" Base="CSharpSyntaxNode"> <Kind Name="PositionalPatternClause"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <Field Name="Subpatterns" Type="SeparatedSyntaxList&lt;SubpatternSyntax&gt;"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> </Node> <Node Name="PropertyPatternClauseSyntax" Base="CSharpSyntaxNode"> <Kind Name="PropertyPatternClause"/> <Field Name="OpenBraceToken" Type="SyntaxToken"> <Kind Name="OpenBraceToken"/> </Field> <Field Name="Subpatterns" Type="SeparatedSyntaxList&lt;SubpatternSyntax&gt;" AllowTrailingSeparator="true"/> <Field Name="CloseBraceToken" Type="SyntaxToken"> <Kind Name="CloseBraceToken"/> </Field> </Node> <Node Name="SubpatternSyntax" Base="CSharpSyntaxNode"> <Kind Name="Subpattern"/> <Field Name="ExpressionColon" Type="BaseExpressionColonSyntax" Optional="true"/> <Field Name="Pattern" Type="PatternSyntax" /> </Node> <Node Name="ConstantPatternSyntax" Base="PatternSyntax"> <Kind Name="ConstantPattern"/> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>ExpressionSyntax node representing the constant expression.</summary> </PropertyComment> </Field> </Node> <!-- Pattern forms added for C# 9.0 --> <Node Name="ParenthesizedPatternSyntax" Base="PatternSyntax"> <Kind Name="ParenthesizedPattern"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <Field Name="Pattern" Type="PatternSyntax" /> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> </Node> <Node Name="RelationalPatternSyntax" Base="PatternSyntax"> <Kind Name="RelationalPattern"/> <Field Name="OperatorToken" Type="SyntaxToken"> <Kind Name="EqualsEqualsToken"/> <Kind Name="ExclamationEqualsToken"/> <Kind Name="LessThanToken"/> <Kind Name="LessThanEqualsToken"/> <Kind Name="GreaterThanToken"/> <Kind Name="GreaterThanEqualsToken"/> <PropertyComment> <summary>SyntaxToken representing the operator of the relational pattern.</summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax" /> </Node> <Node Name="TypePatternSyntax" Base="PatternSyntax"> <Kind Name="TypePattern"/> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>The type for the type pattern.</summary> </PropertyComment> </Field> </Node> <Node Name="BinaryPatternSyntax" Base="PatternSyntax"> <Kind Name="OrPattern"/> <Kind Name="AndPattern"/> <Field Name="Left" Type="PatternSyntax" /> <Field Name="OperatorToken" Type="SyntaxToken"> <Kind Name="OrKeyword"/> <Kind Name="AndKeyword"/> </Field> <Field Name="Right" Type="PatternSyntax" /> </Node> <Node Name="UnaryPatternSyntax" Base="PatternSyntax"> <Kind Name="NotPattern"/> <Field Name="OperatorToken" Type="SyntaxToken"> <Kind Name="NotKeyword"/> </Field> <Field Name="Pattern" Type="PatternSyntax" /> </Node> <AbstractNode Name="InterpolatedStringContentSyntax" Base="CSharpSyntaxNode" /> <Node Name="InterpolatedStringTextSyntax" Base="InterpolatedStringContentSyntax"> <Kind Name="InterpolatedStringText"/> <Field Name="TextToken" Type="SyntaxToken"> <Kind Name="InterpolatedStringTextToken"/> <PropertyComment> <summary>The text contents of a part of the interpolated string.</summary> </PropertyComment> </Field> </Node> <Node Name="InterpolationSyntax" Base="InterpolatedStringContentSyntax"> <Kind Name="Interpolation"/> <Field Name="OpenBraceToken" Type="SyntaxToken"> <Kind Name="OpenBraceToken"/> </Field> <Field Name="Expression" Type="ExpressionSyntax"/> <Field Name="AlignmentClause" Type="InterpolationAlignmentClauseSyntax" Optional="true"/> <Field Name="FormatClause" Type="InterpolationFormatClauseSyntax" Optional="true"/> <Field Name="CloseBraceToken" Type="SyntaxToken"> <Kind Name="CloseBraceToken"/> </Field> </Node> <Node Name="InterpolationAlignmentClauseSyntax" Base="CSharpSyntaxNode"> <Kind Name="InterpolationAlignmentClause"/> <Field Name="CommaToken" Type="SyntaxToken"/> <Field Name="Value" Type="ExpressionSyntax"/> </Node> <Node Name="InterpolationFormatClauseSyntax" Base="CSharpSyntaxNode"> <Kind Name="InterpolationFormatClause"/> <Field Name="ColonToken" Type="SyntaxToken"/> <Field Name="FormatStringToken" Type="SyntaxToken"> <Kind Name="InterpolatedStringTextToken"/> <PropertyComment> <summary>The text contents of the format specifier for an interpolation.</summary> </PropertyComment> </Field> </Node> <!-- Statements --> <Node Name="GlobalStatementSyntax" Base="MemberDeclarationSyntax"> <Kind Name="GlobalStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"> <summary>Always empty on a global statement.</summary> </Field> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"> <summary>Always empty on a global statement.</summary> </Field> <Field Name="Statement" Type="StatementSyntax"/> </Node> <AbstractNode Name="StatementSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Represents the base class for all statements syntax classes.</summary> </TypeComment> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;"/> </AbstractNode> <Node Name="BlockSyntax" Base="StatementSyntax"> <Kind Name="Block"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="OpenBraceToken" Type="SyntaxToken"> <Kind Name="OpenBraceToken"/> </Field> <Field Name="Statements" Type="SyntaxList&lt;StatementSyntax&gt;"/> <Field Name="CloseBraceToken" Type="SyntaxToken"> <Kind Name="CloseBraceToken"/> </Field> </Node> <Node Name="LocalFunctionStatementSyntax" Base="StatementSyntax"> <Kind Name="LocalFunctionStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;"/> <Field Name="ReturnType" Type="TypeSyntax"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="TypeParameterList" Type="TypeParameterListSyntax" Optional="true"/> <Field Name="ParameterList" Type="ParameterListSyntax"/> <Field Name="ConstraintClauses" Type="SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;"/> <Choice> <Field Name="Body" Type="BlockSyntax"/> <Sequence> <Field Name="ExpressionBody" Type="ArrowExpressionClauseSyntax"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the optional semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </Sequence> </Choice> </Node> <Node Name="LocalDeclarationStatementSyntax" Base="StatementSyntax"> <Kind Name="LocalDeclarationStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="AwaitKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="AwaitKeyword"/> </Field> <Field Name="UsingKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="UsingKeyword"/> </Field> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;"> <PropertyComment> <summary>Gets the modifier list.</summary> </PropertyComment> </Field> <Field Name="Declaration" Type="VariableDeclarationSyntax"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="VariableDeclarationSyntax" Base="CSharpSyntaxNode"> <Kind Name="VariableDeclaration"/> <Field Name="Type" Type="TypeSyntax"/> <Field Name="Variables" Type="SeparatedSyntaxList&lt;VariableDeclaratorSyntax&gt;" MinCount="1"/> </Node> <Node Name="VariableDeclaratorSyntax" Base="CSharpSyntaxNode"> <Kind Name="VariableDeclarator"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="ArgumentList" Type="BracketedArgumentListSyntax" Optional="true"/> <Field Name="Initializer" Type="EqualsValueClauseSyntax" Optional="true"/> </Node> <Node Name="EqualsValueClauseSyntax" Base="CSharpSyntaxNode"> <Kind Name="EqualsValueClause"/> <Field Name="EqualsToken" Type="SyntaxToken"> <Kind Name="EqualsToken"/> </Field> <Field Name="Value" Type="ExpressionSyntax"/> </Node> <AbstractNode Name="VariableDesignationSyntax" Base="CSharpSyntaxNode"> </AbstractNode> <Node Name="SingleVariableDesignationSyntax" Base="VariableDesignationSyntax"> <Kind Name="SingleVariableDesignation"/> <Field Name="Identifier" Type="SyntaxToken"> <Kind Name="IdentifierToken"/> </Field> </Node> <Node Name="DiscardDesignationSyntax" Base="VariableDesignationSyntax"> <Kind Name="DiscardDesignation"/> <Field Name="UnderscoreToken" Type="SyntaxToken"> <Kind Name="UnderscoreToken"/> </Field> </Node> <Node Name="ParenthesizedVariableDesignationSyntax" Base="VariableDesignationSyntax"> <Kind Name="ParenthesizedVariableDesignation"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <Field Name="Variables" Type="SeparatedSyntaxList&lt;VariableDesignationSyntax&gt;"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> </Node> <Node Name="ExpressionStatementSyntax" Base="StatementSyntax"> <Kind Name="ExpressionStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Expression" Type="ExpressionSyntax"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="EmptyStatementSyntax" Base="StatementSyntax"> <Kind Name="EmptyStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="LabeledStatementSyntax" Base="StatementSyntax"> <Kind Name="LabeledStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="ColonToken" Type="SyntaxToken"> <Kind Name="ColonToken"/> <PropertyComment> <summary>Gets a SyntaxToken that represents the colon following the statement's label.</summary> </PropertyComment> </Field> <Field Name="Statement" Type="StatementSyntax"/> <TypeComment> <summary>Represents a labeled statement syntax.</summary> </TypeComment> <FactoryComment> <summary>Creates a LabeledStatementSyntax node</summary> </FactoryComment> </Node> <Node Name="GotoStatementSyntax" Base="StatementSyntax"> <Kind Name="GotoStatement"/> <Kind Name="GotoCaseStatement"/> <Kind Name="GotoDefaultStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="GotoKeyword" Type="SyntaxToken"> <Kind Name="GotoKeyword"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the goto keyword. </summary> </PropertyComment> </Field> <Field Name="CaseOrDefaultKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="CaseKeyword"/> <Kind Name="DefaultKeyword"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the case or default keywords if any exists. </summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax" Optional="true"> <PropertyComment> <summary> Gets a constant expression for a goto case statement. </summary> </PropertyComment> </Field> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the semi-colon at the end of the statement. </summary> </PropertyComment> </Field> <TypeComment> <summary> Represents a goto statement syntax </summary> </TypeComment> <FactoryComment> <summary> Creates a GotoStatementSyntax node. </summary> </FactoryComment> </Node> <Node Name="BreakStatementSyntax" Base="StatementSyntax"> <Kind Name="BreakStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="BreakKeyword" Type="SyntaxToken"> <Kind Name="BreakKeyword"/> </Field> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="ContinueStatementSyntax" Base="StatementSyntax"> <Kind Name="ContinueStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="ContinueKeyword" Type="SyntaxToken"> <Kind Name="ContinueKeyword"/> </Field> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="ReturnStatementSyntax" Base="StatementSyntax"> <Kind Name="ReturnStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="ReturnKeyword" Type="SyntaxToken"> <Kind Name="ReturnKeyword"/> </Field> <Field Name="Expression" Type="ExpressionSyntax" Optional="true"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="ThrowStatementSyntax" Base="StatementSyntax"> <Kind Name="ThrowStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="ThrowKeyword" Type="SyntaxToken"> <Kind Name="ThrowKeyword"/> </Field> <Field Name="Expression" Type="ExpressionSyntax" Optional="true"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="YieldStatementSyntax" Base="StatementSyntax"> <Kind Name="YieldReturnStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Kind Name="YieldBreakStatement"/> <Field Name="YieldKeyword" Type="SyntaxToken"> <Kind Name="YieldKeyword"/> </Field> <Field Name="ReturnOrBreakKeyword" Type="SyntaxToken"> <Kind Name="ReturnKeyword"/> <Kind Name="BreakKeyword"/> </Field> <Field Name="Expression" Type="ExpressionSyntax" Optional="true"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="WhileStatementSyntax" Base="StatementSyntax"> <Kind Name="WhileStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="WhileKeyword" Type="SyntaxToken"> <Kind Name="WhileKeyword"/> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <Field Name="Condition" Type="ExpressionSyntax"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> <Field Name="Statement" Type="StatementSyntax"/> </Node> <Node Name="DoStatementSyntax" Base="StatementSyntax"> <Kind Name="DoStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="DoKeyword" Type="SyntaxToken"> <Kind Name="DoKeyword"/> </Field> <Field Name="Statement" Type="StatementSyntax"/> <Field Name="WhileKeyword" Type="SyntaxToken"> <Kind Name="WhileKeyword"/> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <Field Name="Condition" Type="ExpressionSyntax"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="ForStatementSyntax" Base="StatementSyntax"> <Kind Name="ForStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="ForKeyword" Type="SyntaxToken"> <Kind Name="ForKeyword"/> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <!-- Declaration and Initializers are mutually exclusive. --> <Choice> <Field Name="Declaration" Type="VariableDeclarationSyntax" Optional="true"/> <Field Name="Initializers" Type="SeparatedSyntaxList&lt;ExpressionSyntax&gt;"/> </Choice> <Field Name="FirstSemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> <Field Name="Condition" Type="ExpressionSyntax" Optional="true"/> <Field Name="SecondSemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> <Field Name="Incrementors" Type="SeparatedSyntaxList&lt;ExpressionSyntax&gt;"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> <Field Name="Statement" Type="StatementSyntax"/> </Node> <!-- Because there are two forms of the foreach loop, we make an abstract base. --> <AbstractNode Name="CommonForEachStatementSyntax" Base="StatementSyntax"> <Field Name="AwaitKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="AwaitKeyword"/> </Field> <Field Name="ForEachKeyword" Type="SyntaxToken"> <Kind Name="ForEachKeyword"/> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <!-- At this point one of two declaration forms appears --> <Field Name="InKeyword" Type="SyntaxToken"> <Kind Name="InKeyword"/> </Field> <Field Name="Expression" Type="ExpressionSyntax"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> <Field Name="Statement" Type="StatementSyntax"/> </AbstractNode> <Node Name="ForEachStatementSyntax" Base="CommonForEachStatementSyntax"> <!-- This is the existing C# 6 node. --> <Kind Name="ForEachStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="AwaitKeyword" Type="SyntaxToken" Optional="true" Override="true"> <Kind Name="AwaitKeyword"/> </Field> <Field Name="ForEachKeyword" Type="SyntaxToken" Override="true"> <Kind Name="ForEachKeyword"/> </Field> <Field Name="OpenParenToken" Type="SyntaxToken" Override="true"> <Kind Name="OpenParenToken"/> </Field> <Field Name="Type" Type="TypeSyntax"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="InKeyword" Type="SyntaxToken" Override="true"> <Kind Name="InKeyword"/> </Field> <Field Name="Expression" Type="ExpressionSyntax" Override="true"/> <Field Name="CloseParenToken" Type="SyntaxToken" Override="true"> <Kind Name="CloseParenToken"/> </Field> <Field Name="Statement" Type="StatementSyntax" Override="true"/> </Node> <!-- We name this "DeclarationForEachStatementSyntax" because it can express existing foreach loops. We may elect to represent all foreach loops using this node and deprecate (stop parsing into) the old one. --> <Node Name="ForEachVariableStatementSyntax" Base="CommonForEachStatementSyntax"> <Kind Name="ForEachVariableStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="AwaitKeyword" Type="SyntaxToken" Optional="true" Override="true"> <Kind Name="AwaitKeyword"/> </Field> <Field Name="ForEachKeyword" Type="SyntaxToken" Override="true"> <Kind Name="ForEachKeyword"/> </Field> <Field Name="OpenParenToken" Type="SyntaxToken" Override="true"> <Kind Name="OpenParenToken"/> </Field> <Field Name="Variable" Type="ExpressionSyntax"> <PropertyComment> <summary> The variable(s) of the loop. In correct code this is a tuple literal, declaration expression with a tuple designator, or a discard syntax in the form of a simple identifier. In broken code it could be something else. </summary> </PropertyComment> </Field> <Field Name="InKeyword" Type="SyntaxToken" Override="true"> <Kind Name="InKeyword"/> </Field> <Field Name="Expression" Type="ExpressionSyntax" Override="true"/> <Field Name="CloseParenToken" Type="SyntaxToken" Override="true"> <Kind Name="CloseParenToken"/> </Field> <Field Name="Statement" Type="StatementSyntax" Override="true"/> </Node> <!-- - using (...) { ... } - await using (...) { ... } --> <Node Name="UsingStatementSyntax" Base="StatementSyntax"> <Kind Name="UsingStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="AwaitKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="AwaitKeyword"/> </Field> <Field Name="UsingKeyword" Type="SyntaxToken"> <Kind Name="UsingKeyword"/> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <Choice> <Field Name="Declaration" Type="VariableDeclarationSyntax"/> <Field Name="Expression" Type="ExpressionSyntax"/> </Choice> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> <Field Name="Statement" Type="StatementSyntax"/> </Node> <Node Name="FixedStatementSyntax" Base="StatementSyntax"> <Kind Name="FixedStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="FixedKeyword" Type="SyntaxToken"> <Kind Name="FixedKeyword"/> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <Field Name="Declaration" Type="VariableDeclarationSyntax"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> <Field Name="Statement" Type="StatementSyntax"/> </Node> <Node Name="CheckedStatementSyntax" Base="StatementSyntax"> <Kind Name="CheckedStatement"/> <Kind Name="UncheckedStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Keyword" Type="SyntaxToken"> <Kind Name="CheckedKeyword"/> <Kind Name="UncheckedKeyword"/> </Field> <Field Name="Block" Type="BlockSyntax"/> </Node> <Node Name="UnsafeStatementSyntax" Base="StatementSyntax"> <Kind Name="UnsafeStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="UnsafeKeyword" Type="SyntaxToken"> <Kind Name="UnsafeKeyword"/> </Field> <Field Name="Block" Type="BlockSyntax"/> </Node> <Node Name="LockStatementSyntax" Base="StatementSyntax"> <Kind Name="LockStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="LockKeyword" Type="SyntaxToken"> <Kind Name="LockKeyword"/> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <Field Name="Expression" Type="ExpressionSyntax"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> <Field Name="Statement" Type="StatementSyntax"/> </Node> <Node Name="IfStatementSyntax" Base="StatementSyntax"> <Kind Name="IfStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="IfKeyword" Type="SyntaxToken"> <Kind Name="IfKeyword"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the if keyword. </summary> </PropertyComment> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the open parenthesis before the if statement's condition expression. </summary> </PropertyComment> </Field> <Field Name="Condition" Type="ExpressionSyntax"> <PropertyComment> <summary> Gets an ExpressionSyntax that represents the condition of the if statement. </summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the close parenthesis after the if statement's condition expression. </summary> </PropertyComment> </Field> <Field Name="Statement" Type="StatementSyntax"> <PropertyComment> <summary> Gets a StatementSyntax the represents the statement to be executed when the condition is true. </summary> </PropertyComment> </Field> <Field Name="Else" Type="ElseClauseSyntax" Optional="true"> <PropertyComment> <summary> Gets an ElseClauseSyntax that represents the statement to be executed when the condition is false if such statement exists. </summary> </PropertyComment> </Field> <TypeComment> <summary> Represents an if statement syntax. </summary> </TypeComment> <FactoryComment> <summary>Creates an IfStatementSyntax node</summary> </FactoryComment> </Node> <Node Name="ElseClauseSyntax" Base="CSharpSyntaxNode"> <Kind Name="ElseClause"/> <Field Name="ElseKeyword" Type="SyntaxToken"> <Kind Name="ElseKeyword"/> <PropertyComment> <summary> Gets a syntax token </summary> </PropertyComment> </Field> <Field Name="Statement" Type="StatementSyntax"/> <TypeComment> <summary>Represents an else statement syntax.</summary> </TypeComment> <FactoryComment> <summary>Creates a ElseClauseSyntax node</summary> </FactoryComment> </Node> <Node Name="SwitchStatementSyntax" Base="StatementSyntax" SkipConvenienceFactories="true"> <Kind Name="SwitchStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="SwitchKeyword" Type="SyntaxToken"> <Kind Name="SwitchKeyword"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the switch keyword. </summary> </PropertyComment> </Field> <Field Name="OpenParenToken" Type="SyntaxToken" Optional="true"> <Kind Name="OpenParenToken"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the open parenthesis preceding the switch governing expression. </summary> </PropertyComment> </Field> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary> Gets an ExpressionSyntax representing the expression of the switch statement. </summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken" Optional="true"> <Kind Name="CloseParenToken"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the close parenthesis following the switch governing expression. </summary> </PropertyComment> </Field> <Field Name="OpenBraceToken" Type="SyntaxToken"> <Kind Name="OpenBraceToken"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the open braces preceding the switch sections. </summary> </PropertyComment> </Field> <Field Name="Sections" Type="SyntaxList&lt;SwitchSectionSyntax&gt;"> <PropertyComment> <summary> Gets a SyntaxList of SwitchSectionSyntax's that represents the switch sections of the switch statement. </summary> </PropertyComment> </Field> <Field Name="CloseBraceToken" Type="SyntaxToken"> <Kind Name="CloseBraceToken"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the open braces following the switch sections. </summary> </PropertyComment> </Field> <TypeComment> <summary>Represents a switch statement syntax.</summary> </TypeComment> <FactoryComment> <summary>Creates a SwitchStatementSyntax node.</summary> </FactoryComment> </Node> <Node Name="SwitchSectionSyntax" Base="CSharpSyntaxNode"> <Kind Name="SwitchSection"/> <Field Name="Labels" Type="SyntaxList&lt;SwitchLabelSyntax&gt;" MinCount="1"> <PropertyComment> <summary> Gets a SyntaxList of SwitchLabelSyntax's the represents the possible labels that control can transfer to within the section. </summary> </PropertyComment> </Field> <Field Name="Statements" Type="SyntaxList&lt;StatementSyntax&gt;" MinCount="1"> <PropertyComment> <summary> Gets a SyntaxList of StatementSyntax's the represents the statements to be executed when control transfer to a label the belongs to the section. </summary> </PropertyComment> </Field> <TypeComment> <summary>Represents a switch section syntax of a switch statement.</summary> </TypeComment> <FactoryComment> <summary>Creates a SwitchSectionSyntax node.</summary> </FactoryComment> </Node> <AbstractNode Name="SwitchLabelSyntax" Base="CSharpSyntaxNode"> <Field Name="Keyword" Type="SyntaxToken"> <PropertyComment> <summary> Gets a SyntaxToken that represents a case or default keyword that belongs to a switch label. </summary> </PropertyComment> </Field> <Field Name="ColonToken" Type="SyntaxToken"> <Kind Name="ColonToken"/> <PropertyComment> <summary> Gets a SyntaxToken that represents the colon that terminates the switch label. </summary> </PropertyComment> </Field> <TypeComment> <summary>Represents a switch label within a switch statement.</summary> </TypeComment> </AbstractNode> <Node Name="CasePatternSwitchLabelSyntax" Base="SwitchLabelSyntax"> <Kind Name="CasePatternSwitchLabel"/> <Field Name="Keyword" Type="SyntaxToken" Override="true"> <Kind Name="CaseKeyword"/> <PropertyComment> <summary>Gets the case keyword token.</summary> </PropertyComment> </Field> <Field Name="Pattern" Type="PatternSyntax"> <PropertyComment> <summary> Gets a PatternSyntax that represents the pattern that gets matched for the case label. </summary> </PropertyComment> </Field> <Field Name="WhenClause" Type="WhenClauseSyntax" Optional="true"/> <Field Name="ColonToken" Type="SyntaxToken" Override="true"/> <TypeComment> <summary>Represents a case label within a switch statement.</summary> </TypeComment> <FactoryComment> <summary>Creates a CaseMatchLabelSyntax node.</summary> </FactoryComment> </Node> <Node Name="CaseSwitchLabelSyntax" Base="SwitchLabelSyntax"> <Kind Name="CaseSwitchLabel"/> <Field Name="Keyword" Type="SyntaxToken" Override="true"> <Kind Name="CaseKeyword"/> <PropertyComment> <summary>Gets the case keyword token.</summary> </PropertyComment> </Field> <Field Name="Value" Type="ExpressionSyntax"> <PropertyComment> <summary> Gets an ExpressionSyntax that represents the constant expression that gets matched for the case label. </summary> </PropertyComment> </Field> <Field Name="ColonToken" Type="SyntaxToken" Override="true"/> <TypeComment> <summary>Represents a case label within a switch statement.</summary> </TypeComment> <FactoryComment> <summary>Creates a CaseSwitchLabelSyntax node.</summary> </FactoryComment> </Node> <Node Name="DefaultSwitchLabelSyntax" Base="SwitchLabelSyntax"> <Kind Name="DefaultSwitchLabel"/> <Field Name="Keyword" Type="SyntaxToken" Override="true"> <Kind Name="DefaultKeyword"/> <PropertyComment> <summary>Gets the default keyword token.</summary> </PropertyComment> </Field> <Field Name="ColonToken" Type="SyntaxToken" Override="true"/> <TypeComment> <summary>Represents a default label within a switch statement.</summary> </TypeComment> <FactoryComment> <summary>Creates a DefaultSwitchLabelSyntax node.</summary> </FactoryComment> </Node> <Node Name="SwitchExpressionSyntax" Base="ExpressionSyntax"> <Kind Name="SwitchExpression"/> <Field Name="GoverningExpression" Type="ExpressionSyntax"/> <Field Name="SwitchKeyword" Type="SyntaxToken"> <Kind Name="SwitchKeyword"/> </Field> <Field Name="OpenBraceToken" Type="SyntaxToken"> <Kind Name="OpenBraceToken"/> </Field> <Field Name="Arms" Type="SeparatedSyntaxList&lt;SwitchExpressionArmSyntax&gt;" AllowTrailingSeparator="true"/> <Field Name="CloseBraceToken" Type="SyntaxToken"> <Kind Name="CloseBraceToken"/> </Field> </Node> <Node Name="SwitchExpressionArmSyntax" Base="CSharpSyntaxNode"> <Kind Name="SwitchExpressionArm"/> <Field Name="Pattern" Type="PatternSyntax"/> <Field Name="WhenClause" Type="WhenClauseSyntax" Optional="true"/> <Field Name="EqualsGreaterThanToken" Type="SyntaxToken"> <Kind Name="EqualsGreaterThanToken"/> </Field> <Field Name="Expression" Type="ExpressionSyntax"/> </Node> <Node Name="TryStatementSyntax" Base="StatementSyntax"> <Kind Name="TryStatement"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="TryKeyword" Type="SyntaxToken"> <Kind Name="TryKeyword"/> </Field> <Field Name="Block" Type="BlockSyntax"/> <Field Name="Catches" Type="SyntaxList&lt;CatchClauseSyntax&gt;"/> <Field Name="Finally" Type="FinallyClauseSyntax" Optional="true"/> </Node> <Node Name="CatchClauseSyntax" Base="CSharpSyntaxNode"> <Kind Name="CatchClause"/> <Field Name="CatchKeyword" Type="SyntaxToken"> <Kind Name="CatchKeyword"/> </Field> <Field Name="Declaration" Type="CatchDeclarationSyntax" Optional="true"/> <Field Name="Filter" Type="CatchFilterClauseSyntax" Optional="true"/> <Field Name="Block" Type="BlockSyntax"/> </Node> <Node Name="CatchDeclarationSyntax" Base="CSharpSyntaxNode"> <Kind Name="CatchDeclaration"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <Field Name="Type" Type="TypeSyntax"/> <Field Name="Identifier" Type="SyntaxToken" Optional="true"> <Kind Name="IdentifierToken"/> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> </Node> <Node Name="CatchFilterClauseSyntax" Base="CSharpSyntaxNode"> <Kind Name="CatchFilterClause"/> <Field Name="WhenKeyword" Type="SyntaxToken"> <Kind Name="WhenKeyword"/> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <Field Name="FilterExpression" Type="ExpressionSyntax"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> </Node> <Node Name="FinallyClauseSyntax" Base="CSharpSyntaxNode"> <Kind Name="FinallyClause"/> <Field Name="FinallyKeyword" Type="SyntaxToken"> <Kind Name="FinallyKeyword"/> </Field> <Field Name="Block" Type="BlockSyntax"/> </Node> <!-- Declarations --> <Node Name="CompilationUnitSyntax" Base="CSharpSyntaxNode"> <Kind Name="CompilationUnit"/> <Field Name="Externs" Type="SyntaxList&lt;ExternAliasDirectiveSyntax&gt;"/> <Field Name="Usings" Type="SyntaxList&lt;UsingDirectiveSyntax&gt;"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;"> <PropertyComment> <summary>Gets the attribute declaration list.</summary> </PropertyComment> </Field> <Field Name="Members" Type="SyntaxList&lt;MemberDeclarationSyntax&gt;"/> <Field Name="EndOfFileToken" Type="SyntaxToken"> <Kind Name="EndOfFileToken"/> </Field> </Node> <Node Name="ExternAliasDirectiveSyntax" Base="CSharpSyntaxNode"> <Kind Name="ExternAliasDirective"/> <Field Name="ExternKeyword" Type="SyntaxToken"> <Kind Name="ExternKeyword"/> <PropertyComment> <summary>SyntaxToken representing the extern keyword.</summary> </PropertyComment> </Field> <Field Name="AliasKeyword" Type="SyntaxToken"> <Kind Name="AliasKeyword"/> <PropertyComment> <summary>SyntaxToken representing the alias keyword.</summary> </PropertyComment> </Field> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> <PropertyComment> <summary>SyntaxToken representing the semicolon token.</summary> </PropertyComment> </Field> <TypeComment> <summary> Represents an ExternAlias directive syntax, e.g. &quot;extern alias MyAlias;&quot; with specifying &quot;/r:MyAlias=SomeAssembly.dll &quot; on the compiler command line. </summary> </TypeComment> <FactoryComment> <summary>Creates an ExternAliasDirectiveSyntax node</summary> </FactoryComment> </Node> <Node Name="UsingDirectiveSyntax" Base="CSharpSyntaxNode"> <Kind Name="UsingDirective"/> <Field Name="GlobalKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="GlobalKeyword"/> </Field> <Field Name="UsingKeyword" Type="SyntaxToken"> <Kind Name="UsingKeyword"/> </Field> <Choice Optional="true"> <Field Name="StaticKeyword" Type="SyntaxToken"/> <Field Name="Alias" Type="NameEqualsSyntax"/> </Choice> <Field Name="Name" Type="NameSyntax"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Node> <AbstractNode Name="MemberDeclarationSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Member declaration syntax.</summary> </TypeComment> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;"> <PropertyComment> <summary>Gets the attribute declaration list.</summary> </PropertyComment> </Field> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;"> <PropertyComment> <summary>Gets the modifier list.</summary> </PropertyComment> </Field> </AbstractNode> <AbstractNode Name="BaseNamespaceDeclarationSyntax" Base="MemberDeclarationSyntax"> <Field Name="NamespaceKeyword" Type="SyntaxToken"> <Kind Name="NamespaceKeyword"/> </Field> <Field Name="Name" Type="NameSyntax"/> <Field Name="Externs" Type="SyntaxList&lt;ExternAliasDirectiveSyntax&gt;"/> <Field Name="Usings" Type="SyntaxList&lt;UsingDirectiveSyntax&gt;"/> <Field Name="Members" Type="SyntaxList&lt;MemberDeclarationSyntax&gt;"/> </AbstractNode> <Node Name="NamespaceDeclarationSyntax" Base="BaseNamespaceDeclarationSyntax"> <Kind Name="NamespaceDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="NamespaceKeyword" Type="SyntaxToken" Override="true"> <Kind Name="NamespaceKeyword"/> </Field> <Field Name="Name" Type="NameSyntax" Override="true"/> <Field Name="OpenBraceToken" Type="SyntaxToken"> <Kind Name="OpenBraceToken"/> </Field> <Field Name="Externs" Type="SyntaxList&lt;ExternAliasDirectiveSyntax&gt;" Override="true"/> <Field Name="Usings" Type="SyntaxList&lt;UsingDirectiveSyntax&gt;" Override="true"/> <Field Name="Members" Type="SyntaxList&lt;MemberDeclarationSyntax&gt;" Override="true"/> <Field Name="CloseBraceToken" Type="SyntaxToken"> <Kind Name="CloseBraceToken"/> </Field> <Field Name="SemicolonToken" Type="SyntaxToken" Optional="true"> <PropertyComment> <summary>Gets the optional semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="FileScopedNamespaceDeclarationSyntax" Base="BaseNamespaceDeclarationSyntax"> <Kind Name="FileScopedNamespaceDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="NamespaceKeyword" Type="SyntaxToken" Override="true"> <Kind Name="NamespaceKeyword"/> </Field> <Field Name="Name" Type="NameSyntax" Override="true"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> <Field Name="Externs" Type="SyntaxList&lt;ExternAliasDirectiveSyntax&gt;" Override="true"/> <Field Name="Usings" Type="SyntaxList&lt;UsingDirectiveSyntax&gt;" Override="true"/> <Field Name="Members" Type="SyntaxList&lt;MemberDeclarationSyntax&gt;" Override="true"/> </Node> <Node Name="AttributeListSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Class representing one or more attributes applied to a language construct.</summary> </TypeComment> <Kind Name="AttributeList"/> <Field Name="OpenBracketToken" Type="SyntaxToken"> <Kind Name="OpenBracketToken"/> <PropertyComment> <summary>Gets the open bracket token.</summary> </PropertyComment> </Field> <Field Name="Target" Type="AttributeTargetSpecifierSyntax" Optional="true"> <PropertyComment> <summary>Gets the optional construct targeted by the attribute.</summary> </PropertyComment> </Field> <Field Name="Attributes" Type="SeparatedSyntaxList&lt;AttributeSyntax&gt;" MinCount="1"> <PropertyComment> <summary>Gets the attribute declaration list.</summary> </PropertyComment> </Field> <Field Name="CloseBracketToken" Type="SyntaxToken"> <Kind Name="CloseBracketToken"/> <PropertyComment> <summary>Gets the close bracket token.</summary> </PropertyComment> </Field> </Node> <Node Name="AttributeTargetSpecifierSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Class representing what language construct an attribute targets.</summary> </TypeComment> <Kind Name="AttributeTargetSpecifier"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> </Field> <Field Name="ColonToken" Type="SyntaxToken"> <Kind Name="ColonToken"/> <PropertyComment> <summary>Gets the colon token.</summary> </PropertyComment> </Field> </Node> <Node Name="AttributeSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Attribute syntax.</summary> </TypeComment> <Kind Name="Attribute"/> <Field Name="Name" Type="NameSyntax"> <PropertyComment> <summary>Gets the name.</summary> </PropertyComment> </Field> <Field Name="ArgumentList" Type="AttributeArgumentListSyntax" Optional="true"/> </Node> <Node Name="AttributeArgumentListSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Attribute argument list syntax.</summary> </TypeComment> <Kind Name="AttributeArgumentList"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the open paren token.</summary> </PropertyComment> <Kind Name="OpenParenToken"/> </Field> <Field Name="Arguments" Type="SeparatedSyntaxList&lt;AttributeArgumentSyntax&gt;"> <PropertyComment> <summary>Gets the arguments syntax list.</summary> </PropertyComment> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the close paren token.</summary> </PropertyComment> <Kind Name="CloseParenToken"/> </Field> </Node> <Node Name="AttributeArgumentSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Attribute argument syntax.</summary> </TypeComment> <Kind Name="AttributeArgument"/> <Choice> <Field Name="NameEquals" Type="NameEqualsSyntax" Optional="true"/> <Field Name="NameColon" Type="NameColonSyntax" Optional="true"/> </Choice> <Field Name="Expression" Type="ExpressionSyntax"> <PropertyComment> <summary>Gets the expression.</summary> </PropertyComment> </Field> </Node> <Node Name="NameEqualsSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Class representing an identifier name followed by an equals token.</summary> </TypeComment> <Kind Name="NameEquals"/> <Field Name="Name" Type="IdentifierNameSyntax"> <PropertyComment> <summary>Gets the identifier name.</summary> </PropertyComment> <Kind Name="IdentifierName"/> </Field> <Field Name="EqualsToken" Type="SyntaxToken"> <Kind Name="EqualsToken"/> </Field> </Node> <Node Name="TypeParameterListSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Type parameter list syntax.</summary> </TypeComment> <Kind Name="TypeParameterList"/> <Field Name="LessThanToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the &lt; token.</summary> </PropertyComment> <Kind Name="LessThanToken"/> </Field> <Field Name="Parameters" Type="SeparatedSyntaxList&lt;TypeParameterSyntax&gt;" MinCount="1"> <PropertyComment> <summary>Gets the parameter list.</summary> </PropertyComment> </Field> <Field Name="GreaterThanToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the &gt; token.</summary> </PropertyComment> <Kind Name="GreaterThanToken"/> </Field> </Node> <Node Name="TypeParameterSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Type parameter syntax.</summary> </TypeComment> <Kind Name="TypeParameter"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;"> <PropertyComment> <summary>Gets the attribute declaration list.</summary> </PropertyComment> </Field> <Field Name="VarianceKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="InKeyword"/> <Kind Name="OutKeyword"/> </Field> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> </Node> <AbstractNode Name="BaseTypeDeclarationSyntax" Base="MemberDeclarationSyntax"> <TypeComment> <summary>Base class for type declaration syntax.</summary> </TypeComment> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="BaseList" Type="BaseListSyntax" Optional="true"> <PropertyComment> <summary>Gets the base type list.</summary> </PropertyComment> </Field> <Field Name="OpenBraceToken" Type="SyntaxToken" Optional="true"> <PropertyComment> <summary>Gets the open brace token.</summary> </PropertyComment> <Kind Name="OpenBraceToken"/> </Field> <Field Name="CloseBraceToken" Type="SyntaxToken" Optional="true"> <PropertyComment> <summary>Gets the close brace token.</summary> </PropertyComment> <Kind Name="CloseBraceToken"/> </Field> <Field Name="SemicolonToken" Type="SyntaxToken" Optional="true"> <PropertyComment> <summary>Gets the optional semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </AbstractNode> <AbstractNode Name="TypeDeclarationSyntax" Base="BaseTypeDeclarationSyntax"> <TypeComment> <summary>Base class for type declaration syntax (class, struct, interface, record).</summary> </TypeComment> <Field Name="Keyword" Type="SyntaxToken"> <PropertyComment> <summary>Gets the type keyword token ("class", "struct", "interface", "record").</summary> </PropertyComment> </Field> <Field Name="TypeParameterList" Type="TypeParameterListSyntax" Optional="true"/> <Field Name="ConstraintClauses" Type="SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;"> <PropertyComment> <summary>Gets the type constraint list.</summary> </PropertyComment> </Field> <Field Name="Members" Type="SyntaxList&lt;MemberDeclarationSyntax&gt;"> <PropertyComment> <summary>Gets the member declarations.</summary> </PropertyComment> </Field> </AbstractNode> <Node Name="ClassDeclarationSyntax" Base="TypeDeclarationSyntax"> <TypeComment> <summary>Class type declaration syntax.</summary> </TypeComment> <Kind Name="ClassDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="Keyword" Type="SyntaxToken" Override="true"> <PropertyComment> <summary>Gets the class keyword token.</summary> </PropertyComment> <Kind Name="ClassKeyword"/> </Field> <Field Name="Identifier" Type="SyntaxToken" Override="true"> <Kind Name="IdentifierToken"/> </Field> <Field Name="TypeParameterList" Type="TypeParameterListSyntax" Optional="true" Override="true"/> <Field Name="BaseList" Type="BaseListSyntax" Optional="true" Override="true"/> <Field Name="ConstraintClauses" Type="SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;" Override="true"/> <Field Name="OpenBraceToken" Type="SyntaxToken" Override="true"> <Kind Name="OpenBraceToken"/> </Field> <Field Name="Members" Type="SyntaxList&lt;MemberDeclarationSyntax&gt;" Override="true"/> <Field Name="CloseBraceToken" Type="SyntaxToken" Override="true"> <Kind Name="CloseBraceToken"/> </Field> <Field Name="SemicolonToken" Type="SyntaxToken" Optional="true" Override="true"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="StructDeclarationSyntax" Base="TypeDeclarationSyntax"> <TypeComment> <summary>Struct type declaration syntax.</summary> </TypeComment> <Kind Name="StructDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="Keyword" Type="SyntaxToken" Override="true"> <PropertyComment> <summary>Gets the struct keyword token.</summary> </PropertyComment> <Kind Name="StructKeyword"/> </Field> <Field Name="Identifier" Type="SyntaxToken" Override="true"> <Kind Name="IdentifierToken"/> </Field> <Field Name="TypeParameterList" Type="TypeParameterListSyntax" Optional="true" Override="true"/> <Field Name="BaseList" Type="BaseListSyntax" Optional="true" Override="true"/> <Field Name="ConstraintClauses" Type="SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;" Override="true"/> <Field Name="OpenBraceToken" Type="SyntaxToken" Override="true"> <Kind Name="OpenBraceToken"/> </Field> <Field Name="Members" Type="SyntaxList&lt;MemberDeclarationSyntax&gt;" Override="true"/> <Field Name="CloseBraceToken" Type="SyntaxToken" Override="true"> <Kind Name="CloseBraceToken"/> </Field> <Field Name="SemicolonToken" Type="SyntaxToken" Optional="true" Override="true"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="InterfaceDeclarationSyntax" Base="TypeDeclarationSyntax"> <TypeComment> <summary>Interface type declaration syntax.</summary> </TypeComment> <Kind Name="InterfaceDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="Keyword" Type="SyntaxToken" Override="true"> <PropertyComment> <summary>Gets the interface keyword token.</summary> </PropertyComment> <Kind Name="InterfaceKeyword"/> </Field> <Field Name="Identifier" Type="SyntaxToken" Override="true"> <Kind Name="IdentifierToken"/> </Field> <Field Name="TypeParameterList" Type="TypeParameterListSyntax" Optional="true" Override="true"/> <Field Name="BaseList" Type="BaseListSyntax" Optional="true" Override="true"/> <Field Name="ConstraintClauses" Type="SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;" Override="true"/> <Field Name="OpenBraceToken" Type="SyntaxToken" Override="true"> <Kind Name="OpenBraceToken"/> </Field> <Field Name="Members" Type="SyntaxList&lt;MemberDeclarationSyntax&gt;" Override="true"/> <Field Name="CloseBraceToken" Type="SyntaxToken" Override="true"> <Kind Name="CloseBraceToken"/> </Field> <Field Name="SemicolonToken" Type="SyntaxToken" Optional="true" Override="true"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="RecordDeclarationSyntax" Base="TypeDeclarationSyntax"> <Kind Name="RecordDeclaration" /> <Kind Name="RecordStructDeclaration" /> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="Keyword" Type="SyntaxToken" Override="true"> <ContextualKind Name="RecordKeyword"/> </Field> <Field Name="ClassOrStructKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="ClassKeyword"/> <Kind Name="StructKeyword"/> </Field> <Field Name="Identifier" Type="SyntaxToken" Override="true"> <Kind Name="IdentifierToken"/> </Field> <Field Name="TypeParameterList" Type="TypeParameterListSyntax" Optional="true" Override="true"/> <Field Name="ParameterList" Type="ParameterListSyntax" Optional="true" /> <Field Name="BaseList" Type="BaseListSyntax" Optional="true" Override="true"/> <Field Name="ConstraintClauses" Type="SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;" Override="true"/> <Field Name="OpenBraceToken" Type="SyntaxToken" Override="true" Optional="true"> <Kind Name="OpenBraceToken"/> </Field> <Field Name="Members" Type="SyntaxList&lt;MemberDeclarationSyntax&gt;" Override="true"/> <Field Name="CloseBraceToken" Type="SyntaxToken" Override="true" Optional="true"> <Kind Name="CloseBraceToken"/> </Field> <Field Name="SemicolonToken" Type="SyntaxToken" Optional="true" Override="true"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="EnumDeclarationSyntax" Base="BaseTypeDeclarationSyntax"> <TypeComment> <summary>Enum type declaration syntax.</summary> </TypeComment> <Kind Name="EnumDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="EnumKeyword" Type="SyntaxToken"> <PropertyComment> <summary>Gets the enum keyword token.</summary> </PropertyComment> <Kind Name="EnumKeyword"/> </Field> <Field Name="Identifier" Type="SyntaxToken" Override="true"> <Kind Name="IdentifierToken"/> </Field> <Field Name="BaseList" Type="BaseListSyntax" Optional="true" Override="true"> </Field> <Field Name="OpenBraceToken" Type="SyntaxToken" Override="true"> <Kind Name="OpenBraceToken"/> </Field> <Field Name="Members" Type="SeparatedSyntaxList&lt;EnumMemberDeclarationSyntax&gt;" AllowTrailingSeparator="true"> <PropertyComment> <summary>Gets the members declaration list.</summary> </PropertyComment> </Field> <Field Name="CloseBraceToken" Type="SyntaxToken" Override="true"> <Kind Name="CloseBraceToken"/> </Field> <Field Name="SemicolonToken" Type="SyntaxToken" Optional="true" Override="true"> <PropertyComment> <summary>Gets the optional semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="DelegateDeclarationSyntax" Base="MemberDeclarationSyntax"> <TypeComment> <summary>Delegate declaration syntax.</summary> </TypeComment> <Kind Name="DelegateDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="DelegateKeyword" Type="SyntaxToken"> <PropertyComment> <summary>Gets the "delegate" keyword.</summary> </PropertyComment> <Kind Name="DelegateKeyword"/> </Field> <Field Name="ReturnType" Type="TypeSyntax"> <PropertyComment> <summary>Gets the return type.</summary> </PropertyComment> </Field> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="TypeParameterList" Type="TypeParameterListSyntax" Optional="true"/> <Field Name="ParameterList" Type="ParameterListSyntax"> <PropertyComment> <summary>Gets the parameter list.</summary> </PropertyComment> </Field> <Field Name="ConstraintClauses" Type="SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;"> <PropertyComment> <summary>Gets the constraint clause list.</summary> </PropertyComment> </Field> <Field Name="SemicolonToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="EnumMemberDeclarationSyntax" Base="MemberDeclarationSyntax"> <Kind Name="EnumMemberDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="EqualsValue" Type="EqualsValueClauseSyntax" Optional="true"/> </Node> <Node Name="BaseListSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Base list syntax.</summary> </TypeComment> <Kind Name="BaseList"/> <Field Name="ColonToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the colon token.</summary> </PropertyComment> <Kind Name="ColonToken"/> </Field> <Field Name="Types" Type="SeparatedSyntaxList&lt;BaseTypeSyntax&gt;" MinCount="1"> <PropertyComment> <summary>Gets the base type references.</summary> </PropertyComment> </Field> </Node> <AbstractNode Name="BaseTypeSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Provides the base class from which the classes that represent base type syntax nodes are derived. This is an abstract class.</summary> </TypeComment> <Field Name="Type" Type="TypeSyntax"> </Field> </AbstractNode> <Node Name="SimpleBaseTypeSyntax" Base="BaseTypeSyntax"> <Kind Name="SimpleBaseType"/> <Field Name="Type" Type="TypeSyntax" Override="true"> </Field> </Node> <Node Name="PrimaryConstructorBaseTypeSyntax" Base="BaseTypeSyntax"> <Kind Name="PrimaryConstructorBaseType"/> <Field Name="Type" Type="TypeSyntax" Override="true"/> <Field Name="ArgumentList" Type="ArgumentListSyntax"/> </Node> <Node Name="TypeParameterConstraintClauseSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Type parameter constraint clause.</summary> </TypeComment> <Kind Name="TypeParameterConstraintClause"/> <Field Name="WhereKeyword" Type="SyntaxToken"> <Kind Name="WhereKeyword"/> </Field> <Field Name="Name" Type="IdentifierNameSyntax"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierName"/> </Field> <Field Name="ColonToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the colon token.</summary> </PropertyComment> <Kind Name="ColonToken"/> </Field> <Field Name="Constraints" Type="SeparatedSyntaxList&lt;TypeParameterConstraintSyntax&gt;" MinCount="1"> <PropertyComment> <summary>Gets the constraints list.</summary> </PropertyComment> </Field> </Node> <AbstractNode Name="TypeParameterConstraintSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Base type for type parameter constraint syntax.</summary> </TypeComment> </AbstractNode> <Node Name="ConstructorConstraintSyntax" Base="TypeParameterConstraintSyntax"> <TypeComment> <summary>Constructor constraint syntax.</summary> </TypeComment> <Kind Name="ConstructorConstraint"/> <Field Name="NewKeyword" Type="SyntaxToken"> <PropertyComment> <summary>Gets the "new" keyword.</summary> </PropertyComment> <Kind Name="NewKeyword"/> </Field> <Field Name="OpenParenToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the open paren keyword.</summary> </PropertyComment> <Kind Name="OpenParenToken"/> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the close paren keyword.</summary> </PropertyComment> <Kind Name="CloseParenToken"/> </Field> </Node> <Node Name="ClassOrStructConstraintSyntax" Base="TypeParameterConstraintSyntax"> <TypeComment> <summary>Class or struct constraint syntax.</summary> </TypeComment> <Kind Name="ClassConstraint"/> <Kind Name="StructConstraint"/> <Field Name="ClassOrStructKeyword" Type="SyntaxToken"> <PropertyComment> <summary>Gets the constraint keyword ("class" or "struct").</summary> </PropertyComment> <Kind Name="ClassKeyword"/> <Kind Name="StructKeyword"/> </Field> <Field Name="QuestionToken" Type="SyntaxToken" Optional="true"> <Kind Name="QuestionToken"/> <PropertyComment> <summary>SyntaxToken representing the question mark.</summary> </PropertyComment> </Field> </Node> <Node Name="TypeConstraintSyntax" Base="TypeParameterConstraintSyntax"> <TypeComment> <summary>Type constraint syntax.</summary> </TypeComment> <Kind Name="TypeConstraint"/> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>Gets the type syntax.</summary> </PropertyComment> </Field> </Node> <Node Name="DefaultConstraintSyntax" Base="TypeParameterConstraintSyntax"> <TypeComment> <summary>Default constraint syntax.</summary> </TypeComment> <Kind Name="DefaultConstraint"/> <Field Name="DefaultKeyword" Type="SyntaxToken"> <PropertyComment> <summary>Gets the "default" keyword.</summary> </PropertyComment> <Kind Name="DefaultKeyword"/> </Field> </Node> <AbstractNode Name="BaseFieldDeclarationSyntax" Base="MemberDeclarationSyntax"> <Field Name="Declaration" Type="VariableDeclarationSyntax"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </AbstractNode> <Node Name="FieldDeclarationSyntax" Base="BaseFieldDeclarationSyntax"> <Kind Name="FieldDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="Declaration" Type="VariableDeclarationSyntax" Override="true"/> <Field Name="SemicolonToken" Type="SyntaxToken" Override="true"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="EventFieldDeclarationSyntax" Base="BaseFieldDeclarationSyntax"> <Kind Name="EventFieldDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="EventKeyword" Type="SyntaxToken"> <Kind Name="EventKeyword"/> </Field> <Field Name="Declaration" Type="VariableDeclarationSyntax" Override="true"/> <Field Name="SemicolonToken" Type="SyntaxToken" Override="true"> <Kind Name="SemicolonToken"/> </Field> </Node> <Node Name="ExplicitInterfaceSpecifierSyntax" Base="CSharpSyntaxNode"> <Kind Name="ExplicitInterfaceSpecifier"/> <Field Name="Name" Type="NameSyntax"/> <Field Name="DotToken" Type="SyntaxToken"> <Kind Name="DotToken"/> </Field> </Node> <AbstractNode Name="BaseMethodDeclarationSyntax" Base="MemberDeclarationSyntax"> <TypeComment> <summary>Base type for method declaration syntax.</summary> </TypeComment> <Field Name="ParameterList" Type="ParameterListSyntax"> <PropertyComment> <summary>Gets the parameter list.</summary> </PropertyComment> </Field> <Choice> <Field Name="Body" Type="BlockSyntax"/> <Sequence> <Field Name="ExpressionBody" Type="ArrowExpressionClauseSyntax"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the optional semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </Sequence> </Choice> </AbstractNode> <Node Name="MethodDeclarationSyntax" Base="BaseMethodDeclarationSyntax"> <TypeComment> <summary>Method declaration syntax.</summary> </TypeComment> <Kind Name="MethodDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="ReturnType" Type="TypeSyntax"> <PropertyComment> <summary>Gets the return type syntax.</summary> </PropertyComment> </Field> <Field Name="ExplicitInterfaceSpecifier" Type="ExplicitInterfaceSpecifierSyntax" Optional="true"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="TypeParameterList" Type="TypeParameterListSyntax" Optional="true"/> <Field Name="ParameterList" Type="ParameterListSyntax" Override="true"/> <Field Name="ConstraintClauses" Type="SyntaxList&lt;TypeParameterConstraintClauseSyntax&gt;"> <PropertyComment> <summary>Gets the constraint clause list.</summary> </PropertyComment> </Field> <Choice> <Field Name="Body" Type="BlockSyntax" Override="true"/> <Sequence> <Field Name="ExpressionBody" Type="ArrowExpressionClauseSyntax" Override="true"/> <Field Name="SemicolonToken" Type="SyntaxToken" Override="true"> <PropertyComment> <summary>Gets the optional semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </Sequence> </Choice> </Node> <Node Name="OperatorDeclarationSyntax" Base="BaseMethodDeclarationSyntax"> <!-- should be multiple kinds? --> <TypeComment> <summary>Operator declaration syntax.</summary> </TypeComment> <Kind Name="OperatorDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="ReturnType" Type="TypeSyntax"> <PropertyComment> <summary>Gets the return type.</summary> </PropertyComment> </Field> <Field Name="ExplicitInterfaceSpecifier" Type="ExplicitInterfaceSpecifierSyntax" Optional="true"/> <Field Name="OperatorKeyword" Type="SyntaxToken"> <PropertyComment> <summary>Gets the "operator" keyword.</summary> </PropertyComment> <Kind Name="OperatorKeyword"/> </Field> <Field Name="OperatorToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the operator token.</summary> </PropertyComment> <Kind Name="PlusToken"/> <Kind Name="MinusToken"/> <Kind Name="ExclamationToken"/> <Kind Name="TildeToken"/> <Kind Name="PlusPlusToken"/> <Kind Name="MinusMinusToken"/> <Kind Name="AsteriskToken"/> <Kind Name="SlashToken"/> <Kind Name="PercentToken"/> <Kind Name="LessThanLessThanToken"/> <Kind Name="GreaterThanGreaterThanToken"/> <Kind Name="BarToken"/> <Kind Name="AmpersandToken"/> <Kind Name="CaretToken"/> <Kind Name="EqualsEqualsToken"/> <Kind Name="ExclamationEqualsToken"/> <Kind Name="LessThanToken"/> <Kind Name="LessThanEqualsToken"/> <Kind Name="GreaterThanToken"/> <Kind Name="GreaterThanEqualsToken"/> <Kind Name="FalseKeyword"/> <Kind Name="TrueKeyword"/> <Kind Name="IsKeyword"/> </Field> <Field Name="ParameterList" Type="ParameterListSyntax" Override="true"/> <Choice> <Field Name="Body" Type="BlockSyntax" Override="true"/> <Sequence> <Field Name="ExpressionBody" Type="ArrowExpressionClauseSyntax" Override="true"/> <Field Name="SemicolonToken" Type="SyntaxToken" Override="true"> <PropertyComment> <summary>Gets the optional semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </Sequence> </Choice> </Node> <Node Name="ConversionOperatorDeclarationSyntax" Base="BaseMethodDeclarationSyntax"> <!-- should be split into two kinds--> <TypeComment> <summary>Conversion operator declaration syntax.</summary> </TypeComment> <Kind Name="ConversionOperatorDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="ImplicitOrExplicitKeyword" Type="SyntaxToken"> <PropertyComment> <summary>Gets the "implicit" or "explicit" token.</summary> </PropertyComment> <Kind Name="ImplicitKeyword"/> <Kind Name="ExplicitKeyword"/> </Field> <Field Name="ExplicitInterfaceSpecifier" Type="ExplicitInterfaceSpecifierSyntax" Optional="true"/> <Field Name="OperatorKeyword" Type="SyntaxToken"> <PropertyComment> <summary>Gets the "operator" token.</summary> </PropertyComment> <Kind Name="OperatorKeyword"/> </Field> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>Gets the type.</summary> </PropertyComment> </Field> <Field Name="ParameterList" Type="ParameterListSyntax" Override="true"/> <Choice> <Field Name="Body" Type="BlockSyntax" Override="true"/> <Sequence> <Field Name="ExpressionBody" Type="ArrowExpressionClauseSyntax" Override="true"/> <Field Name="SemicolonToken" Type="SyntaxToken" Override="true"> <PropertyComment> <summary>Gets the optional semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </Sequence> </Choice> </Node> <Node Name="ConstructorDeclarationSyntax" Base="BaseMethodDeclarationSyntax"> <TypeComment> <summary>Constructor declaration syntax.</summary> </TypeComment> <Kind Name="ConstructorDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="ParameterList" Type="ParameterListSyntax" Override="true"/> <Field Name="Initializer" Type="ConstructorInitializerSyntax" Optional="true"/> <Choice> <Field Name="Body" Type="BlockSyntax" Override="true"/> <Sequence> <Field Name="ExpressionBody" Type="ArrowExpressionClauseSyntax" Override="true"/> <Field Name="SemicolonToken" Type="SyntaxToken" Override="true"> <PropertyComment> <summary>Gets the optional semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </Sequence> </Choice> </Node> <Node Name="ConstructorInitializerSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Constructor initializer syntax.</summary> </TypeComment> <Kind Name="BaseConstructorInitializer"/> <Kind Name="ThisConstructorInitializer"/> <Field Name="ColonToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the colon token.</summary> </PropertyComment> <Kind Name="ColonToken"/> </Field> <Field Name="ThisOrBaseKeyword" Type="SyntaxToken" > <PropertyComment> <summary>Gets the "this" or "base" keyword.</summary> </PropertyComment> <Kind Name="BaseKeyword"/> <Kind Name="ThisKeyword"/> </Field> <Field Name="ArgumentList" Type="ArgumentListSyntax"/> </Node> <Node Name="DestructorDeclarationSyntax" Base="BaseMethodDeclarationSyntax"> <TypeComment> <summary>Destructor declaration syntax.</summary> </TypeComment> <Kind Name="DestructorDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="TildeToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the tilde token.</summary> </PropertyComment> <Kind Name="TildeToken"/> </Field> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Field Name="ParameterList" Type="ParameterListSyntax" Override="true"/> <Choice> <Field Name="Body" Type="BlockSyntax" Override="true"/> <Sequence> <Field Name="ExpressionBody" Type="ArrowExpressionClauseSyntax" Override="true"/> <Field Name="SemicolonToken" Type="SyntaxToken" Override="true"> <PropertyComment> <summary>Gets the optional semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </Sequence> </Choice> </Node> <AbstractNode Name="BasePropertyDeclarationSyntax" Base="MemberDeclarationSyntax"> <TypeComment> <summary>Base type for property declaration syntax.</summary> </TypeComment> <Field Name="Type" Type="TypeSyntax"> <PropertyComment> <summary>Gets the type syntax.</summary> </PropertyComment> </Field> <Field Name="ExplicitInterfaceSpecifier" Type="ExplicitInterfaceSpecifierSyntax" Optional="true"> <PropertyComment> <summary>Gets the optional explicit interface specifier.</summary> </PropertyComment> </Field> <Field Name="AccessorList" Type="AccessorListSyntax" Optional="true" /> </AbstractNode> <Node Name="PropertyDeclarationSyntax" Base="BasePropertyDeclarationSyntax"> <Kind Name="PropertyDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="Type" Type="TypeSyntax" Override="true"/> <Field Name="ExplicitInterfaceSpecifier" Type="ExplicitInterfaceSpecifierSyntax" Optional="true" Override="true"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Choice> <Field Name="AccessorList" Type="AccessorListSyntax" Override="true" /> <Sequence> <Choice> <Field Name="ExpressionBody" Type="ArrowExpressionClauseSyntax" /> <Field Name="Initializer" Type="EqualsValueClauseSyntax" /> </Choice> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken" /> </Field> </Sequence> </Choice> </Node> <Node Name="ArrowExpressionClauseSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>The syntax for the expression body of an expression-bodied member.</summary> </TypeComment> <Kind Name="ArrowExpressionClause" /> <Field Name="ArrowToken" Type="SyntaxToken"> <Kind Name="EqualsGreaterThanToken" /> </Field> <Field Name="Expression" Type="ExpressionSyntax" /> </Node> <Node Name="EventDeclarationSyntax" Base="BasePropertyDeclarationSyntax"> <Kind Name="EventDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="EventKeyword" Type="SyntaxToken"> <Kind Name="EventKeyword"/> </Field> <Field Name="Type" Type="TypeSyntax" Override="true"/> <Field Name="ExplicitInterfaceSpecifier" Type="ExplicitInterfaceSpecifierSyntax" Optional="true" Override="true"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> </Field> <Choice> <Field Name="AccessorList" Type="AccessorListSyntax" Override="true"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Choice> </Node> <Node Name="IndexerDeclarationSyntax" Base="BasePropertyDeclarationSyntax"> <Kind Name="IndexerDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="Type" Type="TypeSyntax" Override="true"/> <Field Name="ExplicitInterfaceSpecifier" Type="ExplicitInterfaceSpecifierSyntax" Optional="true" Override="true"/> <Field Name="ThisKeyword" Type="SyntaxToken"> <Kind Name="ThisKeyword"/> </Field> <Field Name="ParameterList" Type="BracketedParameterListSyntax"> <PropertyComment> <summary>Gets the parameter list.</summary> </PropertyComment> </Field> <Choice> <Field Name="AccessorList" Type="AccessorListSyntax" Override="true"/> <Sequence> <Field Name="ExpressionBody" Type="ArrowExpressionClauseSyntax"/> <Field Name="SemicolonToken" Type="SyntaxToken"> <Kind Name="SemicolonToken"/> </Field> </Sequence> </Choice> </Node> <Node Name="AccessorListSyntax" Base="CSharpSyntaxNode"> <Kind Name="AccessorList"/> <Field Name="OpenBraceToken" Type="SyntaxToken"> <Kind Name="OpenBraceToken"/> </Field> <Field Name="Accessors" Type="SyntaxList&lt;AccessorDeclarationSyntax&gt;"/> <Field Name="CloseBraceToken" Type="SyntaxToken"> <Kind Name="CloseBraceToken"/> </Field> </Node> <Node Name="AccessorDeclarationSyntax" Base="CSharpSyntaxNode"> <Kind Name="GetAccessorDeclaration"/> <Kind Name="SetAccessorDeclaration"/> <Kind Name="InitAccessorDeclaration"/> <Kind Name="AddAccessorDeclaration"/> <Kind Name="RemoveAccessorDeclaration"/> <Kind Name="UnknownAccessorDeclaration"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;"> <PropertyComment> <summary>Gets the attribute declaration list.</summary> </PropertyComment> </Field> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;"> <PropertyComment> <summary>Gets the modifier list.</summary> </PropertyComment> </Field> <Field Name="Keyword" Type="SyntaxToken"> <Kind Name="GetKeyword"/> <Kind Name="SetKeyword"/> <Kind Name="InitKeyword"/> <Kind Name="AddKeyword"/> <Kind Name="RemoveKeyword"/> <Kind Name="IdentifierToken"/> <PropertyComment> <summary>Gets the keyword token, or identifier if an erroneous accessor declaration.</summary> </PropertyComment> </Field> <Choice> <Field Name="Body" Type="BlockSyntax"> <PropertyComment> <summary>Gets the optional body block which may be empty, but it is null if there are no braces.</summary> </PropertyComment> </Field> <Sequence> <Field Name="ExpressionBody" Type="ArrowExpressionClauseSyntax"> <PropertyComment> <summary>Gets the optional expression body.</summary> </PropertyComment> </Field> <Field Name="SemicolonToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the optional semicolon token.</summary> </PropertyComment> <Kind Name="SemicolonToken"/> </Field> </Sequence> </Choice> </Node> <AbstractNode Name="BaseParameterListSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Base type for parameter list syntax.</summary> </TypeComment> <Field Name="Parameters" Type="SeparatedSyntaxList&lt;ParameterSyntax&gt;"> <PropertyComment> <summary>Gets the parameter list.</summary> </PropertyComment> </Field> </AbstractNode> <Node Name="ParameterListSyntax" Base="BaseParameterListSyntax"> <TypeComment> <summary>Parameter list syntax.</summary> </TypeComment> <Kind Name="ParameterList"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the open paren token.</summary> </PropertyComment> <Kind Name="OpenParenToken"/> </Field> <Field Name="Parameters" Type="SeparatedSyntaxList&lt;ParameterSyntax&gt;" Override="true"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the close paren token.</summary> </PropertyComment> <Kind Name="CloseParenToken"/> </Field> </Node> <Node Name="BracketedParameterListSyntax" Base="BaseParameterListSyntax"> <TypeComment> <summary>Parameter list syntax with surrounding brackets.</summary> </TypeComment> <Kind Name="BracketedParameterList"/> <Field Name="OpenBracketToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the open bracket token.</summary> </PropertyComment> <Kind Name="OpenBracketToken"/> </Field> <Field Name="Parameters" Type="SeparatedSyntaxList&lt;ParameterSyntax&gt;" Override="true" MinCount="1"/> <Field Name="CloseBracketToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the close bracket token.</summary> </PropertyComment> <Kind Name="CloseBracketToken"/> </Field> </Node> <AbstractNode Name="BaseParameterSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary>Base parameter syntax.</summary> </TypeComment> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;"> <PropertyComment> <summary>Gets the attribute declaration list.</summary> </PropertyComment> </Field> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;"> <PropertyComment> <summary>Gets the modifier list.</summary> </PropertyComment> </Field> <Field Name="Type" Type="TypeSyntax" Optional="true"/> </AbstractNode> <Node Name="ParameterSyntax" Base="BaseParameterSyntax"> <TypeComment> <summary>Parameter syntax.</summary> </TypeComment> <Kind Name="Parameter"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"> <PropertyComment> <summary>Gets the attribute declaration list.</summary> </PropertyComment> </Field> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"> <PropertyComment> <summary>Gets the modifier list.</summary> </PropertyComment> </Field> <Field Name="Type" Type="TypeSyntax" Optional="true" Override="true"/> <Field Name="Identifier" Type="SyntaxToken"> <PropertyComment> <summary>Gets the identifier.</summary> </PropertyComment> <Kind Name="IdentifierToken"/> <Kind Name="ArgListKeyword"/> </Field> <Field Name="Default" Type="EqualsValueClauseSyntax" Optional="true"/> </Node> <Node Name="FunctionPointerParameterSyntax" Base="BaseParameterSyntax"> <TypeComment> <summary>Parameter syntax.</summary> </TypeComment> <Kind Name="FunctionPointerParameter"/> <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"> <PropertyComment> <summary>Gets the attribute declaration list.</summary> </PropertyComment> </Field> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"> <PropertyComment> <summary>Gets the modifier list.</summary> </PropertyComment> </Field> <Field Name="Type" Type="TypeSyntax" Optional="false" Override="true"/> </Node> <Node Name="IncompleteMemberSyntax" Base="MemberDeclarationSyntax"> <Kind Name="IncompleteMember"/>n <Field Name="AttributeLists" Type="SyntaxList&lt;AttributeListSyntax&gt;" Override="true"/> <Field Name="Modifiers" Type="SyntaxList&lt;SyntaxToken&gt;" Override="true"/> <Field Name="Type" Type="TypeSyntax" Optional="true"/> </Node> <Node Name="SkippedTokensTriviaSyntax" Base="StructuredTriviaSyntax"> <Kind Name="SkippedTokensTrivia"/> <Field Name="Tokens" Type="SyntaxList&lt;SyntaxToken&gt;"/> </Node> <!-- <Node Name="BadNamespaceMemberDeclarationSyntax" Base="MemberDeclarationSyntax"> <Kind Name="BadNamespaceMemberDeclaration"/> <Field Name="Nodes" Type="SyntaxNodeOrTokenList"/> </Node> --> <!-- Xml --> <Node Name="DocumentationCommentTriviaSyntax" Base="StructuredTriviaSyntax"> <Kind Name="SingleLineDocumentationCommentTrivia"/> <Kind Name="MultiLineDocumentationCommentTrivia"/> <Field Name="Content" Type="SyntaxList&lt;XmlNodeSyntax&gt;"/> <Field Name="EndOfComment" Type="SyntaxToken"> <!-- should be renamed to EndOfCommentToken --> <Kind Name="EndOfDocumentationCommentToken"/> </Field> </Node> <AbstractNode Name="CrefSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary> A symbol referenced by a cref attribute (e.g. in a &lt;see&gt; or &lt;seealso&gt; documentation comment tag). For example, the M in &lt;see cref="M" /&gt;. </summary> </TypeComment> </AbstractNode> <Node Name="TypeCrefSyntax" Base="CrefSyntax"> <TypeComment> <summary> A symbol reference that definitely refers to a type. For example, "int", "A::B", "A.B", "A&lt;T&gt;", but not "M()" (has parameter list) or "this" (indexer). NOTE: TypeCrefSyntax, QualifiedCrefSyntax, and MemberCrefSyntax overlap. The syntax in a TypeCrefSyntax will always be bound as type, so it's safer to use QualifiedCrefSyntax or MemberCrefSyntax if the symbol might be a non-type member. </summary> </TypeComment> <Kind Name="TypeCref"/> <Field Name="Type" Type="TypeSyntax"/> </Node> <Node Name="QualifiedCrefSyntax" Base="CrefSyntax"> <TypeComment> <summary> A symbol reference to a type or non-type member that is qualified by an enclosing type or namespace. For example, cref="System.String.ToString()". NOTE: TypeCrefSyntax, QualifiedCrefSyntax, and MemberCrefSyntax overlap. The syntax in a TypeCrefSyntax will always be bound as type, so it's safer to use QualifiedCrefSyntax or MemberCrefSyntax if the symbol might be a non-type member. </summary> </TypeComment> <Kind Name="QualifiedCref"/> <Field Name="Container" Type="TypeSyntax"/> <Field Name="DotToken" Type="SyntaxToken"> <Kind Name="DotToken"/> </Field> <Field Name="Member" Type="MemberCrefSyntax"/> </Node> <AbstractNode Name="MemberCrefSyntax" Base="CrefSyntax"> <TypeComment> <summary> The unqualified part of a CrefSyntax. For example, "ToString()" in "object.ToString()". NOTE: TypeCrefSyntax, QualifiedCrefSyntax, and MemberCrefSyntax overlap. The syntax in a TypeCrefSyntax will always be bound as type, so it's safer to use QualifiedCrefSyntax or MemberCrefSyntax if the symbol might be a non-type member. </summary> </TypeComment> </AbstractNode> <Node Name="NameMemberCrefSyntax" Base="MemberCrefSyntax"> <TypeComment> <summary> A MemberCrefSyntax specified by a name (an identifier, predefined type keyword, or an alias-qualified name, with an optional type parameter list) and an optional parameter list. For example, "M", "M&lt;T&gt;" or "M(int)". Also, "A::B()" or "string()". </summary> </TypeComment> <Kind Name="NameMemberCref"/> <Field Name="Name" Type="TypeSyntax"/> <Field Name="Parameters" Type="CrefParameterListSyntax" Optional="true"/> </Node> <Node Name="IndexerMemberCrefSyntax" Base="MemberCrefSyntax"> <TypeComment> <summary> A MemberCrefSyntax specified by a this keyword and an optional parameter list. For example, "this" or "this[int]". </summary> </TypeComment> <Kind Name="IndexerMemberCref"/> <Field Name="ThisKeyword" Type="SyntaxToken"> <Kind Name="ThisKeyword"/> </Field> <Field Name="Parameters" Type="CrefBracketedParameterListSyntax" Optional="true"/> </Node> <Node Name="OperatorMemberCrefSyntax" Base="MemberCrefSyntax"> <TypeComment> <summary> A MemberCrefSyntax specified by an operator keyword, an operator symbol and an optional parameter list. For example, "operator +" or "operator -[int]". NOTE: the operator must be overloadable. </summary> </TypeComment> <Kind Name="OperatorMemberCref"/> <Field Name="OperatorKeyword" Type="SyntaxToken"> <Kind Name="OperatorKeyword"/> </Field> <Field Name="OperatorToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the operator token.</summary> </PropertyComment> <Kind Name="PlusToken"/> <Kind Name="MinusToken"/> <Kind Name="ExclamationToken"/> <Kind Name="TildeToken"/> <Kind Name="PlusPlusToken"/> <Kind Name="MinusMinusToken"/> <Kind Name="AsteriskToken"/> <Kind Name="SlashToken"/> <Kind Name="PercentToken"/> <Kind Name="LessThanLessThanToken"/> <Kind Name="GreaterThanGreaterThanToken"/> <Kind Name="BarToken"/> <Kind Name="AmpersandToken"/> <Kind Name="CaretToken"/> <Kind Name="EqualsEqualsToken"/> <Kind Name="ExclamationEqualsToken"/> <Kind Name="LessThanToken"/> <Kind Name="LessThanEqualsToken"/> <Kind Name="GreaterThanToken"/> <Kind Name="GreaterThanEqualsToken"/> <Kind Name="FalseKeyword"/> <Kind Name="TrueKeyword"/> </Field> <Field Name="Parameters" Type="CrefParameterListSyntax" Optional="true"/> </Node> <Node Name="ConversionOperatorMemberCrefSyntax" Base="MemberCrefSyntax"> <TypeComment> <summary> A MemberCrefSyntax specified by an implicit or explicit keyword, an operator keyword, a destination type, and an optional parameter list. For example, "implicit operator int" or "explicit operator MyType(int)". </summary> </TypeComment> <Kind Name="ConversionOperatorMemberCref"/> <Field Name="ImplicitOrExplicitKeyword" Type="SyntaxToken"> <Kind Name="ImplicitKeyword"/> <Kind Name="ExplicitKeyword"/> </Field> <Field Name="OperatorKeyword" Type="SyntaxToken"> <Kind Name="OperatorKeyword"/> </Field> <Field Name="Type" Type="TypeSyntax"/> <Field Name="Parameters" Type="CrefParameterListSyntax" Optional="true"/> </Node> <AbstractNode Name="BaseCrefParameterListSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary> A list of cref parameters with surrounding punctuation. Unlike regular parameters, cref parameters do not have names. </summary> </TypeComment> <Field Name="Parameters" Type="SeparatedSyntaxList&lt;CrefParameterSyntax&gt;"> <PropertyComment> <summary>Gets the parameter list.</summary> </PropertyComment> </Field> </AbstractNode> <Node Name="CrefParameterListSyntax" Base="BaseCrefParameterListSyntax"> <TypeComment> <summary> A parenthesized list of cref parameters. </summary> </TypeComment> <Kind Name="CrefParameterList"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the open paren token.</summary> </PropertyComment> <Kind Name="OpenParenToken"/> </Field> <Field Name="Parameters" Type="SeparatedSyntaxList&lt;CrefParameterSyntax&gt;" Override="true"/> <Field Name="CloseParenToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the close paren token.</summary> </PropertyComment> <Kind Name="CloseParenToken"/> </Field> </Node> <Node Name="CrefBracketedParameterListSyntax" Base="BaseCrefParameterListSyntax"> <TypeComment> <summary> A bracketed list of cref parameters. </summary> </TypeComment> <Kind Name="CrefBracketedParameterList"/> <Field Name="OpenBracketToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the open bracket token.</summary> </PropertyComment> <Kind Name="OpenBracketToken"/> </Field> <Field Name="Parameters" Type="SeparatedSyntaxList&lt;CrefParameterSyntax&gt;" Override="true" MinCount="1"/> <Field Name="CloseBracketToken" Type="SyntaxToken"> <PropertyComment> <summary>Gets the close bracket token.</summary> </PropertyComment> <Kind Name="CloseBracketToken"/> </Field> </Node> <Node Name="CrefParameterSyntax" Base="CSharpSyntaxNode"> <TypeComment> <summary> An element of a BaseCrefParameterListSyntax. Unlike a regular parameter, a cref parameter has only an optional ref or out keyword and a type - there is no name and there are no attributes or other modifiers. </summary> </TypeComment> <Kind Name="CrefParameter"/> <Field Name="RefKindKeyword" Type="SyntaxToken" Optional="true"> <Kind Name="RefKeyword"/> <Kind Name="OutKeyword"/> <Kind Name="InKeyword"/> </Field> <Field Name="Type" Type="TypeSyntax"/> </Node> <AbstractNode Name="XmlNodeSyntax" Base="CSharpSyntaxNode"> </AbstractNode> <Node Name="XmlElementSyntax" Base="XmlNodeSyntax"> <Kind Name="XmlElement"/> <Field Name="StartTag" Type="XmlElementStartTagSyntax"/> <Field Name="Content" Type="SyntaxList&lt;XmlNodeSyntax&gt;"/> <Field Name="EndTag" Type="XmlElementEndTagSyntax"/> </Node> <Node Name="XmlElementStartTagSyntax" Base="CSharpSyntaxNode"> <Kind Name="XmlElementStartTag"/> <Field Name="LessThanToken" Type="SyntaxToken"> <Kind Name="LessThanToken"/> </Field> <Field Name="Name" Type="XmlNameSyntax"/> <Field Name="Attributes" Type="SyntaxList&lt;XmlAttributeSyntax&gt;"/> <Field Name="GreaterThanToken" Type="SyntaxToken"> <Kind Name="GreaterThanToken"/> </Field> </Node> <Node Name="XmlElementEndTagSyntax" Base="CSharpSyntaxNode"> <Kind Name="XmlElementEndTag"/> <Field Name="LessThanSlashToken" Type="SyntaxToken"> <Kind Name="LessThanSlashToken"/> </Field> <Field Name="Name" Type="XmlNameSyntax"/> <Field Name="GreaterThanToken" Type="SyntaxToken"> <Kind Name="GreaterThanToken"/> </Field> </Node> <Node Name="XmlEmptyElementSyntax" Base="XmlNodeSyntax"> <Kind Name="XmlEmptyElement"/> <Field Name="LessThanToken" Type="SyntaxToken"> <Kind Name="LessThanToken"/> </Field> <Field Name="Name" Type="XmlNameSyntax"/> <Field Name="Attributes" Type="SyntaxList&lt;XmlAttributeSyntax&gt;"/> <Field Name="SlashGreaterThanToken" Type="SyntaxToken"> <Kind Name="SlashGreaterThanToken"/> </Field> </Node> <Node Name="XmlNameSyntax" Base="CSharpSyntaxNode"> <Kind Name="XmlName"/> <Field Name="Prefix" Type="XmlPrefixSyntax" Optional="true"/> <Field Name="LocalName" Type="SyntaxToken"> <Kind Name="IdentifierToken"/> </Field> </Node> <Node Name="XmlPrefixSyntax" Base="CSharpSyntaxNode"> <Kind Name="XmlPrefix"/> <Field Name="Prefix" Type="SyntaxToken"> <Kind Name="IdentifierToken"/> </Field> <Field Name="ColonToken" Type="SyntaxToken"> <Kind Name="ColonToken"/> </Field> </Node> <AbstractNode Name="XmlAttributeSyntax" Base="CSharpSyntaxNode"> <Field Name="Name" Type="XmlNameSyntax"/> <Field Name="EqualsToken" Type="SyntaxToken"> <Kind Name="EqualsToken"/> </Field> <Field Name="StartQuoteToken" Type="SyntaxToken"> <Kind Name="SingleQuoteToken"/> <Kind Name="DoubleQuoteToken"/> </Field> <Field Name="EndQuoteToken" Type="SyntaxToken"> <Kind Name="SingleQuoteToken"/> <Kind Name="DoubleQuoteToken"/> </Field> </AbstractNode> <Node Name="XmlTextAttributeSyntax" Base="XmlAttributeSyntax"> <Kind Name="XmlTextAttribute"/> <Field Name="Name" Type="XmlNameSyntax" Override="true"/> <Field Name="EqualsToken" Type="SyntaxToken" Override="true"> <Kind Name="EqualsToken"/> </Field> <Field Name="StartQuoteToken" Type="SyntaxToken" Override="true"> <Kind Name="SingleQuoteToken"/> <Kind Name="DoubleQuoteToken"/> </Field> <Field Name="TextTokens" Type="SyntaxList&lt;SyntaxToken&gt;"/> <!-- XmlTextLiteralToken or XmlEntityLiteralToken--> <Field Name="EndQuoteToken" Type="SyntaxToken" Override="true"> <Kind Name="SingleQuoteToken"/> <Kind Name="DoubleQuoteToken"/> </Field> </Node> <Node Name="XmlCrefAttributeSyntax" Base="XmlAttributeSyntax"> <Kind Name="XmlCrefAttribute"/> <Field Name="Name" Type="XmlNameSyntax" Override="true"/> <Field Name="EqualsToken" Type="SyntaxToken" Override="true"> <Kind Name="EqualsToken"/> </Field> <Field Name="StartQuoteToken" Type="SyntaxToken" Override="true"> <Kind Name="SingleQuoteToken"/> <Kind Name="DoubleQuoteToken"/> </Field> <Field Name="Cref" Type="CrefSyntax"/> <Field Name="EndQuoteToken" Type="SyntaxToken" Override="true"> <Kind Name="SingleQuoteToken"/> <Kind Name="DoubleQuoteToken"/> </Field> </Node> <Node Name="XmlNameAttributeSyntax" Base="XmlAttributeSyntax"> <Kind Name="XmlNameAttribute"/> <Field Name="Name" Type="XmlNameSyntax" Override="true"/> <Field Name="EqualsToken" Type="SyntaxToken" Override="true"> <Kind Name="EqualsToken"/> </Field> <Field Name="StartQuoteToken" Type="SyntaxToken" Override="true"> <Kind Name="SingleQuoteToken"/> <Kind Name="DoubleQuoteToken"/> </Field> <Field Name="Identifier" Type="IdentifierNameSyntax" /> <Field Name="EndQuoteToken" Type="SyntaxToken" Override="true"> <Kind Name="SingleQuoteToken"/> <Kind Name="DoubleQuoteToken"/> </Field> </Node> <Node Name="XmlTextSyntax" Base="XmlNodeSyntax"> <Kind Name="XmlText"/> <Field Name="TextTokens" Type="SyntaxList&lt;SyntaxToken&gt;"/> <!-- XmlTextLiteralToken or XmlEntityLiteralToken--> </Node> <Node Name="XmlCDataSectionSyntax" Base="XmlNodeSyntax"> <Kind Name="XmlCDataSection"/> <Field Name="StartCDataToken" Type="SyntaxToken"> <Kind Name="XmlCDataStartToken"/> </Field> <Field Name="TextTokens" Type="SyntaxList&lt;SyntaxToken&gt;"/> <!-- XmlTextLiteralToken only --> <Field Name="EndCDataToken" Type="SyntaxToken"> <Kind Name="XmlCDataEndToken"/> </Field> </Node> <Node Name="XmlProcessingInstructionSyntax" Base="XmlNodeSyntax"> <Kind Name="XmlProcessingInstruction"/> <Field Name="StartProcessingInstructionToken" Type="SyntaxToken"> <Kind Name="XmlProcessingInstructionStartToken"/> </Field> <Field Name="Name" Type="XmlNameSyntax" /> <Field Name="TextTokens" Type="SyntaxList&lt;SyntaxToken&gt;"/> <!-- XmlTextLiteralToken only --> <Field Name="EndProcessingInstructionToken" Type="SyntaxToken"> <Kind Name="XmlProcessingInstructionEndToken"/> </Field> </Node> <Node Name="XmlCommentSyntax" Base="XmlNodeSyntax"> <Kind Name="XmlComment"/> <Field Name="LessThanExclamationMinusMinusToken" Type="SyntaxToken"> <Kind Name="XmlCommentStartToken"/> </Field> <Field Name="TextTokens" Type="SyntaxList&lt;SyntaxToken&gt;"/> <!-- XmlTextLiteralToken only --> <Field Name="MinusMinusGreaterThanToken" Type="SyntaxToken"> <Kind Name="XmlCommentEndToken"/> </Field> </Node> <!-- <Node Name="XmlProcessingInstructionSyntax" Base="XmlNodeSyntax"> <Kind Name="XmlProcessingInstruction"/> <Field Name="LessThanQuestionToken" Type="SyntaxToken"/> <Field Name="TextTokens" Type="SyntaxList&lt;SyntaxToken&gt;"/> <Field Name="QuestionGreaterThanToken" Type="SyntaxToken"/> </Node> --> <!-- Preprocessor --> <AbstractNode Name="DirectiveTriviaSyntax" Base="StructuredTriviaSyntax"> <Field Name="IsActive" Type="bool"/> <Field Name="HashToken" Type="SyntaxToken"> <Kind Name="HashToken" /> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken"> <Kind Name="EndOfDirectiveToken" /> </Field> </AbstractNode> <AbstractNode Name="BranchingDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Field Name="BranchTaken" Type="bool"/> </AbstractNode> <AbstractNode Name="ConditionalDirectiveTriviaSyntax" Base="BranchingDirectiveTriviaSyntax"> <Field Name="Condition" Type="ExpressionSyntax"/> <Field Name="ConditionValue" Type="bool"/> </AbstractNode> <Node Name="IfDirectiveTriviaSyntax" Base="ConditionalDirectiveTriviaSyntax"> <Kind Name="IfDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="IfKeyword" Type="SyntaxToken"> <Kind Name="IfKeyword"/> </Field> <Field Name="Condition" Type="ExpressionSyntax" Override="true"/> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> <Field Name="BranchTaken" Type="bool" Override="true"/> <Field Name="ConditionValue" Type="bool" Override="true"/> </Node> <Node Name="ElifDirectiveTriviaSyntax" Base="ConditionalDirectiveTriviaSyntax"> <Kind Name="ElifDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="ElifKeyword" Type="SyntaxToken"> <Kind Name="ElifKeyword"/> </Field> <Field Name="Condition" Type="ExpressionSyntax" Override="true"/> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> <Field Name="BranchTaken" Type="bool" Override="true"/> <Field Name="ConditionValue" Type="bool" Override="true"/> </Node> <Node Name="ElseDirectiveTriviaSyntax" Base="BranchingDirectiveTriviaSyntax"> <Kind Name="ElseDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="ElseKeyword" Type="SyntaxToken"> <Kind Name="ElseKeyword"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> <Field Name="BranchTaken" Type="bool" Override="true"/> </Node> <Node Name="EndIfDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="EndIfDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="EndIfKeyword" Type="SyntaxToken"> <Kind Name="EndIfKeyword"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="RegionDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="RegionDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="RegionKeyword" Type="SyntaxToken"> <Kind Name="RegionKeyword"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="EndRegionDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="EndRegionDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="EndRegionKeyword" Type="SyntaxToken"> <Kind Name="EndRegionKeyword"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="ErrorDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="ErrorDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="ErrorKeyword" Type="SyntaxToken"> <Kind Name="ErrorKeyword"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="WarningDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="WarningDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="WarningKeyword" Type="SyntaxToken"> <Kind Name="WarningKeyword"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="BadDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="BadDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="Identifier" Type="SyntaxToken" /> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="DefineDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="DefineDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="DefineKeyword" Type="SyntaxToken"> <Kind Name="DefineKeyword"/> </Field> <Field Name="Name" Type="SyntaxToken"> <!-- should be identifier --> <Kind Name="IdentifierToken"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="UndefDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="UndefDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="UndefKeyword" Type="SyntaxToken"> <Kind Name="UndefKeyword"/> </Field> <Field Name="Name" Type="SyntaxToken"> <!-- should be identifier --> <Kind Name="IdentifierToken"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <AbstractNode Name="LineOrSpanDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Field Name="LineKeyword" Type="SyntaxToken" /> <Field Name="File" Type="SyntaxToken" Optional="true" /> </AbstractNode> <Node Name="LineDirectiveTriviaSyntax" Base="LineOrSpanDirectiveTriviaSyntax"> <Kind Name="LineDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="LineKeyword" Type="SyntaxToken" Override="true"> <Kind Name="LineKeyword"/> </Field> <Field Name="Line" Type="SyntaxToken"> <Kind Name="NumericLiteralToken"/> <Kind Name="DefaultKeyword"/> <Kind Name="HiddenKeyword"/> </Field> <Field Name="File" Type="SyntaxToken" Optional="true" Override="true"> <Kind Name="StringLiteralToken"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="LineDirectivePositionSyntax" Base="CSharpSyntaxNode"> <Kind Name="LineDirectivePosition"/> <Field Name="OpenParenToken" Type="SyntaxToken"> <Kind Name="OpenParenToken"/> </Field> <Field Name="Line" Type="SyntaxToken"> <Kind Name="NumericLiteralToken"/> </Field> <Field Name="CommaToken" Type="SyntaxToken"> <Kind Name="CommaToken"/> </Field> <Field Name="Character" Type="SyntaxToken"> <Kind Name="NumericLiteralToken"/> </Field> <Field Name="CloseParenToken" Type="SyntaxToken"> <Kind Name="CloseParenToken"/> </Field> </Node> <Node Name="LineSpanDirectiveTriviaSyntax" Base="LineOrSpanDirectiveTriviaSyntax"> <Kind Name="LineSpanDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="LineKeyword" Type="SyntaxToken" Override="true"> <Kind Name="LineKeyword"/> </Field> <Field Name="Start" Type="LineDirectivePositionSyntax" /> <Field Name="MinusToken" Type="SyntaxToken"> <Kind Name="MinusToken"/> </Field> <Field Name="End" Type="LineDirectivePositionSyntax" /> <Field Name="CharacterOffset" Type="SyntaxToken" Optional="true"> <Kind Name="NumericLiteralToken"/> </Field> <Field Name="File" Type="SyntaxToken" Override="true"> <Kind Name="StringLiteralToken"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="PragmaWarningDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="PragmaWarningDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="PragmaKeyword" Type="SyntaxToken"> <Kind Name="PragmaKeyword"/> </Field> <Field Name="WarningKeyword" Type="SyntaxToken"> <Kind Name="WarningKeyword"/> </Field> <Field Name="DisableOrRestoreKeyword" Type="SyntaxToken"> <Kind Name="DisableKeyword"/> <Kind Name="RestoreKeyword"/> </Field> <Field Name="ErrorCodes" Type="SeparatedSyntaxList&lt;ExpressionSyntax&gt;"/> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="PragmaChecksumDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="PragmaChecksumDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="PragmaKeyword" Type="SyntaxToken"> <Kind Name="PragmaKeyword"/> </Field> <Field Name="ChecksumKeyword" Type="SyntaxToken"> <Kind Name="ChecksumKeyword"/> </Field> <Field Name="File" Type="SyntaxToken"> <Kind Name="StringLiteralToken"/> </Field> <Field Name="Guid" Type="SyntaxToken"> <Kind Name="StringLiteralToken"/> </Field> <Field Name="Bytes" Type="SyntaxToken"> <Kind Name="StringLiteralToken"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="ReferenceDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="ReferenceDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="ReferenceKeyword" Type="SyntaxToken"> <Kind Name="ReferenceKeyword"/> </Field> <Field Name="File" Type="SyntaxToken"> <Kind Name="StringLiteralToken"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="LoadDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="LoadDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="LoadKeyword" Type="SyntaxToken"> <Kind Name="LoadKeyword"/> </Field> <Field Name="File" Type="SyntaxToken"> <Kind Name="StringLiteralToken"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="ShebangDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="ShebangDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="ExclamationToken" Type="SyntaxToken"> <Kind Name="ExclamationToken"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> <Node Name="NullableDirectiveTriviaSyntax" Base="DirectiveTriviaSyntax"> <Kind Name="NullableDirectiveTrivia"/> <Field Name="HashToken" Type="SyntaxToken" Override="true"> <Kind Name="HashToken"/> </Field> <Field Name="NullableKeyword" Type="SyntaxToken"> <Kind Name="NullableKeyword"/> </Field> <Field Name="SettingToken" Type="SyntaxToken"> <Kind Name="EnableKeyword"/> <Kind Name="DisableKeyword"/> <Kind Name="RestoreKeyword"/> </Field> <Field Name="TargetToken" Type="SyntaxToken" Optional="true"> <Kind Name="WarningsKeyword"/> <Kind Name="AnnotationsKeyword"/> </Field> <Field Name="EndOfDirectiveToken" Type="SyntaxToken" Override="true"> <Kind Name="EndOfDirectiveToken"/> </Field> <Field Name="IsActive" Type="bool" Override="true"/> </Node> </Tree>
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/common/cross/arm64/tizen-fetch.sh
#!/usr/bin/env bash set -e if [[ -z "${VERBOSE// }" ]] || [ "$VERBOSE" -ne "$VERBOSE" ] 2>/dev/null; then VERBOSE=0 fi Log() { if [ $VERBOSE -ge $1 ]; then echo ${@:2} fi } Inform() { Log 1 -e "\x1B[0;34m$@\x1B[m" } Debug() { Log 2 -e "\x1B[0;32m$@\x1B[m" } Error() { >&2 Log 0 -e "\x1B[0;31m$@\x1B[m" } Fetch() { URL=$1 FILE=$2 PROGRESS=$3 if [ $VERBOSE -ge 1 ] && [ $PROGRESS ]; then CURL_OPT="--progress-bar" else CURL_OPT="--silent" fi curl $CURL_OPT $URL > $FILE } hash curl 2> /dev/null || { Error "Require 'curl' Aborting."; exit 1; } hash xmllint 2> /dev/null || { Error "Require 'xmllint' Aborting."; exit 1; } hash sha256sum 2> /dev/null || { Error "Require 'sha256sum' Aborting."; exit 1; } TMPDIR=$1 if [ ! -d $TMPDIR ]; then TMPDIR=./tizen_tmp Debug "Create temporary directory : $TMPDIR" mkdir -p $TMPDIR fi TIZEN_URL=http://download.tizen.org/snapshots/tizen/ BUILD_XML=build.xml REPOMD_XML=repomd.xml PRIMARY_XML=primary.xml TARGET_URL="http://__not_initialized" Xpath_get() { XPATH_RESULT='' XPATH=$1 XML_FILE=$2 RESULT=$(xmllint --xpath $XPATH $XML_FILE) if [[ -z ${RESULT// } ]]; then Error "Can not find target from $XML_FILE" Debug "Xpath = $XPATH" exit 1 fi XPATH_RESULT=$RESULT } fetch_tizen_pkgs_init() { TARGET=$1 PROFILE=$2 Debug "Initialize TARGET=$TARGET, PROFILE=$PROFILE" TMP_PKG_DIR=$TMPDIR/tizen_${PROFILE}_pkgs if [ -d $TMP_PKG_DIR ]; then rm -rf $TMP_PKG_DIR; fi mkdir -p $TMP_PKG_DIR PKG_URL=$TIZEN_URL/$PROFILE/latest BUILD_XML_URL=$PKG_URL/$BUILD_XML TMP_BUILD=$TMP_PKG_DIR/$BUILD_XML TMP_REPOMD=$TMP_PKG_DIR/$REPOMD_XML TMP_PRIMARY=$TMP_PKG_DIR/$PRIMARY_XML TMP_PRIMARYGZ=${TMP_PRIMARY}.gz Fetch $BUILD_XML_URL $TMP_BUILD Debug "fetch $BUILD_XML_URL to $TMP_BUILD" TARGET_XPATH="//build/buildtargets/buildtarget[@name=\"$TARGET\"]/repo[@type=\"binary\"]/text()" Xpath_get $TARGET_XPATH $TMP_BUILD TARGET_PATH=$XPATH_RESULT TARGET_URL=$PKG_URL/$TARGET_PATH REPOMD_URL=$TARGET_URL/repodata/repomd.xml PRIMARY_XPATH='string(//*[local-name()="data"][@type="primary"]/*[local-name()="location"]/@href)' Fetch $REPOMD_URL $TMP_REPOMD Debug "fetch $REPOMD_URL to $TMP_REPOMD" Xpath_get $PRIMARY_XPATH $TMP_REPOMD PRIMARY_XML_PATH=$XPATH_RESULT PRIMARY_URL=$TARGET_URL/$PRIMARY_XML_PATH Fetch $PRIMARY_URL $TMP_PRIMARYGZ Debug "fetch $PRIMARY_URL to $TMP_PRIMARYGZ" gunzip $TMP_PRIMARYGZ Debug "unzip $TMP_PRIMARYGZ to $TMP_PRIMARY" } fetch_tizen_pkgs() { ARCH=$1 PACKAGE_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]][*[local-name()="arch"][text()="_ARCH_"]]/*[local-name()="location"]/@href)' PACKAGE_CHECKSUM_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]][*[local-name()="arch"][text()="_ARCH_"]]/*[local-name()="checksum"]/text())' for pkg in ${@:2} do Inform "Fetching... $pkg" XPATH=${PACKAGE_XPATH_TPL/_PKG_/$pkg} XPATH=${XPATH/_ARCH_/$ARCH} Xpath_get $XPATH $TMP_PRIMARY PKG_PATH=$XPATH_RESULT XPATH=${PACKAGE_CHECKSUM_XPATH_TPL/_PKG_/$pkg} XPATH=${XPATH/_ARCH_/$ARCH} Xpath_get $XPATH $TMP_PRIMARY CHECKSUM=$XPATH_RESULT PKG_URL=$TARGET_URL/$PKG_PATH PKG_FILE=$(basename $PKG_PATH) PKG_PATH=$TMPDIR/$PKG_FILE Debug "Download $PKG_URL to $PKG_PATH" Fetch $PKG_URL $PKG_PATH true echo "$CHECKSUM $PKG_PATH" | sha256sum -c - > /dev/null if [ $? -ne 0 ]; then Error "Fail to fetch $PKG_URL to $PKG_PATH" Debug "Checksum = $CHECKSUM" exit 1 fi done } Inform "Initialize arm base" fetch_tizen_pkgs_init standard base Inform "fetch common packages" fetch_tizen_pkgs aarch64 gcc glibc glibc-devel libicu libicu-devel libatomic linux-glibc-devel keyutils keyutils-devel libkeyutils Inform "fetch coreclr packages" fetch_tizen_pkgs aarch64 lldb lldb-devel libgcc libstdc++ libstdc++-devel libunwind libunwind-devel lttng-ust-devel lttng-ust userspace-rcu-devel userspace-rcu Inform "fetch corefx packages" fetch_tizen_pkgs aarch64 libcom_err libcom_err-devel zlib zlib-devel libopenssl11 libopenssl1.1-devel krb5 krb5-devel Inform "Initialize standard unified" fetch_tizen_pkgs_init standard unified Inform "fetch corefx packages" fetch_tizen_pkgs aarch64 gssdp gssdp-devel tizen-release
#!/usr/bin/env bash set -e if [[ -z "${VERBOSE// }" ]] || [ "$VERBOSE" -ne "$VERBOSE" ] 2>/dev/null; then VERBOSE=0 fi Log() { if [ $VERBOSE -ge $1 ]; then echo ${@:2} fi } Inform() { Log 1 -e "\x1B[0;34m$@\x1B[m" } Debug() { Log 2 -e "\x1B[0;32m$@\x1B[m" } Error() { >&2 Log 0 -e "\x1B[0;31m$@\x1B[m" } Fetch() { URL=$1 FILE=$2 PROGRESS=$3 if [ $VERBOSE -ge 1 ] && [ $PROGRESS ]; then CURL_OPT="--progress-bar" else CURL_OPT="--silent" fi curl $CURL_OPT $URL > $FILE } hash curl 2> /dev/null || { Error "Require 'curl' Aborting."; exit 1; } hash xmllint 2> /dev/null || { Error "Require 'xmllint' Aborting."; exit 1; } hash sha256sum 2> /dev/null || { Error "Require 'sha256sum' Aborting."; exit 1; } TMPDIR=$1 if [ ! -d $TMPDIR ]; then TMPDIR=./tizen_tmp Debug "Create temporary directory : $TMPDIR" mkdir -p $TMPDIR fi TIZEN_URL=http://download.tizen.org/snapshots/tizen/ BUILD_XML=build.xml REPOMD_XML=repomd.xml PRIMARY_XML=primary.xml TARGET_URL="http://__not_initialized" Xpath_get() { XPATH_RESULT='' XPATH=$1 XML_FILE=$2 RESULT=$(xmllint --xpath $XPATH $XML_FILE) if [[ -z ${RESULT// } ]]; then Error "Can not find target from $XML_FILE" Debug "Xpath = $XPATH" exit 1 fi XPATH_RESULT=$RESULT } fetch_tizen_pkgs_init() { TARGET=$1 PROFILE=$2 Debug "Initialize TARGET=$TARGET, PROFILE=$PROFILE" TMP_PKG_DIR=$TMPDIR/tizen_${PROFILE}_pkgs if [ -d $TMP_PKG_DIR ]; then rm -rf $TMP_PKG_DIR; fi mkdir -p $TMP_PKG_DIR PKG_URL=$TIZEN_URL/$PROFILE/latest BUILD_XML_URL=$PKG_URL/$BUILD_XML TMP_BUILD=$TMP_PKG_DIR/$BUILD_XML TMP_REPOMD=$TMP_PKG_DIR/$REPOMD_XML TMP_PRIMARY=$TMP_PKG_DIR/$PRIMARY_XML TMP_PRIMARYGZ=${TMP_PRIMARY}.gz Fetch $BUILD_XML_URL $TMP_BUILD Debug "fetch $BUILD_XML_URL to $TMP_BUILD" TARGET_XPATH="//build/buildtargets/buildtarget[@name=\"$TARGET\"]/repo[@type=\"binary\"]/text()" Xpath_get $TARGET_XPATH $TMP_BUILD TARGET_PATH=$XPATH_RESULT TARGET_URL=$PKG_URL/$TARGET_PATH REPOMD_URL=$TARGET_URL/repodata/repomd.xml PRIMARY_XPATH='string(//*[local-name()="data"][@type="primary"]/*[local-name()="location"]/@href)' Fetch $REPOMD_URL $TMP_REPOMD Debug "fetch $REPOMD_URL to $TMP_REPOMD" Xpath_get $PRIMARY_XPATH $TMP_REPOMD PRIMARY_XML_PATH=$XPATH_RESULT PRIMARY_URL=$TARGET_URL/$PRIMARY_XML_PATH Fetch $PRIMARY_URL $TMP_PRIMARYGZ Debug "fetch $PRIMARY_URL to $TMP_PRIMARYGZ" gunzip $TMP_PRIMARYGZ Debug "unzip $TMP_PRIMARYGZ to $TMP_PRIMARY" } fetch_tizen_pkgs() { ARCH=$1 PACKAGE_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]][*[local-name()="arch"][text()="_ARCH_"]]/*[local-name()="location"]/@href)' PACKAGE_CHECKSUM_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]][*[local-name()="arch"][text()="_ARCH_"]]/*[local-name()="checksum"]/text())' for pkg in ${@:2} do Inform "Fetching... $pkg" XPATH=${PACKAGE_XPATH_TPL/_PKG_/$pkg} XPATH=${XPATH/_ARCH_/$ARCH} Xpath_get $XPATH $TMP_PRIMARY PKG_PATH=$XPATH_RESULT XPATH=${PACKAGE_CHECKSUM_XPATH_TPL/_PKG_/$pkg} XPATH=${XPATH/_ARCH_/$ARCH} Xpath_get $XPATH $TMP_PRIMARY CHECKSUM=$XPATH_RESULT PKG_URL=$TARGET_URL/$PKG_PATH PKG_FILE=$(basename $PKG_PATH) PKG_PATH=$TMPDIR/$PKG_FILE Debug "Download $PKG_URL to $PKG_PATH" Fetch $PKG_URL $PKG_PATH true echo "$CHECKSUM $PKG_PATH" | sha256sum -c - > /dev/null if [ $? -ne 0 ]; then Error "Fail to fetch $PKG_URL to $PKG_PATH" Debug "Checksum = $CHECKSUM" exit 1 fi done } Inform "Initialize arm base" fetch_tizen_pkgs_init standard base Inform "fetch common packages" fetch_tizen_pkgs aarch64 gcc glibc glibc-devel libicu libicu-devel libatomic linux-glibc-devel keyutils keyutils-devel libkeyutils Inform "fetch coreclr packages" fetch_tizen_pkgs aarch64 lldb lldb-devel libgcc libstdc++ libstdc++-devel libunwind libunwind-devel lttng-ust-devel lttng-ust userspace-rcu-devel userspace-rcu Inform "fetch corefx packages" fetch_tizen_pkgs aarch64 libcom_err libcom_err-devel zlib zlib-devel libopenssl11 libopenssl1.1-devel krb5 krb5-devel Inform "Initialize standard unified" fetch_tizen_pkgs_init standard unified Inform "fetch corefx packages" fetch_tizen_pkgs aarch64 gssdp gssdp-devel tizen-release
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Compilers/Extension/Properties/launchSettings.json
{ "profiles": { "Visual Studio Extension": { "executablePath": "$(DevEnvDir)devenv.exe", "commandLineArgs": "/rootsuffix $(VSSDKTargetPlatformRegRootSuffix) /log" } } }
{ "profiles": { "Visual Studio Extension": { "executablePath": "$(DevEnvDir)devenv.exe", "commandLineArgs": "/rootsuffix $(VSSDKTargetPlatformRegRootSuffix) /log" } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./.github/ISSUE_TEMPLATE/config.yml
blank_issues_enabled: true contact_links: - name: Report issues related to CAxxxx rules url: https://github.com/dotnet/roslyn-analyzers/issues/new/choose about: Enhancements and bug reports to CAxxxx rules are reported to dotnet/roslyn-analyzers repository. - name: Suggest language feature url: https://github.com/dotnet/csharplang/issues/new/choose about: Language feature suggestions are discussed in dotnet/csharplang repository first.
blank_issues_enabled: true contact_links: - name: Report issues related to CAxxxx rules url: https://github.com/dotnet/roslyn-analyzers/issues/new/choose about: Enhancements and bug reports to CAxxxx rules are reported to dotnet/roslyn-analyzers repository. - name: Suggest language feature url: https://github.com/dotnet/csharplang/issues/new/choose about: Language feature suggestions are discussed in dotnet/csharplang repository first.
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Compilers/Core/MSBuildTaskTests/Properties/launchSettings.json
{ "profiles": { "xUnit.net Console (32-bit)": { "commandName": "Executable", "executablePath": "$(NuGetPackageRoot)xunit.runner.console\\$(XUnitVersion)\\tools\\net452\\xunit.console.x86.exe", "commandLineArgs": "$(TargetPath) -noshadow -verbose" }, "xUnit.net Console (64-bit)": { "commandName": "Executable", "executablePath": "$(NuGetPackageRoot)xunit.runner.console\\$(XUnitVersion)\\tools\\net452\\xunit.console.exe", "commandLineArgs": "$(TargetPath) -noshadow -verbose" } } }
{ "profiles": { "xUnit.net Console (32-bit)": { "commandName": "Executable", "executablePath": "$(NuGetPackageRoot)xunit.runner.console\\$(XUnitVersion)\\tools\\net452\\xunit.console.x86.exe", "commandLineArgs": "$(TargetPath) -noshadow -verbose" }, "xUnit.net Console (64-bit)": { "commandName": "Executable", "executablePath": "$(NuGetPackageRoot)xunit.runner.console\\$(XUnitVersion)\\tools\\net452\\xunit.console.exe", "commandLineArgs": "$(TargetPath) -noshadow -verbose" } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/common/templates/post-build/setup-maestro-vars.yml
parameters: BARBuildId: '' PromoteToChannelIds: '' jobs: - job: setupMaestroVars displayName: Setup Maestro Vars variables: - template: common-variables.yml pool: vmImage: 'windows-2019' steps: - checkout: none - ${{ if eq(coalesce(parameters.PromoteToChannelIds, 0), 0) }}: - task: DownloadBuildArtifacts@0 displayName: Download Release Configs inputs: buildType: current artifactName: ReleaseConfigs checkDownloadedFiles: true - task: PowerShell@2 name: setReleaseVars displayName: Set Release Configs Vars inputs: targetType: inline script: | try { if (!$Env:PromoteToMaestroChannels -or $Env:PromoteToMaestroChannels.Trim() -eq '') { $Content = Get-Content $(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt $BarId = $Content | Select -Index 0 $Channels = $Content | Select -Index 1 $IsStableBuild = $Content | Select -Index 2 $AzureDevOpsProject = $Env:System_TeamProject $AzureDevOpsBuildDefinitionId = $Env:System_DefinitionId $AzureDevOpsBuildId = $Env:Build_BuildId } else { $buildApiEndpoint = "${Env:MaestroApiEndPoint}/api/builds/${Env:BARBuildId}?api-version=${Env:MaestroApiVersion}" $apiHeaders = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]' $apiHeaders.Add('Accept', 'application/json') $apiHeaders.Add('Authorization',"Bearer ${Env:MAESTRO_API_TOKEN}") $buildInfo = try { Invoke-WebRequest -Method Get -Uri $buildApiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" } $BarId = $Env:BARBuildId $Channels = $Env:PromoteToMaestroChannels -split "," $Channels = $Channels -join "][" $Channels = "[$Channels]" $IsStableBuild = $buildInfo.stable $AzureDevOpsProject = $buildInfo.azureDevOpsProject $AzureDevOpsBuildDefinitionId = $buildInfo.azureDevOpsBuildDefinitionId $AzureDevOpsBuildId = $buildInfo.azureDevOpsBuildId } Write-Host "##vso[task.setvariable variable=BARBuildId;isOutput=true]$BarId" Write-Host "##vso[task.setvariable variable=TargetChannels;isOutput=true]$Channels" Write-Host "##vso[task.setvariable variable=IsStableBuild;isOutput=true]$IsStableBuild" Write-Host "##vso[task.setvariable variable=AzDOProjectName;isOutput=true]$AzureDevOpsProject" Write-Host "##vso[task.setvariable variable=AzDOPipelineId;isOutput=true]$AzureDevOpsBuildDefinitionId" Write-Host "##vso[task.setvariable variable=AzDOBuildId;isOutput=true]$AzureDevOpsBuildId" } catch { Write-Host $_ Write-Host $_.Exception Write-Host $_.ScriptStackTrace exit 1 } env: MAESTRO_API_TOKEN: $(MaestroApiAccessToken) BARBuildId: ${{ parameters.BARBuildId }} PromoteToMaestroChannels: ${{ parameters.PromoteToChannelIds }}
parameters: BARBuildId: '' PromoteToChannelIds: '' jobs: - job: setupMaestroVars displayName: Setup Maestro Vars variables: - template: common-variables.yml pool: vmImage: 'windows-2019' steps: - checkout: none - ${{ if eq(coalesce(parameters.PromoteToChannelIds, 0), 0) }}: - task: DownloadBuildArtifacts@0 displayName: Download Release Configs inputs: buildType: current artifactName: ReleaseConfigs checkDownloadedFiles: true - task: PowerShell@2 name: setReleaseVars displayName: Set Release Configs Vars inputs: targetType: inline script: | try { if (!$Env:PromoteToMaestroChannels -or $Env:PromoteToMaestroChannels.Trim() -eq '') { $Content = Get-Content $(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt $BarId = $Content | Select -Index 0 $Channels = $Content | Select -Index 1 $IsStableBuild = $Content | Select -Index 2 $AzureDevOpsProject = $Env:System_TeamProject $AzureDevOpsBuildDefinitionId = $Env:System_DefinitionId $AzureDevOpsBuildId = $Env:Build_BuildId } else { $buildApiEndpoint = "${Env:MaestroApiEndPoint}/api/builds/${Env:BARBuildId}?api-version=${Env:MaestroApiVersion}" $apiHeaders = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]' $apiHeaders.Add('Accept', 'application/json') $apiHeaders.Add('Authorization',"Bearer ${Env:MAESTRO_API_TOKEN}") $buildInfo = try { Invoke-WebRequest -Method Get -Uri $buildApiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" } $BarId = $Env:BARBuildId $Channels = $Env:PromoteToMaestroChannels -split "," $Channels = $Channels -join "][" $Channels = "[$Channels]" $IsStableBuild = $buildInfo.stable $AzureDevOpsProject = $buildInfo.azureDevOpsProject $AzureDevOpsBuildDefinitionId = $buildInfo.azureDevOpsBuildDefinitionId $AzureDevOpsBuildId = $buildInfo.azureDevOpsBuildId } Write-Host "##vso[task.setvariable variable=BARBuildId;isOutput=true]$BarId" Write-Host "##vso[task.setvariable variable=TargetChannels;isOutput=true]$Channels" Write-Host "##vso[task.setvariable variable=IsStableBuild;isOutput=true]$IsStableBuild" Write-Host "##vso[task.setvariable variable=AzDOProjectName;isOutput=true]$AzureDevOpsProject" Write-Host "##vso[task.setvariable variable=AzDOPipelineId;isOutput=true]$AzureDevOpsBuildDefinitionId" Write-Host "##vso[task.setvariable variable=AzDOBuildId;isOutput=true]$AzureDevOpsBuildId" } catch { Write-Host $_ Write-Host $_.Exception Write-Host $_.ScriptStackTrace exit 1 } env: MAESTRO_API_TOKEN: $(MaestroApiAccessToken) BARBuildId: ${{ parameters.BARBuildId }} PromoteToMaestroChannels: ${{ parameters.PromoteToChannelIds }}
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/test-build-correctness.ps1
<# This script drives the Jenkins verification that our build is correct. In particular: - Our build has no double writes - Our project.json files are consistent - Our build files are well structured - Our solution states are consistent - Our generated files are consistent #> [CmdletBinding(PositionalBinding=$false)] param( [string]$configuration = "Debug", [switch]$enableDumps = $false, [switch]$help) Set-StrictMode -version 2.0 $ErrorActionPreference="Stop" function Print-Usage() { Write-Host "Usage: test-build-correctness.ps1" Write-Host " -configuration Build configuration ('Debug' or 'Release')" } try { if ($help) { Print-Usage exit 0 } $ci = $true . (Join-Path $PSScriptRoot "build-utils.ps1") Push-Location $RepoRoot if ($enableDumps) { $key = "HKLM:\\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" New-Item -Path $key -ErrorAction SilentlyContinue New-ItemProperty -Path $key -Name 'DumpType' -PropertyType 'DWord' -Value 2 -Force New-ItemProperty -Path $key -Name 'DumpCount' -PropertyType 'DWord' -Value 2 -Force New-ItemProperty -Path $key -Name 'DumpFolder' -PropertyType 'String' -Value $LogDir -Force } # Verify no PROTOTYPE marker left in main if ($env:SYSTEM_PULLREQUEST_TARGETBRANCH -eq "main") { Write-Host "Checking no PROTOTYPE markers in source" $prototypes = Get-ChildItem -Path src, eng, scripts -Exclude *.dll,*.exe,*.pdb,*.xlf,test-build-correctness.ps1 -Recurse | Select-String -Pattern 'PROTOTYPE' -CaseSensitive -SimpleMatch if ($prototypes) { Write-Host "Found PROTOTYPE markers in source:" Write-Host $prototypes throw "PROTOTYPE markers disallowed in compiler source" } } Write-Host "Building Roslyn" Exec-Block { & (Join-Path $PSScriptRoot "build.ps1") -restore -build -bootstrap -bootstrapConfiguration:Debug -ci:$ci -runAnalyzers:$true -configuration:$configuration -pack -binaryLog -useGlobalNuGetCache:$false -warnAsError:$true -properties "/p:RoslynEnforceCodeStyle=true"} # Verify the state of our various build artifacts Write-Host "Running BuildBoss" $buildBossPath = GetProjectOutputBinary "BuildBoss.exe" Exec-Console $buildBossPath "-r `"$RepoRoot/`" -c $configuration" -p Roslyn.sln Write-Host "" # Verify the state of our generated syntax files Write-Host "Checking generated compiler files" Exec-Block { & (Join-Path $PSScriptRoot "generate-compiler-code.ps1") -test -configuration:$configuration } Exec-Console dotnet "tool run dotnet-format . --include-generated --include src/Compilers/CSharp/Portable/Generated/ src/Compilers/VisualBasic/Portable/Generated/ src/ExpressionEvaluator/VisualBasic/Source/ResultProvider/Generated/ --check -f" Write-Host "" exit 0 } catch [exception] { Write-Host $_ Write-Host $_.Exception exit 1 } finally { if ($enableDumps) { $key = "HKLM:\\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" Remove-ItemProperty -Path $key -Name 'DumpType' Remove-ItemProperty -Path $key -Name 'DumpCount' Remove-ItemProperty -Path $key -Name 'DumpFolder' } Pop-Location }
<# This script drives the Jenkins verification that our build is correct. In particular: - Our build has no double writes - Our project.json files are consistent - Our build files are well structured - Our solution states are consistent - Our generated files are consistent #> [CmdletBinding(PositionalBinding=$false)] param( [string]$configuration = "Debug", [switch]$enableDumps = $false, [switch]$help) Set-StrictMode -version 2.0 $ErrorActionPreference="Stop" function Print-Usage() { Write-Host "Usage: test-build-correctness.ps1" Write-Host " -configuration Build configuration ('Debug' or 'Release')" } try { if ($help) { Print-Usage exit 0 } $ci = $true . (Join-Path $PSScriptRoot "build-utils.ps1") Push-Location $RepoRoot if ($enableDumps) { $key = "HKLM:\\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" New-Item -Path $key -ErrorAction SilentlyContinue New-ItemProperty -Path $key -Name 'DumpType' -PropertyType 'DWord' -Value 2 -Force New-ItemProperty -Path $key -Name 'DumpCount' -PropertyType 'DWord' -Value 2 -Force New-ItemProperty -Path $key -Name 'DumpFolder' -PropertyType 'String' -Value $LogDir -Force } # Verify no PROTOTYPE marker left in main if ($env:SYSTEM_PULLREQUEST_TARGETBRANCH -eq "main") { Write-Host "Checking no PROTOTYPE markers in source" $prototypes = Get-ChildItem -Path src, eng, scripts -Exclude *.dll,*.exe,*.pdb,*.xlf,test-build-correctness.ps1 -Recurse | Select-String -Pattern 'PROTOTYPE' -CaseSensitive -SimpleMatch if ($prototypes) { Write-Host "Found PROTOTYPE markers in source:" Write-Host $prototypes throw "PROTOTYPE markers disallowed in compiler source" } } Write-Host "Building Roslyn" Exec-Block { & (Join-Path $PSScriptRoot "build.ps1") -restore -build -bootstrap -bootstrapConfiguration:Debug -ci:$ci -runAnalyzers:$true -configuration:$configuration -pack -binaryLog -useGlobalNuGetCache:$false -warnAsError:$true -properties "/p:RoslynEnforceCodeStyle=true"} # Verify the state of our various build artifacts Write-Host "Running BuildBoss" $buildBossPath = GetProjectOutputBinary "BuildBoss.exe" Exec-Console $buildBossPath "-r `"$RepoRoot/`" -c $configuration" -p Roslyn.sln Write-Host "" # Verify the state of our generated syntax files Write-Host "Checking generated compiler files" Exec-Block { & (Join-Path $PSScriptRoot "generate-compiler-code.ps1") -test -configuration:$configuration } Exec-Console dotnet "tool run dotnet-format . --include-generated --include src/Compilers/CSharp/Portable/Generated/ src/Compilers/VisualBasic/Portable/Generated/ src/ExpressionEvaluator/VisualBasic/Source/ResultProvider/Generated/ --check -f" Write-Host "" exit 0 } catch [exception] { Write-Host $_ Write-Host $_.Exception exit 1 } finally { if ($enableDumps) { $key = "HKLM:\\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" Remove-ItemProperty -Path $key -Name 'DumpType' Remove-ItemProperty -Path $key -Name 'DumpCount' Remove-ItemProperty -Path $key -Name 'DumpFolder' } Pop-Location }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/common/templates/post-build/channels/generic-internal-channel.yml
parameters: BARBuildId: '' PromoteToChannelIds: '' artifactsPublishingAdditionalParameters: '' dependsOn: - Validate publishInstallersAndChecksums: true symbolPublishingAdditionalParameters: '' stageName: '' channelName: '' channelId: '' transportFeed: '' shippingFeed: '' symbolsFeed: '' stages: - stage: ${{ parameters.stageName }} dependsOn: ${{ parameters.dependsOn }} variables: - template: ../common-variables.yml displayName: ${{ parameters.channelName }} Publishing jobs: - template: ../setup-maestro-vars.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - job: publish_symbols displayName: Symbol Publishing dependsOn: setupMaestroVars condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.TargetChannels'], format('[{0}]', ${{ parameters.channelId }} )) variables: - group: DotNet-Symbol-Server-Pats - name: AzDOProjectName value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ] - name: AzDOPipelineId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ] - name: AzDOBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ] pool: vmImage: 'windows-2019' steps: - script: echo "##vso[task.logissue type=warning]Going forward, v2 Arcade publishing is no longer supported. Please read https://github.com/dotnet/arcade/blob/main/Documentation/CorePackages/Publishing.md for details, then contact dnceng if you have further questions." displayName: Warn about v2 Arcade Publishing Usage # This is necessary whenever we want to publish/restore to an AzDO private feed - task: NuGetAuthenticate@0 displayName: 'Authenticate to AzDO Feeds' - task: DownloadBuildArtifacts@0 displayName: Download Build Assets continueOnError: true inputs: buildType: specific buildVersionToDownload: specific project: $(AzDOProjectName) pipeline: $(AzDOPipelineId) buildId: $(AzDOBuildId) downloadType: 'specific' itemPattern: | PdbArtifacts/** BlobArtifacts/** downloadPath: '$(Build.ArtifactStagingDirectory)' checkDownloadedFiles: true # This is necessary whenever we want to publish/restore to an AzDO private feed # Since sdk-task.ps1 tries to restore packages we need to do this authentication here # otherwise it'll complain about accessing a private feed. - task: NuGetAuthenticate@0 displayName: 'Authenticate to AzDO Feeds' - task: PowerShell@2 displayName: Enable cross-org publishing inputs: filePath: eng\common\enable-cross-org-publishing.ps1 arguments: -token $(dn-bot-dnceng-artifact-feeds-rw) - task: PowerShell@2 displayName: Publish inputs: filePath: eng\common\sdk-task.ps1 arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) /p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/' /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' /p:SymbolPublishingExclusionsFile='$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt' /p:Configuration=Release /p:PublishToMSDL=false ${{ parameters.symbolPublishingAdditionalParameters }} - template: ../../steps/publish-logs.yml parameters: StageLabel: '${{ parameters.stageName }}' JobLabel: 'SymbolPublishing' - job: publish_assets displayName: Publish Assets dependsOn: setupMaestroVars timeoutInMinutes: 120 variables: - name: BARBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] - name: IsStableBuild value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] - name: AzDOProjectName value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ] - name: AzDOPipelineId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ] - name: AzDOBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ] condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.TargetChannels'], format('[{0}]', ${{ parameters.channelId }} )) pool: vmImage: 'windows-2019' steps: - script: echo "##vso[task.logissue type=warning]Going forward, v2 Arcade publishing is no longer supported. Please read https://github.com/dotnet/arcade/blob/main/Documentation/CorePackages/Publishing.md for details, then contact dnceng if you have further questions." displayName: Warn about v2 Arcade Publishing Usage - task: DownloadBuildArtifacts@0 displayName: Download Build Assets continueOnError: true inputs: buildType: specific buildVersionToDownload: specific project: $(AzDOProjectName) pipeline: $(AzDOPipelineId) buildId: $(AzDOBuildId) downloadType: 'specific' itemPattern: | PackageArtifacts/** BlobArtifacts/** AssetManifests/** downloadPath: '$(Build.ArtifactStagingDirectory)' checkDownloadedFiles: true - task: NuGetToolInstaller@1 displayName: 'Install NuGet.exe' # This is necessary whenever we want to publish/restore to an AzDO private feed - task: NuGetAuthenticate@0 displayName: 'Authenticate to AzDO Feeds' - task: PowerShell@2 displayName: Enable cross-org publishing inputs: filePath: eng\common\enable-cross-org-publishing.ps1 arguments: -token $(dn-bot-dnceng-artifact-feeds-rw) - task: PowerShell@2 displayName: Publish Assets inputs: filePath: eng\common\sdk-task.ps1 arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet /p:PublishingInfraVersion=2 /p:IsStableBuild=$(IsStableBuild) /p:IsInternalBuild=$(IsInternalBuild) /p:RepositoryName=$(Build.Repository.Name) /p:CommitSha=$(Build.SourceVersion) /p:NugetPath=$(NuGetExeToolPath) /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-universal-packages-rw)' /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' /p:BARBuildId=$(BARBuildId) /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' /p:Configuration=Release /p:PublishInstallersAndChecksums=${{ parameters.publishInstallersAndChecksums }} /p:ChecksumsTargetStaticFeed=$(InternalChecksumsBlobFeedUrl) /p:ChecksumsAzureAccountKey=$(InternalChecksumsBlobFeedKey) /p:InstallersTargetStaticFeed=$(InternalInstallersBlobFeedUrl) /p:InstallersAzureAccountKey=$(InternalInstallersBlobFeedKey) /p:AzureDevOpsStaticShippingFeed='${{ parameters.shippingFeed }}' /p:AzureDevOpsStaticShippingFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' /p:AzureDevOpsStaticTransportFeed='${{ parameters.transportFeed }}' /p:AzureDevOpsStaticTransportFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' /p:AzureDevOpsStaticSymbolsFeed='${{ parameters.symbolsFeed }}' /p:AzureDevOpsStaticSymbolsFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' /p:PublishToMSDL=false ${{ parameters.artifactsPublishingAdditionalParameters }} - template: ../../steps/publish-logs.yml parameters: StageLabel: '${{ parameters.stageName }}' JobLabel: 'AssetsPublishing' - template: ../../steps/add-build-to-channel.yml parameters: ChannelId: ${{ parameters.channelId }}
parameters: BARBuildId: '' PromoteToChannelIds: '' artifactsPublishingAdditionalParameters: '' dependsOn: - Validate publishInstallersAndChecksums: true symbolPublishingAdditionalParameters: '' stageName: '' channelName: '' channelId: '' transportFeed: '' shippingFeed: '' symbolsFeed: '' stages: - stage: ${{ parameters.stageName }} dependsOn: ${{ parameters.dependsOn }} variables: - template: ../common-variables.yml displayName: ${{ parameters.channelName }} Publishing jobs: - template: ../setup-maestro-vars.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - job: publish_symbols displayName: Symbol Publishing dependsOn: setupMaestroVars condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.TargetChannels'], format('[{0}]', ${{ parameters.channelId }} )) variables: - group: DotNet-Symbol-Server-Pats - name: AzDOProjectName value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ] - name: AzDOPipelineId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ] - name: AzDOBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ] pool: vmImage: 'windows-2019' steps: - script: echo "##vso[task.logissue type=warning]Going forward, v2 Arcade publishing is no longer supported. Please read https://github.com/dotnet/arcade/blob/main/Documentation/CorePackages/Publishing.md for details, then contact dnceng if you have further questions." displayName: Warn about v2 Arcade Publishing Usage # This is necessary whenever we want to publish/restore to an AzDO private feed - task: NuGetAuthenticate@0 displayName: 'Authenticate to AzDO Feeds' - task: DownloadBuildArtifacts@0 displayName: Download Build Assets continueOnError: true inputs: buildType: specific buildVersionToDownload: specific project: $(AzDOProjectName) pipeline: $(AzDOPipelineId) buildId: $(AzDOBuildId) downloadType: 'specific' itemPattern: | PdbArtifacts/** BlobArtifacts/** downloadPath: '$(Build.ArtifactStagingDirectory)' checkDownloadedFiles: true # This is necessary whenever we want to publish/restore to an AzDO private feed # Since sdk-task.ps1 tries to restore packages we need to do this authentication here # otherwise it'll complain about accessing a private feed. - task: NuGetAuthenticate@0 displayName: 'Authenticate to AzDO Feeds' - task: PowerShell@2 displayName: Enable cross-org publishing inputs: filePath: eng\common\enable-cross-org-publishing.ps1 arguments: -token $(dn-bot-dnceng-artifact-feeds-rw) - task: PowerShell@2 displayName: Publish inputs: filePath: eng\common\sdk-task.ps1 arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) /p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/' /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' /p:SymbolPublishingExclusionsFile='$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt' /p:Configuration=Release /p:PublishToMSDL=false ${{ parameters.symbolPublishingAdditionalParameters }} - template: ../../steps/publish-logs.yml parameters: StageLabel: '${{ parameters.stageName }}' JobLabel: 'SymbolPublishing' - job: publish_assets displayName: Publish Assets dependsOn: setupMaestroVars timeoutInMinutes: 120 variables: - name: BARBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] - name: IsStableBuild value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] - name: AzDOProjectName value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ] - name: AzDOPipelineId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ] - name: AzDOBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ] condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.TargetChannels'], format('[{0}]', ${{ parameters.channelId }} )) pool: vmImage: 'windows-2019' steps: - script: echo "##vso[task.logissue type=warning]Going forward, v2 Arcade publishing is no longer supported. Please read https://github.com/dotnet/arcade/blob/main/Documentation/CorePackages/Publishing.md for details, then contact dnceng if you have further questions." displayName: Warn about v2 Arcade Publishing Usage - task: DownloadBuildArtifacts@0 displayName: Download Build Assets continueOnError: true inputs: buildType: specific buildVersionToDownload: specific project: $(AzDOProjectName) pipeline: $(AzDOPipelineId) buildId: $(AzDOBuildId) downloadType: 'specific' itemPattern: | PackageArtifacts/** BlobArtifacts/** AssetManifests/** downloadPath: '$(Build.ArtifactStagingDirectory)' checkDownloadedFiles: true - task: NuGetToolInstaller@1 displayName: 'Install NuGet.exe' # This is necessary whenever we want to publish/restore to an AzDO private feed - task: NuGetAuthenticate@0 displayName: 'Authenticate to AzDO Feeds' - task: PowerShell@2 displayName: Enable cross-org publishing inputs: filePath: eng\common\enable-cross-org-publishing.ps1 arguments: -token $(dn-bot-dnceng-artifact-feeds-rw) - task: PowerShell@2 displayName: Publish Assets inputs: filePath: eng\common\sdk-task.ps1 arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet /p:PublishingInfraVersion=2 /p:IsStableBuild=$(IsStableBuild) /p:IsInternalBuild=$(IsInternalBuild) /p:RepositoryName=$(Build.Repository.Name) /p:CommitSha=$(Build.SourceVersion) /p:NugetPath=$(NuGetExeToolPath) /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-universal-packages-rw)' /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' /p:BARBuildId=$(BARBuildId) /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' /p:Configuration=Release /p:PublishInstallersAndChecksums=${{ parameters.publishInstallersAndChecksums }} /p:ChecksumsTargetStaticFeed=$(InternalChecksumsBlobFeedUrl) /p:ChecksumsAzureAccountKey=$(InternalChecksumsBlobFeedKey) /p:InstallersTargetStaticFeed=$(InternalInstallersBlobFeedUrl) /p:InstallersAzureAccountKey=$(InternalInstallersBlobFeedKey) /p:AzureDevOpsStaticShippingFeed='${{ parameters.shippingFeed }}' /p:AzureDevOpsStaticShippingFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' /p:AzureDevOpsStaticTransportFeed='${{ parameters.transportFeed }}' /p:AzureDevOpsStaticTransportFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' /p:AzureDevOpsStaticSymbolsFeed='${{ parameters.symbolsFeed }}' /p:AzureDevOpsStaticSymbolsFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' /p:PublishToMSDL=false ${{ parameters.artifactsPublishingAdditionalParameters }} - template: ../../steps/publish-logs.yml parameters: StageLabel: '${{ parameters.stageName }}' JobLabel: 'AssetsPublishing' - template: ../../steps/add-build-to-channel.yml parameters: ChannelId: ${{ parameters.channelId }}
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/publish-assets.ps1
# Publishes our build assets to nuget, Azure DevOps, dotnet/versions, etc .. # # The publish operation is best visioned as an optional yet repeatable post build operation. It can be # run anytime after build or automatically as a post build step. But it is an operation that focuses on # build outputs and hence can't rely on source code from the build being available # # Repeatable is important here because we have to assume that publishes can and will fail with some # degree of regularity. [CmdletBinding(PositionalBinding=$false)] Param( # Standard options [string]$configuration = "", [string]$branchName = "", [string]$releaseName = "", [switch]$test, # Credentials [string]$nugetApiKey = "" ) Set-StrictMode -version 2.0 $ErrorActionPreference="Stop" [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 function Get-PublishKey([string]$uploadUrl) { $url = New-Object Uri $uploadUrl switch ($url.Host) { "api.nuget.org" { return $nugetApiKey } # For publishing to azure, the API key can be any non-empty string as authentication is done in the pipeline. "pkgs.dev.azure.com" { return "AzureArtifacts"} default { throw "Cannot determine publish key for $uploadUrl" } } } function Publish-Nuget($publishData, [string]$packageDir) { Push-Location $packageDir try { # Retrieve the feed name to source mapping. $feedData = GetFeedPublishData # Each branch stores the name of the package to feed map it should use. # Retrieve the correct map for this particular branch. $packagesData = GetPackagesPublishData $publishData.packageFeeds foreach ($package in Get-ChildItem *.nupkg) { $nupkg = Split-Path -Leaf $package Write-Host " Publishing $nupkg" if (-not (Test-Path $nupkg)) { throw "$nupkg does not exist" } # Lookup the feed name from the packages map using the package name without the version or extension. $nupkgWithoutVersion = $nupkg -replace '(\.\d+){3}-.*.nupkg', '' if (-not (Get-Member -InputObject $packagesData -Name $nupkgWithoutVersion)) { throw "$nupkg has no configured feed (looked for $nupkgWithoutVersion)" } $feedName = $packagesData.$nupkgWithoutVersion # If the configured feed is arcade, then skip publishing here. Arcade will handle publishing to their feeds. if ($feedName.equals("arcade")) { Write-Host " Skipping publishing for $nupkg as it is published by arcade" continue } # Use the feed name to get the source to upload the package to. if (-not (Get-Member -InputObject $feedData -Name $feedName)) { throw "$feedName has no configured source feed" } $uploadUrl = $feedData.$feedName $apiKey = Get-PublishKey $uploadUrl if (-not $test) { Exec-Console $dotnet "nuget push $nupkg --source $uploadUrl --api-key $apiKey" } } } finally { Pop-Location } } # Do basic verification on the values provided in the publish configuration function Test-Entry($publishData, [switch]$isBranch) { if ($isBranch) { foreach ($nugetKind in $publishData.nugetKind) { if ($nugetKind -ne "PerBuildPreRelease" -and $nugetKind -ne "Shipping" -and $nugetKind -ne "NonShipping") { throw "Branches are only allowed to publish Shipping, NonShipping, or PerBuildPreRelease" } } } } # Publish a given entry: branch or release. function Publish-Entry($publishData, [switch]$isBranch) { Test-Entry $publishData -isBranch:$isBranch # First publish the NuGet packages to the specified feeds foreach ($nugetKind in $publishData.nugetKind) { Publish-NuGet $publishData (Join-Path $PackagesDir $nugetKind) } exit 0 } try { if ($configuration -eq "") { Write-Host "Must provide the build configuration with -configuration" exit 1 } . (Join-Path $PSScriptRoot "build-utils.ps1") $dotnet = Ensure-DotnetSdk if ($branchName -ne "" -and $releaseName -ne "") { Write-Host "Can only specify -branchName or -releaseName, not both" exit 1 } if ($branchName -ne "") { $data = GetBranchPublishData $branchName if ($data -eq $null) { Write-Host "Branch $branchName not listed for publishing." exit 0 } Publish-Entry $data -isBranch:$true } elseif ($releaseName -ne "") { $data = GetReleasePublishData $releaseName if ($data -eq $null) { Write-Host "Release $releaseName not listed for publishing." exit 1 } Publish-Entry $data -isBranch:$false } else { Write-Host "Need to specify -branchName or -releaseName" exit 1 } } catch { Write-Host $_ Write-Host $_.Exception Write-Host $_.ScriptStackTrace exit 1 }
# Publishes our build assets to nuget, Azure DevOps, dotnet/versions, etc .. # # The publish operation is best visioned as an optional yet repeatable post build operation. It can be # run anytime after build or automatically as a post build step. But it is an operation that focuses on # build outputs and hence can't rely on source code from the build being available # # Repeatable is important here because we have to assume that publishes can and will fail with some # degree of regularity. [CmdletBinding(PositionalBinding=$false)] Param( # Standard options [string]$configuration = "", [string]$branchName = "", [string]$releaseName = "", [switch]$test, # Credentials [string]$nugetApiKey = "" ) Set-StrictMode -version 2.0 $ErrorActionPreference="Stop" [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 function Get-PublishKey([string]$uploadUrl) { $url = New-Object Uri $uploadUrl switch ($url.Host) { "api.nuget.org" { return $nugetApiKey } # For publishing to azure, the API key can be any non-empty string as authentication is done in the pipeline. "pkgs.dev.azure.com" { return "AzureArtifacts"} default { throw "Cannot determine publish key for $uploadUrl" } } } function Publish-Nuget($publishData, [string]$packageDir) { Push-Location $packageDir try { # Retrieve the feed name to source mapping. $feedData = GetFeedPublishData # Each branch stores the name of the package to feed map it should use. # Retrieve the correct map for this particular branch. $packagesData = GetPackagesPublishData $publishData.packageFeeds foreach ($package in Get-ChildItem *.nupkg) { $nupkg = Split-Path -Leaf $package Write-Host " Publishing $nupkg" if (-not (Test-Path $nupkg)) { throw "$nupkg does not exist" } # Lookup the feed name from the packages map using the package name without the version or extension. $nupkgWithoutVersion = $nupkg -replace '(\.\d+){3}-.*.nupkg', '' if (-not (Get-Member -InputObject $packagesData -Name $nupkgWithoutVersion)) { throw "$nupkg has no configured feed (looked for $nupkgWithoutVersion)" } $feedName = $packagesData.$nupkgWithoutVersion # If the configured feed is arcade, then skip publishing here. Arcade will handle publishing to their feeds. if ($feedName.equals("arcade")) { Write-Host " Skipping publishing for $nupkg as it is published by arcade" continue } # Use the feed name to get the source to upload the package to. if (-not (Get-Member -InputObject $feedData -Name $feedName)) { throw "$feedName has no configured source feed" } $uploadUrl = $feedData.$feedName $apiKey = Get-PublishKey $uploadUrl if (-not $test) { Exec-Console $dotnet "nuget push $nupkg --source $uploadUrl --api-key $apiKey" } } } finally { Pop-Location } } # Do basic verification on the values provided in the publish configuration function Test-Entry($publishData, [switch]$isBranch) { if ($isBranch) { foreach ($nugetKind in $publishData.nugetKind) { if ($nugetKind -ne "PerBuildPreRelease" -and $nugetKind -ne "Shipping" -and $nugetKind -ne "NonShipping") { throw "Branches are only allowed to publish Shipping, NonShipping, or PerBuildPreRelease" } } } } # Publish a given entry: branch or release. function Publish-Entry($publishData, [switch]$isBranch) { Test-Entry $publishData -isBranch:$isBranch # First publish the NuGet packages to the specified feeds foreach ($nugetKind in $publishData.nugetKind) { Publish-NuGet $publishData (Join-Path $PackagesDir $nugetKind) } exit 0 } try { if ($configuration -eq "") { Write-Host "Must provide the build configuration with -configuration" exit 1 } . (Join-Path $PSScriptRoot "build-utils.ps1") $dotnet = Ensure-DotnetSdk if ($branchName -ne "" -and $releaseName -ne "") { Write-Host "Can only specify -branchName or -releaseName, not both" exit 1 } if ($branchName -ne "") { $data = GetBranchPublishData $branchName if ($data -eq $null) { Write-Host "Branch $branchName not listed for publishing." exit 0 } Publish-Entry $data -isBranch:$true } elseif ($releaseName -ne "") { $data = GetReleasePublishData $releaseName if ($data -eq $null) { Write-Host "Release $releaseName not listed for publishing." exit 1 } Publish-Entry $data -isBranch:$false } else { Write-Host "Need to specify -branchName or -releaseName" exit 1 } } catch { Write-Host $_ Write-Host $_.Exception Write-Host $_.ScriptStackTrace exit 1 }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/common/post-build/symbols-validation.ps1
param( [Parameter(Mandatory = $true)][string] $InputPath, # Full path to directory where NuGet packages to be checked are stored [Parameter(Mandatory = $true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation [Parameter(Mandatory = $true)][string] $DotnetSymbolVersion, # Version of dotnet symbol to use [Parameter(Mandatory = $false)][switch] $CheckForWindowsPdbs, # If we should check for the existence of windows pdbs in addition to portable PDBs [Parameter(Mandatory = $false)][switch] $ContinueOnError, # If we should keep checking symbols after an error [Parameter(Mandatory = $false)][switch] $Clean # Clean extracted symbols directory after checking symbols ) # Maximum number of jobs to run in parallel $MaxParallelJobs = 16 # Max number of retries $MaxRetry = 5 # Wait time between check for system load $SecondsBetweenLoadChecks = 10 # Set error codes Set-Variable -Name "ERROR_BADEXTRACT" -Option Constant -Value -1 Set-Variable -Name "ERROR_FILEDOESNOTEXIST" -Option Constant -Value -2 $WindowsPdbVerificationParam = "" if ($CheckForWindowsPdbs) { $WindowsPdbVerificationParam = "--windows-pdbs" } $CountMissingSymbols = { param( [string] $PackagePath, # Path to a NuGet package [string] $WindowsPdbVerificationParam # If we should check for the existence of windows pdbs in addition to portable PDBs ) . $using:PSScriptRoot\..\tools.ps1 Add-Type -AssemblyName System.IO.Compression.FileSystem Write-Host "Validating $PackagePath " # Ensure input file exist if (!(Test-Path $PackagePath)) { Write-PipelineTaskError "Input file does not exist: $PackagePath" return [pscustomobject]@{ result = $using:ERROR_FILEDOESNOTEXIST packagePath = $PackagePath } } # Extensions for which we'll look for symbols $RelevantExtensions = @('.dll', '.exe', '.so', '.dylib') # How many files are missing symbol information $MissingSymbols = 0 $PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath) $PackageGuid = New-Guid $ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageGuid $SymbolsPath = Join-Path -Path $ExtractPath -ChildPath 'Symbols' try { [System.IO.Compression.ZipFile]::ExtractToDirectory($PackagePath, $ExtractPath) } catch { Write-Host "Something went wrong extracting $PackagePath" Write-Host $_ return [pscustomobject]@{ result = $using:ERROR_BADEXTRACT packagePath = $PackagePath } } Get-ChildItem -Recurse $ExtractPath | Where-Object { $RelevantExtensions -contains $_.Extension } | ForEach-Object { $FileName = $_.FullName if ($FileName -Match '\\ref\\') { Write-Host "`t Ignoring reference assembly file " $FileName return } $FirstMatchingSymbolDescriptionOrDefault = { param( [string] $FullPath, # Full path to the module that has to be checked [string] $TargetServerParam, # Parameter to pass to `Symbol Tool` indicating the server to lookup for symbols [string] $WindowsPdbVerificationParam, # Parameter to pass to potential check for windows-pdbs. [string] $SymbolsPath ) $FileName = [System.IO.Path]::GetFileName($FullPath) $Extension = [System.IO.Path]::GetExtension($FullPath) # Those below are potential symbol files that the `dotnet symbol` might # return. Which one will be returned depend on the type of file we are # checking and which type of file was uploaded. # The file itself is returned $SymbolPath = $SymbolsPath + '\' + $FileName # PDB file for the module $PdbPath = $SymbolPath.Replace($Extension, '.pdb') # PDB file for R2R module (created by crossgen) $NGenPdb = $SymbolPath.Replace($Extension, '.ni.pdb') # DBG file for a .so library $SODbg = $SymbolPath.Replace($Extension, '.so.dbg') # DWARF file for a .dylib $DylibDwarf = $SymbolPath.Replace($Extension, '.dylib.dwarf') $dotnetSymbolExe = "$env:USERPROFILE\.dotnet\tools" $dotnetSymbolExe = Resolve-Path "$dotnetSymbolExe\dotnet-symbol.exe" $totalRetries = 0 while ($totalRetries -lt $using:MaxRetry) { # Save the output and get diagnostic output $output = & $dotnetSymbolExe --symbols --modules $WindowsPdbVerificationParam $TargetServerParam $FullPath -o $SymbolsPath --diagnostics | Out-String if (Test-Path $PdbPath) { return 'PDB' } elseif (Test-Path $NGenPdb) { return 'NGen PDB' } elseif (Test-Path $SODbg) { return 'DBG for SO' } elseif (Test-Path $DylibDwarf) { return 'Dwarf for Dylib' } elseif (Test-Path $SymbolPath) { return 'Module' } else { $totalRetries++ } } return $null } $FileGuid = New-Guid $ExpandedSymbolsPath = Join-Path -Path $SymbolsPath -ChildPath $FileGuid $SymbolsOnMSDL = & $FirstMatchingSymbolDescriptionOrDefault ` -FullPath $FileName ` -TargetServerParam '--microsoft-symbol-server' ` -SymbolsPath "$ExpandedSymbolsPath-msdl" ` -WindowsPdbVerificationParam $WindowsPdbVerificationParam $SymbolsOnSymWeb = & $FirstMatchingSymbolDescriptionOrDefault ` -FullPath $FileName ` -TargetServerParam '--internal-server' ` -SymbolsPath "$ExpandedSymbolsPath-symweb" ` -WindowsPdbVerificationParam $WindowsPdbVerificationParam Write-Host -NoNewLine "`t Checking file " $FileName "... " if ($SymbolsOnMSDL -ne $null -and $SymbolsOnSymWeb -ne $null) { Write-Host "Symbols found on MSDL ($SymbolsOnMSDL) and SymWeb ($SymbolsOnSymWeb)" } else { $MissingSymbols++ if ($SymbolsOnMSDL -eq $null -and $SymbolsOnSymWeb -eq $null) { Write-Host 'No symbols found on MSDL or SymWeb!' } else { if ($SymbolsOnMSDL -eq $null) { Write-Host 'No symbols found on MSDL!' } else { Write-Host 'No symbols found on SymWeb!' } } } } if ($using:Clean) { Remove-Item $ExtractPath -Recurse -Force } Pop-Location return [pscustomobject]@{ result = $MissingSymbols packagePath = $PackagePath } } function CheckJobResult( $result, $packagePath, [ref]$DupedSymbols, [ref]$TotalFailures) { if ($result -eq $ERROR_BADEXTRACT) { Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "$packagePath has duplicated symbol files" $DupedSymbols.Value++ } elseif ($result -eq $ERROR_FILEDOESNOTEXIST) { Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "$packagePath does not exist" $TotalFailures.Value++ } elseif ($result -gt '0') { Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "Missing symbols for $result modules in the package $packagePath" $TotalFailures.Value++ } else { Write-Host "All symbols verified for package $packagePath" } } function CheckSymbolsAvailable { if (Test-Path $ExtractPath) { Remove-Item $ExtractPath -Force -Recurse -ErrorAction SilentlyContinue } $TotalPackages = 0 $TotalFailures = 0 $DupedSymbols = 0 Get-ChildItem "$InputPath\*.nupkg" | ForEach-Object { $FileName = $_.Name $FullName = $_.FullName # These packages from Arcade-Services include some native libraries that # our current symbol uploader can't handle. Below is a workaround until # we get issue: https://github.com/dotnet/arcade/issues/2457 sorted. if ($FileName -Match 'Microsoft\.DotNet\.Darc\.') { Write-Host "Ignoring Arcade-services file: $FileName" Write-Host return } elseif ($FileName -Match 'Microsoft\.DotNet\.Maestro\.Tasks\.') { Write-Host "Ignoring Arcade-services file: $FileName" Write-Host return } $TotalPackages++ Start-Job -ScriptBlock $CountMissingSymbols -ArgumentList @($FullName,$WindowsPdbVerificationParam) | Out-Null $NumJobs = @(Get-Job -State 'Running').Count while ($NumJobs -ge $MaxParallelJobs) { Write-Host "There are $NumJobs validation jobs running right now. Waiting $SecondsBetweenLoadChecks seconds to check again." sleep $SecondsBetweenLoadChecks $NumJobs = @(Get-Job -State 'Running').Count } foreach ($Job in @(Get-Job -State 'Completed')) { $jobResult = Wait-Job -Id $Job.Id | Receive-Job CheckJobResult $jobResult.result $jobResult.packagePath ([ref]$DupedSymbols) ([ref]$TotalFailures) Remove-Job -Id $Job.Id } Write-Host } foreach ($Job in @(Get-Job)) { $jobResult = Wait-Job -Id $Job.Id | Receive-Job CheckJobResult $jobResult.result $jobResult.packagePath ([ref]$DupedSymbols) ([ref]$TotalFailures) } if ($TotalFailures -gt 0 -or $DupedSymbols -gt 0) { if ($TotalFailures -gt 0) { Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "Symbols missing for $TotalFailures/$TotalPackages packages" } if ($DupedSymbols -gt 0) { Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "$DupedSymbols/$TotalPackages packages had duplicated symbol files and could not be extracted" } ExitWithExitCode 1 } else { Write-Host "All symbols validated!" } } function InstallDotnetSymbol { $dotnetSymbolPackageName = 'dotnet-symbol' $dotnetRoot = InitializeDotNetCli -install:$true $dotnet = "$dotnetRoot\dotnet.exe" $toolList = & "$dotnet" tool list --global if (($toolList -like "*$dotnetSymbolPackageName*") -and ($toolList -like "*$dotnetSymbolVersion*")) { Write-Host "dotnet-symbol version $dotnetSymbolVersion is already installed." } else { Write-Host "Installing dotnet-symbol version $dotnetSymbolVersion..." Write-Host 'You may need to restart your command window if this is the first dotnet tool you have installed.' & "$dotnet" tool install $dotnetSymbolPackageName --version $dotnetSymbolVersion --verbosity "minimal" --global } } try { . $PSScriptRoot\post-build-utils.ps1 InstallDotnetSymbol foreach ($Job in @(Get-Job)) { Remove-Job -Id $Job.Id } CheckSymbolsAvailable } catch { Write-Host $_.ScriptStackTrace Write-PipelineTelemetryError -Category 'CheckSymbols' -Message $_ ExitWithExitCode 1 }
param( [Parameter(Mandatory = $true)][string] $InputPath, # Full path to directory where NuGet packages to be checked are stored [Parameter(Mandatory = $true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation [Parameter(Mandatory = $true)][string] $DotnetSymbolVersion, # Version of dotnet symbol to use [Parameter(Mandatory = $false)][switch] $CheckForWindowsPdbs, # If we should check for the existence of windows pdbs in addition to portable PDBs [Parameter(Mandatory = $false)][switch] $ContinueOnError, # If we should keep checking symbols after an error [Parameter(Mandatory = $false)][switch] $Clean # Clean extracted symbols directory after checking symbols ) # Maximum number of jobs to run in parallel $MaxParallelJobs = 16 # Max number of retries $MaxRetry = 5 # Wait time between check for system load $SecondsBetweenLoadChecks = 10 # Set error codes Set-Variable -Name "ERROR_BADEXTRACT" -Option Constant -Value -1 Set-Variable -Name "ERROR_FILEDOESNOTEXIST" -Option Constant -Value -2 $WindowsPdbVerificationParam = "" if ($CheckForWindowsPdbs) { $WindowsPdbVerificationParam = "--windows-pdbs" } $CountMissingSymbols = { param( [string] $PackagePath, # Path to a NuGet package [string] $WindowsPdbVerificationParam # If we should check for the existence of windows pdbs in addition to portable PDBs ) . $using:PSScriptRoot\..\tools.ps1 Add-Type -AssemblyName System.IO.Compression.FileSystem Write-Host "Validating $PackagePath " # Ensure input file exist if (!(Test-Path $PackagePath)) { Write-PipelineTaskError "Input file does not exist: $PackagePath" return [pscustomobject]@{ result = $using:ERROR_FILEDOESNOTEXIST packagePath = $PackagePath } } # Extensions for which we'll look for symbols $RelevantExtensions = @('.dll', '.exe', '.so', '.dylib') # How many files are missing symbol information $MissingSymbols = 0 $PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath) $PackageGuid = New-Guid $ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageGuid $SymbolsPath = Join-Path -Path $ExtractPath -ChildPath 'Symbols' try { [System.IO.Compression.ZipFile]::ExtractToDirectory($PackagePath, $ExtractPath) } catch { Write-Host "Something went wrong extracting $PackagePath" Write-Host $_ return [pscustomobject]@{ result = $using:ERROR_BADEXTRACT packagePath = $PackagePath } } Get-ChildItem -Recurse $ExtractPath | Where-Object { $RelevantExtensions -contains $_.Extension } | ForEach-Object { $FileName = $_.FullName if ($FileName -Match '\\ref\\') { Write-Host "`t Ignoring reference assembly file " $FileName return } $FirstMatchingSymbolDescriptionOrDefault = { param( [string] $FullPath, # Full path to the module that has to be checked [string] $TargetServerParam, # Parameter to pass to `Symbol Tool` indicating the server to lookup for symbols [string] $WindowsPdbVerificationParam, # Parameter to pass to potential check for windows-pdbs. [string] $SymbolsPath ) $FileName = [System.IO.Path]::GetFileName($FullPath) $Extension = [System.IO.Path]::GetExtension($FullPath) # Those below are potential symbol files that the `dotnet symbol` might # return. Which one will be returned depend on the type of file we are # checking and which type of file was uploaded. # The file itself is returned $SymbolPath = $SymbolsPath + '\' + $FileName # PDB file for the module $PdbPath = $SymbolPath.Replace($Extension, '.pdb') # PDB file for R2R module (created by crossgen) $NGenPdb = $SymbolPath.Replace($Extension, '.ni.pdb') # DBG file for a .so library $SODbg = $SymbolPath.Replace($Extension, '.so.dbg') # DWARF file for a .dylib $DylibDwarf = $SymbolPath.Replace($Extension, '.dylib.dwarf') $dotnetSymbolExe = "$env:USERPROFILE\.dotnet\tools" $dotnetSymbolExe = Resolve-Path "$dotnetSymbolExe\dotnet-symbol.exe" $totalRetries = 0 while ($totalRetries -lt $using:MaxRetry) { # Save the output and get diagnostic output $output = & $dotnetSymbolExe --symbols --modules $WindowsPdbVerificationParam $TargetServerParam $FullPath -o $SymbolsPath --diagnostics | Out-String if (Test-Path $PdbPath) { return 'PDB' } elseif (Test-Path $NGenPdb) { return 'NGen PDB' } elseif (Test-Path $SODbg) { return 'DBG for SO' } elseif (Test-Path $DylibDwarf) { return 'Dwarf for Dylib' } elseif (Test-Path $SymbolPath) { return 'Module' } else { $totalRetries++ } } return $null } $FileGuid = New-Guid $ExpandedSymbolsPath = Join-Path -Path $SymbolsPath -ChildPath $FileGuid $SymbolsOnMSDL = & $FirstMatchingSymbolDescriptionOrDefault ` -FullPath $FileName ` -TargetServerParam '--microsoft-symbol-server' ` -SymbolsPath "$ExpandedSymbolsPath-msdl" ` -WindowsPdbVerificationParam $WindowsPdbVerificationParam $SymbolsOnSymWeb = & $FirstMatchingSymbolDescriptionOrDefault ` -FullPath $FileName ` -TargetServerParam '--internal-server' ` -SymbolsPath "$ExpandedSymbolsPath-symweb" ` -WindowsPdbVerificationParam $WindowsPdbVerificationParam Write-Host -NoNewLine "`t Checking file " $FileName "... " if ($SymbolsOnMSDL -ne $null -and $SymbolsOnSymWeb -ne $null) { Write-Host "Symbols found on MSDL ($SymbolsOnMSDL) and SymWeb ($SymbolsOnSymWeb)" } else { $MissingSymbols++ if ($SymbolsOnMSDL -eq $null -and $SymbolsOnSymWeb -eq $null) { Write-Host 'No symbols found on MSDL or SymWeb!' } else { if ($SymbolsOnMSDL -eq $null) { Write-Host 'No symbols found on MSDL!' } else { Write-Host 'No symbols found on SymWeb!' } } } } if ($using:Clean) { Remove-Item $ExtractPath -Recurse -Force } Pop-Location return [pscustomobject]@{ result = $MissingSymbols packagePath = $PackagePath } } function CheckJobResult( $result, $packagePath, [ref]$DupedSymbols, [ref]$TotalFailures) { if ($result -eq $ERROR_BADEXTRACT) { Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "$packagePath has duplicated symbol files" $DupedSymbols.Value++ } elseif ($result -eq $ERROR_FILEDOESNOTEXIST) { Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "$packagePath does not exist" $TotalFailures.Value++ } elseif ($result -gt '0') { Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "Missing symbols for $result modules in the package $packagePath" $TotalFailures.Value++ } else { Write-Host "All symbols verified for package $packagePath" } } function CheckSymbolsAvailable { if (Test-Path $ExtractPath) { Remove-Item $ExtractPath -Force -Recurse -ErrorAction SilentlyContinue } $TotalPackages = 0 $TotalFailures = 0 $DupedSymbols = 0 Get-ChildItem "$InputPath\*.nupkg" | ForEach-Object { $FileName = $_.Name $FullName = $_.FullName # These packages from Arcade-Services include some native libraries that # our current symbol uploader can't handle. Below is a workaround until # we get issue: https://github.com/dotnet/arcade/issues/2457 sorted. if ($FileName -Match 'Microsoft\.DotNet\.Darc\.') { Write-Host "Ignoring Arcade-services file: $FileName" Write-Host return } elseif ($FileName -Match 'Microsoft\.DotNet\.Maestro\.Tasks\.') { Write-Host "Ignoring Arcade-services file: $FileName" Write-Host return } $TotalPackages++ Start-Job -ScriptBlock $CountMissingSymbols -ArgumentList @($FullName,$WindowsPdbVerificationParam) | Out-Null $NumJobs = @(Get-Job -State 'Running').Count while ($NumJobs -ge $MaxParallelJobs) { Write-Host "There are $NumJobs validation jobs running right now. Waiting $SecondsBetweenLoadChecks seconds to check again." sleep $SecondsBetweenLoadChecks $NumJobs = @(Get-Job -State 'Running').Count } foreach ($Job in @(Get-Job -State 'Completed')) { $jobResult = Wait-Job -Id $Job.Id | Receive-Job CheckJobResult $jobResult.result $jobResult.packagePath ([ref]$DupedSymbols) ([ref]$TotalFailures) Remove-Job -Id $Job.Id } Write-Host } foreach ($Job in @(Get-Job)) { $jobResult = Wait-Job -Id $Job.Id | Receive-Job CheckJobResult $jobResult.result $jobResult.packagePath ([ref]$DupedSymbols) ([ref]$TotalFailures) } if ($TotalFailures -gt 0 -or $DupedSymbols -gt 0) { if ($TotalFailures -gt 0) { Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "Symbols missing for $TotalFailures/$TotalPackages packages" } if ($DupedSymbols -gt 0) { Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "$DupedSymbols/$TotalPackages packages had duplicated symbol files and could not be extracted" } ExitWithExitCode 1 } else { Write-Host "All symbols validated!" } } function InstallDotnetSymbol { $dotnetSymbolPackageName = 'dotnet-symbol' $dotnetRoot = InitializeDotNetCli -install:$true $dotnet = "$dotnetRoot\dotnet.exe" $toolList = & "$dotnet" tool list --global if (($toolList -like "*$dotnetSymbolPackageName*") -and ($toolList -like "*$dotnetSymbolVersion*")) { Write-Host "dotnet-symbol version $dotnetSymbolVersion is already installed." } else { Write-Host "Installing dotnet-symbol version $dotnetSymbolVersion..." Write-Host 'You may need to restart your command window if this is the first dotnet tool you have installed.' & "$dotnet" tool install $dotnetSymbolPackageName --version $dotnetSymbolVersion --verbosity "minimal" --global } } try { . $PSScriptRoot\post-build-utils.ps1 InstallDotnetSymbol foreach ($Job in @(Get-Job)) { Remove-Job -Id $Job.Id } CheckSymbolsAvailable } catch { Write-Host $_.ScriptStackTrace Write-PipelineTelemetryError -Category 'CheckSymbols' -Message $_ ExitWithExitCode 1 }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Scripting/CoreTest.Desktop/Properties/launchSettings.json
{ "profiles": { "xUnit.net Console (32-bit)": { "commandName": "Executable", "executablePath": "$(NuGetPackageRoot)xunit.runner.console\\$(XUnitVersion)\\tools\\net452\\xunit.console.x86.exe", "commandLineArgs": "$(TargetPath) -noshadow -verbose" }, "xUnit.net Console (64-bit)": { "commandName": "Executable", "executablePath": "$(NuGetPackageRoot)xunit.runner.console\\$(XUnitVersion)\\tools\\net452\\xunit.console.exe", "commandLineArgs": "$(TargetPath) -noshadow -verbose" } } }
{ "profiles": { "xUnit.net Console (32-bit)": { "commandName": "Executable", "executablePath": "$(NuGetPackageRoot)xunit.runner.console\\$(XUnitVersion)\\tools\\net452\\xunit.console.x86.exe", "commandLineArgs": "$(TargetPath) -noshadow -verbose" }, "xUnit.net Console (64-bit)": { "commandName": "Executable", "executablePath": "$(NuGetPackageRoot)xunit.runner.console\\$(XUnitVersion)\\tools\\net452\\xunit.console.exe", "commandLineArgs": "$(TargetPath) -noshadow -verbose" } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/common/darc-init.sh
#!/usr/bin/env bash source="${BASH_SOURCE[0]}" darcVersion='' versionEndpoint='https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16' verbosity='minimal' while [[ $# > 0 ]]; do opt="$(echo "$1" | tr "[:upper:]" "[:lower:]")" case "$opt" in --darcversion) darcVersion=$2 shift ;; --versionendpoint) versionEndpoint=$2 shift ;; --verbosity) verbosity=$2 shift ;; --toolpath) toolpath=$2 shift ;; *) echo "Invalid argument: $1" usage exit 1 ;; esac shift done # 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/tools.sh" if [ -z "$darcVersion" ]; then darcVersion=$(curl -X GET "$versionEndpoint" -H "accept: text/plain") fi function InstallDarcCli { local darc_cli_package_name="microsoft.dotnet.darc" InitializeDotNetCli local dotnet_root=$_InitializeDotNetCli if [ -z "$toolpath" ]; then local tool_list=$($dotnet_root/dotnet tool list -g) if [[ $tool_list = *$darc_cli_package_name* ]]; then echo $($dotnet_root/dotnet tool uninstall $darc_cli_package_name -g) fi else local tool_list=$($dotnet_root/dotnet tool list --tool-path "$toolpath") if [[ $tool_list = *$darc_cli_package_name* ]]; then echo $($dotnet_root/dotnet tool uninstall $darc_cli_package_name --tool-path "$toolpath") fi fi local arcadeServicesSource="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" echo "Installing Darc CLI version $darcVersion..." echo "You may need to restart your command shell if this is the first dotnet tool you have installed." if [ -z "$toolpath" ]; then echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g) else echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity --tool-path "$toolpath") fi } InstallDarcCli
#!/usr/bin/env bash source="${BASH_SOURCE[0]}" darcVersion='' versionEndpoint='https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16' verbosity='minimal' while [[ $# > 0 ]]; do opt="$(echo "$1" | tr "[:upper:]" "[:lower:]")" case "$opt" in --darcversion) darcVersion=$2 shift ;; --versionendpoint) versionEndpoint=$2 shift ;; --verbosity) verbosity=$2 shift ;; --toolpath) toolpath=$2 shift ;; *) echo "Invalid argument: $1" usage exit 1 ;; esac shift done # 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/tools.sh" if [ -z "$darcVersion" ]; then darcVersion=$(curl -X GET "$versionEndpoint" -H "accept: text/plain") fi function InstallDarcCli { local darc_cli_package_name="microsoft.dotnet.darc" InitializeDotNetCli local dotnet_root=$_InitializeDotNetCli if [ -z "$toolpath" ]; then local tool_list=$($dotnet_root/dotnet tool list -g) if [[ $tool_list = *$darc_cli_package_name* ]]; then echo $($dotnet_root/dotnet tool uninstall $darc_cli_package_name -g) fi else local tool_list=$($dotnet_root/dotnet tool list --tool-path "$toolpath") if [[ $tool_list = *$darc_cli_package_name* ]]; then echo $($dotnet_root/dotnet tool uninstall $darc_cli_package_name --tool-path "$toolpath") fi fi local arcadeServicesSource="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" echo "Installing Darc CLI version $darcVersion..." echo "You may need to restart your command shell if this is the first dotnet tool you have installed." if [ -z "$toolpath" ]; then echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g) else echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity --tool-path "$toolpath") fi } InstallDarcCli
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./.vscode/launch.json
{ // Use IntelliSense to find out which attributes exist for C# debugging // Use hover for the description of the existing attributes // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md "version": "0.2.0", "configurations": [ { "name": "Launch BuildValidator.dll", "type": "coreclr", "request": "launch", "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. "program": "${workspaceFolder}/artifacts/bin/BuildValidator/Debug/netcoreapp3.1/BuildValidator.dll", "args": [ "--assembliesPath", "./artifacts/obj/csc/Debug/netcoreapp3.1", "--referencesPath", "./artifacts/bin", "--referencesPath", "C:/Program Files/dotnet/packs/Microsoft.AspNetCore.App.Ref", "--referencesPath", "C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref", "--debugPath", "./artifacts/BuildValidator", "--sourcePath", "." ], "cwd": "${workspaceFolder}", "stopAtEntry": false, "console": "internalConsole" }, { "name": "Launch RunTests.dll", "type": "coreclr", "request": "launch", "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. "program": "${workspaceFolder}/artifacts/bin/RunTests/Debug/netcoreapp3.1/RunTests.dll", "args": ["--tfm", "netcoreapp3.1", "--sequential", "--html"], "cwd": "${workspaceFolder}/artifacts/bin/RunTests", "stopAtEntry": false, "console": "internalConsole" }, { "name": "Launch PrepareTests.dll", "type": "coreclr", "request": "launch", "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. "program": "${workspaceFolder}/artifacts/bin/PrepareTests/Debug/net5.0/PrepareTests.dll", "args": [ "--source", "${workspaceFolder}", "--destination", "${workspaceFolder}/artifacts/testPayload" ], "cwd": "${workspaceFolder}/artifacts/bin/PrepareTests", "stopAtEntry": false, "console": "internalConsole" }, { "name": ".NET Core Launch (console)", "type": "coreclr", "request": "launch", "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. "program": "${workspaceFolder}/src/Compilers/CSharp/csc/bin/Debug/netcoreapp2.1/csc.dll", "args": [], "cwd": "${workspaceFolder}/src/Compilers/CSharp/csc", // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console "console": "internalConsole", "stopAtEntry": false }, { "name": ".NET Core Attach", "type": "coreclr", "request": "attach", "processId": "${command:pickProcess}" } ] }
{ // Use IntelliSense to find out which attributes exist for C# debugging // Use hover for the description of the existing attributes // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md "version": "0.2.0", "configurations": [ { "name": "Launch BuildValidator.dll", "type": "coreclr", "request": "launch", "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. "program": "${workspaceFolder}/artifacts/bin/BuildValidator/Debug/netcoreapp3.1/BuildValidator.dll", "args": [ "--assembliesPath", "./artifacts/obj/csc/Debug/netcoreapp3.1", "--referencesPath", "./artifacts/bin", "--referencesPath", "C:/Program Files/dotnet/packs/Microsoft.AspNetCore.App.Ref", "--referencesPath", "C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref", "--debugPath", "./artifacts/BuildValidator", "--sourcePath", "." ], "cwd": "${workspaceFolder}", "stopAtEntry": false, "console": "internalConsole" }, { "name": "Launch RunTests.dll", "type": "coreclr", "request": "launch", "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. "program": "${workspaceFolder}/artifacts/bin/RunTests/Debug/netcoreapp3.1/RunTests.dll", "args": ["--tfm", "netcoreapp3.1", "--sequential", "--html"], "cwd": "${workspaceFolder}/artifacts/bin/RunTests", "stopAtEntry": false, "console": "internalConsole" }, { "name": "Launch PrepareTests.dll", "type": "coreclr", "request": "launch", "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. "program": "${workspaceFolder}/artifacts/bin/PrepareTests/Debug/net5.0/PrepareTests.dll", "args": [ "--source", "${workspaceFolder}", "--destination", "${workspaceFolder}/artifacts/testPayload" ], "cwd": "${workspaceFolder}/artifacts/bin/PrepareTests", "stopAtEntry": false, "console": "internalConsole" }, { "name": ".NET Core Launch (console)", "type": "coreclr", "request": "launch", "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. "program": "${workspaceFolder}/src/Compilers/CSharp/csc/bin/Debug/netcoreapp2.1/csc.dll", "args": [], "cwd": "${workspaceFolder}/src/Compilers/CSharp/csc", // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console "console": "internalConsole", "stopAtEntry": false }, { "name": ".NET Core Attach", "type": "coreclr", "request": "attach", "processId": "${command:pickProcess}" } ] }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/common/post-build/trigger-subscriptions.ps1
param( [Parameter(Mandatory=$true)][string] $SourceRepo, [Parameter(Mandatory=$true)][int] $ChannelId, [Parameter(Mandatory=$true)][string] $MaestroApiAccessToken, [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro-prod.westus2.cloudapp.azure.com', [Parameter(Mandatory=$false)][string] $MaestroApiVersion = '2019-01-16' ) try { . $PSScriptRoot\post-build-utils.ps1 # Get all the $SourceRepo subscriptions $normalizedSourceRepo = $SourceRepo.Replace('dnceng@', '') $subscriptions = Get-MaestroSubscriptions -SourceRepository $normalizedSourceRepo -ChannelId $ChannelId if (!$subscriptions) { Write-PipelineTelemetryError -Category 'TriggerSubscriptions' -Message "No subscriptions found for source repo '$normalizedSourceRepo' in channel '$ChannelId'" ExitWithExitCode 0 } $subscriptionsToTrigger = New-Object System.Collections.Generic.List[string] $failedTriggeredSubscription = $false # Get all enabled subscriptions that need dependency flow on 'everyBuild' foreach ($subscription in $subscriptions) { if ($subscription.enabled -and $subscription.policy.updateFrequency -like 'everyBuild' -and $subscription.channel.id -eq $ChannelId) { Write-Host "Should trigger this subscription: ${$subscription.id}" [void]$subscriptionsToTrigger.Add($subscription.id) } } foreach ($subscriptionToTrigger in $subscriptionsToTrigger) { try { Write-Host "Triggering subscription '$subscriptionToTrigger'." Trigger-Subscription -SubscriptionId $subscriptionToTrigger Write-Host 'done.' } catch { Write-Host "There was an error while triggering subscription '$subscriptionToTrigger'" Write-Host $_ Write-Host $_.ScriptStackTrace $failedTriggeredSubscription = $true } } if ($subscriptionsToTrigger.Count -eq 0) { Write-Host "No subscription matched source repo '$normalizedSourceRepo' and channel ID '$ChannelId'." } elseif ($failedTriggeredSubscription) { Write-PipelineTelemetryError -Category 'TriggerSubscriptions' -Message 'At least one subscription failed to be triggered...' ExitWithExitCode 1 } else { Write-Host 'All subscriptions were triggered successfully!' } } catch { Write-Host $_.ScriptStackTrace Write-PipelineTelemetryError -Category 'TriggerSubscriptions' -Message $_ ExitWithExitCode 1 }
param( [Parameter(Mandatory=$true)][string] $SourceRepo, [Parameter(Mandatory=$true)][int] $ChannelId, [Parameter(Mandatory=$true)][string] $MaestroApiAccessToken, [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro-prod.westus2.cloudapp.azure.com', [Parameter(Mandatory=$false)][string] $MaestroApiVersion = '2019-01-16' ) try { . $PSScriptRoot\post-build-utils.ps1 # Get all the $SourceRepo subscriptions $normalizedSourceRepo = $SourceRepo.Replace('dnceng@', '') $subscriptions = Get-MaestroSubscriptions -SourceRepository $normalizedSourceRepo -ChannelId $ChannelId if (!$subscriptions) { Write-PipelineTelemetryError -Category 'TriggerSubscriptions' -Message "No subscriptions found for source repo '$normalizedSourceRepo' in channel '$ChannelId'" ExitWithExitCode 0 } $subscriptionsToTrigger = New-Object System.Collections.Generic.List[string] $failedTriggeredSubscription = $false # Get all enabled subscriptions that need dependency flow on 'everyBuild' foreach ($subscription in $subscriptions) { if ($subscription.enabled -and $subscription.policy.updateFrequency -like 'everyBuild' -and $subscription.channel.id -eq $ChannelId) { Write-Host "Should trigger this subscription: ${$subscription.id}" [void]$subscriptionsToTrigger.Add($subscription.id) } } foreach ($subscriptionToTrigger in $subscriptionsToTrigger) { try { Write-Host "Triggering subscription '$subscriptionToTrigger'." Trigger-Subscription -SubscriptionId $subscriptionToTrigger Write-Host 'done.' } catch { Write-Host "There was an error while triggering subscription '$subscriptionToTrigger'" Write-Host $_ Write-Host $_.ScriptStackTrace $failedTriggeredSubscription = $true } } if ($subscriptionsToTrigger.Count -eq 0) { Write-Host "No subscription matched source repo '$normalizedSourceRepo' and channel ID '$ChannelId'." } elseif ($failedTriggeredSubscription) { Write-PipelineTelemetryError -Category 'TriggerSubscriptions' -Message 'At least one subscription failed to be triggered...' ExitWithExitCode 1 } else { Write-Host 'All subscriptions were triggered successfully!' } } catch { Write-Host $_.ScriptStackTrace Write-PipelineTelemetryError -Category 'TriggerSubscriptions' -Message $_ ExitWithExitCode 1 }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Compilers/VisualBasic/Portable/Symbols/AnonymousTypes/PublicSymbols/AnonymousType_PropertyPublicAccessors.vb
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports System.Collections.Immutable Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols Partial Friend NotInheritable Class AnonymousTypeManager Private MustInherit Class AnonymousTypePropertyAccessorPublicSymbol Inherits SynthesizedPropertyAccessorBase(Of PropertySymbol) Private ReadOnly _returnType As TypeSymbol Public Sub New([property] As PropertySymbol, returnType As TypeSymbol) MyBase.New([property].ContainingType, [property]) _returnType = returnType End Sub Friend NotOverridable Overrides ReadOnly Property BackingFieldSymbol As FieldSymbol Get Throw ExceptionUtilities.Unreachable End Get End Property Public Overrides ReadOnly Property ReturnType As TypeSymbol Get Return _returnType End Get End Property Friend NotOverridable Overrides ReadOnly Property GenerateDebugInfoImpl As Boolean Get Return False End Get End Property Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer Throw ExceptionUtilities.Unreachable End Function End Class Private NotInheritable Class AnonymousTypePropertyGetAccessorPublicSymbol Inherits AnonymousTypePropertyAccessorPublicSymbol Public Sub New([property] As PropertySymbol) MyBase.New([property], [property].Type) End Sub Public Overrides ReadOnly Property IsSub As Boolean Get Return False End Get End Property Public Overrides ReadOnly Property MethodKind As MethodKind Get Return MethodKind.PropertyGet End Get End Property End Class Private NotInheritable Class AnonymousTypePropertySetAccessorPublicSymbol Inherits AnonymousTypePropertyAccessorPublicSymbol Private _parameters As ImmutableArray(Of ParameterSymbol) Public Sub New([property] As PropertySymbol, voidTypeSymbol As TypeSymbol) MyBase.New([property], voidTypeSymbol) _parameters = ImmutableArray.Create(Of ParameterSymbol)( New SynthesizedParameterSymbol(Me, m_propertyOrEvent.Type, 0, False, StringConstants.ValueParameterName)) End Sub Public Overrides ReadOnly Property IsSub As Boolean Get Return True End Get End Property Public Overrides ReadOnly Property Parameters As ImmutableArray(Of ParameterSymbol) Get Return _parameters End Get End Property Public Overrides ReadOnly Property MethodKind As MethodKind Get Return MethodKind.PropertySet End Get End Property End Class End Class End Namespace
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports System.Collections.Immutable Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols Partial Friend NotInheritable Class AnonymousTypeManager Private MustInherit Class AnonymousTypePropertyAccessorPublicSymbol Inherits SynthesizedPropertyAccessorBase(Of PropertySymbol) Private ReadOnly _returnType As TypeSymbol Public Sub New([property] As PropertySymbol, returnType As TypeSymbol) MyBase.New([property].ContainingType, [property]) _returnType = returnType End Sub Friend NotOverridable Overrides ReadOnly Property BackingFieldSymbol As FieldSymbol Get Throw ExceptionUtilities.Unreachable End Get End Property Public Overrides ReadOnly Property ReturnType As TypeSymbol Get Return _returnType End Get End Property Friend NotOverridable Overrides ReadOnly Property GenerateDebugInfoImpl As Boolean Get Return False End Get End Property Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer Throw ExceptionUtilities.Unreachable End Function End Class Private NotInheritable Class AnonymousTypePropertyGetAccessorPublicSymbol Inherits AnonymousTypePropertyAccessorPublicSymbol Public Sub New([property] As PropertySymbol) MyBase.New([property], [property].Type) End Sub Public Overrides ReadOnly Property IsSub As Boolean Get Return False End Get End Property Public Overrides ReadOnly Property MethodKind As MethodKind Get Return MethodKind.PropertyGet End Get End Property End Class Private NotInheritable Class AnonymousTypePropertySetAccessorPublicSymbol Inherits AnonymousTypePropertyAccessorPublicSymbol Private _parameters As ImmutableArray(Of ParameterSymbol) Public Sub New([property] As PropertySymbol, voidTypeSymbol As TypeSymbol) MyBase.New([property], voidTypeSymbol) _parameters = ImmutableArray.Create(Of ParameterSymbol)( New SynthesizedParameterSymbol(Me, m_propertyOrEvent.Type, 0, False, StringConstants.ValueParameterName)) End Sub Public Overrides ReadOnly Property IsSub As Boolean Get Return True End Get End Property Public Overrides ReadOnly Property Parameters As ImmutableArray(Of ParameterSymbol) Get Return _parameters End Get End Property Public Overrides ReadOnly Property MethodKind As MethodKind Get Return MethodKind.PropertySet End Get End Property End Class End Class End Namespace
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Workspaces/Core/Portable/EmbeddedLanguages/LanguageServices/EmbeddedLanguageInfo.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using Microsoft.CodeAnalysis.EmbeddedLanguages.VirtualChars; using Microsoft.CodeAnalysis.LanguageServices; namespace Microsoft.CodeAnalysis.EmbeddedLanguages.LanguageServices { internal struct EmbeddedLanguageInfo { public readonly int CharLiteralTokenKind; public readonly int StringLiteralTokenKind; public readonly int InterpolatedTextTokenKind; public readonly ISyntaxFacts SyntaxFacts; public readonly ISemanticFactsService SemanticFacts; public readonly IVirtualCharService VirtualCharService; public EmbeddedLanguageInfo( int charLiteralTokenKind, int stringLiteralTokenKind, int interpolatedTextTokenKind, ISyntaxFacts syntaxFacts, ISemanticFactsService semanticFacts, IVirtualCharService virtualCharService) { CharLiteralTokenKind = charLiteralTokenKind; StringLiteralTokenKind = stringLiteralTokenKind; InterpolatedTextTokenKind = interpolatedTextTokenKind; SyntaxFacts = syntaxFacts; SemanticFacts = semanticFacts; VirtualCharService = virtualCharService; } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using Microsoft.CodeAnalysis.EmbeddedLanguages.VirtualChars; using Microsoft.CodeAnalysis.LanguageServices; namespace Microsoft.CodeAnalysis.EmbeddedLanguages.LanguageServices { internal struct EmbeddedLanguageInfo { public readonly int CharLiteralTokenKind; public readonly int StringLiteralTokenKind; public readonly int InterpolatedTextTokenKind; public readonly ISyntaxFacts SyntaxFacts; public readonly ISemanticFactsService SemanticFacts; public readonly IVirtualCharService VirtualCharService; public EmbeddedLanguageInfo( int charLiteralTokenKind, int stringLiteralTokenKind, int interpolatedTextTokenKind, ISyntaxFacts syntaxFacts, ISemanticFactsService semanticFacts, IVirtualCharService virtualCharService) { CharLiteralTokenKind = charLiteralTokenKind; StringLiteralTokenKind = stringLiteralTokenKind; InterpolatedTextTokenKind = interpolatedTextTokenKind; SyntaxFacts = syntaxFacts; SemanticFacts = semanticFacts; VirtualCharService = virtualCharService; } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ICompilationExtensions.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.Collections.Immutable; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Threading.Tasks; using Microsoft.CodeAnalysis.PooledObjects; namespace Microsoft.CodeAnalysis.Shared.Extensions { internal static class ICompilationExtensions { public static ImmutableArray<Compilation> GetReferencedCompilations(this Compilation compilation) { var builder = ArrayBuilder<Compilation>.GetInstance(); foreach (var reference in compilation.References.OfType<CompilationReference>()) { builder.Add(reference.Compilation); } var previous = compilation.ScriptCompilationInfo?.PreviousScriptCompilation; while (previous != null) { builder.Add(previous); previous = previous.ScriptCompilationInfo?.PreviousScriptCompilation; } return builder.ToImmutableAndFree(); } public static ImmutableArray<IAssemblySymbol> GetReferencedAssemblySymbols(this Compilation compilation, bool excludePreviousSubmissions = false) { // The first module of every assembly is its source module and the source // module always has the list of all referenced assemblies. var referencedAssemblySymbols = compilation.Assembly.Modules.First().ReferencedAssemblySymbols; if (excludePreviousSubmissions) { return referencedAssemblySymbols; } var builder = ArrayBuilder<IAssemblySymbol>.GetInstance(); builder.AddRange(referencedAssemblySymbols); var previous = compilation.ScriptCompilationInfo?.PreviousScriptCompilation; while (previous != null) { builder.Add(previous.Assembly); previous = previous.ScriptCompilationInfo?.PreviousScriptCompilation; } return builder.ToImmutableAndFree(); } public static INamedTypeSymbol? AttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(Attribute).FullName!); public static INamedTypeSymbol? ExceptionType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(Exception).FullName!); public static INamedTypeSymbol? DebuggerDisplayAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(System.Diagnostics.DebuggerDisplayAttribute).FullName!); public static INamedTypeSymbol? StructLayoutAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(System.Runtime.InteropServices.StructLayoutAttribute).FullName!); public static INamedTypeSymbol? DesignerCategoryAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName("System.ComponentModel.DesignerCategoryAttribute"); public static INamedTypeSymbol? DesignerGeneratedAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName("Microsoft.VisualBasic.CompilerServices.DesignerGeneratedAttribute"); public static INamedTypeSymbol? HideModuleNameAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName("Microsoft.VisualBasic.HideModuleNameAttribute"); public static INamedTypeSymbol? ThreadStaticAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(ThreadStaticAttribute).FullName!); public static INamedTypeSymbol? EventArgsType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(EventArgs).FullName!); public static INamedTypeSymbol? NotImplementedExceptionType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(NotImplementedException).FullName!); public static INamedTypeSymbol? EqualityComparerOfTType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(EqualityComparer<>).FullName!); public static INamedTypeSymbol? ActionType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(Action).FullName!); public static INamedTypeSymbol? ExpressionOfTType(this Compilation compilation) => compilation.GetTypeByMetadataName("System.Linq.Expressions.Expression`1"); public static INamedTypeSymbol? EditorBrowsableAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(EditorBrowsableAttribute).FullName!); public static INamedTypeSymbol? EditorBrowsableStateType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(EditorBrowsableState).FullName!); public static INamedTypeSymbol? TaskType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(Task).FullName!); public static INamedTypeSymbol? TaskOfTType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(Task<>).FullName!); public static INamedTypeSymbol? ValueTaskType(this Compilation compilation) => compilation.GetTypeByMetadataName("System.Threading.Tasks.ValueTask"); public static INamedTypeSymbol? ValueTaskOfTType(this Compilation compilation) => compilation.GetTypeByMetadataName("System.Threading.Tasks.ValueTask`1"); public static INamedTypeSymbol? IEnumerableOfTType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(IEnumerable<>).FullName!); public static INamedTypeSymbol? IEnumeratorOfTType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(IEnumerator<>).FullName!); public static INamedTypeSymbol? IAsyncEnumerableOfTType(this Compilation compilation) => compilation.GetTypeByMetadataName("System.Collections.Generic.IAsyncEnumerable`1"); public static INamedTypeSymbol? IAsyncEnumeratorOfTType(this Compilation compilation) => compilation.GetTypeByMetadataName("System.Collections.Generic.IAsyncEnumerator`1"); public static INamedTypeSymbol? SerializableAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(SerializableAttribute).FullName!); public static INamedTypeSymbol? CoClassType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(CoClassAttribute).FullName!); public static INamedTypeSymbol? ComAliasNameAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(ComAliasNameAttribute).FullName!); public static INamedTypeSymbol? SuppressMessageAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(SuppressMessageAttribute).FullName!); public static INamedTypeSymbol? TupleElementNamesAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(TupleElementNamesAttribute).FullName!); public static INamedTypeSymbol? NativeIntegerAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName("System.Runtime.CompilerServices.NativeIntegerAttribute"); public static INamedTypeSymbol? DynamicAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(DynamicAttribute).FullName!); public static INamedTypeSymbol? LazyOfTType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(Lazy<>).FullName!); public static INamedTypeSymbol? ISerializableType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(ISerializable).FullName!); public static INamedTypeSymbol? SerializationInfoType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(SerializationInfo).FullName!); public static INamedTypeSymbol? StreamingContextType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(StreamingContext).FullName!); public static INamedTypeSymbol? OnDeserializingAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(OnDeserializingAttribute).FullName!); public static INamedTypeSymbol? OnDeserializedAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(OnDeserializedAttribute).FullName!); public static INamedTypeSymbol? OnSerializingAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(OnSerializingAttribute).FullName!); public static INamedTypeSymbol? OnSerializedAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(OnSerializedAttribute).FullName!); public static INamedTypeSymbol? ComRegisterFunctionAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(ComRegisterFunctionAttribute).FullName!); public static INamedTypeSymbol? ComUnregisterFunctionAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(ComUnregisterFunctionAttribute).FullName!); public static INamedTypeSymbol? ConditionalAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(ConditionalAttribute).FullName!); public static INamedTypeSymbol? ObsoleteAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(ObsoleteAttribute).FullName!); public static INamedTypeSymbol? SystemCompositionImportingConstructorAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName("System.Composition.ImportingConstructorAttribute"); public static INamedTypeSymbol? SystemComponentModelCompositionImportingConstructorAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName("System.ComponentModel.Composition.ImportingConstructorAttribute"); public static INamedTypeSymbol? SystemIDisposableType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(IDisposable).FullName!); public static INamedTypeSymbol? NotNullAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(NotNullAttribute).FullName!); public static INamedTypeSymbol? MaybeNullAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(MaybeNullAttribute).FullName!); public static INamedTypeSymbol? MaybeNullWhenAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(MaybeNullWhenAttribute).FullName!); public static INamedTypeSymbol? AllowNullAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(AllowNullAttribute).FullName!); public static INamedTypeSymbol? DisallowNullAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(DisallowNullAttribute).FullName!); } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.Collections.Immutable; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Threading.Tasks; using Microsoft.CodeAnalysis.PooledObjects; namespace Microsoft.CodeAnalysis.Shared.Extensions { internal static class ICompilationExtensions { public static ImmutableArray<Compilation> GetReferencedCompilations(this Compilation compilation) { var builder = ArrayBuilder<Compilation>.GetInstance(); foreach (var reference in compilation.References.OfType<CompilationReference>()) { builder.Add(reference.Compilation); } var previous = compilation.ScriptCompilationInfo?.PreviousScriptCompilation; while (previous != null) { builder.Add(previous); previous = previous.ScriptCompilationInfo?.PreviousScriptCompilation; } return builder.ToImmutableAndFree(); } public static ImmutableArray<IAssemblySymbol> GetReferencedAssemblySymbols(this Compilation compilation, bool excludePreviousSubmissions = false) { // The first module of every assembly is its source module and the source // module always has the list of all referenced assemblies. var referencedAssemblySymbols = compilation.Assembly.Modules.First().ReferencedAssemblySymbols; if (excludePreviousSubmissions) { return referencedAssemblySymbols; } var builder = ArrayBuilder<IAssemblySymbol>.GetInstance(); builder.AddRange(referencedAssemblySymbols); var previous = compilation.ScriptCompilationInfo?.PreviousScriptCompilation; while (previous != null) { builder.Add(previous.Assembly); previous = previous.ScriptCompilationInfo?.PreviousScriptCompilation; } return builder.ToImmutableAndFree(); } public static INamedTypeSymbol? AttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(Attribute).FullName!); public static INamedTypeSymbol? ExceptionType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(Exception).FullName!); public static INamedTypeSymbol? DebuggerDisplayAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(System.Diagnostics.DebuggerDisplayAttribute).FullName!); public static INamedTypeSymbol? StructLayoutAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(System.Runtime.InteropServices.StructLayoutAttribute).FullName!); public static INamedTypeSymbol? DesignerCategoryAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName("System.ComponentModel.DesignerCategoryAttribute"); public static INamedTypeSymbol? DesignerGeneratedAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName("Microsoft.VisualBasic.CompilerServices.DesignerGeneratedAttribute"); public static INamedTypeSymbol? HideModuleNameAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName("Microsoft.VisualBasic.HideModuleNameAttribute"); public static INamedTypeSymbol? ThreadStaticAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(ThreadStaticAttribute).FullName!); public static INamedTypeSymbol? EventArgsType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(EventArgs).FullName!); public static INamedTypeSymbol? NotImplementedExceptionType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(NotImplementedException).FullName!); public static INamedTypeSymbol? EqualityComparerOfTType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(EqualityComparer<>).FullName!); public static INamedTypeSymbol? ActionType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(Action).FullName!); public static INamedTypeSymbol? ExpressionOfTType(this Compilation compilation) => compilation.GetTypeByMetadataName("System.Linq.Expressions.Expression`1"); public static INamedTypeSymbol? EditorBrowsableAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(EditorBrowsableAttribute).FullName!); public static INamedTypeSymbol? EditorBrowsableStateType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(EditorBrowsableState).FullName!); public static INamedTypeSymbol? TaskType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(Task).FullName!); public static INamedTypeSymbol? TaskOfTType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(Task<>).FullName!); public static INamedTypeSymbol? ValueTaskType(this Compilation compilation) => compilation.GetTypeByMetadataName("System.Threading.Tasks.ValueTask"); public static INamedTypeSymbol? ValueTaskOfTType(this Compilation compilation) => compilation.GetTypeByMetadataName("System.Threading.Tasks.ValueTask`1"); public static INamedTypeSymbol? IEnumerableOfTType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(IEnumerable<>).FullName!); public static INamedTypeSymbol? IEnumeratorOfTType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(IEnumerator<>).FullName!); public static INamedTypeSymbol? IAsyncEnumerableOfTType(this Compilation compilation) => compilation.GetTypeByMetadataName("System.Collections.Generic.IAsyncEnumerable`1"); public static INamedTypeSymbol? IAsyncEnumeratorOfTType(this Compilation compilation) => compilation.GetTypeByMetadataName("System.Collections.Generic.IAsyncEnumerator`1"); public static INamedTypeSymbol? SerializableAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(SerializableAttribute).FullName!); public static INamedTypeSymbol? CoClassType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(CoClassAttribute).FullName!); public static INamedTypeSymbol? ComAliasNameAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(ComAliasNameAttribute).FullName!); public static INamedTypeSymbol? SuppressMessageAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(SuppressMessageAttribute).FullName!); public static INamedTypeSymbol? TupleElementNamesAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(TupleElementNamesAttribute).FullName!); public static INamedTypeSymbol? NativeIntegerAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName("System.Runtime.CompilerServices.NativeIntegerAttribute"); public static INamedTypeSymbol? DynamicAttributeType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(DynamicAttribute).FullName!); public static INamedTypeSymbol? LazyOfTType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(Lazy<>).FullName!); public static INamedTypeSymbol? ISerializableType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(ISerializable).FullName!); public static INamedTypeSymbol? SerializationInfoType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(SerializationInfo).FullName!); public static INamedTypeSymbol? StreamingContextType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(StreamingContext).FullName!); public static INamedTypeSymbol? OnDeserializingAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(OnDeserializingAttribute).FullName!); public static INamedTypeSymbol? OnDeserializedAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(OnDeserializedAttribute).FullName!); public static INamedTypeSymbol? OnSerializingAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(OnSerializingAttribute).FullName!); public static INamedTypeSymbol? OnSerializedAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(OnSerializedAttribute).FullName!); public static INamedTypeSymbol? ComRegisterFunctionAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(ComRegisterFunctionAttribute).FullName!); public static INamedTypeSymbol? ComUnregisterFunctionAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(ComUnregisterFunctionAttribute).FullName!); public static INamedTypeSymbol? ConditionalAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(ConditionalAttribute).FullName!); public static INamedTypeSymbol? ObsoleteAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(ObsoleteAttribute).FullName!); public static INamedTypeSymbol? SystemCompositionImportingConstructorAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName("System.Composition.ImportingConstructorAttribute"); public static INamedTypeSymbol? SystemComponentModelCompositionImportingConstructorAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName("System.ComponentModel.Composition.ImportingConstructorAttribute"); public static INamedTypeSymbol? SystemIDisposableType(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(IDisposable).FullName!); public static INamedTypeSymbol? NotNullAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(NotNullAttribute).FullName!); public static INamedTypeSymbol? MaybeNullAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(MaybeNullAttribute).FullName!); public static INamedTypeSymbol? MaybeNullWhenAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(MaybeNullWhenAttribute).FullName!); public static INamedTypeSymbol? AllowNullAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(AllowNullAttribute).FullName!); public static INamedTypeSymbol? DisallowNullAttribute(this Compilation compilation) => compilation.GetTypeByMetadataName(typeof(DisallowNullAttribute).FullName!); } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./eng/common/native/CommonLibrary.psm1
<# .SYNOPSIS Helper module to install an archive to a directory .DESCRIPTION Helper module to download and extract an archive to a specified directory .PARAMETER Uri Uri of artifact to download .PARAMETER InstallDirectory Directory to extract artifact contents to .PARAMETER Force Force download / extraction if file or contents already exist. Default = False .PARAMETER DownloadRetries Total number of retry attempts. Default = 5 .PARAMETER RetryWaitTimeInSeconds Wait time between retry attempts in seconds. Default = 30 .NOTES Returns False if download or extraction fail, True otherwise #> function DownloadAndExtract { [CmdletBinding(PositionalBinding=$false)] Param ( [Parameter(Mandatory=$True)] [string] $Uri, [Parameter(Mandatory=$True)] [string] $InstallDirectory, [switch] $Force = $False, [int] $DownloadRetries = 5, [int] $RetryWaitTimeInSeconds = 30 ) # Define verbose switch if undefined $Verbose = $VerbosePreference -Eq "Continue" $TempToolPath = CommonLibrary\Get-TempPathFilename -Path $Uri # Download native tool $DownloadStatus = CommonLibrary\Get-File -Uri $Uri ` -Path $TempToolPath ` -DownloadRetries $DownloadRetries ` -RetryWaitTimeInSeconds $RetryWaitTimeInSeconds ` -Force:$Force ` -Verbose:$Verbose if ($DownloadStatus -Eq $False) { Write-Error "Download failed from $Uri" return $False } # Extract native tool $UnzipStatus = CommonLibrary\Expand-Zip -ZipPath $TempToolPath ` -OutputDirectory $InstallDirectory ` -Force:$Force ` -Verbose:$Verbose if ($UnzipStatus -Eq $False) { # Retry Download one more time with Force=true $DownloadRetryStatus = CommonLibrary\Get-File -Uri $Uri ` -Path $TempToolPath ` -DownloadRetries 1 ` -RetryWaitTimeInSeconds $RetryWaitTimeInSeconds ` -Force:$True ` -Verbose:$Verbose if ($DownloadRetryStatus -Eq $False) { Write-Error "Last attempt of download failed as well" return $False } # Retry unzip again one more time with Force=true $UnzipRetryStatus = CommonLibrary\Expand-Zip -ZipPath $TempToolPath ` -OutputDirectory $InstallDirectory ` -Force:$True ` -Verbose:$Verbose if ($UnzipRetryStatus -Eq $False) { Write-Error "Last attempt of unzip failed as well" # Clean up partial zips and extracts if (Test-Path $TempToolPath) { Remove-Item $TempToolPath -Force } if (Test-Path $InstallDirectory) { Remove-Item $InstallDirectory -Force -Recurse } return $False } } return $True } <# .SYNOPSIS Download a file, retry on failure .DESCRIPTION Download specified file and retry if attempt fails .PARAMETER Uri Uri of file to download. If Uri is a local path, the file will be copied instead of downloaded .PARAMETER Path Path to download or copy uri file to .PARAMETER Force Overwrite existing file if present. Default = False .PARAMETER DownloadRetries Total number of retry attempts. Default = 5 .PARAMETER RetryWaitTimeInSeconds Wait time between retry attempts in seconds Default = 30 #> function Get-File { [CmdletBinding(PositionalBinding=$false)] Param ( [Parameter(Mandatory=$True)] [string] $Uri, [Parameter(Mandatory=$True)] [string] $Path, [int] $DownloadRetries = 5, [int] $RetryWaitTimeInSeconds = 30, [switch] $Force = $False ) $Attempt = 0 if ($Force) { if (Test-Path $Path) { Remove-Item $Path -Force } } if (Test-Path $Path) { Write-Host "File '$Path' already exists, skipping download" return $True } $DownloadDirectory = Split-Path -ErrorAction Ignore -Path "$Path" -Parent if (-Not (Test-Path $DownloadDirectory)) { New-Item -path $DownloadDirectory -force -itemType "Directory" | Out-Null } $TempPath = "$Path.tmp" if (Test-Path -IsValid -Path $Uri) { Write-Verbose "'$Uri' is a file path, copying temporarily to '$TempPath'" Copy-Item -Path $Uri -Destination $TempPath Write-Verbose "Moving temporary file to '$Path'" Move-Item -Path $TempPath -Destination $Path return $? } else { Write-Verbose "Downloading $Uri" # Don't display the console progress UI - it's a huge perf hit $ProgressPreference = 'SilentlyContinue' while($Attempt -Lt $DownloadRetries) { try { Invoke-WebRequest -UseBasicParsing -Uri $Uri -OutFile $TempPath Write-Verbose "Downloaded to temporary location '$TempPath'" Move-Item -Path $TempPath -Destination $Path Write-Verbose "Moved temporary file to '$Path'" return $True } catch { $Attempt++ if ($Attempt -Lt $DownloadRetries) { $AttemptsLeft = $DownloadRetries - $Attempt Write-Warning "Download failed, $AttemptsLeft attempts remaining, will retry in $RetryWaitTimeInSeconds seconds" Start-Sleep -Seconds $RetryWaitTimeInSeconds } else { Write-Error $_ Write-Error $_.Exception } } } } return $False } <# .SYNOPSIS Generate a shim for a native tool .DESCRIPTION Creates a wrapper script (shim) that passes arguments forward to native tool assembly .PARAMETER ShimName The name of the shim .PARAMETER ShimDirectory The directory where shims are stored .PARAMETER ToolFilePath Path to file that shim forwards to .PARAMETER Force Replace shim if already present. Default = False .NOTES Returns $True if generating shim succeeds, $False otherwise #> function New-ScriptShim { [CmdletBinding(PositionalBinding=$false)] Param ( [Parameter(Mandatory=$True)] [string] $ShimName, [Parameter(Mandatory=$True)] [string] $ShimDirectory, [Parameter(Mandatory=$True)] [string] $ToolFilePath, [Parameter(Mandatory=$True)] [string] $BaseUri, [switch] $Force ) try { Write-Verbose "Generating '$ShimName' shim" if (-Not (Test-Path $ToolFilePath)){ Write-Error "Specified tool file path '$ToolFilePath' does not exist" return $False } # WinShimmer is a small .NET Framework program that creates .exe shims to bootstrapped programs # Many of the checks for installed programs expect a .exe extension for Windows tools, rather # than a .bat or .cmd file. # Source: https://github.com/dotnet/arcade/tree/master/src/WinShimmer if (-Not (Test-Path "$ShimDirectory\WinShimmer\winshimmer.exe")) { $InstallStatus = DownloadAndExtract -Uri "$BaseUri/windows/winshimmer/WinShimmer.zip" ` -InstallDirectory $ShimDirectory\WinShimmer ` -Force:$Force ` -DownloadRetries 2 ` -RetryWaitTimeInSeconds 5 ` -Verbose:$Verbose } if ((Test-Path (Join-Path $ShimDirectory "$ShimName.exe"))) { Write-Host "$ShimName.exe already exists; replacing..." Remove-Item (Join-Path $ShimDirectory "$ShimName.exe") } & "$ShimDirectory\WinShimmer\winshimmer.exe" $ShimName $ToolFilePath $ShimDirectory return $True } catch { Write-Host $_ Write-Host $_.Exception return $False } } <# .SYNOPSIS Returns the machine architecture of the host machine .NOTES Returns 'x64' on 64 bit machines Returns 'x86' on 32 bit machines #> function Get-MachineArchitecture { $ProcessorArchitecture = $Env:PROCESSOR_ARCHITECTURE $ProcessorArchitectureW6432 = $Env:PROCESSOR_ARCHITEW6432 if($ProcessorArchitecture -Eq "X86") { if(($ProcessorArchitectureW6432 -Eq "") -Or ($ProcessorArchitectureW6432 -Eq "X86")) { return "x86" } $ProcessorArchitecture = $ProcessorArchitectureW6432 } if (($ProcessorArchitecture -Eq "AMD64") -Or ($ProcessorArchitecture -Eq "IA64") -Or ($ProcessorArchitecture -Eq "ARM64")) { return "x64" } return "x86" } <# .SYNOPSIS Get the name of a temporary folder under the native install directory #> function Get-TempDirectory { return Join-Path (Get-NativeInstallDirectory) "temp/" } function Get-TempPathFilename { [CmdletBinding(PositionalBinding=$false)] Param ( [Parameter(Mandatory=$True)] [string] $Path ) $TempDir = CommonLibrary\Get-TempDirectory $TempFilename = Split-Path $Path -leaf $TempPath = Join-Path $TempDir $TempFilename return $TempPath } <# .SYNOPSIS Returns the base directory to use for native tool installation .NOTES Returns the value of the NETCOREENG_INSTALL_DIRECTORY if that environment variable is set, or otherwise returns an install directory under the %USERPROFILE% #> function Get-NativeInstallDirectory { $InstallDir = $Env:NETCOREENG_INSTALL_DIRECTORY if (!$InstallDir) { $InstallDir = Join-Path $Env:USERPROFILE ".netcoreeng/native/" } return $InstallDir } <# .SYNOPSIS Unzip an archive .DESCRIPTION Powershell module to unzip an archive to a specified directory .PARAMETER ZipPath (Required) Path to archive to unzip .PARAMETER OutputDirectory (Required) Output directory for archive contents .PARAMETER Force Overwrite output directory contents if they already exist .NOTES - Returns True and does not perform an extraction if output directory already exists but Overwrite is not True. - Returns True if unzip operation is successful - Returns False if Overwrite is True and it is unable to remove contents of OutputDirectory - Returns False if unable to extract zip archive #> function Expand-Zip { [CmdletBinding(PositionalBinding=$false)] Param ( [Parameter(Mandatory=$True)] [string] $ZipPath, [Parameter(Mandatory=$True)] [string] $OutputDirectory, [switch] $Force ) Write-Verbose "Extracting '$ZipPath' to '$OutputDirectory'" try { if ((Test-Path $OutputDirectory) -And (-Not $Force)) { Write-Host "Directory '$OutputDirectory' already exists, skipping extract" return $True } if (Test-Path $OutputDirectory) { Write-Verbose "'Force' is 'True', but '$OutputDirectory' exists, removing directory" Remove-Item $OutputDirectory -Force -Recurse if ($? -Eq $False) { Write-Error "Unable to remove '$OutputDirectory'" return $False } } $TempOutputDirectory = Join-Path "$(Split-Path -Parent $OutputDirectory)" "$(Split-Path -Leaf $OutputDirectory).tmp" if (Test-Path $TempOutputDirectory) { Remove-Item $TempOutputDirectory -Force -Recurse } New-Item -Path $TempOutputDirectory -Force -ItemType "Directory" | Out-Null Add-Type -assembly "system.io.compression.filesystem" [io.compression.zipfile]::ExtractToDirectory("$ZipPath", "$TempOutputDirectory") if ($? -Eq $False) { Write-Error "Unable to extract '$ZipPath'" return $False } Move-Item -Path $TempOutputDirectory -Destination $OutputDirectory } catch { Write-Host $_ Write-Host $_.Exception return $False } return $True } export-modulemember -function DownloadAndExtract export-modulemember -function Expand-Zip export-modulemember -function Get-File export-modulemember -function Get-MachineArchitecture export-modulemember -function Get-NativeInstallDirectory export-modulemember -function Get-TempDirectory export-modulemember -function Get-TempPathFilename export-modulemember -function New-ScriptShim
<# .SYNOPSIS Helper module to install an archive to a directory .DESCRIPTION Helper module to download and extract an archive to a specified directory .PARAMETER Uri Uri of artifact to download .PARAMETER InstallDirectory Directory to extract artifact contents to .PARAMETER Force Force download / extraction if file or contents already exist. Default = False .PARAMETER DownloadRetries Total number of retry attempts. Default = 5 .PARAMETER RetryWaitTimeInSeconds Wait time between retry attempts in seconds. Default = 30 .NOTES Returns False if download or extraction fail, True otherwise #> function DownloadAndExtract { [CmdletBinding(PositionalBinding=$false)] Param ( [Parameter(Mandatory=$True)] [string] $Uri, [Parameter(Mandatory=$True)] [string] $InstallDirectory, [switch] $Force = $False, [int] $DownloadRetries = 5, [int] $RetryWaitTimeInSeconds = 30 ) # Define verbose switch if undefined $Verbose = $VerbosePreference -Eq "Continue" $TempToolPath = CommonLibrary\Get-TempPathFilename -Path $Uri # Download native tool $DownloadStatus = CommonLibrary\Get-File -Uri $Uri ` -Path $TempToolPath ` -DownloadRetries $DownloadRetries ` -RetryWaitTimeInSeconds $RetryWaitTimeInSeconds ` -Force:$Force ` -Verbose:$Verbose if ($DownloadStatus -Eq $False) { Write-Error "Download failed from $Uri" return $False } # Extract native tool $UnzipStatus = CommonLibrary\Expand-Zip -ZipPath $TempToolPath ` -OutputDirectory $InstallDirectory ` -Force:$Force ` -Verbose:$Verbose if ($UnzipStatus -Eq $False) { # Retry Download one more time with Force=true $DownloadRetryStatus = CommonLibrary\Get-File -Uri $Uri ` -Path $TempToolPath ` -DownloadRetries 1 ` -RetryWaitTimeInSeconds $RetryWaitTimeInSeconds ` -Force:$True ` -Verbose:$Verbose if ($DownloadRetryStatus -Eq $False) { Write-Error "Last attempt of download failed as well" return $False } # Retry unzip again one more time with Force=true $UnzipRetryStatus = CommonLibrary\Expand-Zip -ZipPath $TempToolPath ` -OutputDirectory $InstallDirectory ` -Force:$True ` -Verbose:$Verbose if ($UnzipRetryStatus -Eq $False) { Write-Error "Last attempt of unzip failed as well" # Clean up partial zips and extracts if (Test-Path $TempToolPath) { Remove-Item $TempToolPath -Force } if (Test-Path $InstallDirectory) { Remove-Item $InstallDirectory -Force -Recurse } return $False } } return $True } <# .SYNOPSIS Download a file, retry on failure .DESCRIPTION Download specified file and retry if attempt fails .PARAMETER Uri Uri of file to download. If Uri is a local path, the file will be copied instead of downloaded .PARAMETER Path Path to download or copy uri file to .PARAMETER Force Overwrite existing file if present. Default = False .PARAMETER DownloadRetries Total number of retry attempts. Default = 5 .PARAMETER RetryWaitTimeInSeconds Wait time between retry attempts in seconds Default = 30 #> function Get-File { [CmdletBinding(PositionalBinding=$false)] Param ( [Parameter(Mandatory=$True)] [string] $Uri, [Parameter(Mandatory=$True)] [string] $Path, [int] $DownloadRetries = 5, [int] $RetryWaitTimeInSeconds = 30, [switch] $Force = $False ) $Attempt = 0 if ($Force) { if (Test-Path $Path) { Remove-Item $Path -Force } } if (Test-Path $Path) { Write-Host "File '$Path' already exists, skipping download" return $True } $DownloadDirectory = Split-Path -ErrorAction Ignore -Path "$Path" -Parent if (-Not (Test-Path $DownloadDirectory)) { New-Item -path $DownloadDirectory -force -itemType "Directory" | Out-Null } $TempPath = "$Path.tmp" if (Test-Path -IsValid -Path $Uri) { Write-Verbose "'$Uri' is a file path, copying temporarily to '$TempPath'" Copy-Item -Path $Uri -Destination $TempPath Write-Verbose "Moving temporary file to '$Path'" Move-Item -Path $TempPath -Destination $Path return $? } else { Write-Verbose "Downloading $Uri" # Don't display the console progress UI - it's a huge perf hit $ProgressPreference = 'SilentlyContinue' while($Attempt -Lt $DownloadRetries) { try { Invoke-WebRequest -UseBasicParsing -Uri $Uri -OutFile $TempPath Write-Verbose "Downloaded to temporary location '$TempPath'" Move-Item -Path $TempPath -Destination $Path Write-Verbose "Moved temporary file to '$Path'" return $True } catch { $Attempt++ if ($Attempt -Lt $DownloadRetries) { $AttemptsLeft = $DownloadRetries - $Attempt Write-Warning "Download failed, $AttemptsLeft attempts remaining, will retry in $RetryWaitTimeInSeconds seconds" Start-Sleep -Seconds $RetryWaitTimeInSeconds } else { Write-Error $_ Write-Error $_.Exception } } } } return $False } <# .SYNOPSIS Generate a shim for a native tool .DESCRIPTION Creates a wrapper script (shim) that passes arguments forward to native tool assembly .PARAMETER ShimName The name of the shim .PARAMETER ShimDirectory The directory where shims are stored .PARAMETER ToolFilePath Path to file that shim forwards to .PARAMETER Force Replace shim if already present. Default = False .NOTES Returns $True if generating shim succeeds, $False otherwise #> function New-ScriptShim { [CmdletBinding(PositionalBinding=$false)] Param ( [Parameter(Mandatory=$True)] [string] $ShimName, [Parameter(Mandatory=$True)] [string] $ShimDirectory, [Parameter(Mandatory=$True)] [string] $ToolFilePath, [Parameter(Mandatory=$True)] [string] $BaseUri, [switch] $Force ) try { Write-Verbose "Generating '$ShimName' shim" if (-Not (Test-Path $ToolFilePath)){ Write-Error "Specified tool file path '$ToolFilePath' does not exist" return $False } # WinShimmer is a small .NET Framework program that creates .exe shims to bootstrapped programs # Many of the checks for installed programs expect a .exe extension for Windows tools, rather # than a .bat or .cmd file. # Source: https://github.com/dotnet/arcade/tree/master/src/WinShimmer if (-Not (Test-Path "$ShimDirectory\WinShimmer\winshimmer.exe")) { $InstallStatus = DownloadAndExtract -Uri "$BaseUri/windows/winshimmer/WinShimmer.zip" ` -InstallDirectory $ShimDirectory\WinShimmer ` -Force:$Force ` -DownloadRetries 2 ` -RetryWaitTimeInSeconds 5 ` -Verbose:$Verbose } if ((Test-Path (Join-Path $ShimDirectory "$ShimName.exe"))) { Write-Host "$ShimName.exe already exists; replacing..." Remove-Item (Join-Path $ShimDirectory "$ShimName.exe") } & "$ShimDirectory\WinShimmer\winshimmer.exe" $ShimName $ToolFilePath $ShimDirectory return $True } catch { Write-Host $_ Write-Host $_.Exception return $False } } <# .SYNOPSIS Returns the machine architecture of the host machine .NOTES Returns 'x64' on 64 bit machines Returns 'x86' on 32 bit machines #> function Get-MachineArchitecture { $ProcessorArchitecture = $Env:PROCESSOR_ARCHITECTURE $ProcessorArchitectureW6432 = $Env:PROCESSOR_ARCHITEW6432 if($ProcessorArchitecture -Eq "X86") { if(($ProcessorArchitectureW6432 -Eq "") -Or ($ProcessorArchitectureW6432 -Eq "X86")) { return "x86" } $ProcessorArchitecture = $ProcessorArchitectureW6432 } if (($ProcessorArchitecture -Eq "AMD64") -Or ($ProcessorArchitecture -Eq "IA64") -Or ($ProcessorArchitecture -Eq "ARM64")) { return "x64" } return "x86" } <# .SYNOPSIS Get the name of a temporary folder under the native install directory #> function Get-TempDirectory { return Join-Path (Get-NativeInstallDirectory) "temp/" } function Get-TempPathFilename { [CmdletBinding(PositionalBinding=$false)] Param ( [Parameter(Mandatory=$True)] [string] $Path ) $TempDir = CommonLibrary\Get-TempDirectory $TempFilename = Split-Path $Path -leaf $TempPath = Join-Path $TempDir $TempFilename return $TempPath } <# .SYNOPSIS Returns the base directory to use for native tool installation .NOTES Returns the value of the NETCOREENG_INSTALL_DIRECTORY if that environment variable is set, or otherwise returns an install directory under the %USERPROFILE% #> function Get-NativeInstallDirectory { $InstallDir = $Env:NETCOREENG_INSTALL_DIRECTORY if (!$InstallDir) { $InstallDir = Join-Path $Env:USERPROFILE ".netcoreeng/native/" } return $InstallDir } <# .SYNOPSIS Unzip an archive .DESCRIPTION Powershell module to unzip an archive to a specified directory .PARAMETER ZipPath (Required) Path to archive to unzip .PARAMETER OutputDirectory (Required) Output directory for archive contents .PARAMETER Force Overwrite output directory contents if they already exist .NOTES - Returns True and does not perform an extraction if output directory already exists but Overwrite is not True. - Returns True if unzip operation is successful - Returns False if Overwrite is True and it is unable to remove contents of OutputDirectory - Returns False if unable to extract zip archive #> function Expand-Zip { [CmdletBinding(PositionalBinding=$false)] Param ( [Parameter(Mandatory=$True)] [string] $ZipPath, [Parameter(Mandatory=$True)] [string] $OutputDirectory, [switch] $Force ) Write-Verbose "Extracting '$ZipPath' to '$OutputDirectory'" try { if ((Test-Path $OutputDirectory) -And (-Not $Force)) { Write-Host "Directory '$OutputDirectory' already exists, skipping extract" return $True } if (Test-Path $OutputDirectory) { Write-Verbose "'Force' is 'True', but '$OutputDirectory' exists, removing directory" Remove-Item $OutputDirectory -Force -Recurse if ($? -Eq $False) { Write-Error "Unable to remove '$OutputDirectory'" return $False } } $TempOutputDirectory = Join-Path "$(Split-Path -Parent $OutputDirectory)" "$(Split-Path -Leaf $OutputDirectory).tmp" if (Test-Path $TempOutputDirectory) { Remove-Item $TempOutputDirectory -Force -Recurse } New-Item -Path $TempOutputDirectory -Force -ItemType "Directory" | Out-Null Add-Type -assembly "system.io.compression.filesystem" [io.compression.zipfile]::ExtractToDirectory("$ZipPath", "$TempOutputDirectory") if ($? -Eq $False) { Write-Error "Unable to extract '$ZipPath'" return $False } Move-Item -Path $TempOutputDirectory -Destination $OutputDirectory } catch { Write-Host $_ Write-Host $_.Exception return $False } return $True } export-modulemember -function DownloadAndExtract export-modulemember -function Expand-Zip export-modulemember -function Get-File export-modulemember -function Get-MachineArchitecture export-modulemember -function Get-NativeInstallDirectory export-modulemember -function Get-TempDirectory export-modulemember -function Get-TempPathFilename export-modulemember -function New-ScriptShim
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf
<?xml version="1.0" encoding="utf-8"?> <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd"> <file datatype="xml" source-language="en" target-language="de" original="../WorkspacesResources.resx"> <body> <trans-unit id="A_project_may_not_reference_itself"> <source>A project may not reference itself.</source> <target state="translated">Ein Projekt darf nicht auf sich selbst verweisen.</target> <note /> </trans-unit> <trans-unit id="Adding_analyzer_config_documents_is_not_supported"> <source>Adding analyzer config documents is not supported.</source> <target state="translated">Das Hinzufügen von Konfigurationsdokumenten des Analysetools wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="An_error_occurred_while_reading_the_specified_configuration_file_colon_0"> <source>An error occurred while reading the specified configuration file: {0}</source> <target state="translated">Beim Lesen der angegebenen Konfigurationsdatei ist ein Fehler aufgetreten: {0}</target> <note /> </trans-unit> <trans-unit id="CSharp_files"> <source>C# files</source> <target state="translated">C#-Dateien</target> <note /> </trans-unit> <trans-unit id="Cannot_apply_action_that_is_not_in_0"> <source>Cannot apply action that is not in '{0}'</source> <target state="translated">Es können nur in "{0}" enthaltene Aktionen angewendet werden.</target> <note /> </trans-unit> <trans-unit id="Changing_analyzer_config_documents_is_not_supported"> <source>Changing analyzer config documents is not supported.</source> <target state="translated">Das Ändern von Konfigurationsdokumenten des Analysetools wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Changing_document_0_is_not_supported"> <source>Changing document '{0}' is not supported.</source> <target state="translated">Das Ändern des Dokuments "{0}" wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="CodeAction_{0}_did_not_produce_a_changed_solution"> <source>CodeAction '{0}' did not produce a changed solution</source> <target state="translated">Durch CodeAction "{0}" wurde keine geänderte Lösung erstellt.</target> <note>"CodeAction" is a specific type, and {0} represents the title shown by the action.</note> </trans-unit> <trans-unit id="Core_EditorConfig_Options"> <source>Core EditorConfig Options</source> <target state="translated">Wichtige EditorConfig-Optionen</target> <note /> </trans-unit> <trans-unit id="DateTimeKind_must_be_Utc"> <source>DateTimeKind must be Utc</source> <target state="translated">"DateTimeKind" muss UTC sein.</target> <note /> </trans-unit> <trans-unit id="Destination_type_must_be_a_0_1_2_or_3_but_given_one_is_4"> <source>Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}.</source> <target state="translated">Der Zieltyp muss "{0}", "{1}", "{2}" oder "{3}" lauten. Es wurde jedoch "{4}" angegeben.</target> <note /> </trans-unit> <trans-unit id="Document_does_not_support_syntax_trees"> <source>Document does not support syntax trees</source> <target state="translated">Das Dokument unterstützt keine Syntaxstrukturen.</target> <note /> </trans-unit> <trans-unit id="Error_reading_content_of_source_file_0_1"> <source>Error reading content of source file '{0}' -- '{1}'.</source> <target state="translated">Fehler beim Lesen des Inhalts der Quelldatei "{0}": "{1}".</target> <note /> </trans-unit> <trans-unit id="Indentation_and_spacing"> <source>Indentation and spacing</source> <target state="translated">Einzüge und Abstände</target> <note /> </trans-unit> <trans-unit id="New_line_preferences"> <source>New line preferences</source> <target state="translated">Einstellungen für neue Zeilen</target> <note /> </trans-unit> <trans-unit id="Only_submission_project_can_reference_submission_projects"> <source>Only submission project can reference submission projects.</source> <target state="translated">Nur ein Übermittlungsprojekt kann auf Übermittlungsprojekte verweisen.</target> <note /> </trans-unit> <trans-unit id="Options_did_not_come_from_specified_Solution"> <source>Options did not come from specified Solution</source> <target state="translated">Optionen stammen nicht aus der angegebenen Projektmappe.</target> <note /> </trans-unit> <trans-unit id="Predefined_conversion_from_0_to_1"> <source>Predefined conversion from {0} to {1}.</source> <target state="translated">Vordefinierte Konvertierung von "{0}" in "{1}".</target> <note /> </trans-unit> <trans-unit id="Project_does_not_contain_specified_reference"> <source>Project does not contain specified reference</source> <target state="translated">Der angegebene Verweis ist im Projekt nicht enthalten.</target> <note /> </trans-unit> <trans-unit id="Refactoring_Only"> <source>Refactoring Only</source> <target state="translated">Nur Refactoring</target> <note /> </trans-unit> <trans-unit id="Remove_the_line_below_if_you_want_to_inherit_dot_editorconfig_settings_from_higher_directories"> <source>Remove the line below if you want to inherit .editorconfig settings from higher directories</source> <target state="translated">Entfernen Sie die folgende Zeile, wenn Sie EDITORCONFIG-Einstellungen von höheren Verzeichnissen vererben möchten.</target> <note /> </trans-unit> <trans-unit id="Removing_analyzer_config_documents_is_not_supported"> <source>Removing analyzer config documents is not supported.</source> <target state="translated">Das Entfernen von Konfigurationsdokumenten des Analysetools wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Rename_0_to_1"> <source>Rename '{0}' to '{1}'</source> <target state="translated">"{0}" in "{1}" umbenennen</target> <note /> </trans-unit> <trans-unit id="Solution_does_not_contain_specified_reference"> <source>Solution does not contain specified reference</source> <target state="translated">Der angegebene Verweis ist nicht in der Projektmappe enthalten.</target> <note /> </trans-unit> <trans-unit id="Symbol_0_is_not_from_source"> <source>Symbol "{0}" is not from source.</source> <target state="translated">Symbol "{0}" ist nicht aus Quelle.</target> <note /> </trans-unit> <trans-unit id="Documentation_comment_id_must_start_with_E_F_M_N_P_or_T"> <source>Documentation comment id must start with E, F, M, N, P or T</source> <target state="translated">Dokumentationskommentar-ID muss mit E, F, M, N, P oder T beginnen</target> <note /> </trans-unit> <trans-unit id="Cycle_detected_in_extensions"> <source>Cycle detected in extensions</source> <target state="translated">Zyklus in Erweiterungen entdeckt</target> <note /> </trans-unit> <trans-unit id="Destination_type_must_be_a_0_but_given_one_is_1"> <source>Destination type must be a {0}, but given one is {1}.</source> <target state="translated">Zieltyp muss {0} sein. Es wurde jedoch {1} angegeben.</target> <note /> </trans-unit> <trans-unit id="Destination_type_must_be_a_0_or_a_1_but_given_one_is_2"> <source>Destination type must be a {0} or a {1}, but given one is {2}.</source> <target state="translated">Zieltyp muss {0} oder {1} sein. Es wurde jedoch {2} angegeben.</target> <note /> </trans-unit> <trans-unit id="Destination_type_must_be_a_0_1_or_2_but_given_one_is_3"> <source>Destination type must be a {0}, {1} or {2}, but given one is {3}.</source> <target state="translated">Zieltyp muss {0}, {1} oder {2} sein. Es wurde jedoch {3} angegeben.</target> <note /> </trans-unit> <trans-unit id="Could_not_find_location_to_generation_symbol_into"> <source>Could not find location to generation symbol into.</source> <target state="translated">Konnte keinen Ort finden, in den das Symbol generiert werden kann.</target> <note /> </trans-unit> <trans-unit id="No_location_provided_to_add_statements_to"> <source>No location provided to add statements to.</source> <target state="translated">Kein Ort angegeben, zu dem Anweisungen hinzugefügt werden.</target> <note /> </trans-unit> <trans-unit id="Destination_location_was_not_in_source"> <source>Destination location was not in source.</source> <target state="translated">Zielort war nicht in Quelle.</target> <note /> </trans-unit> <trans-unit id="Destination_location_was_from_a_different_tree"> <source>Destination location was from a different tree.</source> <target state="translated">Zielort stammt aus anderem Baum.</target> <note /> </trans-unit> <trans-unit id="Node_is_of_the_wrong_type"> <source>Node is of the wrong type.</source> <target state="translated">Knoten hat den falschen Typ.</target> <note /> </trans-unit> <trans-unit id="Location_must_be_null_or_from_source"> <source>Location must be null or from source.</source> <target state="translated">Ort muss null oder von Quelle sein.</target> <note /> </trans-unit> <trans-unit id="Duplicate_source_file_0_in_project_1"> <source>Duplicate source file '{0}' in project '{1}'</source> <target state="translated">Doppelte Quelldatei "{0}" in Projekt "{1}"</target> <note /> </trans-unit> <trans-unit id="Removing_projects_is_not_supported"> <source>Removing projects is not supported.</source> <target state="translated">Das Entfernen von Projekten wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Adding_projects_is_not_supported"> <source>Adding projects is not supported.</source> <target state="translated">Das Hinzufügen von Projekten wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Symbols_project_could_not_be_found_in_the_provided_solution"> <source>Symbol's project could not be found in the provided solution</source> <target state="translated">Das Projekt des Symbols wurde in der angegebenen Projektmappe nicht gefunden.</target> <note /> </trans-unit> <trans-unit id="Sync_namespace_to_folder_structure"> <source>Sync namespace to folder structure</source> <target state="translated">Namespace mit Ordnerstruktur synchronisieren</target> <note /> </trans-unit> <trans-unit id="The_contents_of_a_SourceGeneratedDocument_may_not_be_changed"> <source>The contents of a SourceGeneratedDocument may not be changed.</source> <target state="translated">Der Inhalt eines SourceGeneratedDocument kann nicht geändert werden.</target> <note>{locked:SourceGeneratedDocument}</note> </trans-unit> <trans-unit id="The_project_already_contains_the_specified_reference"> <source>The project already contains the specified reference.</source> <target state="translated">Im Projekt ist der angegebene Verweis bereits enthalten.</target> <note /> </trans-unit> <trans-unit id="The_solution_already_contains_the_specified_reference"> <source>The solution already contains the specified reference.</source> <target state="translated">Der angegebene Verweis ist bereits in der Projektmappe enthalten.</target> <note /> </trans-unit> <trans-unit id="Unknown"> <source>Unknown</source> <target state="translated">Unbekannt</target> <note /> </trans-unit> <trans-unit id="Visual_Basic_files"> <source>Visual Basic files</source> <target state="translated">Visual Basic-Dateien</target> <note /> </trans-unit> <trans-unit id="Warning_adding_imports_will_bring_an_extension_method_into_scope_with_the_same_name_as_member_access"> <source>Adding imports will bring an extension method into scope with the same name as '{0}'</source> <target state="translated">Durch das Hinzufügen von Importen wird eine Erweiterungsmethode mit dem gleichen Namen wie "{0}" in den Bereich eingeführt.</target> <note /> </trans-unit> <trans-unit id="Workspace_error"> <source>Workspace error</source> <target state="translated">Arbeitsbereichsfehler</target> <note /> </trans-unit> <trans-unit id="Workspace_is_not_empty"> <source>Workspace is not empty.</source> <target state="translated">Arbeitsbereich ist nicht leer.</target> <note /> </trans-unit> <trans-unit id="_0_is_in_a_different_project"> <source>{0} is in a different project.</source> <target state="translated">"{0}" befindet sich in einem anderen Projekt.</target> <note /> </trans-unit> <trans-unit id="_0_is_not_part_of_the_workspace"> <source>'{0}' is not part of the workspace.</source> <target state="translated">"{0}" ist nicht Teil des Arbeitsbereichs.</target> <note /> </trans-unit> <trans-unit id="_0_is_already_part_of_the_workspace"> <source>'{0}' is already part of the workspace.</source> <target state="translated">"{0}" ist bereits Teil des Arbeitsbereichs.</target> <note /> </trans-unit> <trans-unit id="_0_is_not_referenced"> <source>'{0}' is not referenced.</source> <target state="translated">"{0}" ist nicht referenziert.</target> <note /> </trans-unit> <trans-unit id="_0_is_already_referenced"> <source>'{0}' is already referenced.</source> <target state="translated">"{0}" ist bereits referenziert.</target> <note /> </trans-unit> <trans-unit id="Adding_project_reference_from_0_to_1_will_cause_a_circular_reference"> <source>Adding project reference from '{0}' to '{1}' will cause a circular reference.</source> <target state="translated">Das Hinzufügen der Projektreferenz "{0}" zu "{1}" wird einen Zirkelbezug verursachen.</target> <note /> </trans-unit> <trans-unit id="Metadata_is_not_referenced"> <source>Metadata is not referenced.</source> <target state="translated">Metadaten sind nicht referenziert.</target> <note /> </trans-unit> <trans-unit id="Metadata_is_already_referenced"> <source>Metadata is already referenced.</source> <target state="translated">Metadaten sind bereits referenziert.</target> <note /> </trans-unit> <trans-unit id="_0_is_not_present"> <source>{0} is not present.</source> <target state="translated">{0} ist nicht vorhanden.</target> <note /> </trans-unit> <trans-unit id="_0_is_already_present"> <source>{0} is already present.</source> <target state="translated">{0} ist bereits vorhanden.</target> <note /> </trans-unit> <trans-unit id="The_specified_document_is_not_a_version_of_this_document"> <source>The specified document is not a version of this document.</source> <target state="translated">Das angegebene Dokument ist keine Version dieses Dokuments.</target> <note /> </trans-unit> <trans-unit id="The_language_0_is_not_supported"> <source>The language '{0}' is not supported.</source> <target state="translated">Die Sprache "{0}" wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="The_solution_already_contains_the_specified_project"> <source>The solution already contains the specified project.</source> <target state="translated">Die Lösung enthält bereits das angegebene Projekt.</target> <note /> </trans-unit> <trans-unit id="The_solution_does_not_contain_the_specified_project"> <source>The solution does not contain the specified project.</source> <target state="translated">Lösung enthält nicht das angegebene Projekt.</target> <note /> </trans-unit> <trans-unit id="The_project_already_references_the_target_project"> <source>The project already references the target project.</source> <target state="translated">Das Projekt verweist bereits auf das Zielprojekt.</target> <note /> </trans-unit> <trans-unit id="The_solution_already_contains_the_specified_document"> <source>The solution already contains the specified document.</source> <target state="translated">Die Lösung enthält bereits das angegebene Dokument.</target> <note /> </trans-unit> <trans-unit id="Temporary_storage_cannot_be_written_more_than_once"> <source>Temporary storage cannot be written more than once.</source> <target state="translated">Temporärer Speicher kann nicht mehr als einmal geschrieben werden.</target> <note /> </trans-unit> <trans-unit id="_0_is_not_open"> <source>'{0}' is not open.</source> <target state="translated">"{0}" ist nicht geöffnet.</target> <note /> </trans-unit> <trans-unit id="A_language_name_cannot_be_specified_for_this_option"> <source>A language name cannot be specified for this option.</source> <target state="translated">Für diese Option kann kein Sprachenname angegeben werden.</target> <note /> </trans-unit> <trans-unit id="A_language_name_must_be_specified_for_this_option"> <source>A language name must be specified for this option.</source> <target state="translated">Für diese Option muss ein Sprachenname angegeben werden.</target> <note /> </trans-unit> <trans-unit id="File_was_externally_modified_colon_0"> <source>File was externally modified: {0}.</source> <target state="translated">Datei wurde extern modifiziert: {0}.</target> <note /> </trans-unit> <trans-unit id="Unrecognized_language_name"> <source>Unrecognized language name.</source> <target state="translated">Unerkannter Sprachenname.</target> <note /> </trans-unit> <trans-unit id="Can_t_resolve_metadata_reference_colon_0"> <source>Can't resolve metadata reference: '{0}'.</source> <target state="translated">Metadatenreferenz kann nicht aufgelöst werden: "{0}".</target> <note /> </trans-unit> <trans-unit id="Can_t_resolve_analyzer_reference_colon_0"> <source>Can't resolve analyzer reference: '{0}'.</source> <target state="translated">Analysereferenz kann nicht aufgelöst werden: "{0}".</target> <note /> </trans-unit> <trans-unit id="Invalid_project_block_expected_after_Project"> <source>Invalid project block, expected "=" after Project.</source> <target state="translated">Ungültiger Projektblock, erwartet wird "=" nach Projekt.</target> <note /> </trans-unit> <trans-unit id="Invalid_project_block_expected_after_project_name"> <source>Invalid project block, expected "," after project name.</source> <target state="translated">Ungültiger Projektblock, erwartet wird "," nach Projektname.</target> <note /> </trans-unit> <trans-unit id="Invalid_project_block_expected_after_project_path"> <source>Invalid project block, expected "," after project path.</source> <target state="translated">Ungültiger Projektblock, erwartet wird "," nach Projektpfad.</target> <note /> </trans-unit> <trans-unit id="Expected_0"> <source>Expected {0}.</source> <target state="translated">Erwartet wird {0}.</target> <note /> </trans-unit> <trans-unit id="_0_must_be_a_non_null_and_non_empty_string"> <source>"{0}" must be a non-null and non-empty string.</source> <target state="translated">"{0}" muss eine Zeichenfolge sein, die nicht null und nicht leer ist.</target> <note /> </trans-unit> <trans-unit id="Expected_header_colon_0"> <source>Expected header: "{0}".</source> <target state="translated">Erwartete Überschrift: "{0}".</target> <note /> </trans-unit> <trans-unit id="Expected_end_of_file"> <source>Expected end-of-file.</source> <target state="translated">Erwartetes Dateiende.</target> <note /> </trans-unit> <trans-unit id="Expected_0_line"> <source>Expected {0} line.</source> <target state="translated">Erwartete {0}-Zeile.</target> <note /> </trans-unit> <trans-unit id="This_submission_already_references_another_submission_project"> <source>This submission already references another submission project.</source> <target state="translated">Diese Übermittlung verweist bereits auf ein anderes Übermittlungsprojekt.</target> <note /> </trans-unit> <trans-unit id="_0_still_contains_open_documents"> <source>{0} still contains open documents.</source> <target state="translated">{0} enthält noch offene Dokumente.</target> <note /> </trans-unit> <trans-unit id="_0_is_still_open"> <source>{0} is still open.</source> <target state="translated">"{0}" ist noch geöffnet.</target> <note /> </trans-unit> <trans-unit id="Arrays_with_more_than_one_dimension_cannot_be_serialized"> <source>Arrays with more than one dimension cannot be serialized.</source> <target state="translated">Arrays mit mehr als einer Dimension können nicht serialisiert werden.</target> <note /> </trans-unit> <trans-unit id="Value_too_large_to_be_represented_as_a_30_bit_unsigned_integer"> <source>Value too large to be represented as a 30 bit unsigned integer.</source> <target state="translated">Der Wert ist zu groß, um als ganze 30-Bit-Zahl ohne Vorzeichen dargestellt zu werden.</target> <note /> </trans-unit> <trans-unit id="Specified_path_must_be_absolute"> <source>Specified path must be absolute.</source> <target state="translated">Angegebener Pfad muss absolut sein.</target> <note /> </trans-unit> <trans-unit id="Name_can_be_simplified"> <source>Name can be simplified.</source> <target state="translated">Der Name kann vereinfacht werden.</target> <note /> </trans-unit> <trans-unit id="Unknown_identifier"> <source>Unknown identifier.</source> <target state="translated">Unbekannter Bezeichner.</target> <note /> </trans-unit> <trans-unit id="Cannot_generate_code_for_unsupported_operator_0"> <source>Cannot generate code for unsupported operator '{0}'</source> <target state="translated">Kann keinen Code für nicht unterstützten Operator "{0}" generieren</target> <note /> </trans-unit> <trans-unit id="Invalid_number_of_parameters_for_binary_operator"> <source>Invalid number of parameters for binary operator.</source> <target state="translated">Ungültige Parameteranzahl für binären Operator.</target> <note /> </trans-unit> <trans-unit id="Invalid_number_of_parameters_for_unary_operator"> <source>Invalid number of parameters for unary operator.</source> <target state="translated">Ungültige Parameteranzahl für unären Operator.</target> <note /> </trans-unit> <trans-unit id="Cannot_open_project_0_because_the_file_extension_1_is_not_associated_with_a_language"> <source>Cannot open project '{0}' because the file extension '{1}' is not associated with a language.</source> <target state="translated">Projekt "{0}" kann nicht geöffnet werden, da die Dateierweiterung "{1}" keiner Sprache zugeordnet ist.</target> <note /> </trans-unit> <trans-unit id="Cannot_open_project_0_because_the_language_1_is_not_supported"> <source>Cannot open project '{0}' because the language '{1}' is not supported.</source> <target state="translated">Projekt "{0}" kann nicht geöffnet werden, da die Sprache "{1}" nicht unterstützt wird.</target> <note /> </trans-unit> <trans-unit id="Invalid_project_file_path_colon_0"> <source>Invalid project file path: '{0}'</source> <target state="translated">Ungültiger Projektdateipfad: "{0}"</target> <note /> </trans-unit> <trans-unit id="Invalid_solution_file_path_colon_0"> <source>Invalid solution file path: '{0}'</source> <target state="translated">Ungültiger Lösungsdateipfad: "{0}"</target> <note /> </trans-unit> <trans-unit id="Project_file_not_found_colon_0"> <source>Project file not found: '{0}'</source> <target state="translated">Projektdatei nicht gefunden: "{0}"</target> <note /> </trans-unit> <trans-unit id="Solution_file_not_found_colon_0"> <source>Solution file not found: '{0}'</source> <target state="translated">Lösungsdatei nicht gefunden: "{0}"</target> <note /> </trans-unit> <trans-unit id="Unmerged_change_from_project_0"> <source>Unmerged change from project '{0}'</source> <target state="translated">Nicht gemergte Änderung aus Projekt "{0}"</target> <note /> </trans-unit> <trans-unit id="Added_colon"> <source>Added:</source> <target state="translated">Hinzugefügt:</target> <note /> </trans-unit> <trans-unit id="After_colon"> <source>After:</source> <target state="translated">Nach:</target> <note /> </trans-unit> <trans-unit id="Before_colon"> <source>Before:</source> <target state="translated">Vor:</target> <note /> </trans-unit> <trans-unit id="Removed_colon"> <source>Removed:</source> <target state="translated">Entfernt:</target> <note /> </trans-unit> <trans-unit id="Invalid_CodePage_value_colon_0"> <source>Invalid CodePage value: {0}</source> <target state="translated">Ungültiger CodePage-Wert: {0}</target> <note /> </trans-unit> <trans-unit id="Adding_additional_documents_is_not_supported"> <source>Adding additional documents is not supported.</source> <target state="translated">Das Hinzufügen weitere Dokumente wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Adding_analyzer_references_is_not_supported"> <source>Adding analyzer references is not supported.</source> <target state="translated">Das Hinzufügen von Verweisen der Analyse wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Adding_documents_is_not_supported"> <source>Adding documents is not supported.</source> <target state="translated">Das Hinzufügen von Dokumenten wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Adding_metadata_references_is_not_supported"> <source>Adding metadata references is not supported.</source> <target state="translated">Das Hinzufügen von Verweisen auf Metadaten wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Adding_project_references_is_not_supported"> <source>Adding project references is not supported.</source> <target state="translated">Das Hinzufügen von Projektverweisen wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Changing_additional_documents_is_not_supported"> <source>Changing additional documents is not supported.</source> <target state="translated">Das Ändern weiterer Dokumente wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Changing_documents_is_not_supported"> <source>Changing documents is not supported.</source> <target state="translated">Das Ändern von Dokumenten wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Changing_project_properties_is_not_supported"> <source>Changing project properties is not supported.</source> <target state="translated">Das Ändern von Projekteigenschaften wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Removing_additional_documents_is_not_supported"> <source>Removing additional documents is not supported.</source> <target state="translated">Das Entfernen weiterer Dokumente wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Removing_analyzer_references_is_not_supported"> <source>Removing analyzer references is not supported.</source> <target state="translated">Das Entfernen von Verweisen der Analyse wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Removing_documents_is_not_supported"> <source>Removing documents is not supported.</source> <target state="translated">Das Entfernen von Dokumenten wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Removing_metadata_references_is_not_supported"> <source>Removing metadata references is not supported.</source> <target state="translated">Das Entfernen von Verweisen auf Metadaten wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Removing_project_references_is_not_supported"> <source>Removing project references is not supported.</source> <target state="translated">Das Entfernen von Projektverweisen wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Service_of_type_0_is_required_to_accomplish_the_task_but_is_not_available_from_the_workspace"> <source>Service of type '{0}' is required to accomplish the task but is not available from the workspace.</source> <target state="translated">Ein Dienst vom Typ "{0}" ist zum Ausführen der Aufgabe erforderlich, steht aber im Arbeitsbereich nicht zur Verfügung.</target> <note /> </trans-unit> <trans-unit id="At_least_one_diagnostic_must_be_supplied"> <source>At least one diagnostic must be supplied.</source> <target state="translated">Es muss mindestens eine Diagnose bereitgestellt sein.</target> <note /> </trans-unit> <trans-unit id="Diagnostic_must_have_span_0"> <source>Diagnostic must have span '{0}'</source> <target state="translated">Diagnose muss den Bereich "{0}" enthalten</target> <note /> </trans-unit> <trans-unit id="Cannot_deserialize_type_0"> <source>Cannot deserialize type '{0}'.</source> <target state="translated">Typ "{0}" kann nicht deserialisiert werden.</target> <note /> </trans-unit> <trans-unit id="Cannot_serialize_type_0"> <source>Cannot serialize type '{0}'.</source> <target state="translated">Typ "{0}" kann nicht serialisiert werden.</target> <note /> </trans-unit> <trans-unit id="The_type_0_is_not_understood_by_the_serialization_binder"> <source>The type '{0}' is not understood by the serialization binder.</source> <target state="translated">Der Typ "{0}" wird vom Serialisierungsbinder nicht verstanden.</target> <note /> </trans-unit> <trans-unit id="Label_for_node_0_is_invalid_it_must_be_within_bracket_0_1"> <source>Label for node '{0}' is invalid, it must be within [0, {1}).</source> <target state="translated">Die Bezeichnung für Knoten '{0}' ist ungültig, sie muss innerhalb von [0, {1}) liegen.</target> <note /> </trans-unit> <trans-unit id="Matching_nodes_0_and_1_must_have_the_same_label"> <source>Matching nodes '{0}' and '{1}' must have the same label.</source> <target state="translated">Die übereinstimmenden Knoten '{0}' und '{1}' müssen dieselbe Bezeichnung aufweisen.</target> <note /> </trans-unit> <trans-unit id="Node_0_must_be_contained_in_the_new_tree"> <source>Node '{0}' must be contained in the new tree.</source> <target state="translated">Der Knoten '{0}' muss im neuen Baum enthalten sein.</target> <note /> </trans-unit> <trans-unit id="Node_0_must_be_contained_in_the_old_tree"> <source>Node '{0}' must be contained in the old tree.</source> <target state="translated">Der Knoten '{0}' muss im alten Baum enthalten sein.</target> <note /> </trans-unit> <trans-unit id="The_member_0_is_not_declared_within_the_declaration_of_the_symbol"> <source>The member '{0}' is not declared within the declaration of the symbol.</source> <target state="translated">Der Member '{0}' wird nicht innerhalb der Deklaration des Symbols deklariert.</target> <note /> </trans-unit> <trans-unit id="The_position_is_not_within_the_symbol_s_declaration"> <source>The position is not within the symbol's declaration</source> <target state="translated">Die Position liegt nicht innerhalb der Deklaration des Symbols.</target> <note /> </trans-unit> <trans-unit id="The_symbol_0_cannot_be_located_within_the_current_solution"> <source>The symbol '{0}' cannot be located within the current solution.</source> <target state="translated">Das Symbol '{0}' kann nicht in die aktuelle Projektmappe geladen werden.</target> <note /> </trans-unit> <trans-unit id="Changing_compilation_options_is_not_supported"> <source>Changing compilation options is not supported.</source> <target state="translated">Das Ändern von Kompilierungsoptionen wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Changing_parse_options_is_not_supported"> <source>Changing parse options is not supported.</source> <target state="translated">Das Ändern von Analyseoptionen wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="The_node_is_not_part_of_the_tree"> <source>The node is not part of the tree.</source> <target state="translated">Dieser Knoten ist nicht Teil des Baums.</target> <note /> </trans-unit> <trans-unit id="This_workspace_does_not_support_opening_and_closing_documents"> <source>This workspace does not support opening and closing documents.</source> <target state="translated">Das Öffnen und Schließen von Dokumenten wird in diesem Arbeitsbereich nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Exceptions_colon"> <source>Exceptions:</source> <target state="translated">Ausnahmen:</target> <note /> </trans-unit> <trans-unit id="_0_returned_an_uninitialized_ImmutableArray"> <source>'{0}' returned an uninitialized ImmutableArray</source> <target state="translated">"{0}" hat ein nicht initialisiertes "ImmutableArray" zurückgegeben.</target> <note /> </trans-unit> <trans-unit id="Failure"> <source>Failure</source> <target state="translated">Fehler</target> <note /> </trans-unit> <trans-unit id="Warning"> <source>Warning</source> <target state="translated">Warnung</target> <note /> </trans-unit> <trans-unit id="Enable"> <source>Enable</source> <target state="translated">Aktivieren</target> <note /> </trans-unit> <trans-unit id="Enable_and_ignore_future_errors"> <source>Enable and ignore future errors</source> <target state="translated">Aktivieren und weitere Fehler ignorieren</target> <note /> </trans-unit> <trans-unit id="_0_encountered_an_error_and_has_been_disabled"> <source>'{0}' encountered an error and has been disabled.</source> <target state="translated">"{0}" hat einen Fehler festgestellt und wurde deaktiviert.</target> <note /> </trans-unit> <trans-unit id="Show_Stack_Trace"> <source>Show Stack Trace</source> <target state="translated">Stapelüberwachung anzeigen</target> <note /> </trans-unit> <trans-unit id="Stream_is_too_long"> <source>Stream is too long.</source> <target state="translated">Der Datenstrom ist zu lang.</target> <note /> </trans-unit> <trans-unit id="Deserialization_reader_for_0_read_incorrect_number_of_values"> <source>Deserialization reader for '{0}' read incorrect number of values.</source> <target state="translated">Der Deserialisierungsreader für "{0}" hat eine falsche Anzahl von Werten gelesen.</target> <note /> </trans-unit> <trans-unit id="Async_Method"> <source>Async Method</source> <target state="translated">Asynchrone Methode</target> <note>{locked: async}{locked: method} These are keywords (unless the order of words or capitalization should be handled differently)</note> </trans-unit> <trans-unit id="Error"> <source>Error</source> <target state="translated">Fehler</target> <note /> </trans-unit> <trans-unit id="None"> <source>None</source> <target state="translated">NONE</target> <note /> </trans-unit> <trans-unit id="Suggestion"> <source>Suggestion</source> <target state="translated">Vorschlag</target> <note /> </trans-unit> <trans-unit id="File_0_size_of_1_exceeds_maximum_allowed_size_of_2"> <source>File '{0}' size of {1} exceeds maximum allowed size of {2}</source> <target state="translated">Die Größe der Datei "{0}" beträgt {1} und überschreitet so die maximal zulässige Größe von {2}.</target> <note /> </trans-unit> <trans-unit id="Changing_document_property_is_not_supported"> <source>Changing document properties is not supported</source> <target state="translated">Das Ändern der Dokumenteigenschaften wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="dot_NET_Coding_Conventions"> <source>.NET Coding Conventions</source> <target state="translated">.NET-Codierungskonventionen</target> <note /> </trans-unit> <trans-unit id="Variables_captured_colon"> <source>Variables captured:</source> <target state="translated">Erfasste Variablen:</target> <note /> </trans-unit> </body> </file> </xliff>
<?xml version="1.0" encoding="utf-8"?> <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd"> <file datatype="xml" source-language="en" target-language="de" original="../WorkspacesResources.resx"> <body> <trans-unit id="A_project_may_not_reference_itself"> <source>A project may not reference itself.</source> <target state="translated">Ein Projekt darf nicht auf sich selbst verweisen.</target> <note /> </trans-unit> <trans-unit id="Adding_analyzer_config_documents_is_not_supported"> <source>Adding analyzer config documents is not supported.</source> <target state="translated">Das Hinzufügen von Konfigurationsdokumenten des Analysetools wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="An_error_occurred_while_reading_the_specified_configuration_file_colon_0"> <source>An error occurred while reading the specified configuration file: {0}</source> <target state="translated">Beim Lesen der angegebenen Konfigurationsdatei ist ein Fehler aufgetreten: {0}</target> <note /> </trans-unit> <trans-unit id="CSharp_files"> <source>C# files</source> <target state="translated">C#-Dateien</target> <note /> </trans-unit> <trans-unit id="Cannot_apply_action_that_is_not_in_0"> <source>Cannot apply action that is not in '{0}'</source> <target state="translated">Es können nur in "{0}" enthaltene Aktionen angewendet werden.</target> <note /> </trans-unit> <trans-unit id="Changing_analyzer_config_documents_is_not_supported"> <source>Changing analyzer config documents is not supported.</source> <target state="translated">Das Ändern von Konfigurationsdokumenten des Analysetools wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Changing_document_0_is_not_supported"> <source>Changing document '{0}' is not supported.</source> <target state="translated">Das Ändern des Dokuments "{0}" wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="CodeAction_{0}_did_not_produce_a_changed_solution"> <source>CodeAction '{0}' did not produce a changed solution</source> <target state="translated">Durch CodeAction "{0}" wurde keine geänderte Lösung erstellt.</target> <note>"CodeAction" is a specific type, and {0} represents the title shown by the action.</note> </trans-unit> <trans-unit id="Core_EditorConfig_Options"> <source>Core EditorConfig Options</source> <target state="translated">Wichtige EditorConfig-Optionen</target> <note /> </trans-unit> <trans-unit id="DateTimeKind_must_be_Utc"> <source>DateTimeKind must be Utc</source> <target state="translated">"DateTimeKind" muss UTC sein.</target> <note /> </trans-unit> <trans-unit id="Destination_type_must_be_a_0_1_2_or_3_but_given_one_is_4"> <source>Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}.</source> <target state="translated">Der Zieltyp muss "{0}", "{1}", "{2}" oder "{3}" lauten. Es wurde jedoch "{4}" angegeben.</target> <note /> </trans-unit> <trans-unit id="Document_does_not_support_syntax_trees"> <source>Document does not support syntax trees</source> <target state="translated">Das Dokument unterstützt keine Syntaxstrukturen.</target> <note /> </trans-unit> <trans-unit id="Error_reading_content_of_source_file_0_1"> <source>Error reading content of source file '{0}' -- '{1}'.</source> <target state="translated">Fehler beim Lesen des Inhalts der Quelldatei "{0}": "{1}".</target> <note /> </trans-unit> <trans-unit id="Indentation_and_spacing"> <source>Indentation and spacing</source> <target state="translated">Einzüge und Abstände</target> <note /> </trans-unit> <trans-unit id="New_line_preferences"> <source>New line preferences</source> <target state="translated">Einstellungen für neue Zeilen</target> <note /> </trans-unit> <trans-unit id="Only_submission_project_can_reference_submission_projects"> <source>Only submission project can reference submission projects.</source> <target state="translated">Nur ein Übermittlungsprojekt kann auf Übermittlungsprojekte verweisen.</target> <note /> </trans-unit> <trans-unit id="Options_did_not_come_from_specified_Solution"> <source>Options did not come from specified Solution</source> <target state="translated">Optionen stammen nicht aus der angegebenen Projektmappe.</target> <note /> </trans-unit> <trans-unit id="Predefined_conversion_from_0_to_1"> <source>Predefined conversion from {0} to {1}.</source> <target state="translated">Vordefinierte Konvertierung von "{0}" in "{1}".</target> <note /> </trans-unit> <trans-unit id="Project_does_not_contain_specified_reference"> <source>Project does not contain specified reference</source> <target state="translated">Der angegebene Verweis ist im Projekt nicht enthalten.</target> <note /> </trans-unit> <trans-unit id="Refactoring_Only"> <source>Refactoring Only</source> <target state="translated">Nur Refactoring</target> <note /> </trans-unit> <trans-unit id="Remove_the_line_below_if_you_want_to_inherit_dot_editorconfig_settings_from_higher_directories"> <source>Remove the line below if you want to inherit .editorconfig settings from higher directories</source> <target state="translated">Entfernen Sie die folgende Zeile, wenn Sie EDITORCONFIG-Einstellungen von höheren Verzeichnissen vererben möchten.</target> <note /> </trans-unit> <trans-unit id="Removing_analyzer_config_documents_is_not_supported"> <source>Removing analyzer config documents is not supported.</source> <target state="translated">Das Entfernen von Konfigurationsdokumenten des Analysetools wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Rename_0_to_1"> <source>Rename '{0}' to '{1}'</source> <target state="translated">"{0}" in "{1}" umbenennen</target> <note /> </trans-unit> <trans-unit id="Solution_does_not_contain_specified_reference"> <source>Solution does not contain specified reference</source> <target state="translated">Der angegebene Verweis ist nicht in der Projektmappe enthalten.</target> <note /> </trans-unit> <trans-unit id="Symbol_0_is_not_from_source"> <source>Symbol "{0}" is not from source.</source> <target state="translated">Symbol "{0}" ist nicht aus Quelle.</target> <note /> </trans-unit> <trans-unit id="Documentation_comment_id_must_start_with_E_F_M_N_P_or_T"> <source>Documentation comment id must start with E, F, M, N, P or T</source> <target state="translated">Dokumentationskommentar-ID muss mit E, F, M, N, P oder T beginnen</target> <note /> </trans-unit> <trans-unit id="Cycle_detected_in_extensions"> <source>Cycle detected in extensions</source> <target state="translated">Zyklus in Erweiterungen entdeckt</target> <note /> </trans-unit> <trans-unit id="Destination_type_must_be_a_0_but_given_one_is_1"> <source>Destination type must be a {0}, but given one is {1}.</source> <target state="translated">Zieltyp muss {0} sein. Es wurde jedoch {1} angegeben.</target> <note /> </trans-unit> <trans-unit id="Destination_type_must_be_a_0_or_a_1_but_given_one_is_2"> <source>Destination type must be a {0} or a {1}, but given one is {2}.</source> <target state="translated">Zieltyp muss {0} oder {1} sein. Es wurde jedoch {2} angegeben.</target> <note /> </trans-unit> <trans-unit id="Destination_type_must_be_a_0_1_or_2_but_given_one_is_3"> <source>Destination type must be a {0}, {1} or {2}, but given one is {3}.</source> <target state="translated">Zieltyp muss {0}, {1} oder {2} sein. Es wurde jedoch {3} angegeben.</target> <note /> </trans-unit> <trans-unit id="Could_not_find_location_to_generation_symbol_into"> <source>Could not find location to generation symbol into.</source> <target state="translated">Konnte keinen Ort finden, in den das Symbol generiert werden kann.</target> <note /> </trans-unit> <trans-unit id="No_location_provided_to_add_statements_to"> <source>No location provided to add statements to.</source> <target state="translated">Kein Ort angegeben, zu dem Anweisungen hinzugefügt werden.</target> <note /> </trans-unit> <trans-unit id="Destination_location_was_not_in_source"> <source>Destination location was not in source.</source> <target state="translated">Zielort war nicht in Quelle.</target> <note /> </trans-unit> <trans-unit id="Destination_location_was_from_a_different_tree"> <source>Destination location was from a different tree.</source> <target state="translated">Zielort stammt aus anderem Baum.</target> <note /> </trans-unit> <trans-unit id="Node_is_of_the_wrong_type"> <source>Node is of the wrong type.</source> <target state="translated">Knoten hat den falschen Typ.</target> <note /> </trans-unit> <trans-unit id="Location_must_be_null_or_from_source"> <source>Location must be null or from source.</source> <target state="translated">Ort muss null oder von Quelle sein.</target> <note /> </trans-unit> <trans-unit id="Duplicate_source_file_0_in_project_1"> <source>Duplicate source file '{0}' in project '{1}'</source> <target state="translated">Doppelte Quelldatei "{0}" in Projekt "{1}"</target> <note /> </trans-unit> <trans-unit id="Removing_projects_is_not_supported"> <source>Removing projects is not supported.</source> <target state="translated">Das Entfernen von Projekten wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Adding_projects_is_not_supported"> <source>Adding projects is not supported.</source> <target state="translated">Das Hinzufügen von Projekten wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Symbols_project_could_not_be_found_in_the_provided_solution"> <source>Symbol's project could not be found in the provided solution</source> <target state="translated">Das Projekt des Symbols wurde in der angegebenen Projektmappe nicht gefunden.</target> <note /> </trans-unit> <trans-unit id="Sync_namespace_to_folder_structure"> <source>Sync namespace to folder structure</source> <target state="translated">Namespace mit Ordnerstruktur synchronisieren</target> <note /> </trans-unit> <trans-unit id="The_contents_of_a_SourceGeneratedDocument_may_not_be_changed"> <source>The contents of a SourceGeneratedDocument may not be changed.</source> <target state="translated">Der Inhalt eines SourceGeneratedDocument kann nicht geändert werden.</target> <note>{locked:SourceGeneratedDocument}</note> </trans-unit> <trans-unit id="The_project_already_contains_the_specified_reference"> <source>The project already contains the specified reference.</source> <target state="translated">Im Projekt ist der angegebene Verweis bereits enthalten.</target> <note /> </trans-unit> <trans-unit id="The_solution_already_contains_the_specified_reference"> <source>The solution already contains the specified reference.</source> <target state="translated">Der angegebene Verweis ist bereits in der Projektmappe enthalten.</target> <note /> </trans-unit> <trans-unit id="Unknown"> <source>Unknown</source> <target state="translated">Unbekannt</target> <note /> </trans-unit> <trans-unit id="Visual_Basic_files"> <source>Visual Basic files</source> <target state="translated">Visual Basic-Dateien</target> <note /> </trans-unit> <trans-unit id="Warning_adding_imports_will_bring_an_extension_method_into_scope_with_the_same_name_as_member_access"> <source>Adding imports will bring an extension method into scope with the same name as '{0}'</source> <target state="translated">Durch das Hinzufügen von Importen wird eine Erweiterungsmethode mit dem gleichen Namen wie "{0}" in den Bereich eingeführt.</target> <note /> </trans-unit> <trans-unit id="Workspace_error"> <source>Workspace error</source> <target state="translated">Arbeitsbereichsfehler</target> <note /> </trans-unit> <trans-unit id="Workspace_is_not_empty"> <source>Workspace is not empty.</source> <target state="translated">Arbeitsbereich ist nicht leer.</target> <note /> </trans-unit> <trans-unit id="_0_is_in_a_different_project"> <source>{0} is in a different project.</source> <target state="translated">"{0}" befindet sich in einem anderen Projekt.</target> <note /> </trans-unit> <trans-unit id="_0_is_not_part_of_the_workspace"> <source>'{0}' is not part of the workspace.</source> <target state="translated">"{0}" ist nicht Teil des Arbeitsbereichs.</target> <note /> </trans-unit> <trans-unit id="_0_is_already_part_of_the_workspace"> <source>'{0}' is already part of the workspace.</source> <target state="translated">"{0}" ist bereits Teil des Arbeitsbereichs.</target> <note /> </trans-unit> <trans-unit id="_0_is_not_referenced"> <source>'{0}' is not referenced.</source> <target state="translated">"{0}" ist nicht referenziert.</target> <note /> </trans-unit> <trans-unit id="_0_is_already_referenced"> <source>'{0}' is already referenced.</source> <target state="translated">"{0}" ist bereits referenziert.</target> <note /> </trans-unit> <trans-unit id="Adding_project_reference_from_0_to_1_will_cause_a_circular_reference"> <source>Adding project reference from '{0}' to '{1}' will cause a circular reference.</source> <target state="translated">Das Hinzufügen der Projektreferenz "{0}" zu "{1}" wird einen Zirkelbezug verursachen.</target> <note /> </trans-unit> <trans-unit id="Metadata_is_not_referenced"> <source>Metadata is not referenced.</source> <target state="translated">Metadaten sind nicht referenziert.</target> <note /> </trans-unit> <trans-unit id="Metadata_is_already_referenced"> <source>Metadata is already referenced.</source> <target state="translated">Metadaten sind bereits referenziert.</target> <note /> </trans-unit> <trans-unit id="_0_is_not_present"> <source>{0} is not present.</source> <target state="translated">{0} ist nicht vorhanden.</target> <note /> </trans-unit> <trans-unit id="_0_is_already_present"> <source>{0} is already present.</source> <target state="translated">{0} ist bereits vorhanden.</target> <note /> </trans-unit> <trans-unit id="The_specified_document_is_not_a_version_of_this_document"> <source>The specified document is not a version of this document.</source> <target state="translated">Das angegebene Dokument ist keine Version dieses Dokuments.</target> <note /> </trans-unit> <trans-unit id="The_language_0_is_not_supported"> <source>The language '{0}' is not supported.</source> <target state="translated">Die Sprache "{0}" wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="The_solution_already_contains_the_specified_project"> <source>The solution already contains the specified project.</source> <target state="translated">Die Lösung enthält bereits das angegebene Projekt.</target> <note /> </trans-unit> <trans-unit id="The_solution_does_not_contain_the_specified_project"> <source>The solution does not contain the specified project.</source> <target state="translated">Lösung enthält nicht das angegebene Projekt.</target> <note /> </trans-unit> <trans-unit id="The_project_already_references_the_target_project"> <source>The project already references the target project.</source> <target state="translated">Das Projekt verweist bereits auf das Zielprojekt.</target> <note /> </trans-unit> <trans-unit id="The_solution_already_contains_the_specified_document"> <source>The solution already contains the specified document.</source> <target state="translated">Die Lösung enthält bereits das angegebene Dokument.</target> <note /> </trans-unit> <trans-unit id="Temporary_storage_cannot_be_written_more_than_once"> <source>Temporary storage cannot be written more than once.</source> <target state="translated">Temporärer Speicher kann nicht mehr als einmal geschrieben werden.</target> <note /> </trans-unit> <trans-unit id="_0_is_not_open"> <source>'{0}' is not open.</source> <target state="translated">"{0}" ist nicht geöffnet.</target> <note /> </trans-unit> <trans-unit id="A_language_name_cannot_be_specified_for_this_option"> <source>A language name cannot be specified for this option.</source> <target state="translated">Für diese Option kann kein Sprachenname angegeben werden.</target> <note /> </trans-unit> <trans-unit id="A_language_name_must_be_specified_for_this_option"> <source>A language name must be specified for this option.</source> <target state="translated">Für diese Option muss ein Sprachenname angegeben werden.</target> <note /> </trans-unit> <trans-unit id="File_was_externally_modified_colon_0"> <source>File was externally modified: {0}.</source> <target state="translated">Datei wurde extern modifiziert: {0}.</target> <note /> </trans-unit> <trans-unit id="Unrecognized_language_name"> <source>Unrecognized language name.</source> <target state="translated">Unerkannter Sprachenname.</target> <note /> </trans-unit> <trans-unit id="Can_t_resolve_metadata_reference_colon_0"> <source>Can't resolve metadata reference: '{0}'.</source> <target state="translated">Metadatenreferenz kann nicht aufgelöst werden: "{0}".</target> <note /> </trans-unit> <trans-unit id="Can_t_resolve_analyzer_reference_colon_0"> <source>Can't resolve analyzer reference: '{0}'.</source> <target state="translated">Analysereferenz kann nicht aufgelöst werden: "{0}".</target> <note /> </trans-unit> <trans-unit id="Invalid_project_block_expected_after_Project"> <source>Invalid project block, expected "=" after Project.</source> <target state="translated">Ungültiger Projektblock, erwartet wird "=" nach Projekt.</target> <note /> </trans-unit> <trans-unit id="Invalid_project_block_expected_after_project_name"> <source>Invalid project block, expected "," after project name.</source> <target state="translated">Ungültiger Projektblock, erwartet wird "," nach Projektname.</target> <note /> </trans-unit> <trans-unit id="Invalid_project_block_expected_after_project_path"> <source>Invalid project block, expected "," after project path.</source> <target state="translated">Ungültiger Projektblock, erwartet wird "," nach Projektpfad.</target> <note /> </trans-unit> <trans-unit id="Expected_0"> <source>Expected {0}.</source> <target state="translated">Erwartet wird {0}.</target> <note /> </trans-unit> <trans-unit id="_0_must_be_a_non_null_and_non_empty_string"> <source>"{0}" must be a non-null and non-empty string.</source> <target state="translated">"{0}" muss eine Zeichenfolge sein, die nicht null und nicht leer ist.</target> <note /> </trans-unit> <trans-unit id="Expected_header_colon_0"> <source>Expected header: "{0}".</source> <target state="translated">Erwartete Überschrift: "{0}".</target> <note /> </trans-unit> <trans-unit id="Expected_end_of_file"> <source>Expected end-of-file.</source> <target state="translated">Erwartetes Dateiende.</target> <note /> </trans-unit> <trans-unit id="Expected_0_line"> <source>Expected {0} line.</source> <target state="translated">Erwartete {0}-Zeile.</target> <note /> </trans-unit> <trans-unit id="This_submission_already_references_another_submission_project"> <source>This submission already references another submission project.</source> <target state="translated">Diese Übermittlung verweist bereits auf ein anderes Übermittlungsprojekt.</target> <note /> </trans-unit> <trans-unit id="_0_still_contains_open_documents"> <source>{0} still contains open documents.</source> <target state="translated">{0} enthält noch offene Dokumente.</target> <note /> </trans-unit> <trans-unit id="_0_is_still_open"> <source>{0} is still open.</source> <target state="translated">"{0}" ist noch geöffnet.</target> <note /> </trans-unit> <trans-unit id="Arrays_with_more_than_one_dimension_cannot_be_serialized"> <source>Arrays with more than one dimension cannot be serialized.</source> <target state="translated">Arrays mit mehr als einer Dimension können nicht serialisiert werden.</target> <note /> </trans-unit> <trans-unit id="Value_too_large_to_be_represented_as_a_30_bit_unsigned_integer"> <source>Value too large to be represented as a 30 bit unsigned integer.</source> <target state="translated">Der Wert ist zu groß, um als ganze 30-Bit-Zahl ohne Vorzeichen dargestellt zu werden.</target> <note /> </trans-unit> <trans-unit id="Specified_path_must_be_absolute"> <source>Specified path must be absolute.</source> <target state="translated">Angegebener Pfad muss absolut sein.</target> <note /> </trans-unit> <trans-unit id="Name_can_be_simplified"> <source>Name can be simplified.</source> <target state="translated">Der Name kann vereinfacht werden.</target> <note /> </trans-unit> <trans-unit id="Unknown_identifier"> <source>Unknown identifier.</source> <target state="translated">Unbekannter Bezeichner.</target> <note /> </trans-unit> <trans-unit id="Cannot_generate_code_for_unsupported_operator_0"> <source>Cannot generate code for unsupported operator '{0}'</source> <target state="translated">Kann keinen Code für nicht unterstützten Operator "{0}" generieren</target> <note /> </trans-unit> <trans-unit id="Invalid_number_of_parameters_for_binary_operator"> <source>Invalid number of parameters for binary operator.</source> <target state="translated">Ungültige Parameteranzahl für binären Operator.</target> <note /> </trans-unit> <trans-unit id="Invalid_number_of_parameters_for_unary_operator"> <source>Invalid number of parameters for unary operator.</source> <target state="translated">Ungültige Parameteranzahl für unären Operator.</target> <note /> </trans-unit> <trans-unit id="Cannot_open_project_0_because_the_file_extension_1_is_not_associated_with_a_language"> <source>Cannot open project '{0}' because the file extension '{1}' is not associated with a language.</source> <target state="translated">Projekt "{0}" kann nicht geöffnet werden, da die Dateierweiterung "{1}" keiner Sprache zugeordnet ist.</target> <note /> </trans-unit> <trans-unit id="Cannot_open_project_0_because_the_language_1_is_not_supported"> <source>Cannot open project '{0}' because the language '{1}' is not supported.</source> <target state="translated">Projekt "{0}" kann nicht geöffnet werden, da die Sprache "{1}" nicht unterstützt wird.</target> <note /> </trans-unit> <trans-unit id="Invalid_project_file_path_colon_0"> <source>Invalid project file path: '{0}'</source> <target state="translated">Ungültiger Projektdateipfad: "{0}"</target> <note /> </trans-unit> <trans-unit id="Invalid_solution_file_path_colon_0"> <source>Invalid solution file path: '{0}'</source> <target state="translated">Ungültiger Lösungsdateipfad: "{0}"</target> <note /> </trans-unit> <trans-unit id="Project_file_not_found_colon_0"> <source>Project file not found: '{0}'</source> <target state="translated">Projektdatei nicht gefunden: "{0}"</target> <note /> </trans-unit> <trans-unit id="Solution_file_not_found_colon_0"> <source>Solution file not found: '{0}'</source> <target state="translated">Lösungsdatei nicht gefunden: "{0}"</target> <note /> </trans-unit> <trans-unit id="Unmerged_change_from_project_0"> <source>Unmerged change from project '{0}'</source> <target state="translated">Nicht gemergte Änderung aus Projekt "{0}"</target> <note /> </trans-unit> <trans-unit id="Added_colon"> <source>Added:</source> <target state="translated">Hinzugefügt:</target> <note /> </trans-unit> <trans-unit id="After_colon"> <source>After:</source> <target state="translated">Nach:</target> <note /> </trans-unit> <trans-unit id="Before_colon"> <source>Before:</source> <target state="translated">Vor:</target> <note /> </trans-unit> <trans-unit id="Removed_colon"> <source>Removed:</source> <target state="translated">Entfernt:</target> <note /> </trans-unit> <trans-unit id="Invalid_CodePage_value_colon_0"> <source>Invalid CodePage value: {0}</source> <target state="translated">Ungültiger CodePage-Wert: {0}</target> <note /> </trans-unit> <trans-unit id="Adding_additional_documents_is_not_supported"> <source>Adding additional documents is not supported.</source> <target state="translated">Das Hinzufügen weitere Dokumente wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Adding_analyzer_references_is_not_supported"> <source>Adding analyzer references is not supported.</source> <target state="translated">Das Hinzufügen von Verweisen der Analyse wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Adding_documents_is_not_supported"> <source>Adding documents is not supported.</source> <target state="translated">Das Hinzufügen von Dokumenten wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Adding_metadata_references_is_not_supported"> <source>Adding metadata references is not supported.</source> <target state="translated">Das Hinzufügen von Verweisen auf Metadaten wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Adding_project_references_is_not_supported"> <source>Adding project references is not supported.</source> <target state="translated">Das Hinzufügen von Projektverweisen wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Changing_additional_documents_is_not_supported"> <source>Changing additional documents is not supported.</source> <target state="translated">Das Ändern weiterer Dokumente wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Changing_documents_is_not_supported"> <source>Changing documents is not supported.</source> <target state="translated">Das Ändern von Dokumenten wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Changing_project_properties_is_not_supported"> <source>Changing project properties is not supported.</source> <target state="translated">Das Ändern von Projekteigenschaften wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Removing_additional_documents_is_not_supported"> <source>Removing additional documents is not supported.</source> <target state="translated">Das Entfernen weiterer Dokumente wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Removing_analyzer_references_is_not_supported"> <source>Removing analyzer references is not supported.</source> <target state="translated">Das Entfernen von Verweisen der Analyse wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Removing_documents_is_not_supported"> <source>Removing documents is not supported.</source> <target state="translated">Das Entfernen von Dokumenten wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Removing_metadata_references_is_not_supported"> <source>Removing metadata references is not supported.</source> <target state="translated">Das Entfernen von Verweisen auf Metadaten wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Removing_project_references_is_not_supported"> <source>Removing project references is not supported.</source> <target state="translated">Das Entfernen von Projektverweisen wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Service_of_type_0_is_required_to_accomplish_the_task_but_is_not_available_from_the_workspace"> <source>Service of type '{0}' is required to accomplish the task but is not available from the workspace.</source> <target state="translated">Ein Dienst vom Typ "{0}" ist zum Ausführen der Aufgabe erforderlich, steht aber im Arbeitsbereich nicht zur Verfügung.</target> <note /> </trans-unit> <trans-unit id="At_least_one_diagnostic_must_be_supplied"> <source>At least one diagnostic must be supplied.</source> <target state="translated">Es muss mindestens eine Diagnose bereitgestellt sein.</target> <note /> </trans-unit> <trans-unit id="Diagnostic_must_have_span_0"> <source>Diagnostic must have span '{0}'</source> <target state="translated">Diagnose muss den Bereich "{0}" enthalten</target> <note /> </trans-unit> <trans-unit id="Cannot_deserialize_type_0"> <source>Cannot deserialize type '{0}'.</source> <target state="translated">Typ "{0}" kann nicht deserialisiert werden.</target> <note /> </trans-unit> <trans-unit id="Cannot_serialize_type_0"> <source>Cannot serialize type '{0}'.</source> <target state="translated">Typ "{0}" kann nicht serialisiert werden.</target> <note /> </trans-unit> <trans-unit id="The_type_0_is_not_understood_by_the_serialization_binder"> <source>The type '{0}' is not understood by the serialization binder.</source> <target state="translated">Der Typ "{0}" wird vom Serialisierungsbinder nicht verstanden.</target> <note /> </trans-unit> <trans-unit id="Label_for_node_0_is_invalid_it_must_be_within_bracket_0_1"> <source>Label for node '{0}' is invalid, it must be within [0, {1}).</source> <target state="translated">Die Bezeichnung für Knoten '{0}' ist ungültig, sie muss innerhalb von [0, {1}) liegen.</target> <note /> </trans-unit> <trans-unit id="Matching_nodes_0_and_1_must_have_the_same_label"> <source>Matching nodes '{0}' and '{1}' must have the same label.</source> <target state="translated">Die übereinstimmenden Knoten '{0}' und '{1}' müssen dieselbe Bezeichnung aufweisen.</target> <note /> </trans-unit> <trans-unit id="Node_0_must_be_contained_in_the_new_tree"> <source>Node '{0}' must be contained in the new tree.</source> <target state="translated">Der Knoten '{0}' muss im neuen Baum enthalten sein.</target> <note /> </trans-unit> <trans-unit id="Node_0_must_be_contained_in_the_old_tree"> <source>Node '{0}' must be contained in the old tree.</source> <target state="translated">Der Knoten '{0}' muss im alten Baum enthalten sein.</target> <note /> </trans-unit> <trans-unit id="The_member_0_is_not_declared_within_the_declaration_of_the_symbol"> <source>The member '{0}' is not declared within the declaration of the symbol.</source> <target state="translated">Der Member '{0}' wird nicht innerhalb der Deklaration des Symbols deklariert.</target> <note /> </trans-unit> <trans-unit id="The_position_is_not_within_the_symbol_s_declaration"> <source>The position is not within the symbol's declaration</source> <target state="translated">Die Position liegt nicht innerhalb der Deklaration des Symbols.</target> <note /> </trans-unit> <trans-unit id="The_symbol_0_cannot_be_located_within_the_current_solution"> <source>The symbol '{0}' cannot be located within the current solution.</source> <target state="translated">Das Symbol '{0}' kann nicht in die aktuelle Projektmappe geladen werden.</target> <note /> </trans-unit> <trans-unit id="Changing_compilation_options_is_not_supported"> <source>Changing compilation options is not supported.</source> <target state="translated">Das Ändern von Kompilierungsoptionen wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Changing_parse_options_is_not_supported"> <source>Changing parse options is not supported.</source> <target state="translated">Das Ändern von Analyseoptionen wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="The_node_is_not_part_of_the_tree"> <source>The node is not part of the tree.</source> <target state="translated">Dieser Knoten ist nicht Teil des Baums.</target> <note /> </trans-unit> <trans-unit id="This_workspace_does_not_support_opening_and_closing_documents"> <source>This workspace does not support opening and closing documents.</source> <target state="translated">Das Öffnen und Schließen von Dokumenten wird in diesem Arbeitsbereich nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="Exceptions_colon"> <source>Exceptions:</source> <target state="translated">Ausnahmen:</target> <note /> </trans-unit> <trans-unit id="_0_returned_an_uninitialized_ImmutableArray"> <source>'{0}' returned an uninitialized ImmutableArray</source> <target state="translated">"{0}" hat ein nicht initialisiertes "ImmutableArray" zurückgegeben.</target> <note /> </trans-unit> <trans-unit id="Failure"> <source>Failure</source> <target state="translated">Fehler</target> <note /> </trans-unit> <trans-unit id="Warning"> <source>Warning</source> <target state="translated">Warnung</target> <note /> </trans-unit> <trans-unit id="Enable"> <source>Enable</source> <target state="translated">Aktivieren</target> <note /> </trans-unit> <trans-unit id="Enable_and_ignore_future_errors"> <source>Enable and ignore future errors</source> <target state="translated">Aktivieren und weitere Fehler ignorieren</target> <note /> </trans-unit> <trans-unit id="_0_encountered_an_error_and_has_been_disabled"> <source>'{0}' encountered an error and has been disabled.</source> <target state="translated">"{0}" hat einen Fehler festgestellt und wurde deaktiviert.</target> <note /> </trans-unit> <trans-unit id="Show_Stack_Trace"> <source>Show Stack Trace</source> <target state="translated">Stapelüberwachung anzeigen</target> <note /> </trans-unit> <trans-unit id="Stream_is_too_long"> <source>Stream is too long.</source> <target state="translated">Der Datenstrom ist zu lang.</target> <note /> </trans-unit> <trans-unit id="Deserialization_reader_for_0_read_incorrect_number_of_values"> <source>Deserialization reader for '{0}' read incorrect number of values.</source> <target state="translated">Der Deserialisierungsreader für "{0}" hat eine falsche Anzahl von Werten gelesen.</target> <note /> </trans-unit> <trans-unit id="Async_Method"> <source>Async Method</source> <target state="translated">Asynchrone Methode</target> <note>{locked: async}{locked: method} These are keywords (unless the order of words or capitalization should be handled differently)</note> </trans-unit> <trans-unit id="Error"> <source>Error</source> <target state="translated">Fehler</target> <note /> </trans-unit> <trans-unit id="None"> <source>None</source> <target state="translated">NONE</target> <note /> </trans-unit> <trans-unit id="Suggestion"> <source>Suggestion</source> <target state="translated">Vorschlag</target> <note /> </trans-unit> <trans-unit id="File_0_size_of_1_exceeds_maximum_allowed_size_of_2"> <source>File '{0}' size of {1} exceeds maximum allowed size of {2}</source> <target state="translated">Die Größe der Datei "{0}" beträgt {1} und überschreitet so die maximal zulässige Größe von {2}.</target> <note /> </trans-unit> <trans-unit id="Changing_document_property_is_not_supported"> <source>Changing document properties is not supported</source> <target state="translated">Das Ändern der Dokumenteigenschaften wird nicht unterstützt.</target> <note /> </trans-unit> <trans-unit id="dot_NET_Coding_Conventions"> <source>.NET Coding Conventions</source> <target state="translated">.NET-Codierungskonventionen</target> <note /> </trans-unit> <trans-unit id="Variables_captured_colon"> <source>Variables captured:</source> <target state="translated">Erfasste Variablen:</target> <note /> </trans-unit> </body> </file> </xliff>
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/AttributeArgumentSyntaxExtensions.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Linq; using System.Threading; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.CSharp.Extensions { internal static class AttributeArgumentSyntaxExtensions { /// <summary> /// Returns the parameter to which this argument is passed. If <paramref name="allowParams"/> /// is true, the last parameter will be returned if it is params parameter and the index of /// the specified argument is greater than the number of parameters. /// </summary> /// <remarks> /// Returns null if the <paramref name="argument"/> is a named argument. /// </remarks> public static IParameterSymbol DetermineParameter( this AttributeArgumentSyntax argument, SemanticModel semanticModel, bool allowParams = false, CancellationToken cancellationToken = default) { // if argument is a named argument it can't map to a parameter. if (argument.NameEquals != null) { return null; } if (argument.Parent is not AttributeArgumentListSyntax argumentList) { return null; } if (argumentList.Parent is not AttributeSyntax invocableExpression) { return null; } var symbol = semanticModel.GetSymbolInfo(invocableExpression, cancellationToken).Symbol; if (symbol == null) { return null; } var parameters = symbol.GetParameters(); // Handle named argument if (argument.NameColon != null && !argument.NameColon.IsMissing) { var name = argument.NameColon.Name.Identifier.ValueText; return parameters.FirstOrDefault(p => p.Name == name); } // Handle positional argument var index = argumentList.Arguments.IndexOf(argument); if (index < 0) { return null; } if (index < parameters.Length) { return parameters[index]; } if (allowParams) { var lastParameter = parameters.LastOrDefault(); if (lastParameter == null) { return null; } if (lastParameter.IsParams) { return lastParameter; } } return null; } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Linq; using System.Threading; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.CSharp.Extensions { internal static class AttributeArgumentSyntaxExtensions { /// <summary> /// Returns the parameter to which this argument is passed. If <paramref name="allowParams"/> /// is true, the last parameter will be returned if it is params parameter and the index of /// the specified argument is greater than the number of parameters. /// </summary> /// <remarks> /// Returns null if the <paramref name="argument"/> is a named argument. /// </remarks> public static IParameterSymbol DetermineParameter( this AttributeArgumentSyntax argument, SemanticModel semanticModel, bool allowParams = false, CancellationToken cancellationToken = default) { // if argument is a named argument it can't map to a parameter. if (argument.NameEquals != null) { return null; } if (argument.Parent is not AttributeArgumentListSyntax argumentList) { return null; } if (argumentList.Parent is not AttributeSyntax invocableExpression) { return null; } var symbol = semanticModel.GetSymbolInfo(invocableExpression, cancellationToken).Symbol; if (symbol == null) { return null; } var parameters = symbol.GetParameters(); // Handle named argument if (argument.NameColon != null && !argument.NameColon.IsMissing) { var name = argument.NameColon.Name.Identifier.ValueText; return parameters.FirstOrDefault(p => p.Name == name); } // Handle positional argument var index = argumentList.Arguments.IndexOf(argument); if (index < 0) { return null; } if (index < parameters.Length) { return parameters[index]; } if (allowParams) { var lastParameter = parameters.LastOrDefault(); if (lastParameter == null) { return null; } if (lastParameter.IsParams) { return lastParameter; } } return null; } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Compilers/VisualBasic/Portable/BoundTree/BoundLateBoundArgumentSupportingAssignmentWithCapture.vb
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports Microsoft.CodeAnalysis.Text Imports Microsoft.CodeAnalysis.VisualBasic.Symbols Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Namespace Microsoft.CodeAnalysis.VisualBasic Partial Friend Class BoundLateBoundArgumentSupportingAssignmentWithCapture #If DEBUG Then Private Sub Validate() Debug.Assert(OriginalArgument.Kind <> BoundKind.LateBoundArgumentSupportingAssignmentWithCapture) Debug.Assert(OriginalArgument.IsSupportingAssignment()) End Sub #End If End Class End Namespace
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports Microsoft.CodeAnalysis.Text Imports Microsoft.CodeAnalysis.VisualBasic.Symbols Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Namespace Microsoft.CodeAnalysis.VisualBasic Partial Friend Class BoundLateBoundArgumentSupportingAssignmentWithCapture #If DEBUG Then Private Sub Validate() Debug.Assert(OriginalArgument.Kind <> BoundKind.LateBoundArgumentSupportingAssignmentWithCapture) Debug.Assert(OriginalArgument.IsSupportingAssignment()) End Sub #End If End Class End Namespace
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Compilers/Core/CodeAnalysisTest/Diagnostics/SarifErrorLoggerTests.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using Microsoft.CodeAnalysis.Text; using Roslyn.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.UnitTests.Diagnostics { public abstract class SarifErrorLoggerTests { internal abstract SarifErrorLogger CreateLogger( Stream stream, string toolName, string toolFileVersion, Version toolAssemblyVersion, CultureInfo culture); protected abstract string ExpectedOutputForAdditionalLocationsAsRelatedLocations { get; } protected abstract string ExpectedOutputForDescriptorIdCollision { get; } public void AdditionalLocationsAsRelatedLocationsImpl() { var stream = new MemoryStream(); using (var logger = CreateLogger(stream, "toolName", "1.2.3.4 for Windows", new Version(1, 2, 3, 4), new CultureInfo("fr-CA", useUserOverride: false))) { var span = new TextSpan(0, 0); var position = new LinePositionSpan(LinePosition.Zero, LinePosition.Zero); var mainLocation = Location.Create(@"Z:\Main Location.cs", span, position); var descriptor = new DiagnosticDescriptor("TST", "_TST_", "", "", DiagnosticSeverity.Error, false); IEnumerable<Location> additionalLocations = new[] { Location.Create(@"Relative Additional/Location.cs", span, position), }; logger.LogDiagnostic(Diagnostic.Create(descriptor, mainLocation, additionalLocations), null); } string actual = Encoding.UTF8.GetString(stream.ToArray()); Assert.Equal(ExpectedOutputForAdditionalLocationsAsRelatedLocations, actual); } public void DescriptorIdCollisionImpl() { var descriptors = new[] { // Toughest case: generation of TST001-001 collides with actual TST001-001 and must be bumped to TST001-002 new DiagnosticDescriptor("TST001-001", "_TST001-001_", "", "", DiagnosticSeverity.Warning, true), new DiagnosticDescriptor("TST001", "_TST001_", "", "", DiagnosticSeverity.Warning, true), new DiagnosticDescriptor("TST001", "_TST001-002_", "", "", DiagnosticSeverity.Warning, true), new DiagnosticDescriptor("TST001", "_TST001-003_", "", "", DiagnosticSeverity.Warning, true), // Descriptors with same values should not get distinct entries in log new DiagnosticDescriptor("TST002", "", "", "", DiagnosticSeverity.Warning, true), new DiagnosticDescriptor("TST002", "", "", "", DiagnosticSeverity.Warning, true), // Changing only the message format (which we do not write out) should not produce a distinct entry in log. new DiagnosticDescriptor("TST002", "", "messageFormat", "", DiagnosticSeverity.Warning, true), // Changing any property that we do write out should create a distinct entry new DiagnosticDescriptor("TST002", "title_001", "", "", DiagnosticSeverity.Warning, true), new DiagnosticDescriptor("TST002", "", "", "category_002", DiagnosticSeverity.Warning, true), new DiagnosticDescriptor("TST002", "", "", "", DiagnosticSeverity.Error /*003*/, true), new DiagnosticDescriptor("TST002", "", "", "", DiagnosticSeverity.Warning, isEnabledByDefault: false /*004*/), new DiagnosticDescriptor("TST002", "", "", "", DiagnosticSeverity.Warning, true, "description_005"), }; var stream = new MemoryStream(); using (var logger = CreateLogger(stream, "toolName", "1.2.3.4 for Windows", new Version(1, 2, 3, 4), new CultureInfo("en-US", useUserOverride: false))) { for (int i = 0; i < 2; i++) { foreach (var descriptor in descriptors) { logger.LogDiagnostic(Diagnostic.Create(descriptor, Location.None), null); } } } string actual = Encoding.UTF8.GetString(stream.ToArray()); Assert.Equal(ExpectedOutputForDescriptorIdCollision, actual); } protected void PathToUriImpl(string formatString) { var isUnix = PathUtilities.IsUnixLikePlatform; var paths = new[] { (@"A:\B\C\\..\D.cs", isUnix ? @"A:/B/C/D.cs" : "file:///A:/B/D.cs"), (@"A\B\C\\..\D.cs", isUnix ? @"A%5CB%5CC%5C%5C..%5CD.cs" : @"A/B/D.cs") }; foreach (var (inputPath, outputPath) in paths) { var stream = new MemoryStream(); using (var logger = CreateLogger( stream, toolName: "", toolFileVersion: "", toolAssemblyVersion: Version.Parse("1.0.0"), CultureInfo.InvariantCulture)) { var location = Location.Create( inputPath, textSpan: default, lineSpan: default); logger.LogDiagnostic(Diagnostic.Create( "uriDiagnostic", category: "", message: "blank diagnostic", DiagnosticSeverity.Warning, DiagnosticSeverity.Warning, isEnabledByDefault: true, warningLevel: 3, location: location), null); } var buffer = stream.ToArray(); Assert.Equal( string.Format(formatString, outputPath), Encoding.UTF8.GetString(buffer, 0, buffer.Length), ignoreLineEndingDifferences: true, ignoreWhiteSpaceDifferences: true); } } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using Microsoft.CodeAnalysis.Text; using Roslyn.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.UnitTests.Diagnostics { public abstract class SarifErrorLoggerTests { internal abstract SarifErrorLogger CreateLogger( Stream stream, string toolName, string toolFileVersion, Version toolAssemblyVersion, CultureInfo culture); protected abstract string ExpectedOutputForAdditionalLocationsAsRelatedLocations { get; } protected abstract string ExpectedOutputForDescriptorIdCollision { get; } public void AdditionalLocationsAsRelatedLocationsImpl() { var stream = new MemoryStream(); using (var logger = CreateLogger(stream, "toolName", "1.2.3.4 for Windows", new Version(1, 2, 3, 4), new CultureInfo("fr-CA", useUserOverride: false))) { var span = new TextSpan(0, 0); var position = new LinePositionSpan(LinePosition.Zero, LinePosition.Zero); var mainLocation = Location.Create(@"Z:\Main Location.cs", span, position); var descriptor = new DiagnosticDescriptor("TST", "_TST_", "", "", DiagnosticSeverity.Error, false); IEnumerable<Location> additionalLocations = new[] { Location.Create(@"Relative Additional/Location.cs", span, position), }; logger.LogDiagnostic(Diagnostic.Create(descriptor, mainLocation, additionalLocations), null); } string actual = Encoding.UTF8.GetString(stream.ToArray()); Assert.Equal(ExpectedOutputForAdditionalLocationsAsRelatedLocations, actual); } public void DescriptorIdCollisionImpl() { var descriptors = new[] { // Toughest case: generation of TST001-001 collides with actual TST001-001 and must be bumped to TST001-002 new DiagnosticDescriptor("TST001-001", "_TST001-001_", "", "", DiagnosticSeverity.Warning, true), new DiagnosticDescriptor("TST001", "_TST001_", "", "", DiagnosticSeverity.Warning, true), new DiagnosticDescriptor("TST001", "_TST001-002_", "", "", DiagnosticSeverity.Warning, true), new DiagnosticDescriptor("TST001", "_TST001-003_", "", "", DiagnosticSeverity.Warning, true), // Descriptors with same values should not get distinct entries in log new DiagnosticDescriptor("TST002", "", "", "", DiagnosticSeverity.Warning, true), new DiagnosticDescriptor("TST002", "", "", "", DiagnosticSeverity.Warning, true), // Changing only the message format (which we do not write out) should not produce a distinct entry in log. new DiagnosticDescriptor("TST002", "", "messageFormat", "", DiagnosticSeverity.Warning, true), // Changing any property that we do write out should create a distinct entry new DiagnosticDescriptor("TST002", "title_001", "", "", DiagnosticSeverity.Warning, true), new DiagnosticDescriptor("TST002", "", "", "category_002", DiagnosticSeverity.Warning, true), new DiagnosticDescriptor("TST002", "", "", "", DiagnosticSeverity.Error /*003*/, true), new DiagnosticDescriptor("TST002", "", "", "", DiagnosticSeverity.Warning, isEnabledByDefault: false /*004*/), new DiagnosticDescriptor("TST002", "", "", "", DiagnosticSeverity.Warning, true, "description_005"), }; var stream = new MemoryStream(); using (var logger = CreateLogger(stream, "toolName", "1.2.3.4 for Windows", new Version(1, 2, 3, 4), new CultureInfo("en-US", useUserOverride: false))) { for (int i = 0; i < 2; i++) { foreach (var descriptor in descriptors) { logger.LogDiagnostic(Diagnostic.Create(descriptor, Location.None), null); } } } string actual = Encoding.UTF8.GetString(stream.ToArray()); Assert.Equal(ExpectedOutputForDescriptorIdCollision, actual); } protected void PathToUriImpl(string formatString) { var isUnix = PathUtilities.IsUnixLikePlatform; var paths = new[] { (@"A:\B\C\\..\D.cs", isUnix ? @"A:/B/C/D.cs" : "file:///A:/B/D.cs"), (@"A\B\C\\..\D.cs", isUnix ? @"A%5CB%5CC%5C%5C..%5CD.cs" : @"A/B/D.cs") }; foreach (var (inputPath, outputPath) in paths) { var stream = new MemoryStream(); using (var logger = CreateLogger( stream, toolName: "", toolFileVersion: "", toolAssemblyVersion: Version.Parse("1.0.0"), CultureInfo.InvariantCulture)) { var location = Location.Create( inputPath, textSpan: default, lineSpan: default); logger.LogDiagnostic(Diagnostic.Create( "uriDiagnostic", category: "", message: "blank diagnostic", DiagnosticSeverity.Warning, DiagnosticSeverity.Warning, isEnabledByDefault: true, warningLevel: 3, location: location), null); } var buffer = stream.ToArray(); Assert.Equal( string.Format(formatString, outputPath), Encoding.UTF8.GetString(buffer, 0, buffer.Length), ignoreLineEndingDifferences: true, ignoreWhiteSpaceDifferences: true); } } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Compilers/CSharp/Test/IOperation/IOperation/IOperationTests_IDynamicObjectCreationExpression.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Test.Utilities; using Roslyn.Test.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.CSharp.UnitTests { public class IOperationTests_IDynamicObjectCreationExpression : SemanticModelTestBase { [CompilerTrait(CompilerFeature.IOperation)] [Fact] public void DynamicObjectCreation_DynamicArgument() { string source = @" class C { public C(int i) { } void M(dynamic d) { var x = /*<bind>*/new C(d)/*</bind>*/; } } "; string expectedOperationTree = @" IDynamicObjectCreationOperation (OperationKind.DynamicObjectCreation, Type: C) (Syntax: 'new C(d)') Arguments(1): IParameterReferenceOperation: d (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'd') ArgumentNames(0) ArgumentRefKinds(0) Initializer: null "; var expectedDiagnostics = DiagnosticDescription.None; VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics); } [CompilerTrait(CompilerFeature.IOperation)] [Fact] public void DynamicObjectCreation_MultipleApplicableSymbols() { string source = @" class C { public C(int i) { } public C(long i) { } void M(dynamic d) { var x = /*<bind>*/new C(d)/*</bind>*/; } } "; string expectedOperationTree = @" IDynamicObjectCreationOperation (OperationKind.DynamicObjectCreation, Type: C) (Syntax: 'new C(d)') Arguments(1): IParameterReferenceOperation: d (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'd') ArgumentNames(0) ArgumentRefKinds(0) Initializer: null "; var expectedDiagnostics = DiagnosticDescription.None; VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics); } [CompilerTrait(CompilerFeature.IOperation)] [Fact] public void DynamicObjectCreation_MultipleArgumentsAndApplicableSymbols() { string source = @" class C { public C(int i, char c) { } public C(long i, char c) { } void M(dynamic d) { char c = 'c'; var x = /*<bind>*/new C(d, c)/*</bind>*/; } } "; string expectedOperationTree = @" IDynamicObjectCreationOperation (OperationKind.DynamicObjectCreation, Type: C) (Syntax: 'new C(d, c)') Arguments(2): IParameterReferenceOperation: d (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'd') ILocalReferenceOperation: c (OperationKind.LocalReference, Type: System.Char) (Syntax: 'c') ArgumentNames(0) ArgumentRefKinds(0) Initializer: null "; var expectedDiagnostics = DiagnosticDescription.None; VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics); } [CompilerTrait(CompilerFeature.IOperation)] [Fact] public void DynamicObjectCreation_ArgumentNames() { string source = @" class C { public C(int i, char c) { } public C(long i, char c) { } void M(dynamic d, dynamic e) { var x = /*<bind>*/new C(i: d, c: e)/*</bind>*/; } } "; string expectedOperationTree = @" IDynamicObjectCreationOperation (OperationKind.DynamicObjectCreation, Type: C) (Syntax: 'new C(i: d, c: e)') Arguments(2): IParameterReferenceOperation: d (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'd') IParameterReferenceOperation: e (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'e') ArgumentNames(2): ""i"" ""c"" ArgumentRefKinds(0) Initializer: null "; var expectedDiagnostics = DiagnosticDescription.None; VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics); } [CompilerTrait(CompilerFeature.IOperation)] [Fact] public void DynamicObjectCreation_ArgumentRefKinds() { string source = @" class C { public C(ref object i, out int j, char c) { j = 0; } void M(object d, dynamic e) { int k; var x = /*<bind>*/new C(ref d, out k, e)/*</bind>*/; } } "; string expectedOperationTree = @" IDynamicObjectCreationOperation (OperationKind.DynamicObjectCreation, Type: C) (Syntax: 'new C(ref d, out k, e)') Arguments(3): IParameterReferenceOperation: d (OperationKind.ParameterReference, Type: System.Object) (Syntax: 'd') ILocalReferenceOperation: k (OperationKind.LocalReference, Type: System.Int32) (Syntax: 'k') IParameterReferenceOperation: e (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'e') ArgumentNames(0) ArgumentRefKinds(3): Ref Out None Initializer: null "; var expectedDiagnostics = DiagnosticDescription.None; VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics); } [CompilerTrait(CompilerFeature.IOperation)] [Fact] public void DynamicObjectCreation_Initializer() { string source = @" class C { public int X; public C(char c) { } void M(dynamic d) { var x = /*<bind>*/new C(d) { X = 0 }/*</bind>*/; } } "; string expectedOperationTree = @" IDynamicObjectCreationOperation (OperationKind.DynamicObjectCreation, Type: C) (Syntax: 'new C(d) { X = 0 }') Arguments(1): IParameterReferenceOperation: d (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'd') ArgumentNames(0) ArgumentRefKinds(0) Initializer: IObjectOrCollectionInitializerOperation (OperationKind.ObjectOrCollectionInitializer, Type: C) (Syntax: '{ X = 0 }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32) (Syntax: 'X = 0') Left: IFieldReferenceOperation: System.Int32 C.X (OperationKind.FieldReference, Type: System.Int32) (Syntax: 'X') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: C, IsImplicit) (Syntax: 'X') Right: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 0) (Syntax: '0') "; var expectedDiagnostics = DiagnosticDescription.None; VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics); } [CompilerTrait(CompilerFeature.IOperation)] [Fact] public void DynamicObjectCreation_AllFields() { string source = @" class C { public int X; public C(ref int i, char c) { } public C(ref int i, long c) { } void M(dynamic d) { int i = 0; var x = /*<bind>*/new C(ref i, c: d) { X = 0 }/*</bind>*/; } } "; string expectedOperationTree = @" IDynamicObjectCreationOperation (OperationKind.DynamicObjectCreation, Type: C) (Syntax: 'new C(ref i ... ) { X = 0 }') Arguments(2): ILocalReferenceOperation: i (OperationKind.LocalReference, Type: System.Int32) (Syntax: 'i') IParameterReferenceOperation: d (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'd') ArgumentNames(2): ""null"" ""c"" ArgumentRefKinds(2): Ref None Initializer: IObjectOrCollectionInitializerOperation (OperationKind.ObjectOrCollectionInitializer, Type: C) (Syntax: '{ X = 0 }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32) (Syntax: 'X = 0') Left: IFieldReferenceOperation: System.Int32 C.X (OperationKind.FieldReference, Type: System.Int32) (Syntax: 'X') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: C, IsImplicit) (Syntax: 'X') Right: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 0) (Syntax: '0') "; var expectedDiagnostics = DiagnosticDescription.None; VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics); } [CompilerTrait(CompilerFeature.IOperation)] [Fact] public void DynamicObjectCreation_ErrorBadDynamicMethodArgLambda() { string source = @" using System; class C { static void Main() { dynamic y = null; /*<bind>*/new C(delegate { }, y)/*</bind>*/; } public C(Action a, Action y) { } } "; string expectedOperationTree = @" IDynamicObjectCreationOperation (OperationKind.DynamicObjectCreation, Type: C, IsInvalid) (Syntax: 'new C(delegate { }, y)') Arguments(2): IAnonymousFunctionOperation (Symbol: lambda expression) (OperationKind.AnonymousFunction, Type: null, IsInvalid) (Syntax: 'delegate { }') IBlockOperation (1 statements) (OperationKind.Block, Type: null, IsInvalid) (Syntax: '{ }') IReturnOperation (OperationKind.Return, Type: null, IsInvalid, IsImplicit) (Syntax: '{ }') ReturnedValue: null ILocalReferenceOperation: y (OperationKind.LocalReference, Type: dynamic) (Syntax: 'y') ArgumentNames(0) ArgumentRefKinds(0) Initializer: null "; var expectedDiagnostics = new DiagnosticDescription[] { // CS1977: Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type. // /*<bind>*/new C(delegate { }, y)/*</bind>*/; Diagnostic(ErrorCode.ERR_BadDynamicMethodArgLambda, "delegate { }").WithLocation(9, 25) }; VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics); } [CompilerTrait(CompilerFeature.IOperation)] [Fact] public void DynamicObjectCreation_OVerloadResolutionFailure() { string source = @" class C { public C() { } public C(int i, int j) { } void M(dynamic d) { var x = /*<bind>*/new C(d)/*</bind>*/; } } "; string expectedOperationTree = @" IInvalidOperation (OperationKind.Invalid, Type: C, IsInvalid) (Syntax: 'new C(d)') Children(1): IParameterReferenceOperation: d (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'd') "; var expectedDiagnostics = new DiagnosticDescription[] { // CS7036: There is no argument given that corresponds to the required formal parameter 'j' of 'C.C(int, int)' // var x = /*<bind>*/new C(d)/*</bind>*/; Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "C").WithArguments("j", "C.C(int, int)").WithLocation(14, 31) }; VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics); } [CompilerTrait(CompilerFeature.IOperation, CompilerFeature.Dataflow)] [Fact] public void DynamicObjectCreationFlow_01() { string source = @" class C1 { C1(int i) { } /*<bind>*/void M(C1 c1, dynamic d) { c1 = new C1(d); }/*</bind>*/ } "; var expectedDiagnostics = DiagnosticDescription.None; string expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Block[B1] - Block Predecessors: [B0] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'c1 = new C1(d);') Expression: ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: C1) (Syntax: 'c1 = new C1(d)') Left: IParameterReferenceOperation: c1 (OperationKind.ParameterReference, Type: C1) (Syntax: 'c1') Right: IDynamicObjectCreationOperation (OperationKind.DynamicObjectCreation, Type: C1) (Syntax: 'new C1(d)') Arguments(1): IParameterReferenceOperation: d (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'd') ArgumentNames(0) ArgumentRefKinds(0) Initializer: null Next (Regular) Block[B2] Block[B2] - Exit Predecessors: [B1] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<MethodDeclarationSyntax>(source, expectedFlowGraph, expectedDiagnostics); } [CompilerTrait(CompilerFeature.IOperation, CompilerFeature.Dataflow)] [Fact] public void DynamicObjectCreationFlow_02() { string source = @" class C1 { C1(int i) { } /*<bind>*/void M(C1 c1, dynamic d, bool b) { c1 = new C1(d) { I1 = 1, I2 = b ? 2 : 3 }; }/*</bind>*/ int I1 { get; set; } int I2 { get; set; } } "; var expectedDiagnostics = DiagnosticDescription.None; string expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} .locals {R1} { CaptureIds: [0] [1] Block[B1] - Block Predecessors: [B0] Statements (3) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'c1') Value: IParameterReferenceOperation: c1 (OperationKind.ParameterReference, Type: C1) (Syntax: 'c1') IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'new C1(d) { ... b ? 2 : 3 }') Value: IDynamicObjectCreationOperation (OperationKind.DynamicObjectCreation, Type: C1) (Syntax: 'new C1(d) { ... b ? 2 : 3 }') Arguments(1): IParameterReferenceOperation: d (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'd') ArgumentNames(0) ArgumentRefKinds(0) Initializer: null ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32) (Syntax: 'I1 = 1') Left: IPropertyReferenceOperation: System.Int32 C1.I1 { get; set; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'I1') Instance Receiver: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: C1, IsImplicit) (Syntax: 'new C1(d) { ... b ? 2 : 3 }') Right: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 1) (Syntax: '1') Next (Regular) Block[B2] Entering: {R2} .locals {R2} { CaptureIds: [2] Block[B2] - Block Predecessors: [B1] Statements (0) Jump if False (Regular) to Block[B4] IParameterReferenceOperation: b (OperationKind.ParameterReference, Type: System.Boolean) (Syntax: 'b') Next (Regular) Block[B3] Block[B3] - Block Predecessors: [B2] Statements (1) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '2') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 2) (Syntax: '2') Next (Regular) Block[B5] Block[B4] - Block Predecessors: [B2] Statements (1) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '3') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 3) (Syntax: '3') Next (Regular) Block[B5] Block[B5] - Block Predecessors: [B3] [B4] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32) (Syntax: 'I2 = b ? 2 : 3') Left: IPropertyReferenceOperation: System.Int32 C1.I2 { get; set; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'I2') Instance Receiver: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: C1, IsImplicit) (Syntax: 'new C1(d) { ... b ? 2 : 3 }') Right: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: System.Int32, IsImplicit) (Syntax: 'b ? 2 : 3') Next (Regular) Block[B6] Leaving: {R2} } Block[B6] - Block Predecessors: [B5] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'c1 = new C1 ... ? 2 : 3 };') Expression: ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: C1) (Syntax: 'c1 = new C1 ... b ? 2 : 3 }') Left: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: C1, IsImplicit) (Syntax: 'c1') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: C1, IsImplicit) (Syntax: 'new C1(d) { ... b ? 2 : 3 }') Next (Regular) Block[B7] Leaving: {R1} } Block[B7] - Exit Predecessors: [B6] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<MethodDeclarationSyntax>(source, expectedFlowGraph, expectedDiagnostics); } [CompilerTrait(CompilerFeature.IOperation, CompilerFeature.Dataflow)] [Fact] public void DynamicObjectCreationFlow_03() { string source = @" using System.Collections; using System.Collections.Generic; class C1 : IEnumerable<int> { C1(int i) { } /*<bind>*/void M(C1 c1, dynamic d, bool b) { c1 = new C1(d) { 1, b ? 2 : 3 }; }/*</bind>*/ public IEnumerator<int> GetEnumerator() => throw new System.NotImplementedException(); IEnumerator IEnumerable.GetEnumerator() => throw new System.NotImplementedException(); public void Add(int i) { } } "; var expectedDiagnostics = DiagnosticDescription.None; string expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} .locals {R1} { CaptureIds: [0] [1] Block[B1] - Block Predecessors: [B0] Statements (3) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'c1') Value: IParameterReferenceOperation: c1 (OperationKind.ParameterReference, Type: C1) (Syntax: 'c1') IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'new C1(d) { ... b ? 2 : 3 }') Value: IDynamicObjectCreationOperation (OperationKind.DynamicObjectCreation, Type: C1) (Syntax: 'new C1(d) { ... b ? 2 : 3 }') Arguments(1): IParameterReferenceOperation: d (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'd') ArgumentNames(0) ArgumentRefKinds(0) Initializer: null IInvocationOperation ( void C1.Add(System.Int32 i)) (OperationKind.Invocation, Type: System.Void, IsImplicit) (Syntax: '1') Instance Receiver: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: C1, IsImplicit) (Syntax: 'new C1(d) { ... b ? 2 : 3 }') Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: i) (OperationKind.Argument, Type: null, IsImplicit) (Syntax: '1') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 1) (Syntax: '1') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B2] Entering: {R2} .locals {R2} { CaptureIds: [2] Block[B2] - Block Predecessors: [B1] Statements (0) Jump if False (Regular) to Block[B4] IParameterReferenceOperation: b (OperationKind.ParameterReference, Type: System.Boolean) (Syntax: 'b') Next (Regular) Block[B3] Block[B3] - Block Predecessors: [B2] Statements (1) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '2') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 2) (Syntax: '2') Next (Regular) Block[B5] Block[B4] - Block Predecessors: [B2] Statements (1) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '3') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 3) (Syntax: '3') Next (Regular) Block[B5] Block[B5] - Block Predecessors: [B3] [B4] Statements (1) IInvocationOperation ( void C1.Add(System.Int32 i)) (OperationKind.Invocation, Type: System.Void, IsImplicit) (Syntax: 'b ? 2 : 3') Instance Receiver: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: C1, IsImplicit) (Syntax: 'new C1(d) { ... b ? 2 : 3 }') Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: i) (OperationKind.Argument, Type: null, IsImplicit) (Syntax: 'b ? 2 : 3') IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: System.Int32, IsImplicit) (Syntax: 'b ? 2 : 3') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B6] Leaving: {R2} } Block[B6] - Block Predecessors: [B5] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'c1 = new C1 ... ? 2 : 3 };') Expression: ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: C1) (Syntax: 'c1 = new C1 ... b ? 2 : 3 }') Left: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: C1, IsImplicit) (Syntax: 'c1') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: C1, IsImplicit) (Syntax: 'new C1(d) { ... b ? 2 : 3 }') Next (Regular) Block[B7] Leaving: {R1} } Block[B7] - Exit Predecessors: [B6] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<MethodDeclarationSyntax>(source, expectedFlowGraph, expectedDiagnostics); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Test.Utilities; using Roslyn.Test.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.CSharp.UnitTests { public class IOperationTests_IDynamicObjectCreationExpression : SemanticModelTestBase { [CompilerTrait(CompilerFeature.IOperation)] [Fact] public void DynamicObjectCreation_DynamicArgument() { string source = @" class C { public C(int i) { } void M(dynamic d) { var x = /*<bind>*/new C(d)/*</bind>*/; } } "; string expectedOperationTree = @" IDynamicObjectCreationOperation (OperationKind.DynamicObjectCreation, Type: C) (Syntax: 'new C(d)') Arguments(1): IParameterReferenceOperation: d (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'd') ArgumentNames(0) ArgumentRefKinds(0) Initializer: null "; var expectedDiagnostics = DiagnosticDescription.None; VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics); } [CompilerTrait(CompilerFeature.IOperation)] [Fact] public void DynamicObjectCreation_MultipleApplicableSymbols() { string source = @" class C { public C(int i) { } public C(long i) { } void M(dynamic d) { var x = /*<bind>*/new C(d)/*</bind>*/; } } "; string expectedOperationTree = @" IDynamicObjectCreationOperation (OperationKind.DynamicObjectCreation, Type: C) (Syntax: 'new C(d)') Arguments(1): IParameterReferenceOperation: d (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'd') ArgumentNames(0) ArgumentRefKinds(0) Initializer: null "; var expectedDiagnostics = DiagnosticDescription.None; VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics); } [CompilerTrait(CompilerFeature.IOperation)] [Fact] public void DynamicObjectCreation_MultipleArgumentsAndApplicableSymbols() { string source = @" class C { public C(int i, char c) { } public C(long i, char c) { } void M(dynamic d) { char c = 'c'; var x = /*<bind>*/new C(d, c)/*</bind>*/; } } "; string expectedOperationTree = @" IDynamicObjectCreationOperation (OperationKind.DynamicObjectCreation, Type: C) (Syntax: 'new C(d, c)') Arguments(2): IParameterReferenceOperation: d (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'd') ILocalReferenceOperation: c (OperationKind.LocalReference, Type: System.Char) (Syntax: 'c') ArgumentNames(0) ArgumentRefKinds(0) Initializer: null "; var expectedDiagnostics = DiagnosticDescription.None; VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics); } [CompilerTrait(CompilerFeature.IOperation)] [Fact] public void DynamicObjectCreation_ArgumentNames() { string source = @" class C { public C(int i, char c) { } public C(long i, char c) { } void M(dynamic d, dynamic e) { var x = /*<bind>*/new C(i: d, c: e)/*</bind>*/; } } "; string expectedOperationTree = @" IDynamicObjectCreationOperation (OperationKind.DynamicObjectCreation, Type: C) (Syntax: 'new C(i: d, c: e)') Arguments(2): IParameterReferenceOperation: d (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'd') IParameterReferenceOperation: e (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'e') ArgumentNames(2): ""i"" ""c"" ArgumentRefKinds(0) Initializer: null "; var expectedDiagnostics = DiagnosticDescription.None; VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics); } [CompilerTrait(CompilerFeature.IOperation)] [Fact] public void DynamicObjectCreation_ArgumentRefKinds() { string source = @" class C { public C(ref object i, out int j, char c) { j = 0; } void M(object d, dynamic e) { int k; var x = /*<bind>*/new C(ref d, out k, e)/*</bind>*/; } } "; string expectedOperationTree = @" IDynamicObjectCreationOperation (OperationKind.DynamicObjectCreation, Type: C) (Syntax: 'new C(ref d, out k, e)') Arguments(3): IParameterReferenceOperation: d (OperationKind.ParameterReference, Type: System.Object) (Syntax: 'd') ILocalReferenceOperation: k (OperationKind.LocalReference, Type: System.Int32) (Syntax: 'k') IParameterReferenceOperation: e (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'e') ArgumentNames(0) ArgumentRefKinds(3): Ref Out None Initializer: null "; var expectedDiagnostics = DiagnosticDescription.None; VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics); } [CompilerTrait(CompilerFeature.IOperation)] [Fact] public void DynamicObjectCreation_Initializer() { string source = @" class C { public int X; public C(char c) { } void M(dynamic d) { var x = /*<bind>*/new C(d) { X = 0 }/*</bind>*/; } } "; string expectedOperationTree = @" IDynamicObjectCreationOperation (OperationKind.DynamicObjectCreation, Type: C) (Syntax: 'new C(d) { X = 0 }') Arguments(1): IParameterReferenceOperation: d (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'd') ArgumentNames(0) ArgumentRefKinds(0) Initializer: IObjectOrCollectionInitializerOperation (OperationKind.ObjectOrCollectionInitializer, Type: C) (Syntax: '{ X = 0 }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32) (Syntax: 'X = 0') Left: IFieldReferenceOperation: System.Int32 C.X (OperationKind.FieldReference, Type: System.Int32) (Syntax: 'X') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: C, IsImplicit) (Syntax: 'X') Right: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 0) (Syntax: '0') "; var expectedDiagnostics = DiagnosticDescription.None; VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics); } [CompilerTrait(CompilerFeature.IOperation)] [Fact] public void DynamicObjectCreation_AllFields() { string source = @" class C { public int X; public C(ref int i, char c) { } public C(ref int i, long c) { } void M(dynamic d) { int i = 0; var x = /*<bind>*/new C(ref i, c: d) { X = 0 }/*</bind>*/; } } "; string expectedOperationTree = @" IDynamicObjectCreationOperation (OperationKind.DynamicObjectCreation, Type: C) (Syntax: 'new C(ref i ... ) { X = 0 }') Arguments(2): ILocalReferenceOperation: i (OperationKind.LocalReference, Type: System.Int32) (Syntax: 'i') IParameterReferenceOperation: d (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'd') ArgumentNames(2): ""null"" ""c"" ArgumentRefKinds(2): Ref None Initializer: IObjectOrCollectionInitializerOperation (OperationKind.ObjectOrCollectionInitializer, Type: C) (Syntax: '{ X = 0 }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32) (Syntax: 'X = 0') Left: IFieldReferenceOperation: System.Int32 C.X (OperationKind.FieldReference, Type: System.Int32) (Syntax: 'X') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: C, IsImplicit) (Syntax: 'X') Right: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 0) (Syntax: '0') "; var expectedDiagnostics = DiagnosticDescription.None; VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics); } [CompilerTrait(CompilerFeature.IOperation)] [Fact] public void DynamicObjectCreation_ErrorBadDynamicMethodArgLambda() { string source = @" using System; class C { static void Main() { dynamic y = null; /*<bind>*/new C(delegate { }, y)/*</bind>*/; } public C(Action a, Action y) { } } "; string expectedOperationTree = @" IDynamicObjectCreationOperation (OperationKind.DynamicObjectCreation, Type: C, IsInvalid) (Syntax: 'new C(delegate { }, y)') Arguments(2): IAnonymousFunctionOperation (Symbol: lambda expression) (OperationKind.AnonymousFunction, Type: null, IsInvalid) (Syntax: 'delegate { }') IBlockOperation (1 statements) (OperationKind.Block, Type: null, IsInvalid) (Syntax: '{ }') IReturnOperation (OperationKind.Return, Type: null, IsInvalid, IsImplicit) (Syntax: '{ }') ReturnedValue: null ILocalReferenceOperation: y (OperationKind.LocalReference, Type: dynamic) (Syntax: 'y') ArgumentNames(0) ArgumentRefKinds(0) Initializer: null "; var expectedDiagnostics = new DiagnosticDescription[] { // CS1977: Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type. // /*<bind>*/new C(delegate { }, y)/*</bind>*/; Diagnostic(ErrorCode.ERR_BadDynamicMethodArgLambda, "delegate { }").WithLocation(9, 25) }; VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics); } [CompilerTrait(CompilerFeature.IOperation)] [Fact] public void DynamicObjectCreation_OVerloadResolutionFailure() { string source = @" class C { public C() { } public C(int i, int j) { } void M(dynamic d) { var x = /*<bind>*/new C(d)/*</bind>*/; } } "; string expectedOperationTree = @" IInvalidOperation (OperationKind.Invalid, Type: C, IsInvalid) (Syntax: 'new C(d)') Children(1): IParameterReferenceOperation: d (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'd') "; var expectedDiagnostics = new DiagnosticDescription[] { // CS7036: There is no argument given that corresponds to the required formal parameter 'j' of 'C.C(int, int)' // var x = /*<bind>*/new C(d)/*</bind>*/; Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "C").WithArguments("j", "C.C(int, int)").WithLocation(14, 31) }; VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics); } [CompilerTrait(CompilerFeature.IOperation, CompilerFeature.Dataflow)] [Fact] public void DynamicObjectCreationFlow_01() { string source = @" class C1 { C1(int i) { } /*<bind>*/void M(C1 c1, dynamic d) { c1 = new C1(d); }/*</bind>*/ } "; var expectedDiagnostics = DiagnosticDescription.None; string expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Block[B1] - Block Predecessors: [B0] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'c1 = new C1(d);') Expression: ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: C1) (Syntax: 'c1 = new C1(d)') Left: IParameterReferenceOperation: c1 (OperationKind.ParameterReference, Type: C1) (Syntax: 'c1') Right: IDynamicObjectCreationOperation (OperationKind.DynamicObjectCreation, Type: C1) (Syntax: 'new C1(d)') Arguments(1): IParameterReferenceOperation: d (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'd') ArgumentNames(0) ArgumentRefKinds(0) Initializer: null Next (Regular) Block[B2] Block[B2] - Exit Predecessors: [B1] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<MethodDeclarationSyntax>(source, expectedFlowGraph, expectedDiagnostics); } [CompilerTrait(CompilerFeature.IOperation, CompilerFeature.Dataflow)] [Fact] public void DynamicObjectCreationFlow_02() { string source = @" class C1 { C1(int i) { } /*<bind>*/void M(C1 c1, dynamic d, bool b) { c1 = new C1(d) { I1 = 1, I2 = b ? 2 : 3 }; }/*</bind>*/ int I1 { get; set; } int I2 { get; set; } } "; var expectedDiagnostics = DiagnosticDescription.None; string expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} .locals {R1} { CaptureIds: [0] [1] Block[B1] - Block Predecessors: [B0] Statements (3) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'c1') Value: IParameterReferenceOperation: c1 (OperationKind.ParameterReference, Type: C1) (Syntax: 'c1') IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'new C1(d) { ... b ? 2 : 3 }') Value: IDynamicObjectCreationOperation (OperationKind.DynamicObjectCreation, Type: C1) (Syntax: 'new C1(d) { ... b ? 2 : 3 }') Arguments(1): IParameterReferenceOperation: d (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'd') ArgumentNames(0) ArgumentRefKinds(0) Initializer: null ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32) (Syntax: 'I1 = 1') Left: IPropertyReferenceOperation: System.Int32 C1.I1 { get; set; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'I1') Instance Receiver: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: C1, IsImplicit) (Syntax: 'new C1(d) { ... b ? 2 : 3 }') Right: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 1) (Syntax: '1') Next (Regular) Block[B2] Entering: {R2} .locals {R2} { CaptureIds: [2] Block[B2] - Block Predecessors: [B1] Statements (0) Jump if False (Regular) to Block[B4] IParameterReferenceOperation: b (OperationKind.ParameterReference, Type: System.Boolean) (Syntax: 'b') Next (Regular) Block[B3] Block[B3] - Block Predecessors: [B2] Statements (1) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '2') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 2) (Syntax: '2') Next (Regular) Block[B5] Block[B4] - Block Predecessors: [B2] Statements (1) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '3') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 3) (Syntax: '3') Next (Regular) Block[B5] Block[B5] - Block Predecessors: [B3] [B4] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32) (Syntax: 'I2 = b ? 2 : 3') Left: IPropertyReferenceOperation: System.Int32 C1.I2 { get; set; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'I2') Instance Receiver: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: C1, IsImplicit) (Syntax: 'new C1(d) { ... b ? 2 : 3 }') Right: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: System.Int32, IsImplicit) (Syntax: 'b ? 2 : 3') Next (Regular) Block[B6] Leaving: {R2} } Block[B6] - Block Predecessors: [B5] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'c1 = new C1 ... ? 2 : 3 };') Expression: ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: C1) (Syntax: 'c1 = new C1 ... b ? 2 : 3 }') Left: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: C1, IsImplicit) (Syntax: 'c1') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: C1, IsImplicit) (Syntax: 'new C1(d) { ... b ? 2 : 3 }') Next (Regular) Block[B7] Leaving: {R1} } Block[B7] - Exit Predecessors: [B6] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<MethodDeclarationSyntax>(source, expectedFlowGraph, expectedDiagnostics); } [CompilerTrait(CompilerFeature.IOperation, CompilerFeature.Dataflow)] [Fact] public void DynamicObjectCreationFlow_03() { string source = @" using System.Collections; using System.Collections.Generic; class C1 : IEnumerable<int> { C1(int i) { } /*<bind>*/void M(C1 c1, dynamic d, bool b) { c1 = new C1(d) { 1, b ? 2 : 3 }; }/*</bind>*/ public IEnumerator<int> GetEnumerator() => throw new System.NotImplementedException(); IEnumerator IEnumerable.GetEnumerator() => throw new System.NotImplementedException(); public void Add(int i) { } } "; var expectedDiagnostics = DiagnosticDescription.None; string expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} .locals {R1} { CaptureIds: [0] [1] Block[B1] - Block Predecessors: [B0] Statements (3) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'c1') Value: IParameterReferenceOperation: c1 (OperationKind.ParameterReference, Type: C1) (Syntax: 'c1') IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'new C1(d) { ... b ? 2 : 3 }') Value: IDynamicObjectCreationOperation (OperationKind.DynamicObjectCreation, Type: C1) (Syntax: 'new C1(d) { ... b ? 2 : 3 }') Arguments(1): IParameterReferenceOperation: d (OperationKind.ParameterReference, Type: dynamic) (Syntax: 'd') ArgumentNames(0) ArgumentRefKinds(0) Initializer: null IInvocationOperation ( void C1.Add(System.Int32 i)) (OperationKind.Invocation, Type: System.Void, IsImplicit) (Syntax: '1') Instance Receiver: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: C1, IsImplicit) (Syntax: 'new C1(d) { ... b ? 2 : 3 }') Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: i) (OperationKind.Argument, Type: null, IsImplicit) (Syntax: '1') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 1) (Syntax: '1') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B2] Entering: {R2} .locals {R2} { CaptureIds: [2] Block[B2] - Block Predecessors: [B1] Statements (0) Jump if False (Regular) to Block[B4] IParameterReferenceOperation: b (OperationKind.ParameterReference, Type: System.Boolean) (Syntax: 'b') Next (Regular) Block[B3] Block[B3] - Block Predecessors: [B2] Statements (1) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '2') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 2) (Syntax: '2') Next (Regular) Block[B5] Block[B4] - Block Predecessors: [B2] Statements (1) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '3') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 3) (Syntax: '3') Next (Regular) Block[B5] Block[B5] - Block Predecessors: [B3] [B4] Statements (1) IInvocationOperation ( void C1.Add(System.Int32 i)) (OperationKind.Invocation, Type: System.Void, IsImplicit) (Syntax: 'b ? 2 : 3') Instance Receiver: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: C1, IsImplicit) (Syntax: 'new C1(d) { ... b ? 2 : 3 }') Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: i) (OperationKind.Argument, Type: null, IsImplicit) (Syntax: 'b ? 2 : 3') IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: System.Int32, IsImplicit) (Syntax: 'b ? 2 : 3') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B6] Leaving: {R2} } Block[B6] - Block Predecessors: [B5] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'c1 = new C1 ... ? 2 : 3 };') Expression: ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: C1) (Syntax: 'c1 = new C1 ... b ? 2 : 3 }') Left: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: C1, IsImplicit) (Syntax: 'c1') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: C1, IsImplicit) (Syntax: 'new C1(d) { ... b ? 2 : 3 }') Next (Regular) Block[B7] Leaving: {R1} } Block[B7] - Exit Predecessors: [B6] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<MethodDeclarationSyntax>(source, expectedFlowGraph, expectedDiagnostics); } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ICollectionExtensions.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; namespace Microsoft.CodeAnalysis.Shared.Extensions { internal static class ICollectionExtensions { public static void RemoveRange<T>(this ICollection<T> collection, IEnumerable<T>? items) { if (collection == null) { throw new ArgumentNullException(nameof(collection)); } if (items != null) { foreach (var item in items) { collection.Remove(item); } } } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; namespace Microsoft.CodeAnalysis.Shared.Extensions { internal static class ICollectionExtensions { public static void RemoveRange<T>(this ICollection<T> collection, IEnumerable<T>? items) { if (collection == null) { throw new ArgumentNullException(nameof(collection)); } if (items != null) { foreach (var item in items) { collection.Remove(item); } } } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Features/CSharp/Portable/Completion/KeywordRecommenders/OverrideKeywordRecommender.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Collections.Generic; using System.Threading; using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; using Microsoft.CodeAnalysis.CSharp.Utilities; namespace Microsoft.CodeAnalysis.CSharp.Completion.KeywordRecommenders { internal class OverrideKeywordRecommender : AbstractSyntacticSingleKeywordRecommender { private static readonly ISet<SyntaxKind> s_validMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) { SyntaxKind.ExternKeyword, SyntaxKind.InternalKeyword, SyntaxKind.PublicKeyword, SyntaxKind.ProtectedKeyword, SyntaxKind.PrivateKeyword, SyntaxKind.UnsafeKeyword, SyntaxKind.SealedKeyword, SyntaxKind.AbstractKeyword, }; public OverrideKeywordRecommender() : base(SyntaxKind.OverrideKeyword) { } protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken) { if (!context.IsMemberDeclarationContext( validModifiers: s_validMemberModifiers, validTypeDeclarations: SyntaxKindSet.ClassStructRecordTypeDeclarations, canBePartial: false, cancellationToken: cancellationToken)) { return false; } var modifiers = context.PrecedingModifiers; return !modifiers.Contains(SyntaxKind.PrivateKeyword) || modifiers.Contains(SyntaxKind.ProtectedKeyword); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Collections.Generic; using System.Threading; using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; using Microsoft.CodeAnalysis.CSharp.Utilities; namespace Microsoft.CodeAnalysis.CSharp.Completion.KeywordRecommenders { internal class OverrideKeywordRecommender : AbstractSyntacticSingleKeywordRecommender { private static readonly ISet<SyntaxKind> s_validMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) { SyntaxKind.ExternKeyword, SyntaxKind.InternalKeyword, SyntaxKind.PublicKeyword, SyntaxKind.ProtectedKeyword, SyntaxKind.PrivateKeyword, SyntaxKind.UnsafeKeyword, SyntaxKind.SealedKeyword, SyntaxKind.AbstractKeyword, }; public OverrideKeywordRecommender() : base(SyntaxKind.OverrideKeyword) { } protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken) { if (!context.IsMemberDeclarationContext( validModifiers: s_validMemberModifiers, validTypeDeclarations: SyntaxKindSet.ClassStructRecordTypeDeclarations, canBePartial: false, cancellationToken: cancellationToken)) { return false; } var modifiers = context.PrecedingModifiers; return !modifiers.Contains(SyntaxKind.PrivateKeyword) || modifiers.Contains(SyntaxKind.ProtectedKeyword); } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/VisualStudio/TestUtilities2/CodeModel/Mocks/MockTextManagerAdapter.vb
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports System.Threading Imports Microsoft.CodeAnalysis.Editor.Shared.Utilities Imports Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.CodeModel.Mocks Friend NotInheritable Class MockTextManagerAdapter Implements ITextManagerAdapter Public Function CreateTextPoint(fileCodeModel As FileCodeModel, point As VirtualTreePoint) As EnvDTE.TextPoint Implements ITextManagerAdapter.CreateTextPoint Return New MockTextPoint(point) End Function End Class End Namespace
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports System.Threading Imports Microsoft.CodeAnalysis.Editor.Shared.Utilities Imports Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.CodeModel.Mocks Friend NotInheritable Class MockTextManagerAdapter Implements ITextManagerAdapter Public Function CreateTextPoint(fileCodeModel As FileCodeModel, point As VirtualTreePoint) As EnvDTE.TextPoint Implements ITextManagerAdapter.CreateTextPoint Return New MockTextPoint(point) End Function End Class End Namespace
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Features/CSharp/Portable/SignatureHelp/SignatureHelpUtilities.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.Linq; using Microsoft.CodeAnalysis.CSharp.Extensions; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.SignatureHelp; using Microsoft.CodeAnalysis.Text; using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.CSharp.SignatureHelp { internal static class SignatureHelpUtilities { private static readonly Func<BaseArgumentListSyntax, SyntaxToken> s_getBaseArgumentListOpenToken = list => list.GetOpenToken(); private static readonly Func<TypeArgumentListSyntax, SyntaxToken> s_getTypeArgumentListOpenToken = list => list.LessThanToken; private static readonly Func<InitializerExpressionSyntax, SyntaxToken> s_getInitializerExpressionOpenToken = e => e.OpenBraceToken; private static readonly Func<AttributeArgumentListSyntax, SyntaxToken> s_getAttributeArgumentListOpenToken = list => list.OpenParenToken; private static readonly Func<BaseArgumentListSyntax, SyntaxToken> s_getBaseArgumentListCloseToken = list => list.GetCloseToken(); private static readonly Func<TypeArgumentListSyntax, SyntaxToken> s_getTypeArgumentListCloseToken = list => list.GreaterThanToken; private static readonly Func<InitializerExpressionSyntax, SyntaxToken> s_getInitializerExpressionCloseToken = e => e.CloseBraceToken; private static readonly Func<AttributeArgumentListSyntax, SyntaxToken> s_getAttributeArgumentListCloseToken = list => list.CloseParenToken; private static readonly Func<BaseArgumentListSyntax, IEnumerable<SyntaxNodeOrToken>> s_getBaseArgumentListArgumentsWithSeparators = list => list.Arguments.GetWithSeparators(); private static readonly Func<TypeArgumentListSyntax, IEnumerable<SyntaxNodeOrToken>> s_getTypeArgumentListArgumentsWithSeparators = list => list.Arguments.GetWithSeparators(); private static readonly Func<InitializerExpressionSyntax, IEnumerable<SyntaxNodeOrToken>> s_getInitializerExpressionArgumentsWithSeparators = e => e.Expressions.GetWithSeparators(); private static readonly Func<AttributeArgumentListSyntax, IEnumerable<SyntaxNodeOrToken>> s_getAttributeArgumentListArgumentsWithSeparators = list => list.Arguments.GetWithSeparators(); private static readonly Func<BaseArgumentListSyntax, IEnumerable<string?>> s_getBaseArgumentListNames = list => list.Arguments.Select(argument => argument.NameColon?.Name.Identifier.ValueText); private static readonly Func<TypeArgumentListSyntax, IEnumerable<string?>> s_getTypeArgumentListNames = list => list.Arguments.Select(a => (string?)null); private static readonly Func<InitializerExpressionSyntax, IEnumerable<string?>> s_getInitializerExpressionNames = e => e.Expressions.Select(a => (string?)null); private static readonly Func<AttributeArgumentListSyntax, IEnumerable<string?>> s_getAttributeArgumentListNames = list => list.Arguments.Select( argument => argument.NameColon != null ? argument.NameColon.Name.Identifier.ValueText : argument.NameEquals?.Name.Identifier.ValueText); internal static SignatureHelpState? GetSignatureHelpState(BaseArgumentListSyntax argumentList, int position) { return CommonSignatureHelpUtilities.GetSignatureHelpState( argumentList, position, s_getBaseArgumentListOpenToken, s_getBaseArgumentListCloseToken, s_getBaseArgumentListArgumentsWithSeparators, s_getBaseArgumentListNames); } internal static SignatureHelpState? GetSignatureHelpState(TypeArgumentListSyntax argumentList, int position) { return CommonSignatureHelpUtilities.GetSignatureHelpState( argumentList, position, s_getTypeArgumentListOpenToken, s_getTypeArgumentListCloseToken, s_getTypeArgumentListArgumentsWithSeparators, s_getTypeArgumentListNames); } internal static SignatureHelpState? GetSignatureHelpState(InitializerExpressionSyntax argumentList, int position) { return CommonSignatureHelpUtilities.GetSignatureHelpState( argumentList, position, s_getInitializerExpressionOpenToken, s_getInitializerExpressionCloseToken, s_getInitializerExpressionArgumentsWithSeparators, s_getInitializerExpressionNames); } internal static SignatureHelpState? GetSignatureHelpState(AttributeArgumentListSyntax argumentList, int position) { return CommonSignatureHelpUtilities.GetSignatureHelpState( argumentList, position, s_getAttributeArgumentListOpenToken, s_getAttributeArgumentListCloseToken, s_getAttributeArgumentListArgumentsWithSeparators, s_getAttributeArgumentListNames); } internal static TextSpan GetSignatureHelpSpan(BaseArgumentListSyntax argumentList) => CommonSignatureHelpUtilities.GetSignatureHelpSpan(argumentList, s_getBaseArgumentListCloseToken); internal static TextSpan GetSignatureHelpSpan(TypeArgumentListSyntax argumentList) => CommonSignatureHelpUtilities.GetSignatureHelpSpan(argumentList, s_getTypeArgumentListCloseToken); internal static TextSpan GetSignatureHelpSpan(InitializerExpressionSyntax initializer) => CommonSignatureHelpUtilities.GetSignatureHelpSpan(initializer, initializer.SpanStart, s_getInitializerExpressionCloseToken); internal static TextSpan GetSignatureHelpSpan(AttributeArgumentListSyntax argumentList) => CommonSignatureHelpUtilities.GetSignatureHelpSpan(argumentList, s_getAttributeArgumentListCloseToken); internal static bool IsTriggerParenOrComma<TSyntaxNode>(SyntaxToken token, Func<char, bool> isTriggerCharacter) where TSyntaxNode : SyntaxNode { // Don't dismiss if the user types ( to start a parenthesized expression or tuple // Note that the tuple initially parses as a parenthesized expression if (token.IsKind(SyntaxKind.OpenParenToken) && token.Parent.IsKind(SyntaxKind.ParenthesizedExpression, out ParenthesizedExpressionSyntax? parenExpr)) { var parenthesizedExpr = parenExpr.WalkUpParentheses(); if (parenthesizedExpr.Parent is ArgumentSyntax) { var parent = parenthesizedExpr.Parent; var grandParent = parent.Parent; if (grandParent is ArgumentListSyntax && grandParent.Parent is TSyntaxNode) { // Argument to TSyntaxNode's argument list return true; } else { // Argument to a tuple in TSyntaxNode's argument list return grandParent is TupleExpressionSyntax && parenthesizedExpr.GetAncestor<TSyntaxNode>() != null; } } else { // Not an argument return false; } } // Don't dismiss if the user types ',' to add a member to a tuple if (token.IsKind(SyntaxKind.CommaToken) && token.Parent is TupleExpressionSyntax && token.GetAncestor<TSyntaxNode>() != null) { return true; } return !token.IsKind(SyntaxKind.None) && token.ValueText.Length == 1 && isTriggerCharacter(token.ValueText[0]) && token.Parent is ArgumentListSyntax && token.Parent.Parent is TSyntaxNode; } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.Linq; using Microsoft.CodeAnalysis.CSharp.Extensions; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.SignatureHelp; using Microsoft.CodeAnalysis.Text; using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.CSharp.SignatureHelp { internal static class SignatureHelpUtilities { private static readonly Func<BaseArgumentListSyntax, SyntaxToken> s_getBaseArgumentListOpenToken = list => list.GetOpenToken(); private static readonly Func<TypeArgumentListSyntax, SyntaxToken> s_getTypeArgumentListOpenToken = list => list.LessThanToken; private static readonly Func<InitializerExpressionSyntax, SyntaxToken> s_getInitializerExpressionOpenToken = e => e.OpenBraceToken; private static readonly Func<AttributeArgumentListSyntax, SyntaxToken> s_getAttributeArgumentListOpenToken = list => list.OpenParenToken; private static readonly Func<BaseArgumentListSyntax, SyntaxToken> s_getBaseArgumentListCloseToken = list => list.GetCloseToken(); private static readonly Func<TypeArgumentListSyntax, SyntaxToken> s_getTypeArgumentListCloseToken = list => list.GreaterThanToken; private static readonly Func<InitializerExpressionSyntax, SyntaxToken> s_getInitializerExpressionCloseToken = e => e.CloseBraceToken; private static readonly Func<AttributeArgumentListSyntax, SyntaxToken> s_getAttributeArgumentListCloseToken = list => list.CloseParenToken; private static readonly Func<BaseArgumentListSyntax, IEnumerable<SyntaxNodeOrToken>> s_getBaseArgumentListArgumentsWithSeparators = list => list.Arguments.GetWithSeparators(); private static readonly Func<TypeArgumentListSyntax, IEnumerable<SyntaxNodeOrToken>> s_getTypeArgumentListArgumentsWithSeparators = list => list.Arguments.GetWithSeparators(); private static readonly Func<InitializerExpressionSyntax, IEnumerable<SyntaxNodeOrToken>> s_getInitializerExpressionArgumentsWithSeparators = e => e.Expressions.GetWithSeparators(); private static readonly Func<AttributeArgumentListSyntax, IEnumerable<SyntaxNodeOrToken>> s_getAttributeArgumentListArgumentsWithSeparators = list => list.Arguments.GetWithSeparators(); private static readonly Func<BaseArgumentListSyntax, IEnumerable<string?>> s_getBaseArgumentListNames = list => list.Arguments.Select(argument => argument.NameColon?.Name.Identifier.ValueText); private static readonly Func<TypeArgumentListSyntax, IEnumerable<string?>> s_getTypeArgumentListNames = list => list.Arguments.Select(a => (string?)null); private static readonly Func<InitializerExpressionSyntax, IEnumerable<string?>> s_getInitializerExpressionNames = e => e.Expressions.Select(a => (string?)null); private static readonly Func<AttributeArgumentListSyntax, IEnumerable<string?>> s_getAttributeArgumentListNames = list => list.Arguments.Select( argument => argument.NameColon != null ? argument.NameColon.Name.Identifier.ValueText : argument.NameEquals?.Name.Identifier.ValueText); internal static SignatureHelpState? GetSignatureHelpState(BaseArgumentListSyntax argumentList, int position) { return CommonSignatureHelpUtilities.GetSignatureHelpState( argumentList, position, s_getBaseArgumentListOpenToken, s_getBaseArgumentListCloseToken, s_getBaseArgumentListArgumentsWithSeparators, s_getBaseArgumentListNames); } internal static SignatureHelpState? GetSignatureHelpState(TypeArgumentListSyntax argumentList, int position) { return CommonSignatureHelpUtilities.GetSignatureHelpState( argumentList, position, s_getTypeArgumentListOpenToken, s_getTypeArgumentListCloseToken, s_getTypeArgumentListArgumentsWithSeparators, s_getTypeArgumentListNames); } internal static SignatureHelpState? GetSignatureHelpState(InitializerExpressionSyntax argumentList, int position) { return CommonSignatureHelpUtilities.GetSignatureHelpState( argumentList, position, s_getInitializerExpressionOpenToken, s_getInitializerExpressionCloseToken, s_getInitializerExpressionArgumentsWithSeparators, s_getInitializerExpressionNames); } internal static SignatureHelpState? GetSignatureHelpState(AttributeArgumentListSyntax argumentList, int position) { return CommonSignatureHelpUtilities.GetSignatureHelpState( argumentList, position, s_getAttributeArgumentListOpenToken, s_getAttributeArgumentListCloseToken, s_getAttributeArgumentListArgumentsWithSeparators, s_getAttributeArgumentListNames); } internal static TextSpan GetSignatureHelpSpan(BaseArgumentListSyntax argumentList) => CommonSignatureHelpUtilities.GetSignatureHelpSpan(argumentList, s_getBaseArgumentListCloseToken); internal static TextSpan GetSignatureHelpSpan(TypeArgumentListSyntax argumentList) => CommonSignatureHelpUtilities.GetSignatureHelpSpan(argumentList, s_getTypeArgumentListCloseToken); internal static TextSpan GetSignatureHelpSpan(InitializerExpressionSyntax initializer) => CommonSignatureHelpUtilities.GetSignatureHelpSpan(initializer, initializer.SpanStart, s_getInitializerExpressionCloseToken); internal static TextSpan GetSignatureHelpSpan(AttributeArgumentListSyntax argumentList) => CommonSignatureHelpUtilities.GetSignatureHelpSpan(argumentList, s_getAttributeArgumentListCloseToken); internal static bool IsTriggerParenOrComma<TSyntaxNode>(SyntaxToken token, Func<char, bool> isTriggerCharacter) where TSyntaxNode : SyntaxNode { // Don't dismiss if the user types ( to start a parenthesized expression or tuple // Note that the tuple initially parses as a parenthesized expression if (token.IsKind(SyntaxKind.OpenParenToken) && token.Parent.IsKind(SyntaxKind.ParenthesizedExpression, out ParenthesizedExpressionSyntax? parenExpr)) { var parenthesizedExpr = parenExpr.WalkUpParentheses(); if (parenthesizedExpr.Parent is ArgumentSyntax) { var parent = parenthesizedExpr.Parent; var grandParent = parent.Parent; if (grandParent is ArgumentListSyntax && grandParent.Parent is TSyntaxNode) { // Argument to TSyntaxNode's argument list return true; } else { // Argument to a tuple in TSyntaxNode's argument list return grandParent is TupleExpressionSyntax && parenthesizedExpr.GetAncestor<TSyntaxNode>() != null; } } else { // Not an argument return false; } } // Don't dismiss if the user types ',' to add a member to a tuple if (token.IsKind(SyntaxKind.CommaToken) && token.Parent is TupleExpressionSyntax && token.GetAncestor<TSyntaxNode>() != null) { return true; } return !token.IsKind(SyntaxKind.None) && token.ValueText.Length == 1 && isTriggerCharacter(token.ValueText[0]) && token.Parent is ArgumentListSyntax && token.Parent.Parent is TSyntaxNode; } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Compilers/CSharp/Test/Emit/CodeGen/DestructorTests.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Reflection.Metadata; using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Microsoft.CodeAnalysis.CSharp.UnitTests.Emit; using Microsoft.CodeAnalysis.Test.Utilities; using Microsoft.CodeAnalysis.Text; using Roslyn.Test.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.CSharp.UnitTests.CodeGen { public class DestructorTests : EmitMetadataTestBase { [ConditionalFact(typeof(DesktopOnly))] public void ClassDestructor() { var text = @" using System; public class Base { ~Base() { Console.WriteLine(""~Base""); } } public class Program { public static void Main() { Base b = new Base(); b = null; GC.Collect(GC.MaxGeneration); GC.WaitForPendingFinalizers(); } } "; var validator = GetDestructorValidator("Base"); var compVerifier = CompileAndVerify(text, sourceSymbolValidator: validator, symbolValidator: validator, expectedOutput: @"~Base", expectedSignatures: new[] { Signature("Base", "Finalize", ".method family hidebysig virtual instance System.Void Finalize() cil managed") }); compVerifier.VerifyIL("Base.Finalize", @" { // Code size 20 (0x14) .maxstack 1 .try { IL_0000: ldstr ""~Base"" IL_0005: call ""void System.Console.WriteLine(string)"" IL_000a: leave.s IL_0013 } finally { IL_000c: ldarg.0 IL_000d: call ""void object.Finalize()"" IL_0012: endfinally } IL_0013: ret } "); } [ConditionalFact(typeof(DesktopOnly))] [CompilerTrait(CompilerFeature.ExpressionBody)] public void ExpressionBodiedClassDestructor() { var text = @" using System; public class Base { ~Base() => Console.WriteLine(""~Base""); } public class Program { public static void Main() { Base b = new Base(); b = null; GC.Collect(GC.MaxGeneration); GC.WaitForPendingFinalizers(); } } "; var validator = GetDestructorValidator("Base"); var compVerifier = CompileAndVerify(text, sourceSymbolValidator: validator, symbolValidator: validator, expectedOutput: @"~Base", expectedSignatures: new[] { Signature("Base", "Finalize", ".method family hidebysig virtual instance System.Void Finalize() cil managed") }); compVerifier.VerifyIL("Base.Finalize", @" { // Code size 20 (0x14) .maxstack 1 .try { IL_0000: ldstr ""~Base"" IL_0005: call ""void System.Console.WriteLine(string)"" IL_000a: leave.s IL_0013 } finally { IL_000c: ldarg.0 IL_000d: call ""void object.Finalize()"" IL_0012: endfinally } IL_0013: ret } "); } [ConditionalFact(typeof(DesktopOnly))] [CompilerTrait(CompilerFeature.ExpressionBody)] public void ExpressionBodiedSubClassDestructor() { var text = @" using System; public class Base { ~Base() => Console.WriteLine(""~Base""); } public class Derived : Base { ~Derived() => Console.WriteLine(""~Derived""); } public class Program { public static void Main() { Derived d = new Derived(); d = null; GC.Collect(GC.MaxGeneration); GC.WaitForPendingFinalizers(); } } "; var validator = GetDestructorValidator("Derived"); var compVerifier = CompileAndVerify(text, sourceSymbolValidator: validator, symbolValidator: validator, expectedOutput: @"~Derived ~Base", expectedSignatures: new[] { Signature("Base", "Finalize", ".method family hidebysig virtual instance System.Void Finalize() cil managed"), Signature("Derived", "Finalize", ".method family hidebysig virtual instance System.Void Finalize() cil managed") }); compVerifier.VerifyIL("Base.Finalize", @" { // Code size 20 (0x14) .maxstack 1 .try { IL_0000: ldstr ""~Base"" IL_0005: call ""void System.Console.WriteLine(string)"" IL_000a: leave.s IL_0013 } finally { IL_000c: ldarg.0 IL_000d: call ""void object.Finalize()"" IL_0012: endfinally } IL_0013: ret } "); compVerifier.VerifyIL("Derived.Finalize", @" { // Code size 20 (0x14) .maxstack 1 .try { IL_0000: ldstr ""~Derived"" IL_0005: call ""void System.Console.WriteLine(string)"" IL_000a: leave.s IL_0013 } finally { IL_000c: ldarg.0 IL_000d: call ""void Base.Finalize()"" IL_0012: endfinally } IL_0013: ret } "); compVerifier.VerifyDiagnostics(); } [ConditionalFact(typeof(DesktopOnly))] public void SubclassDestructor() { var text = @" using System; public class Base { ~Base() { Console.WriteLine(""~Base""); } } public class Derived : Base { ~Derived() { Console.WriteLine(""~Derived""); } } public class Program { public static void Main() { Base b = new Derived(); b = null; GC.Collect(GC.MaxGeneration); GC.WaitForPendingFinalizers(); } } "; var validator = GetDestructorValidator("Derived"); var compVerifier = CompileAndVerify(text, sourceSymbolValidator: validator, symbolValidator: validator, expectedOutput: @"~Derived ~Base", expectedSignatures: new[] { Signature("Base", "Finalize", ".method family hidebysig virtual instance System.Void Finalize() cil managed"), Signature("Derived", "Finalize", ".method family hidebysig virtual instance System.Void Finalize() cil managed") }); compVerifier.VerifyIL("Base.Finalize", @" { // Code size 20 (0x14) .maxstack 1 .try { IL_0000: ldstr ""~Base"" IL_0005: call ""void System.Console.WriteLine(string)"" IL_000a: leave.s IL_0013 } finally { IL_000c: ldarg.0 IL_000d: call ""void object.Finalize()"" IL_0012: endfinally } IL_0013: ret } "); compVerifier.VerifyIL("Derived.Finalize", @" { // Code size 20 (0x14) .maxstack 1 .try { IL_0000: ldstr ""~Derived"" IL_0005: call ""void System.Console.WriteLine(string)"" IL_000a: leave.s IL_0013 } finally { IL_000c: ldarg.0 IL_000d: call ""void Base.Finalize()"" IL_0012: endfinally } IL_0013: ret } "); compVerifier.VerifyDiagnostics(); } [ConditionalFact(typeof(WindowsDesktopOnly))] public void DestructorOverridesNonDestructor() { var text = @" using System; public class Base { protected virtual void Finalize() //NB: does not override Object.Finalize { Console.WriteLine(""~Base""); } } public class Derived : Base { ~Derived() //NB: in metadata, this will implicitly override Base.Finalize, but explicitly override Object.Finalize { Console.WriteLine(""~Derived""); } } public class Program { public static void Main() { Base b = new Base(); b = null; GC.Collect(GC.MaxGeneration); GC.WaitForPendingFinalizers(); Derived d = new Derived(); d = null; GC.Collect(GC.MaxGeneration); GC.WaitForPendingFinalizers(); } } "; var expectedOutput = @" ~Derived ~Base "; // Destructors generated by Roslyn should still be destructors when they are loaded back in - // even in cases where the user creates their own Finalize methods (which is legal, but ill-advised). // This may not be the case for metadata from other C# compilers (which will likely not have // destructors explicitly override System.Object.Finalize). var validator = GetDestructorValidator("Derived"); var compVerifier = CompileAndVerify(text, sourceSymbolValidator: validator, symbolValidator: validator, expectedOutput: expectedOutput, expectedSignatures: new[] { Signature("Base", "Finalize", ".method family hidebysig newslot virtual instance System.Void Finalize() cil managed"), Signature("Derived", "Finalize", ".method family hidebysig virtual instance System.Void Finalize() cil managed") }); compVerifier.VerifyDiagnostics( // (6,28): warning CS0465: Introducing a 'Finalize' method can interfere with destructor invocation. Did you intend to declare a destructor? Diagnostic(ErrorCode.WRN_FinalizeMethod, "Finalize")); } [WorkItem(542828, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542828")] [ConditionalFact(typeof(WindowsDesktopOnly))] public void BaseTypeHasNonVirtualFinalize() { var text = @" using System; public class Base { protected void Finalize() //NB: does not override Object.Finalize { Console.WriteLine(""~Base""); } } public class Derived : Base { ~Derived() //NB: in metadata, this will override Base.Finalize { Console.WriteLine(""~Derived""); } } public class Program { public static void Main() { Base b = new Base(); b = null; GC.Collect(GC.MaxGeneration); GC.WaitForPendingFinalizers(); Derived d = new Derived(); d = null; GC.Collect(GC.MaxGeneration); GC.WaitForPendingFinalizers(); } } "; var validator = GetDestructorValidator("Derived"); var compVerifier = CompileAndVerify(text, sourceSymbolValidator: validator, symbolValidator: validator, expectedOutput: @"~Derived ~Base", expectedSignatures: new[] { Signature("Base", "Finalize", ".method family hidebysig instance System.Void Finalize() cil managed"), Signature("Derived", "Finalize", ".method family hidebysig virtual instance System.Void Finalize() cil managed") }); compVerifier.VerifyDiagnostics( // (6,20): warning CS0465: Introducing a 'Finalize' method can interfere with destructor invocation. Did you intend to declare a destructor? Diagnostic(ErrorCode.WRN_FinalizeMethod, "Finalize")); } [WorkItem(542828, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542828")] [ConditionalFact(typeof(WindowsDesktopOnly))] public void GenericBaseTypeHasNonVirtualFinalize() { var text = @" using System; public class Base<T> { protected void Finalize() //NB: does not override Object.Finalize { Console.WriteLine(""~Base""); } } public class Derived : Base<int> { ~Derived() //NB: in metadata, this will override Base.Finalize { Console.WriteLine(""~Derived""); } } public class Program { public static void Main() { Base<char> b = new Base<char>(); b = null; GC.Collect(GC.MaxGeneration); GC.WaitForPendingFinalizers(); Derived d = new Derived(); d = null; GC.Collect(GC.MaxGeneration); GC.WaitForPendingFinalizers(); } } "; var validator = GetDestructorValidator("Derived"); var compVerifier = CompileAndVerify(text, sourceSymbolValidator: validator, symbolValidator: validator, expectedOutput: @"~Derived ~Base", expectedSignatures: new[] { Signature("Base`1", "Finalize", ".method family hidebysig instance System.Void Finalize() cil managed"), Signature("Derived", "Finalize", ".method family hidebysig virtual instance System.Void Finalize() cil managed") }); compVerifier.VerifyDiagnostics( // (6,20): warning CS0465: Introducing a 'Finalize' method can interfere with destructor invocation. Did you intend to declare a destructor? Diagnostic(ErrorCode.WRN_FinalizeMethod, "Finalize")); } [Fact] public void StructAndInterfaceHasNonVirtualFinalize() { var text = @" public interface I { void Finalize(); } public struct S { void Finalize() { } } class C { private string Finalize; } "; var compVerifier = CompileAndVerify(text); compVerifier.VerifyDiagnostics( // (4,10): warning CS0465: Introducing a 'Finalize' method can interfere with destructor invocation. Did you intend to declare a destructor? // void Finalize(); Diagnostic(ErrorCode.WRN_FinalizeMethod, "Finalize"), // (9,10): warning CS0465: Introducing a 'Finalize' method can interfere with destructor invocation. Did you intend to declare a destructor? // void Finalize() { } Diagnostic(ErrorCode.WRN_FinalizeMethod, "Finalize"), // (14,20): warning CS0169: The field 'C.Finalize' is never used // private string Finalize; Diagnostic(ErrorCode.WRN_UnreferencedField, "Finalize").WithArguments("C.Finalize") ); } [Fact] public void IsRuntimeFinalizer1() { var text = @" public class A { ~A() { } } public class B { public virtual void Finalize() { } } public class C : A { public void Finalize() { } } public class D : B { public override void Finalize() { } } public struct E { public void Finalize() { } } public interface F { void Finalize(); } public class G { protected virtual void Finalize() { } } public class H : G { ~H() { } } public class I { protected virtual void Finalize<T>() { } } public class J<T> { protected virtual void Finalize() { } } public class K<T> { ~K() { } } public class L<T> { ~L() { } } public class M<T> : L<T> { ~M() { } } "; Action<ModuleSymbol> validator = module => { var globalNamespace = module.GlobalNamespace; var mscorlib = module.ContainingAssembly.CorLibrary; var systemNamespace = mscorlib.GlobalNamespace.GetMember<NamespaceSymbol>("System"); Assert.True(systemNamespace.GetMember<NamedTypeSymbol>("Object").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); Assert.True(globalNamespace.GetMember<NamedTypeSymbol>("A").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); Assert.False(globalNamespace.GetMember<NamedTypeSymbol>("B").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); Assert.False(globalNamespace.GetMember<NamedTypeSymbol>("C").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); Assert.False(globalNamespace.GetMember<NamedTypeSymbol>("D").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); Assert.False(globalNamespace.GetMember<NamedTypeSymbol>("E").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); Assert.False(globalNamespace.GetMember<NamedTypeSymbol>("F").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); Assert.False(globalNamespace.GetMember<NamedTypeSymbol>("G").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); Assert.True(globalNamespace.GetMember<NamedTypeSymbol>("H").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); Assert.False(globalNamespace.GetMember<NamedTypeSymbol>("I").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); var intType = systemNamespace.GetMember<TypeSymbol>("Int32"); Assert.Equal(SpecialType.System_Int32, intType.SpecialType); var classJ = globalNamespace.GetMember<NamedTypeSymbol>("J"); Assert.False(classJ.GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); var classJInt = classJ.Construct(intType); Assert.False(classJInt.GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); var classK = globalNamespace.GetMember<NamedTypeSymbol>("K"); Assert.True(classK.GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); var classKInt = classK.Construct(intType); Assert.True(classKInt.GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); var classL = globalNamespace.GetMember<NamedTypeSymbol>("L"); Assert.True(classL.GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); var classLInt = classL.Construct(intType); Assert.True(classLInt.GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); var classM = globalNamespace.GetMember<NamedTypeSymbol>("M"); Assert.True(classM.GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); var classMInt = classM.Construct(intType); Assert.True(classMInt.GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); }; CompileAndVerify(text, sourceSymbolValidator: validator, symbolValidator: validator); } [Fact] public void IsRuntimeFinalizer2() { var text = @" .class public auto ansi beforefieldinit C extends [mscorlib]System.Object { .method family hidebysig virtual instance void Finalize() cil managed { ret } .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { ldarg.0 call instance void [mscorlib]System.Object::.ctor() ret } } // end of class C .class public auto ansi beforefieldinit D extends [mscorlib]System.Object { .method family hidebysig newslot virtual instance void Finalize() cil managed { ret } .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { ldarg.0 call instance void [mscorlib]System.Object::.ctor() ret } } // end of class D "; var compilation = CreateCompilationWithILAndMscorlib40("", text); var globalNamespace = compilation.GlobalNamespace; Assert.True(globalNamespace.GetMember<NamedTypeSymbol>("C").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); //override of object.Finalize Assert.False(globalNamespace.GetMember<NamedTypeSymbol>("D").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); //same but has "newslot" } [WorkItem(528903, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/528903")] // Won't fix - test just captures behavior. [Fact] public void DestructorOverridesPublicFinalize() { var text = @" public class A { public virtual void Finalize() { } } public class B : A { ~B() { } } "; var compilation = CreateCompilation(text, options: TestOptions.ReleaseDll); // NOTE: has warnings, but not errors. compilation.VerifyDiagnostics( // (4,25): warning CS0465: Introducing a 'Finalize' method can interfere with destructor invocation. Did you intend to declare a destructor? // public virtual void Finalize() { } Diagnostic(ErrorCode.WRN_FinalizeMethod, "Finalize")); // We produce unverifiable code here as per bug resolution (compat concerns, not common case). CompileAndVerify(compilation, verify: Verification.Fails).VerifyIL("B.Finalize", @" { // Code size 10 (0xa) .maxstack 1 .try { IL_0000: leave.s IL_0009 } finally { IL_0002: ldarg.0 IL_0003: call ""void object.Finalize()"" IL_0008: endfinally } IL_0009: ret } "); } [WorkItem(528907, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/528907")] [Fact] public void BaseTypeHasGenericFinalize() { var text = @" public class A { protected void Finalize<T>() { } } public class B : A { ~B() { } } "; // NOTE: calling object.Finalize, since A.Finalize has the wrong arity. // (Dev11 called A.Finalize and failed at runtime, since it wasn't providing // a type argument.) CompileAndVerify(text).VerifyIL("B.Finalize", @" { // Code size 10 (0xa) .maxstack 1 .try { IL_0000: leave.s IL_0009 } finally { IL_0002: ldarg.0 IL_0003: call ""void object.Finalize()"" IL_0008: endfinally } IL_0009: ret } "); } [WorkItem(528903, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/528903")] [Fact] public void MethodImplEntry() { var text = @" public class A { ~A() { } } "; CompileAndVerify(text, assemblyValidator: (assembly) => { var peFileReader = assembly.GetMetadataReader(); // Find the handle and row for A. var pairA = peFileReader.TypeDefinitions.AsEnumerable(). Select(handle => new { handle = handle, row = peFileReader.GetTypeDefinition(handle) }). Single(pair => peFileReader.GetString(pair.row.Name) == "A" && string.IsNullOrEmpty(peFileReader.GetString(pair.row.Namespace))); TypeDefinitionHandle handleA = pairA.handle; TypeDefinition typeA = pairA.row; // Find the handle for A's destructor. MethodDefinitionHandle handleDestructorA = typeA.GetMethods().AsEnumerable(). Single(handle => peFileReader.GetString(peFileReader.GetMethodDefinition(handle).Name) == WellKnownMemberNames.DestructorName); // Find the handle for System.Object. TypeReferenceHandle handleObject = peFileReader.TypeReferences.AsEnumerable(). Select(handle => new { handle = handle, row = peFileReader.GetTypeReference(handle) }). Single(pair => peFileReader.GetString(pair.row.Name) == "Object" && peFileReader.GetString(pair.row.Namespace) == "System").handle; // Find the handle for System.Object's destructor. MemberReferenceHandle handleDestructorObject = peFileReader.MemberReferences.AsEnumerable(). Select(handle => new { handle = handle, row = peFileReader.GetMemberReference(handle) }). Single(pair => pair.row.Parent == (EntityHandle)handleObject && peFileReader.GetString(pair.row.Name) == WellKnownMemberNames.DestructorName).handle; // Find the MethodImpl row for A. MethodImplementation methodImpl = typeA.GetMethodImplementations().AsEnumerable(). Select(handle => peFileReader.GetMethodImplementation(handle)). Single(); // The Class column should point to A. Assert.Equal(handleA, methodImpl.Type); // The MethodDeclaration column should point to System.Object.Finalize. Assert.Equal((EntityHandle)handleDestructorObject, methodImpl.MethodDeclaration); // The MethodDeclarationColumn should point to A's destructor. Assert.Equal((EntityHandle)handleDestructorA, methodImpl.MethodBody); }); } private static Action<ModuleSymbol> GetDestructorValidator(string typeName) { return module => ValidateDestructor(module, typeName); } // NOTE: assumes there's a destructor. private static void ValidateDestructor(ModuleSymbol module, string typeName) { var @class = module.GlobalNamespace.GetMember<NamedTypeSymbol>(typeName); var destructor = @class.GetMember<MethodSymbol>(WellKnownMemberNames.DestructorName); Assert.Equal(MethodKind.Destructor, destructor.MethodKind); Assert.True(destructor.IsMetadataVirtual()); Assert.False(destructor.IsVirtual); Assert.False(destructor.IsOverride); Assert.False(destructor.IsSealed); Assert.False(destructor.IsStatic); Assert.False(destructor.IsAbstract); Assert.Null(destructor.OverriddenMethod); Assert.Equal(SpecialType.System_Void, destructor.ReturnType.SpecialType); Assert.Equal(0, destructor.Parameters.Length); Assert.Equal(0, destructor.TypeParameters.Length); Assert.Equal(Accessibility.Protected, destructor.DeclaredAccessibility); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Reflection.Metadata; using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Microsoft.CodeAnalysis.CSharp.UnitTests.Emit; using Microsoft.CodeAnalysis.Test.Utilities; using Microsoft.CodeAnalysis.Text; using Roslyn.Test.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.CSharp.UnitTests.CodeGen { public class DestructorTests : EmitMetadataTestBase { [ConditionalFact(typeof(DesktopOnly))] public void ClassDestructor() { var text = @" using System; public class Base { ~Base() { Console.WriteLine(""~Base""); } } public class Program { public static void Main() { Base b = new Base(); b = null; GC.Collect(GC.MaxGeneration); GC.WaitForPendingFinalizers(); } } "; var validator = GetDestructorValidator("Base"); var compVerifier = CompileAndVerify(text, sourceSymbolValidator: validator, symbolValidator: validator, expectedOutput: @"~Base", expectedSignatures: new[] { Signature("Base", "Finalize", ".method family hidebysig virtual instance System.Void Finalize() cil managed") }); compVerifier.VerifyIL("Base.Finalize", @" { // Code size 20 (0x14) .maxstack 1 .try { IL_0000: ldstr ""~Base"" IL_0005: call ""void System.Console.WriteLine(string)"" IL_000a: leave.s IL_0013 } finally { IL_000c: ldarg.0 IL_000d: call ""void object.Finalize()"" IL_0012: endfinally } IL_0013: ret } "); } [ConditionalFact(typeof(DesktopOnly))] [CompilerTrait(CompilerFeature.ExpressionBody)] public void ExpressionBodiedClassDestructor() { var text = @" using System; public class Base { ~Base() => Console.WriteLine(""~Base""); } public class Program { public static void Main() { Base b = new Base(); b = null; GC.Collect(GC.MaxGeneration); GC.WaitForPendingFinalizers(); } } "; var validator = GetDestructorValidator("Base"); var compVerifier = CompileAndVerify(text, sourceSymbolValidator: validator, symbolValidator: validator, expectedOutput: @"~Base", expectedSignatures: new[] { Signature("Base", "Finalize", ".method family hidebysig virtual instance System.Void Finalize() cil managed") }); compVerifier.VerifyIL("Base.Finalize", @" { // Code size 20 (0x14) .maxstack 1 .try { IL_0000: ldstr ""~Base"" IL_0005: call ""void System.Console.WriteLine(string)"" IL_000a: leave.s IL_0013 } finally { IL_000c: ldarg.0 IL_000d: call ""void object.Finalize()"" IL_0012: endfinally } IL_0013: ret } "); } [ConditionalFact(typeof(DesktopOnly))] [CompilerTrait(CompilerFeature.ExpressionBody)] public void ExpressionBodiedSubClassDestructor() { var text = @" using System; public class Base { ~Base() => Console.WriteLine(""~Base""); } public class Derived : Base { ~Derived() => Console.WriteLine(""~Derived""); } public class Program { public static void Main() { Derived d = new Derived(); d = null; GC.Collect(GC.MaxGeneration); GC.WaitForPendingFinalizers(); } } "; var validator = GetDestructorValidator("Derived"); var compVerifier = CompileAndVerify(text, sourceSymbolValidator: validator, symbolValidator: validator, expectedOutput: @"~Derived ~Base", expectedSignatures: new[] { Signature("Base", "Finalize", ".method family hidebysig virtual instance System.Void Finalize() cil managed"), Signature("Derived", "Finalize", ".method family hidebysig virtual instance System.Void Finalize() cil managed") }); compVerifier.VerifyIL("Base.Finalize", @" { // Code size 20 (0x14) .maxstack 1 .try { IL_0000: ldstr ""~Base"" IL_0005: call ""void System.Console.WriteLine(string)"" IL_000a: leave.s IL_0013 } finally { IL_000c: ldarg.0 IL_000d: call ""void object.Finalize()"" IL_0012: endfinally } IL_0013: ret } "); compVerifier.VerifyIL("Derived.Finalize", @" { // Code size 20 (0x14) .maxstack 1 .try { IL_0000: ldstr ""~Derived"" IL_0005: call ""void System.Console.WriteLine(string)"" IL_000a: leave.s IL_0013 } finally { IL_000c: ldarg.0 IL_000d: call ""void Base.Finalize()"" IL_0012: endfinally } IL_0013: ret } "); compVerifier.VerifyDiagnostics(); } [ConditionalFact(typeof(DesktopOnly))] public void SubclassDestructor() { var text = @" using System; public class Base { ~Base() { Console.WriteLine(""~Base""); } } public class Derived : Base { ~Derived() { Console.WriteLine(""~Derived""); } } public class Program { public static void Main() { Base b = new Derived(); b = null; GC.Collect(GC.MaxGeneration); GC.WaitForPendingFinalizers(); } } "; var validator = GetDestructorValidator("Derived"); var compVerifier = CompileAndVerify(text, sourceSymbolValidator: validator, symbolValidator: validator, expectedOutput: @"~Derived ~Base", expectedSignatures: new[] { Signature("Base", "Finalize", ".method family hidebysig virtual instance System.Void Finalize() cil managed"), Signature("Derived", "Finalize", ".method family hidebysig virtual instance System.Void Finalize() cil managed") }); compVerifier.VerifyIL("Base.Finalize", @" { // Code size 20 (0x14) .maxstack 1 .try { IL_0000: ldstr ""~Base"" IL_0005: call ""void System.Console.WriteLine(string)"" IL_000a: leave.s IL_0013 } finally { IL_000c: ldarg.0 IL_000d: call ""void object.Finalize()"" IL_0012: endfinally } IL_0013: ret } "); compVerifier.VerifyIL("Derived.Finalize", @" { // Code size 20 (0x14) .maxstack 1 .try { IL_0000: ldstr ""~Derived"" IL_0005: call ""void System.Console.WriteLine(string)"" IL_000a: leave.s IL_0013 } finally { IL_000c: ldarg.0 IL_000d: call ""void Base.Finalize()"" IL_0012: endfinally } IL_0013: ret } "); compVerifier.VerifyDiagnostics(); } [ConditionalFact(typeof(WindowsDesktopOnly))] public void DestructorOverridesNonDestructor() { var text = @" using System; public class Base { protected virtual void Finalize() //NB: does not override Object.Finalize { Console.WriteLine(""~Base""); } } public class Derived : Base { ~Derived() //NB: in metadata, this will implicitly override Base.Finalize, but explicitly override Object.Finalize { Console.WriteLine(""~Derived""); } } public class Program { public static void Main() { Base b = new Base(); b = null; GC.Collect(GC.MaxGeneration); GC.WaitForPendingFinalizers(); Derived d = new Derived(); d = null; GC.Collect(GC.MaxGeneration); GC.WaitForPendingFinalizers(); } } "; var expectedOutput = @" ~Derived ~Base "; // Destructors generated by Roslyn should still be destructors when they are loaded back in - // even in cases where the user creates their own Finalize methods (which is legal, but ill-advised). // This may not be the case for metadata from other C# compilers (which will likely not have // destructors explicitly override System.Object.Finalize). var validator = GetDestructorValidator("Derived"); var compVerifier = CompileAndVerify(text, sourceSymbolValidator: validator, symbolValidator: validator, expectedOutput: expectedOutput, expectedSignatures: new[] { Signature("Base", "Finalize", ".method family hidebysig newslot virtual instance System.Void Finalize() cil managed"), Signature("Derived", "Finalize", ".method family hidebysig virtual instance System.Void Finalize() cil managed") }); compVerifier.VerifyDiagnostics( // (6,28): warning CS0465: Introducing a 'Finalize' method can interfere with destructor invocation. Did you intend to declare a destructor? Diagnostic(ErrorCode.WRN_FinalizeMethod, "Finalize")); } [WorkItem(542828, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542828")] [ConditionalFact(typeof(WindowsDesktopOnly))] public void BaseTypeHasNonVirtualFinalize() { var text = @" using System; public class Base { protected void Finalize() //NB: does not override Object.Finalize { Console.WriteLine(""~Base""); } } public class Derived : Base { ~Derived() //NB: in metadata, this will override Base.Finalize { Console.WriteLine(""~Derived""); } } public class Program { public static void Main() { Base b = new Base(); b = null; GC.Collect(GC.MaxGeneration); GC.WaitForPendingFinalizers(); Derived d = new Derived(); d = null; GC.Collect(GC.MaxGeneration); GC.WaitForPendingFinalizers(); } } "; var validator = GetDestructorValidator("Derived"); var compVerifier = CompileAndVerify(text, sourceSymbolValidator: validator, symbolValidator: validator, expectedOutput: @"~Derived ~Base", expectedSignatures: new[] { Signature("Base", "Finalize", ".method family hidebysig instance System.Void Finalize() cil managed"), Signature("Derived", "Finalize", ".method family hidebysig virtual instance System.Void Finalize() cil managed") }); compVerifier.VerifyDiagnostics( // (6,20): warning CS0465: Introducing a 'Finalize' method can interfere with destructor invocation. Did you intend to declare a destructor? Diagnostic(ErrorCode.WRN_FinalizeMethod, "Finalize")); } [WorkItem(542828, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542828")] [ConditionalFact(typeof(WindowsDesktopOnly))] public void GenericBaseTypeHasNonVirtualFinalize() { var text = @" using System; public class Base<T> { protected void Finalize() //NB: does not override Object.Finalize { Console.WriteLine(""~Base""); } } public class Derived : Base<int> { ~Derived() //NB: in metadata, this will override Base.Finalize { Console.WriteLine(""~Derived""); } } public class Program { public static void Main() { Base<char> b = new Base<char>(); b = null; GC.Collect(GC.MaxGeneration); GC.WaitForPendingFinalizers(); Derived d = new Derived(); d = null; GC.Collect(GC.MaxGeneration); GC.WaitForPendingFinalizers(); } } "; var validator = GetDestructorValidator("Derived"); var compVerifier = CompileAndVerify(text, sourceSymbolValidator: validator, symbolValidator: validator, expectedOutput: @"~Derived ~Base", expectedSignatures: new[] { Signature("Base`1", "Finalize", ".method family hidebysig instance System.Void Finalize() cil managed"), Signature("Derived", "Finalize", ".method family hidebysig virtual instance System.Void Finalize() cil managed") }); compVerifier.VerifyDiagnostics( // (6,20): warning CS0465: Introducing a 'Finalize' method can interfere with destructor invocation. Did you intend to declare a destructor? Diagnostic(ErrorCode.WRN_FinalizeMethod, "Finalize")); } [Fact] public void StructAndInterfaceHasNonVirtualFinalize() { var text = @" public interface I { void Finalize(); } public struct S { void Finalize() { } } class C { private string Finalize; } "; var compVerifier = CompileAndVerify(text); compVerifier.VerifyDiagnostics( // (4,10): warning CS0465: Introducing a 'Finalize' method can interfere with destructor invocation. Did you intend to declare a destructor? // void Finalize(); Diagnostic(ErrorCode.WRN_FinalizeMethod, "Finalize"), // (9,10): warning CS0465: Introducing a 'Finalize' method can interfere with destructor invocation. Did you intend to declare a destructor? // void Finalize() { } Diagnostic(ErrorCode.WRN_FinalizeMethod, "Finalize"), // (14,20): warning CS0169: The field 'C.Finalize' is never used // private string Finalize; Diagnostic(ErrorCode.WRN_UnreferencedField, "Finalize").WithArguments("C.Finalize") ); } [Fact] public void IsRuntimeFinalizer1() { var text = @" public class A { ~A() { } } public class B { public virtual void Finalize() { } } public class C : A { public void Finalize() { } } public class D : B { public override void Finalize() { } } public struct E { public void Finalize() { } } public interface F { void Finalize(); } public class G { protected virtual void Finalize() { } } public class H : G { ~H() { } } public class I { protected virtual void Finalize<T>() { } } public class J<T> { protected virtual void Finalize() { } } public class K<T> { ~K() { } } public class L<T> { ~L() { } } public class M<T> : L<T> { ~M() { } } "; Action<ModuleSymbol> validator = module => { var globalNamespace = module.GlobalNamespace; var mscorlib = module.ContainingAssembly.CorLibrary; var systemNamespace = mscorlib.GlobalNamespace.GetMember<NamespaceSymbol>("System"); Assert.True(systemNamespace.GetMember<NamedTypeSymbol>("Object").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); Assert.True(globalNamespace.GetMember<NamedTypeSymbol>("A").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); Assert.False(globalNamespace.GetMember<NamedTypeSymbol>("B").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); Assert.False(globalNamespace.GetMember<NamedTypeSymbol>("C").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); Assert.False(globalNamespace.GetMember<NamedTypeSymbol>("D").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); Assert.False(globalNamespace.GetMember<NamedTypeSymbol>("E").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); Assert.False(globalNamespace.GetMember<NamedTypeSymbol>("F").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); Assert.False(globalNamespace.GetMember<NamedTypeSymbol>("G").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); Assert.True(globalNamespace.GetMember<NamedTypeSymbol>("H").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); Assert.False(globalNamespace.GetMember<NamedTypeSymbol>("I").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); var intType = systemNamespace.GetMember<TypeSymbol>("Int32"); Assert.Equal(SpecialType.System_Int32, intType.SpecialType); var classJ = globalNamespace.GetMember<NamedTypeSymbol>("J"); Assert.False(classJ.GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); var classJInt = classJ.Construct(intType); Assert.False(classJInt.GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); var classK = globalNamespace.GetMember<NamedTypeSymbol>("K"); Assert.True(classK.GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); var classKInt = classK.Construct(intType); Assert.True(classKInt.GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); var classL = globalNamespace.GetMember<NamedTypeSymbol>("L"); Assert.True(classL.GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); var classLInt = classL.Construct(intType); Assert.True(classLInt.GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); var classM = globalNamespace.GetMember<NamedTypeSymbol>("M"); Assert.True(classM.GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); var classMInt = classM.Construct(intType); Assert.True(classMInt.GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); }; CompileAndVerify(text, sourceSymbolValidator: validator, symbolValidator: validator); } [Fact] public void IsRuntimeFinalizer2() { var text = @" .class public auto ansi beforefieldinit C extends [mscorlib]System.Object { .method family hidebysig virtual instance void Finalize() cil managed { ret } .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { ldarg.0 call instance void [mscorlib]System.Object::.ctor() ret } } // end of class C .class public auto ansi beforefieldinit D extends [mscorlib]System.Object { .method family hidebysig newslot virtual instance void Finalize() cil managed { ret } .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { ldarg.0 call instance void [mscorlib]System.Object::.ctor() ret } } // end of class D "; var compilation = CreateCompilationWithILAndMscorlib40("", text); var globalNamespace = compilation.GlobalNamespace; Assert.True(globalNamespace.GetMember<NamedTypeSymbol>("C").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); //override of object.Finalize Assert.False(globalNamespace.GetMember<NamedTypeSymbol>("D").GetMember<MethodSymbol>("Finalize").IsRuntimeFinalizer()); //same but has "newslot" } [WorkItem(528903, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/528903")] // Won't fix - test just captures behavior. [Fact] public void DestructorOverridesPublicFinalize() { var text = @" public class A { public virtual void Finalize() { } } public class B : A { ~B() { } } "; var compilation = CreateCompilation(text, options: TestOptions.ReleaseDll); // NOTE: has warnings, but not errors. compilation.VerifyDiagnostics( // (4,25): warning CS0465: Introducing a 'Finalize' method can interfere with destructor invocation. Did you intend to declare a destructor? // public virtual void Finalize() { } Diagnostic(ErrorCode.WRN_FinalizeMethod, "Finalize")); // We produce unverifiable code here as per bug resolution (compat concerns, not common case). CompileAndVerify(compilation, verify: Verification.Fails).VerifyIL("B.Finalize", @" { // Code size 10 (0xa) .maxstack 1 .try { IL_0000: leave.s IL_0009 } finally { IL_0002: ldarg.0 IL_0003: call ""void object.Finalize()"" IL_0008: endfinally } IL_0009: ret } "); } [WorkItem(528907, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/528907")] [Fact] public void BaseTypeHasGenericFinalize() { var text = @" public class A { protected void Finalize<T>() { } } public class B : A { ~B() { } } "; // NOTE: calling object.Finalize, since A.Finalize has the wrong arity. // (Dev11 called A.Finalize and failed at runtime, since it wasn't providing // a type argument.) CompileAndVerify(text).VerifyIL("B.Finalize", @" { // Code size 10 (0xa) .maxstack 1 .try { IL_0000: leave.s IL_0009 } finally { IL_0002: ldarg.0 IL_0003: call ""void object.Finalize()"" IL_0008: endfinally } IL_0009: ret } "); } [WorkItem(528903, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/528903")] [Fact] public void MethodImplEntry() { var text = @" public class A { ~A() { } } "; CompileAndVerify(text, assemblyValidator: (assembly) => { var peFileReader = assembly.GetMetadataReader(); // Find the handle and row for A. var pairA = peFileReader.TypeDefinitions.AsEnumerable(). Select(handle => new { handle = handle, row = peFileReader.GetTypeDefinition(handle) }). Single(pair => peFileReader.GetString(pair.row.Name) == "A" && string.IsNullOrEmpty(peFileReader.GetString(pair.row.Namespace))); TypeDefinitionHandle handleA = pairA.handle; TypeDefinition typeA = pairA.row; // Find the handle for A's destructor. MethodDefinitionHandle handleDestructorA = typeA.GetMethods().AsEnumerable(). Single(handle => peFileReader.GetString(peFileReader.GetMethodDefinition(handle).Name) == WellKnownMemberNames.DestructorName); // Find the handle for System.Object. TypeReferenceHandle handleObject = peFileReader.TypeReferences.AsEnumerable(). Select(handle => new { handle = handle, row = peFileReader.GetTypeReference(handle) }). Single(pair => peFileReader.GetString(pair.row.Name) == "Object" && peFileReader.GetString(pair.row.Namespace) == "System").handle; // Find the handle for System.Object's destructor. MemberReferenceHandle handleDestructorObject = peFileReader.MemberReferences.AsEnumerable(). Select(handle => new { handle = handle, row = peFileReader.GetMemberReference(handle) }). Single(pair => pair.row.Parent == (EntityHandle)handleObject && peFileReader.GetString(pair.row.Name) == WellKnownMemberNames.DestructorName).handle; // Find the MethodImpl row for A. MethodImplementation methodImpl = typeA.GetMethodImplementations().AsEnumerable(). Select(handle => peFileReader.GetMethodImplementation(handle)). Single(); // The Class column should point to A. Assert.Equal(handleA, methodImpl.Type); // The MethodDeclaration column should point to System.Object.Finalize. Assert.Equal((EntityHandle)handleDestructorObject, methodImpl.MethodDeclaration); // The MethodDeclarationColumn should point to A's destructor. Assert.Equal((EntityHandle)handleDestructorA, methodImpl.MethodBody); }); } private static Action<ModuleSymbol> GetDestructorValidator(string typeName) { return module => ValidateDestructor(module, typeName); } // NOTE: assumes there's a destructor. private static void ValidateDestructor(ModuleSymbol module, string typeName) { var @class = module.GlobalNamespace.GetMember<NamedTypeSymbol>(typeName); var destructor = @class.GetMember<MethodSymbol>(WellKnownMemberNames.DestructorName); Assert.Equal(MethodKind.Destructor, destructor.MethodKind); Assert.True(destructor.IsMetadataVirtual()); Assert.False(destructor.IsVirtual); Assert.False(destructor.IsOverride); Assert.False(destructor.IsSealed); Assert.False(destructor.IsStatic); Assert.False(destructor.IsAbstract); Assert.Null(destructor.OverriddenMethod); Assert.Equal(SpecialType.System_Void, destructor.ReturnType.SpecialType); Assert.Equal(0, destructor.Parameters.Length); Assert.Equal(0, destructor.TypeParameters.Length); Assert.Equal(Accessibility.Protected, destructor.DeclaredAccessibility); } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Workspaces/CoreTest/FindAllDeclarationsTests.TestSolutionsAndProject.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System; using System.Collections.Generic; using System.Linq; using Microsoft.CodeAnalysis.Remote; using Microsoft.CodeAnalysis.Remote.Testing; using Microsoft.CodeAnalysis.Test.Utilities; using Microsoft.CodeAnalysis.Text; using Roslyn.Test.Utilities; using Roslyn.Utilities; using Xunit; using Xunit.Abstractions; namespace Microsoft.CodeAnalysis.UnitTests { public partial class FindAllDeclarationsTests { private readonly ITestOutputHelper _logger; public FindAllDeclarationsTests(ITestOutputHelper logger) { _logger = logger; } private static void Verify(string searchTerm, bool respectCase, SolutionKind workspaceKind, IEnumerable<ISymbol> declarations, params string[] expectedResults) { var actualResultCount = declarations.Count(); var expectedResultCount = expectedResults.Length; Assert.True(expectedResultCount == actualResultCount, string.Format("Search term '{0}' expected '{1}' results, found '{2}. Ignore case was set to '{3}', Workspace {4} was used", searchTerm, expectedResultCount, actualResultCount, respectCase, Enum.GetName(typeof(SolutionKind), workspaceKind))); if (actualResultCount > 0) { VerifyResults(declarations, expectedResults); } } private static void Verify(SolutionKind workspaceKind, IEnumerable<ISymbol> declarations, params string[] expectedResults) { var actualResultCount = declarations.Count(); var expectedResultCount = expectedResults.Length; Assert.True(expectedResultCount == actualResultCount, string.Format("Expected '{0}' results, found '{1}. Workspace {2} was used", expectedResultCount, actualResultCount, Enum.GetName(typeof(SolutionKind), workspaceKind))); if (actualResultCount > 0) { VerifyResults(declarations, expectedResults); } } private static void VerifyResults(IEnumerable<ISymbol> declarations, string[] expectedResults) { declarations = declarations.OrderBy(d => d.ToString()); expectedResults = expectedResults.OrderBy(r => r).ToArray(); for (var i = 0; i < expectedResults.Length; i++) { var actualResult = declarations.ElementAt(i).ToString(); var expectedResult = expectedResults[i]; Assert.True( string.Equals(actualResult, expectedResult, StringComparison.Ordinal), string.Format("Expected result to be {0} was {1}", expectedResult, actualResult)); } } private Workspace CreateWorkspace(TestHost testHost = TestHost.InProcess) { var composition = FeaturesTestCompositions.Features.WithTestHostParts(testHost); var workspace = new AdhocWorkspace(composition.GetHostServices()); if (testHost == TestHost.OutOfProcess) { var remoteHostProvider = (InProcRemoteHostClientProvider)workspace.Services.GetRequiredService<IRemoteHostClientProvider>(); remoteHostProvider.TraceListener = new XunitTraceListener(_logger); } return workspace; } private Workspace CreateWorkspaceWithSingleProjectSolution(TestHost testHost, string[] sourceTexts, out Solution solution) { var pid = ProjectId.CreateNewId(); var workspace = CreateWorkspace(testHost); solution = workspace.CurrentSolution .AddProject(pid, "TestCases", "TestCases", LanguageNames.CSharp) .AddMetadataReference(pid, MscorlibRef); for (var i = 0; i < sourceTexts.Length; i++) { var did = DocumentId.CreateNewId(pid); solution = solution.AddDocument(did, "goo" + i + ".cs", SourceText.From(sourceTexts[i])); } return workspace; } private Workspace CreateWorkspaceWithMultipleProjectSolution(TestHost testHost, string[] sourceTexts, out Solution solution) { var workspace = CreateWorkspace(testHost); solution = workspace.CurrentSolution; for (var i = 0; i < sourceTexts.Length; i++) { var pid = ProjectId.CreateNewId(); var did = DocumentId.CreateNewId(pid); solution = solution .AddProject(pid, "TestCases" + i, "TestCases" + i, LanguageNames.CSharp) .AddMetadataReference(pid, MscorlibRef); solution = solution.AddDocument(did, "goo" + i + ".cs", SourceText.From(sourceTexts[i])); } return workspace; } private Workspace CreateWorkspaceWithSolution(SolutionKind solutionKind, out Solution solution, TestHost testHost = TestHost.InProcess) => solutionKind switch { SolutionKind.SingleClass => CreateWorkspaceWithSingleProjectSolution(testHost, new[] { SingleClass }, out solution), SolutionKind.SingleClassWithSingleMethod => CreateWorkspaceWithSingleProjectSolution(testHost, new[] { SingleClassWithSingleMethod }, out solution), SolutionKind.SingleClassWithSingleProperty => CreateWorkspaceWithSingleProjectSolution(testHost, new[] { SingleClassWithSingleProperty }, out solution), SolutionKind.SingleClassWithSingleField => CreateWorkspaceWithSingleProjectSolution(testHost, new[] { SingleClassWithSingleField }, out solution), SolutionKind.TwoProjectsEachWithASingleClassWithSingleMethod => CreateWorkspaceWithMultipleProjectSolution(testHost, new[] { SingleClassWithSingleMethod, SingleClassWithSingleMethod }, out solution), SolutionKind.TwoProjectsEachWithASingleClassWithSingleProperty => CreateWorkspaceWithMultipleProjectSolution(testHost, new[] { SingleClassWithSingleProperty, SingleClassWithSingleProperty }, out solution), SolutionKind.TwoProjectsEachWithASingleClassWithSingleField => CreateWorkspaceWithMultipleProjectSolution(testHost, new[] { SingleClassWithSingleField, SingleClassWithSingleField }, out solution), SolutionKind.NestedClass => CreateWorkspaceWithSingleProjectSolution(testHost, new[] { NestedClass }, out solution), SolutionKind.TwoNamespacesWithIdenticalClasses => CreateWorkspaceWithSingleProjectSolution(testHost, new[] { Namespace1, Namespace2 }, out solution), _ => throw ExceptionUtilities.UnexpectedValue(solutionKind), }; private Workspace CreateWorkspaceWithProject(SolutionKind solutionKind, out Project project, TestHost testHost = TestHost.InProcess) { var workspace = CreateWorkspaceWithSolution(solutionKind, out var solution, testHost); project = solution.Projects.First(); return workspace; } public enum SolutionKind { SingleClass, SingleClassWithSingleMethod, SingleClassWithSingleProperty, SingleClassWithSingleField, TwoProjectsEachWithASingleClassWithSingleMethod, TwoProjectsEachWithASingleClassWithSingleProperty, TwoProjectsEachWithASingleClassWithSingleField, NestedClass, TwoNamespacesWithIdenticalClasses } private const string SingleClass = @" using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TestCases { class TestCase { } } "; private const string SingleClassWithSingleMethod = @" using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TestCases { class TestCase { static void Test(string[] args) { } } } "; private const string SingleClassWithSingleProperty = @" using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TestCases { class TestCase { public int TestProperty{ get; set; } } } "; private const string SingleClassWithSingleField = @" using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TestCases { class TestCase { private int TestField = 0; } } "; private const string NestedClass = @" using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TestCases { class TestCase { class InnerTestCase { } } } "; private const string Namespace1 = @" using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TestCase1 { class TestCase { } } "; private const string Namespace2 = @" using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TestCase2 { class TestCase { } } "; } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System; using System.Collections.Generic; using System.Linq; using Microsoft.CodeAnalysis.Remote; using Microsoft.CodeAnalysis.Remote.Testing; using Microsoft.CodeAnalysis.Test.Utilities; using Microsoft.CodeAnalysis.Text; using Roslyn.Test.Utilities; using Roslyn.Utilities; using Xunit; using Xunit.Abstractions; namespace Microsoft.CodeAnalysis.UnitTests { public partial class FindAllDeclarationsTests { private readonly ITestOutputHelper _logger; public FindAllDeclarationsTests(ITestOutputHelper logger) { _logger = logger; } private static void Verify(string searchTerm, bool respectCase, SolutionKind workspaceKind, IEnumerable<ISymbol> declarations, params string[] expectedResults) { var actualResultCount = declarations.Count(); var expectedResultCount = expectedResults.Length; Assert.True(expectedResultCount == actualResultCount, string.Format("Search term '{0}' expected '{1}' results, found '{2}. Ignore case was set to '{3}', Workspace {4} was used", searchTerm, expectedResultCount, actualResultCount, respectCase, Enum.GetName(typeof(SolutionKind), workspaceKind))); if (actualResultCount > 0) { VerifyResults(declarations, expectedResults); } } private static void Verify(SolutionKind workspaceKind, IEnumerable<ISymbol> declarations, params string[] expectedResults) { var actualResultCount = declarations.Count(); var expectedResultCount = expectedResults.Length; Assert.True(expectedResultCount == actualResultCount, string.Format("Expected '{0}' results, found '{1}. Workspace {2} was used", expectedResultCount, actualResultCount, Enum.GetName(typeof(SolutionKind), workspaceKind))); if (actualResultCount > 0) { VerifyResults(declarations, expectedResults); } } private static void VerifyResults(IEnumerable<ISymbol> declarations, string[] expectedResults) { declarations = declarations.OrderBy(d => d.ToString()); expectedResults = expectedResults.OrderBy(r => r).ToArray(); for (var i = 0; i < expectedResults.Length; i++) { var actualResult = declarations.ElementAt(i).ToString(); var expectedResult = expectedResults[i]; Assert.True( string.Equals(actualResult, expectedResult, StringComparison.Ordinal), string.Format("Expected result to be {0} was {1}", expectedResult, actualResult)); } } private Workspace CreateWorkspace(TestHost testHost = TestHost.InProcess) { var composition = FeaturesTestCompositions.Features.WithTestHostParts(testHost); var workspace = new AdhocWorkspace(composition.GetHostServices()); if (testHost == TestHost.OutOfProcess) { var remoteHostProvider = (InProcRemoteHostClientProvider)workspace.Services.GetRequiredService<IRemoteHostClientProvider>(); remoteHostProvider.TraceListener = new XunitTraceListener(_logger); } return workspace; } private Workspace CreateWorkspaceWithSingleProjectSolution(TestHost testHost, string[] sourceTexts, out Solution solution) { var pid = ProjectId.CreateNewId(); var workspace = CreateWorkspace(testHost); solution = workspace.CurrentSolution .AddProject(pid, "TestCases", "TestCases", LanguageNames.CSharp) .AddMetadataReference(pid, MscorlibRef); for (var i = 0; i < sourceTexts.Length; i++) { var did = DocumentId.CreateNewId(pid); solution = solution.AddDocument(did, "goo" + i + ".cs", SourceText.From(sourceTexts[i])); } return workspace; } private Workspace CreateWorkspaceWithMultipleProjectSolution(TestHost testHost, string[] sourceTexts, out Solution solution) { var workspace = CreateWorkspace(testHost); solution = workspace.CurrentSolution; for (var i = 0; i < sourceTexts.Length; i++) { var pid = ProjectId.CreateNewId(); var did = DocumentId.CreateNewId(pid); solution = solution .AddProject(pid, "TestCases" + i, "TestCases" + i, LanguageNames.CSharp) .AddMetadataReference(pid, MscorlibRef); solution = solution.AddDocument(did, "goo" + i + ".cs", SourceText.From(sourceTexts[i])); } return workspace; } private Workspace CreateWorkspaceWithSolution(SolutionKind solutionKind, out Solution solution, TestHost testHost = TestHost.InProcess) => solutionKind switch { SolutionKind.SingleClass => CreateWorkspaceWithSingleProjectSolution(testHost, new[] { SingleClass }, out solution), SolutionKind.SingleClassWithSingleMethod => CreateWorkspaceWithSingleProjectSolution(testHost, new[] { SingleClassWithSingleMethod }, out solution), SolutionKind.SingleClassWithSingleProperty => CreateWorkspaceWithSingleProjectSolution(testHost, new[] { SingleClassWithSingleProperty }, out solution), SolutionKind.SingleClassWithSingleField => CreateWorkspaceWithSingleProjectSolution(testHost, new[] { SingleClassWithSingleField }, out solution), SolutionKind.TwoProjectsEachWithASingleClassWithSingleMethod => CreateWorkspaceWithMultipleProjectSolution(testHost, new[] { SingleClassWithSingleMethod, SingleClassWithSingleMethod }, out solution), SolutionKind.TwoProjectsEachWithASingleClassWithSingleProperty => CreateWorkspaceWithMultipleProjectSolution(testHost, new[] { SingleClassWithSingleProperty, SingleClassWithSingleProperty }, out solution), SolutionKind.TwoProjectsEachWithASingleClassWithSingleField => CreateWorkspaceWithMultipleProjectSolution(testHost, new[] { SingleClassWithSingleField, SingleClassWithSingleField }, out solution), SolutionKind.NestedClass => CreateWorkspaceWithSingleProjectSolution(testHost, new[] { NestedClass }, out solution), SolutionKind.TwoNamespacesWithIdenticalClasses => CreateWorkspaceWithSingleProjectSolution(testHost, new[] { Namespace1, Namespace2 }, out solution), _ => throw ExceptionUtilities.UnexpectedValue(solutionKind), }; private Workspace CreateWorkspaceWithProject(SolutionKind solutionKind, out Project project, TestHost testHost = TestHost.InProcess) { var workspace = CreateWorkspaceWithSolution(solutionKind, out var solution, testHost); project = solution.Projects.First(); return workspace; } public enum SolutionKind { SingleClass, SingleClassWithSingleMethod, SingleClassWithSingleProperty, SingleClassWithSingleField, TwoProjectsEachWithASingleClassWithSingleMethod, TwoProjectsEachWithASingleClassWithSingleProperty, TwoProjectsEachWithASingleClassWithSingleField, NestedClass, TwoNamespacesWithIdenticalClasses } private const string SingleClass = @" using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TestCases { class TestCase { } } "; private const string SingleClassWithSingleMethod = @" using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TestCases { class TestCase { static void Test(string[] args) { } } } "; private const string SingleClassWithSingleProperty = @" using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TestCases { class TestCase { public int TestProperty{ get; set; } } } "; private const string SingleClassWithSingleField = @" using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TestCases { class TestCase { private int TestField = 0; } } "; private const string NestedClass = @" using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TestCases { class TestCase { class InnerTestCase { } } } "; private const string Namespace1 = @" using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TestCase1 { class TestCase { } } "; private const string Namespace2 = @" using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TestCase2 { class TestCase { } } "; } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Compilers/VisualBasic/Test/Emit/ExpressionTrees/Results/UncheckedCTypeAndImplicitConversionsOdd.txt
-=-=-=-=-=-=-=-=- SByte -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Parameter( x type: System.SByte ) } return type: System.SByte type: System.Func`2[System.SByte,System.SByte] ) -=-=-=-=-=-=-=-=- CType(SByte, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.SByte,E_SByte] ) -=-=-=-=-=-=-=-=- SByte -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.SByte,System.Byte] ) -=-=-=-=-=-=-=-=- CType(SByte, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.SByte,E_Byte] ) -=-=-=-=-=-=-=-=- SByte -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.SByte,System.Int16] ) -=-=-=-=-=-=-=-=- CType(SByte, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: E_Short ) } return type: E_Short type: System.Func`2[System.SByte,E_Short] ) -=-=-=-=-=-=-=-=- SByte -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.SByte,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(SByte, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.SByte,E_UShort] ) -=-=-=-=-=-=-=-=- SByte -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.SByte,System.Int32] ) -=-=-=-=-=-=-=-=- CType(SByte, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.SByte,E_Integer] ) -=-=-=-=-=-=-=-=- SByte -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.SByte,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(SByte, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.SByte,E_UInteger] ) -=-=-=-=-=-=-=-=- SByte -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.SByte,System.Int64] ) -=-=-=-=-=-=-=-=- CType(SByte, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: E_Long ) } return type: E_Long type: System.Func`2[System.SByte,E_Long] ) -=-=-=-=-=-=-=-=- SByte -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Convert( Parameter( x type: System.SByte ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.SByte,System.Boolean] ) -=-=-=-=-=-=-=-=- SByte -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.SByte,System.Single] ) -=-=-=-=-=-=-=-=- CType(SByte, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.SByte,System.Single] ) -=-=-=-=-=-=-=-=- SByte -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.SByte,System.Double] ) -=-=-=-=-=-=-=-=- CType(SByte, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.SByte,System.Double] ) -=-=-=-=-=-=-=-=- CType(SByte, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Convert( Parameter( x type: System.SByte ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.SByte,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(SByte, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Convert( Parameter( x type: System.SByte ) type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.SByte,System.String] ) -=-=-=-=-=-=-=-=- SByte? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Parameter( x type: System.Nullable`1[System.SByte] ) Lifted type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[System.SByte],System.SByte] ) -=-=-=-=-=-=-=-=- CType(SByte?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[System.SByte],E_SByte] ) -=-=-=-=-=-=-=-=- SByte? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[System.SByte],System.Byte] ) -=-=-=-=-=-=-=-=- CType(SByte?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[System.SByte],E_Byte] ) -=-=-=-=-=-=-=-=- SByte? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[System.SByte],System.Int16] ) -=-=-=-=-=-=-=-=- CType(SByte?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[System.SByte],E_Short] ) -=-=-=-=-=-=-=-=- SByte? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[System.SByte],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(SByte?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[System.SByte],E_UShort] ) -=-=-=-=-=-=-=-=- SByte? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[System.SByte],System.Int32] ) -=-=-=-=-=-=-=-=- CType(SByte?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[System.SByte],E_Integer] ) -=-=-=-=-=-=-=-=- SByte? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[System.SByte],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(SByte?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[System.SByte],E_UInteger] ) -=-=-=-=-=-=-=-=- SByte? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[System.SByte],System.Int64] ) -=-=-=-=-=-=-=-=- CType(SByte?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[System.SByte],E_Long] ) -=-=-=-=-=-=-=-=- SByte? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[System.SByte],System.Boolean] ) -=-=-=-=-=-=-=-=- SByte? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.SByte],System.Single] ) -=-=-=-=-=-=-=-=- CType(SByte?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.SByte],System.Single] ) -=-=-=-=-=-=-=-=- SByte? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.SByte],System.Double] ) -=-=-=-=-=-=-=-=- CType(SByte?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.SByte],System.Double] ) -=-=-=-=-=-=-=-=- CType(SByte?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[System.SByte],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(SByte?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.SByte],System.String] ) -=-=-=-=-=-=-=-=- E_SByte -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: System.SByte ) } return type: System.SByte type: System.Func`2[E_SByte,System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_SByte, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Parameter( x type: E_SByte ) } return type: E_SByte type: System.Func`2[E_SByte,E_SByte] ) -=-=-=-=-=-=-=-=- E_SByte -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: System.Byte ) } return type: System.Byte type: System.Func`2[E_SByte,System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_SByte, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[E_SByte,E_Byte] ) -=-=-=-=-=-=-=-=- E_SByte -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[E_SByte,System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_SByte, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: E_Short ) } return type: E_Short type: System.Func`2[E_SByte,E_Short] ) -=-=-=-=-=-=-=-=- E_SByte -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[E_SByte,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_SByte, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: E_UShort ) } return type: E_UShort type: System.Func`2[E_SByte,E_UShort] ) -=-=-=-=-=-=-=-=- E_SByte -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[E_SByte,System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_SByte, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: E_Integer ) } return type: E_Integer type: System.Func`2[E_SByte,E_Integer] ) -=-=-=-=-=-=-=-=- E_SByte -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[E_SByte,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_SByte, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[E_SByte,E_UInteger] ) -=-=-=-=-=-=-=-=- E_SByte -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[E_SByte,System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_SByte, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: E_Long ) } return type: E_Long type: System.Func`2[E_SByte,E_Long] ) -=-=-=-=-=-=-=-=- E_SByte -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Convert( Parameter( x type: E_SByte ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[E_SByte,System.Boolean] ) -=-=-=-=-=-=-=-=- E_SByte -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: System.Single ) } return type: System.Single type: System.Func`2[E_SByte,System.Single] ) -=-=-=-=-=-=-=-=- CType(E_SByte, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: System.Single ) } return type: System.Single type: System.Func`2[E_SByte,System.Single] ) -=-=-=-=-=-=-=-=- E_SByte -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: System.Double ) } return type: System.Double type: System.Func`2[E_SByte,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_SByte, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: System.Double ) } return type: System.Double type: System.Func`2[E_SByte,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_SByte, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Convert( Parameter( x type: E_SByte ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[E_SByte,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_SByte, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Convert( Parameter( x type: E_SByte ) type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[E_SByte,System.String] ) -=-=-=-=-=-=-=-=- E_SByte? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[E_SByte],System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_SByte?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Parameter( x type: System.Nullable`1[E_SByte] ) Lifted type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[E_SByte],E_SByte] ) -=-=-=-=-=-=-=-=- E_SByte? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[E_SByte],System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_SByte?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[E_SByte],E_Byte] ) -=-=-=-=-=-=-=-=- E_SByte? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[E_SByte],System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_SByte?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[E_SByte],E_Short] ) -=-=-=-=-=-=-=-=- E_SByte? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[E_SByte],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_SByte?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[E_SByte],E_UShort] ) -=-=-=-=-=-=-=-=- E_SByte? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[E_SByte],System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_SByte?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[E_SByte],E_Integer] ) -=-=-=-=-=-=-=-=- E_SByte? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[E_SByte],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_SByte?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[E_SByte],E_UInteger] ) -=-=-=-=-=-=-=-=- E_SByte? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[E_SByte],System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_SByte?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[E_SByte],E_Long] ) -=-=-=-=-=-=-=-=- E_SByte? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[E_SByte],System.Boolean] ) -=-=-=-=-=-=-=-=- E_SByte? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_SByte],System.Single] ) -=-=-=-=-=-=-=-=- CType(E_SByte?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_SByte],System.Single] ) -=-=-=-=-=-=-=-=- E_SByte? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_SByte],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_SByte?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_SByte],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_SByte?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[E_SByte],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_SByte?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[E_SByte],System.String] ) -=-=-=-=-=-=-=-=- Byte -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Byte,System.SByte] ) -=-=-=-=-=-=-=-=- CType(Byte, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Byte,E_SByte] ) -=-=-=-=-=-=-=-=- Byte -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Parameter( x type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Byte,System.Byte] ) -=-=-=-=-=-=-=-=- CType(Byte, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Byte,E_Byte] ) -=-=-=-=-=-=-=-=- Byte -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Byte,System.Int16] ) -=-=-=-=-=-=-=-=- CType(Byte, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Byte,E_Short] ) -=-=-=-=-=-=-=-=- Byte -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Byte,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Byte, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Byte,E_UShort] ) -=-=-=-=-=-=-=-=- Byte -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Byte,System.Int32] ) -=-=-=-=-=-=-=-=- CType(Byte, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Byte,E_Integer] ) -=-=-=-=-=-=-=-=- Byte -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Byte,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Byte, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Byte,E_UInteger] ) -=-=-=-=-=-=-=-=- Byte -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Byte,System.Int64] ) -=-=-=-=-=-=-=-=- CType(Byte, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Byte,E_Long] ) -=-=-=-=-=-=-=-=- Byte -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Convert( Parameter( x type: System.Byte ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Byte,System.Boolean] ) -=-=-=-=-=-=-=-=- Byte -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Byte,System.Single] ) -=-=-=-=-=-=-=-=- CType(Byte, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Byte,System.Single] ) -=-=-=-=-=-=-=-=- Byte -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Byte,System.Double] ) -=-=-=-=-=-=-=-=- CType(Byte, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Byte,System.Double] ) -=-=-=-=-=-=-=-=- CType(Byte, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Convert( Parameter( x type: System.Byte ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Byte,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Byte, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) method: System.String ToString(Byte) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Byte,System.String] ) -=-=-=-=-=-=-=-=- Byte? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[System.Byte],System.SByte] ) -=-=-=-=-=-=-=-=- CType(Byte?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[System.Byte],E_SByte] ) -=-=-=-=-=-=-=-=- Byte? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Parameter( x type: System.Nullable`1[System.Byte] ) Lifted type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[System.Byte],System.Byte] ) -=-=-=-=-=-=-=-=- CType(Byte?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[System.Byte],E_Byte] ) -=-=-=-=-=-=-=-=- Byte? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[System.Byte],System.Int16] ) -=-=-=-=-=-=-=-=- CType(Byte?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[System.Byte],E_Short] ) -=-=-=-=-=-=-=-=- Byte? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[System.Byte],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Byte?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[System.Byte],E_UShort] ) -=-=-=-=-=-=-=-=- Byte? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[System.Byte],System.Int32] ) -=-=-=-=-=-=-=-=- CType(Byte?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[System.Byte],E_Integer] ) -=-=-=-=-=-=-=-=- Byte? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[System.Byte],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Byte?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[System.Byte],E_UInteger] ) -=-=-=-=-=-=-=-=- Byte? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[System.Byte],System.Int64] ) -=-=-=-=-=-=-=-=- CType(Byte?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[System.Byte],E_Long] ) -=-=-=-=-=-=-=-=- Byte? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[System.Byte],System.Boolean] ) -=-=-=-=-=-=-=-=- Byte? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Byte],System.Single] ) -=-=-=-=-=-=-=-=- CType(Byte?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Byte],System.Single] ) -=-=-=-=-=-=-=-=- Byte? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Byte],System.Double] ) -=-=-=-=-=-=-=-=- CType(Byte?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Byte],System.Double] ) -=-=-=-=-=-=-=-=- CType(Byte?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[System.Byte],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Byte?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) method: System.String ToString(Byte) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.Byte],System.String] ) -=-=-=-=-=-=-=-=- E_Byte -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: System.SByte ) } return type: System.SByte type: System.Func`2[E_Byte,System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_Byte, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[E_Byte,E_SByte] ) -=-=-=-=-=-=-=-=- E_Byte -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: System.Byte ) } return type: System.Byte type: System.Func`2[E_Byte,System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_Byte, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Parameter( x type: E_Byte ) } return type: E_Byte type: System.Func`2[E_Byte,E_Byte] ) -=-=-=-=-=-=-=-=- E_Byte -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[E_Byte,System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_Byte, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: E_Short ) } return type: E_Short type: System.Func`2[E_Byte,E_Short] ) -=-=-=-=-=-=-=-=- E_Byte -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[E_Byte,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_Byte, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: E_UShort ) } return type: E_UShort type: System.Func`2[E_Byte,E_UShort] ) -=-=-=-=-=-=-=-=- E_Byte -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[E_Byte,System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_Byte, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: E_Integer ) } return type: E_Integer type: System.Func`2[E_Byte,E_Integer] ) -=-=-=-=-=-=-=-=- E_Byte -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[E_Byte,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_Byte, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[E_Byte,E_UInteger] ) -=-=-=-=-=-=-=-=- E_Byte -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[E_Byte,System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_Byte, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: E_Long ) } return type: E_Long type: System.Func`2[E_Byte,E_Long] ) -=-=-=-=-=-=-=-=- E_Byte -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Convert( Parameter( x type: E_Byte ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[E_Byte,System.Boolean] ) -=-=-=-=-=-=-=-=- E_Byte -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: System.Single ) } return type: System.Single type: System.Func`2[E_Byte,System.Single] ) -=-=-=-=-=-=-=-=- CType(E_Byte, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: System.Single ) } return type: System.Single type: System.Func`2[E_Byte,System.Single] ) -=-=-=-=-=-=-=-=- E_Byte -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: System.Double ) } return type: System.Double type: System.Func`2[E_Byte,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Byte, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: System.Double ) } return type: System.Double type: System.Func`2[E_Byte,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Byte, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Convert( Parameter( x type: E_Byte ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[E_Byte,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_Byte, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Convert( Parameter( x type: E_Byte ) type: System.Byte ) method: System.String ToString(Byte) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[E_Byte,System.String] ) -=-=-=-=-=-=-=-=- E_Byte? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[E_Byte],System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_Byte?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[E_Byte],E_SByte] ) -=-=-=-=-=-=-=-=- E_Byte? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[E_Byte],System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_Byte?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Parameter( x type: System.Nullable`1[E_Byte] ) Lifted type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[E_Byte],E_Byte] ) -=-=-=-=-=-=-=-=- E_Byte? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[E_Byte],System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_Byte?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[E_Byte],E_Short] ) -=-=-=-=-=-=-=-=- E_Byte? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[E_Byte],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_Byte?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[E_Byte],E_UShort] ) -=-=-=-=-=-=-=-=- E_Byte? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[E_Byte],System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_Byte?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[E_Byte],E_Integer] ) -=-=-=-=-=-=-=-=- E_Byte? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[E_Byte],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_Byte?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[E_Byte],E_UInteger] ) -=-=-=-=-=-=-=-=- E_Byte? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[E_Byte],System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_Byte?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[E_Byte],E_Long] ) -=-=-=-=-=-=-=-=- E_Byte? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[E_Byte],System.Boolean] ) -=-=-=-=-=-=-=-=- E_Byte? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_Byte],System.Single] ) -=-=-=-=-=-=-=-=- CType(E_Byte?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_Byte],System.Single] ) -=-=-=-=-=-=-=-=- E_Byte? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_Byte],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Byte?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_Byte],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Byte?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[E_Byte],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_Byte?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.Byte ) method: System.String ToString(Byte) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[E_Byte],System.String] ) -=-=-=-=-=-=-=-=- Short -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Int16,System.SByte] ) -=-=-=-=-=-=-=-=- CType(Short, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Int16,E_SByte] ) -=-=-=-=-=-=-=-=- Short -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Int16,System.Byte] ) -=-=-=-=-=-=-=-=- CType(Short, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Int16,E_Byte] ) -=-=-=-=-=-=-=-=- Short -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Parameter( x type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Int16,System.Int16] ) -=-=-=-=-=-=-=-=- CType(Short, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Int16,E_Short] ) -=-=-=-=-=-=-=-=- Short -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Int16,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Short, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Int16,E_UShort] ) -=-=-=-=-=-=-=-=- Short -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Int16,System.Int32] ) -=-=-=-=-=-=-=-=- CType(Short, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Int16,E_Integer] ) -=-=-=-=-=-=-=-=- Short -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Int16,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Short, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Int16,E_UInteger] ) -=-=-=-=-=-=-=-=- Short -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Int16,System.Int64] ) -=-=-=-=-=-=-=-=- CType(Short, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Int16,E_Long] ) -=-=-=-=-=-=-=-=- Short -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Convert( Parameter( x type: System.Int16 ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Int16,System.Boolean] ) -=-=-=-=-=-=-=-=- Short -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Int16,System.Single] ) -=-=-=-=-=-=-=-=- CType(Short, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Int16,System.Single] ) -=-=-=-=-=-=-=-=- Short -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Int16,System.Double] ) -=-=-=-=-=-=-=-=- CType(Short, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Int16,System.Double] ) -=-=-=-=-=-=-=-=- CType(Short, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Convert( Parameter( x type: System.Int16 ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Int16,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Short, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Convert( Parameter( x type: System.Int16 ) type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Int16,System.String] ) -=-=-=-=-=-=-=-=- Short? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[System.Int16],System.SByte] ) -=-=-=-=-=-=-=-=- CType(Short?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[System.Int16],E_SByte] ) -=-=-=-=-=-=-=-=- Short? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[System.Int16],System.Byte] ) -=-=-=-=-=-=-=-=- CType(Short?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[System.Int16],E_Byte] ) -=-=-=-=-=-=-=-=- Short? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Parameter( x type: System.Nullable`1[System.Int16] ) Lifted type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[System.Int16],System.Int16] ) -=-=-=-=-=-=-=-=- CType(Short?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[System.Int16],E_Short] ) -=-=-=-=-=-=-=-=- Short? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[System.Int16],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Short?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[System.Int16],E_UShort] ) -=-=-=-=-=-=-=-=- Short? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[System.Int16],System.Int32] ) -=-=-=-=-=-=-=-=- CType(Short?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[System.Int16],E_Integer] ) -=-=-=-=-=-=-=-=- Short? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[System.Int16],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Short?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[System.Int16],E_UInteger] ) -=-=-=-=-=-=-=-=- Short? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[System.Int16],System.Int64] ) -=-=-=-=-=-=-=-=- CType(Short?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[System.Int16],E_Long] ) -=-=-=-=-=-=-=-=- Short? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[System.Int16],System.Boolean] ) -=-=-=-=-=-=-=-=- Short? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Int16],System.Single] ) -=-=-=-=-=-=-=-=- CType(Short?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Int16],System.Single] ) -=-=-=-=-=-=-=-=- Short? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Int16],System.Double] ) -=-=-=-=-=-=-=-=- CType(Short?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Int16],System.Double] ) -=-=-=-=-=-=-=-=- CType(Short?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[System.Int16],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Short?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.Int16],System.String] ) -=-=-=-=-=-=-=-=- E_Short -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: System.SByte ) } return type: System.SByte type: System.Func`2[E_Short,System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_Short, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: E_SByte ) } return type: E_SByte type: System.Func`2[E_Short,E_SByte] ) -=-=-=-=-=-=-=-=- E_Short -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: System.Byte ) } return type: System.Byte type: System.Func`2[E_Short,System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_Short, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: E_Byte ) } return type: E_Byte type: System.Func`2[E_Short,E_Byte] ) -=-=-=-=-=-=-=-=- E_Short -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[E_Short,System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_Short, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Parameter( x type: E_Short ) } return type: E_Short type: System.Func`2[E_Short,E_Short] ) -=-=-=-=-=-=-=-=- E_Short -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[E_Short,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_Short, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: E_UShort ) } return type: E_UShort type: System.Func`2[E_Short,E_UShort] ) -=-=-=-=-=-=-=-=- E_Short -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[E_Short,System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_Short, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: E_Integer ) } return type: E_Integer type: System.Func`2[E_Short,E_Integer] ) -=-=-=-=-=-=-=-=- E_Short -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[E_Short,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_Short, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[E_Short,E_UInteger] ) -=-=-=-=-=-=-=-=- E_Short -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[E_Short,System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_Short, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: E_Long ) } return type: E_Long type: System.Func`2[E_Short,E_Long] ) -=-=-=-=-=-=-=-=- E_Short -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Convert( Parameter( x type: E_Short ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[E_Short,System.Boolean] ) -=-=-=-=-=-=-=-=- E_Short -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: System.Single ) } return type: System.Single type: System.Func`2[E_Short,System.Single] ) -=-=-=-=-=-=-=-=- CType(E_Short, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: System.Single ) } return type: System.Single type: System.Func`2[E_Short,System.Single] ) -=-=-=-=-=-=-=-=- E_Short -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: System.Double ) } return type: System.Double type: System.Func`2[E_Short,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Short, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: System.Double ) } return type: System.Double type: System.Func`2[E_Short,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Short, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Convert( Parameter( x type: E_Short ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[E_Short,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_Short, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Convert( Parameter( x type: E_Short ) type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[E_Short,System.String] ) -=-=-=-=-=-=-=-=- E_Short? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[E_Short],System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_Short?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[E_Short],E_SByte] ) -=-=-=-=-=-=-=-=- E_Short? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[E_Short],System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_Short?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[E_Short],E_Byte] ) -=-=-=-=-=-=-=-=- E_Short? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[E_Short],System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_Short?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Parameter( x type: System.Nullable`1[E_Short] ) Lifted type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[E_Short],E_Short] ) -=-=-=-=-=-=-=-=- E_Short? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[E_Short],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_Short?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[E_Short],E_UShort] ) -=-=-=-=-=-=-=-=- E_Short? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[E_Short],System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_Short?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[E_Short],E_Integer] ) -=-=-=-=-=-=-=-=- E_Short? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[E_Short],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_Short?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[E_Short],E_UInteger] ) -=-=-=-=-=-=-=-=- E_Short? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[E_Short],System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_Short?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[E_Short],E_Long] ) -=-=-=-=-=-=-=-=- E_Short? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[E_Short],System.Boolean] ) -=-=-=-=-=-=-=-=- E_Short? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_Short],System.Single] ) -=-=-=-=-=-=-=-=- CType(E_Short?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_Short],System.Single] ) -=-=-=-=-=-=-=-=- E_Short? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_Short],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Short?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_Short],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Short?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[E_Short],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_Short?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[E_Short],System.String] ) -=-=-=-=-=-=-=-=- UShort -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.UInt16,System.SByte] ) -=-=-=-=-=-=-=-=- CType(UShort, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.UInt16,E_SByte] ) -=-=-=-=-=-=-=-=- UShort -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.UInt16,System.Byte] ) -=-=-=-=-=-=-=-=- CType(UShort, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.UInt16,E_Byte] ) -=-=-=-=-=-=-=-=- UShort -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.UInt16,System.Int16] ) -=-=-=-=-=-=-=-=- CType(UShort, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.UInt16,E_Short] ) -=-=-=-=-=-=-=-=- UShort -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Parameter( x type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.UInt16,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(UShort, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.UInt16,E_UShort] ) -=-=-=-=-=-=-=-=- UShort -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.UInt16,System.Int32] ) -=-=-=-=-=-=-=-=- CType(UShort, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.UInt16,E_Integer] ) -=-=-=-=-=-=-=-=- UShort -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.UInt16,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(UShort, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.UInt16,E_UInteger] ) -=-=-=-=-=-=-=-=- UShort -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.UInt16,System.Int64] ) -=-=-=-=-=-=-=-=- CType(UShort, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.UInt16,E_Long] ) -=-=-=-=-=-=-=-=- UShort -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Convert( Parameter( x type: System.UInt16 ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.UInt16,System.Boolean] ) -=-=-=-=-=-=-=-=- UShort -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.UInt16,System.Single] ) -=-=-=-=-=-=-=-=- CType(UShort, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.UInt16,System.Single] ) -=-=-=-=-=-=-=-=- UShort -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.UInt16,System.Double] ) -=-=-=-=-=-=-=-=- CType(UShort, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.UInt16,System.Double] ) -=-=-=-=-=-=-=-=- CType(UShort, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Convert( Parameter( x type: System.UInt16 ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.UInt16,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(UShort, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Convert( Parameter( x type: System.UInt16 ) type: System.UInt32 ) method: System.String ToString(UInt32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.UInt16,System.String] ) -=-=-=-=-=-=-=-=- UShort? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[System.UInt16],System.SByte] ) -=-=-=-=-=-=-=-=- CType(UShort?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[System.UInt16],E_SByte] ) -=-=-=-=-=-=-=-=- UShort? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[System.UInt16],System.Byte] ) -=-=-=-=-=-=-=-=- CType(UShort?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[System.UInt16],E_Byte] ) -=-=-=-=-=-=-=-=- UShort? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[System.UInt16],System.Int16] ) -=-=-=-=-=-=-=-=- CType(UShort?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[System.UInt16],E_Short] ) -=-=-=-=-=-=-=-=- UShort? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) Lifted type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[System.UInt16],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(UShort?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[System.UInt16],E_UShort] ) -=-=-=-=-=-=-=-=- UShort? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[System.UInt16],System.Int32] ) -=-=-=-=-=-=-=-=- CType(UShort?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[System.UInt16],E_Integer] ) -=-=-=-=-=-=-=-=- UShort? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[System.UInt16],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(UShort?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[System.UInt16],E_UInteger] ) -=-=-=-=-=-=-=-=- UShort? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[System.UInt16],System.Int64] ) -=-=-=-=-=-=-=-=- CType(UShort?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[System.UInt16],E_Long] ) -=-=-=-=-=-=-=-=- UShort? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[System.UInt16],System.Boolean] ) -=-=-=-=-=-=-=-=- UShort? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.UInt16],System.Single] ) -=-=-=-=-=-=-=-=- CType(UShort?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.UInt16],System.Single] ) -=-=-=-=-=-=-=-=- UShort? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.UInt16],System.Double] ) -=-=-=-=-=-=-=-=- CType(UShort?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.UInt16],System.Double] ) -=-=-=-=-=-=-=-=- CType(UShort?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[System.UInt16],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(UShort?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.UInt32 ) method: System.String ToString(UInt32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.UInt16],System.String] ) -=-=-=-=-=-=-=-=- E_UShort -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: System.SByte ) } return type: System.SByte type: System.Func`2[E_UShort,System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_UShort, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: E_SByte ) } return type: E_SByte type: System.Func`2[E_UShort,E_SByte] ) -=-=-=-=-=-=-=-=- E_UShort -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: System.Byte ) } return type: System.Byte type: System.Func`2[E_UShort,System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_UShort, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: E_Byte ) } return type: E_Byte type: System.Func`2[E_UShort,E_Byte] ) -=-=-=-=-=-=-=-=- E_UShort -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[E_UShort,System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_UShort, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: E_Short ) } return type: E_Short type: System.Func`2[E_UShort,E_Short] ) -=-=-=-=-=-=-=-=- E_UShort -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[E_UShort,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_UShort, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Parameter( x type: E_UShort ) } return type: E_UShort type: System.Func`2[E_UShort,E_UShort] ) -=-=-=-=-=-=-=-=- E_UShort -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[E_UShort,System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_UShort, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: E_Integer ) } return type: E_Integer type: System.Func`2[E_UShort,E_Integer] ) -=-=-=-=-=-=-=-=- E_UShort -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[E_UShort,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_UShort, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[E_UShort,E_UInteger] ) -=-=-=-=-=-=-=-=- E_UShort -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[E_UShort,System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_UShort, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: E_Long ) } return type: E_Long type: System.Func`2[E_UShort,E_Long] ) -=-=-=-=-=-=-=-=- E_UShort -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Convert( Parameter( x type: E_UShort ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[E_UShort,System.Boolean] ) -=-=-=-=-=-=-=-=- E_UShort -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: System.Single ) } return type: System.Single type: System.Func`2[E_UShort,System.Single] ) -=-=-=-=-=-=-=-=- CType(E_UShort, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: System.Single ) } return type: System.Single type: System.Func`2[E_UShort,System.Single] ) -=-=-=-=-=-=-=-=- E_UShort -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: System.Double ) } return type: System.Double type: System.Func`2[E_UShort,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_UShort, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: System.Double ) } return type: System.Double type: System.Func`2[E_UShort,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_UShort, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Convert( Parameter( x type: E_UShort ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[E_UShort,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_UShort, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Convert( Parameter( x type: E_UShort ) type: System.UInt32 ) method: System.String ToString(UInt32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[E_UShort,System.String] ) -=-=-=-=-=-=-=-=- E_UShort? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[E_UShort],System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_UShort?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[E_UShort],E_SByte] ) -=-=-=-=-=-=-=-=- E_UShort? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[E_UShort],System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_UShort?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[E_UShort],E_Byte] ) -=-=-=-=-=-=-=-=- E_UShort? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[E_UShort],System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_UShort?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[E_UShort],E_Short] ) -=-=-=-=-=-=-=-=- E_UShort? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[E_UShort],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_UShort?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Parameter( x type: System.Nullable`1[E_UShort] ) Lifted type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[E_UShort],E_UShort] ) -=-=-=-=-=-=-=-=- E_UShort? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[E_UShort],System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_UShort?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[E_UShort],E_Integer] ) -=-=-=-=-=-=-=-=- E_UShort? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[E_UShort],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_UShort?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[E_UShort],E_UInteger] ) -=-=-=-=-=-=-=-=- E_UShort? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[E_UShort],System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_UShort?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[E_UShort],E_Long] ) -=-=-=-=-=-=-=-=- E_UShort? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[E_UShort],System.Boolean] ) -=-=-=-=-=-=-=-=- E_UShort? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_UShort],System.Single] ) -=-=-=-=-=-=-=-=- CType(E_UShort?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_UShort],System.Single] ) -=-=-=-=-=-=-=-=- E_UShort? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_UShort],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_UShort?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_UShort],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_UShort?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[E_UShort],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_UShort?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.UInt32 ) method: System.String ToString(UInt32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[E_UShort],System.String] ) -=-=-=-=-=-=-=-=- Integer -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Int32,System.SByte] ) -=-=-=-=-=-=-=-=- CType(Integer, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Int32,E_SByte] ) -=-=-=-=-=-=-=-=- Integer -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Int32,System.Byte] ) -=-=-=-=-=-=-=-=- CType(Integer, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Int32,E_Byte] ) -=-=-=-=-=-=-=-=- Integer -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Int32,System.Int16] ) -=-=-=-=-=-=-=-=- CType(Integer, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Int32,E_Short] ) -=-=-=-=-=-=-=-=- Integer -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Int32,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Integer, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Int32,E_UShort] ) -=-=-=-=-=-=-=-=- Integer -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Parameter( x type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Int32,System.Int32] ) -=-=-=-=-=-=-=-=- CType(Integer, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Int32,E_Integer] ) -=-=-=-=-=-=-=-=- Integer -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Int32,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Integer, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Int32,E_UInteger] ) -=-=-=-=-=-=-=-=- Integer -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Int32,System.Int64] ) -=-=-=-=-=-=-=-=- CType(Integer, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Int32,E_Long] ) -=-=-=-=-=-=-=-=- Integer -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Int32,System.Boolean] ) -=-=-=-=-=-=-=-=- Integer -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Int32,System.Single] ) -=-=-=-=-=-=-=-=- CType(Integer, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Int32,System.Single] ) -=-=-=-=-=-=-=-=- Integer -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Int32,System.Double] ) -=-=-=-=-=-=-=-=- CType(Integer, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Int32,System.Double] ) -=-=-=-=-=-=-=-=- CType(Integer, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Int32,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Integer, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Int32,System.String] ) -=-=-=-=-=-=-=-=- Integer? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[System.Int32],System.SByte] ) -=-=-=-=-=-=-=-=- CType(Integer?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[System.Int32],E_SByte] ) -=-=-=-=-=-=-=-=- Integer? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[System.Int32],System.Byte] ) -=-=-=-=-=-=-=-=- CType(Integer?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[System.Int32],E_Byte] ) -=-=-=-=-=-=-=-=- Integer? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[System.Int32],System.Int16] ) -=-=-=-=-=-=-=-=- CType(Integer?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[System.Int32],E_Short] ) -=-=-=-=-=-=-=-=- Integer? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[System.Int32],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Integer?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[System.Int32],E_UShort] ) -=-=-=-=-=-=-=-=- Integer? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Parameter( x type: System.Nullable`1[System.Int32] ) Lifted type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[System.Int32],System.Int32] ) -=-=-=-=-=-=-=-=- CType(Integer?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[System.Int32],E_Integer] ) -=-=-=-=-=-=-=-=- Integer? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[System.Int32],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Integer?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[System.Int32],E_UInteger] ) -=-=-=-=-=-=-=-=- Integer? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[System.Int32],System.Int64] ) -=-=-=-=-=-=-=-=- CType(Integer?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[System.Int32],E_Long] ) -=-=-=-=-=-=-=-=- Integer? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[System.Int32],System.Boolean] ) -=-=-=-=-=-=-=-=- Integer? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Int32],System.Single] ) -=-=-=-=-=-=-=-=- CType(Integer?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Int32],System.Single] ) -=-=-=-=-=-=-=-=- Integer? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Int32],System.Double] ) -=-=-=-=-=-=-=-=- CType(Integer?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Int32],System.Double] ) -=-=-=-=-=-=-=-=- CType(Integer?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[System.Int32],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Integer?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.Int32],System.String] ) -=-=-=-=-=-=-=-=- E_Integer -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: System.SByte ) } return type: System.SByte type: System.Func`2[E_Integer,System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_Integer, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: E_SByte ) } return type: E_SByte type: System.Func`2[E_Integer,E_SByte] ) -=-=-=-=-=-=-=-=- E_Integer -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: System.Byte ) } return type: System.Byte type: System.Func`2[E_Integer,System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_Integer, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: E_Byte ) } return type: E_Byte type: System.Func`2[E_Integer,E_Byte] ) -=-=-=-=-=-=-=-=- E_Integer -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[E_Integer,System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_Integer, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: E_Short ) } return type: E_Short type: System.Func`2[E_Integer,E_Short] ) -=-=-=-=-=-=-=-=- E_Integer -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[E_Integer,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_Integer, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: E_UShort ) } return type: E_UShort type: System.Func`2[E_Integer,E_UShort] ) -=-=-=-=-=-=-=-=- E_Integer -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[E_Integer,System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_Integer, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Parameter( x type: E_Integer ) } return type: E_Integer type: System.Func`2[E_Integer,E_Integer] ) -=-=-=-=-=-=-=-=- E_Integer -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[E_Integer,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_Integer, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[E_Integer,E_UInteger] ) -=-=-=-=-=-=-=-=- E_Integer -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[E_Integer,System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_Integer, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: E_Long ) } return type: E_Long type: System.Func`2[E_Integer,E_Long] ) -=-=-=-=-=-=-=-=- E_Integer -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Convert( Parameter( x type: E_Integer ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[E_Integer,System.Boolean] ) -=-=-=-=-=-=-=-=- E_Integer -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: System.Single ) } return type: System.Single type: System.Func`2[E_Integer,System.Single] ) -=-=-=-=-=-=-=-=- CType(E_Integer, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: System.Single ) } return type: System.Single type: System.Func`2[E_Integer,System.Single] ) -=-=-=-=-=-=-=-=- E_Integer -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: System.Double ) } return type: System.Double type: System.Func`2[E_Integer,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Integer, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: System.Double ) } return type: System.Double type: System.Func`2[E_Integer,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Integer, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Convert( Parameter( x type: E_Integer ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[E_Integer,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_Integer, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Convert( Parameter( x type: E_Integer ) type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[E_Integer,System.String] ) -=-=-=-=-=-=-=-=- E_Integer? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[E_Integer],System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_Integer?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[E_Integer],E_SByte] ) -=-=-=-=-=-=-=-=- E_Integer? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[E_Integer],System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_Integer?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[E_Integer],E_Byte] ) -=-=-=-=-=-=-=-=- E_Integer? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[E_Integer],System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_Integer?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[E_Integer],E_Short] ) -=-=-=-=-=-=-=-=- E_Integer? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[E_Integer],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_Integer?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[E_Integer],E_UShort] ) -=-=-=-=-=-=-=-=- E_Integer? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[E_Integer],System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_Integer?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Parameter( x type: System.Nullable`1[E_Integer] ) Lifted type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[E_Integer],E_Integer] ) -=-=-=-=-=-=-=-=- E_Integer? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[E_Integer],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_Integer?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[E_Integer],E_UInteger] ) -=-=-=-=-=-=-=-=- E_Integer? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[E_Integer],System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_Integer?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[E_Integer],E_Long] ) -=-=-=-=-=-=-=-=- E_Integer? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[E_Integer],System.Boolean] ) -=-=-=-=-=-=-=-=- E_Integer? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_Integer],System.Single] ) -=-=-=-=-=-=-=-=- CType(E_Integer?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_Integer],System.Single] ) -=-=-=-=-=-=-=-=- E_Integer? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_Integer],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Integer?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_Integer],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Integer?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[E_Integer],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_Integer?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[E_Integer],System.String] ) -=-=-=-=-=-=-=-=- UInteger -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.UInt32,System.SByte] ) -=-=-=-=-=-=-=-=- CType(UInteger, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.UInt32,E_SByte] ) -=-=-=-=-=-=-=-=- UInteger -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.UInt32,System.Byte] ) -=-=-=-=-=-=-=-=- CType(UInteger, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.UInt32,E_Byte] ) -=-=-=-=-=-=-=-=- UInteger -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.UInt32,System.Int16] ) -=-=-=-=-=-=-=-=- CType(UInteger, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.UInt32,E_Short] ) -=-=-=-=-=-=-=-=- UInteger -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.UInt32,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(UInteger, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.UInt32,E_UShort] ) -=-=-=-=-=-=-=-=- UInteger -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.UInt32,System.Int32] ) -=-=-=-=-=-=-=-=- CType(UInteger, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.UInt32,E_Integer] ) -=-=-=-=-=-=-=-=- UInteger -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Parameter( x type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.UInt32,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(UInteger, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.UInt32,E_UInteger] ) -=-=-=-=-=-=-=-=- UInteger -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.UInt32,System.Int64] ) -=-=-=-=-=-=-=-=- CType(UInteger, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.UInt32,E_Long] ) -=-=-=-=-=-=-=-=- UInteger -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) method: Boolean ToBoolean(UInt32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.UInt32,System.Boolean] ) -=-=-=-=-=-=-=-=- UInteger -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.UInt32,System.Single] ) -=-=-=-=-=-=-=-=- CType(UInteger, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.UInt32,System.Single] ) -=-=-=-=-=-=-=-=- UInteger -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.UInt32,System.Double] ) -=-=-=-=-=-=-=-=- CType(UInteger, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.UInt32,System.Double] ) -=-=-=-=-=-=-=-=- CType(UInteger, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) method: System.Decimal op_Implicit(UInt32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.UInt32,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(UInteger, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) method: System.String ToString(UInt32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.UInt32,System.String] ) -=-=-=-=-=-=-=-=- UInteger? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[System.UInt32],System.SByte] ) -=-=-=-=-=-=-=-=- CType(UInteger?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[System.UInt32],E_SByte] ) -=-=-=-=-=-=-=-=- UInteger? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[System.UInt32],System.Byte] ) -=-=-=-=-=-=-=-=- CType(UInteger?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[System.UInt32],E_Byte] ) -=-=-=-=-=-=-=-=- UInteger? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[System.UInt32],System.Int16] ) -=-=-=-=-=-=-=-=- CType(UInteger?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[System.UInt32],E_Short] ) -=-=-=-=-=-=-=-=- UInteger? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[System.UInt32],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(UInteger?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[System.UInt32],E_UShort] ) -=-=-=-=-=-=-=-=- UInteger? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[System.UInt32],System.Int32] ) -=-=-=-=-=-=-=-=- CType(UInteger?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[System.UInt32],E_Integer] ) -=-=-=-=-=-=-=-=- UInteger? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) Lifted type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[System.UInt32],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(UInteger?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[System.UInt32],E_UInteger] ) -=-=-=-=-=-=-=-=- UInteger? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[System.UInt32],System.Int64] ) -=-=-=-=-=-=-=-=- CType(UInteger?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[System.UInt32],E_Long] ) -=-=-=-=-=-=-=-=- UInteger? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) method: Boolean ToBoolean(UInt32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[System.UInt32],System.Boolean] ) -=-=-=-=-=-=-=-=- UInteger? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.UInt32],System.Single] ) -=-=-=-=-=-=-=-=- CType(UInteger?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.UInt32],System.Single] ) -=-=-=-=-=-=-=-=- UInteger? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.UInt32],System.Double] ) -=-=-=-=-=-=-=-=- CType(UInteger?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.UInt32],System.Double] ) -=-=-=-=-=-=-=-=- CType(UInteger?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) method: System.Decimal op_Implicit(UInt32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[System.UInt32],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(UInteger?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) method: System.String ToString(UInt32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.UInt32],System.String] ) -=-=-=-=-=-=-=-=- E_UInteger -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: System.SByte ) } return type: System.SByte type: System.Func`2[E_UInteger,System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_UInteger, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: E_SByte ) } return type: E_SByte type: System.Func`2[E_UInteger,E_SByte] ) -=-=-=-=-=-=-=-=- E_UInteger -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: System.Byte ) } return type: System.Byte type: System.Func`2[E_UInteger,System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_UInteger, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: E_Byte ) } return type: E_Byte type: System.Func`2[E_UInteger,E_Byte] ) -=-=-=-=-=-=-=-=- E_UInteger -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[E_UInteger,System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_UInteger, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: E_Short ) } return type: E_Short type: System.Func`2[E_UInteger,E_Short] ) -=-=-=-=-=-=-=-=- E_UInteger -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[E_UInteger,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_UInteger, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: E_UShort ) } return type: E_UShort type: System.Func`2[E_UInteger,E_UShort] ) -=-=-=-=-=-=-=-=- E_UInteger -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[E_UInteger,System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_UInteger, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: E_Integer ) } return type: E_Integer type: System.Func`2[E_UInteger,E_Integer] ) -=-=-=-=-=-=-=-=- E_UInteger -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[E_UInteger,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_UInteger, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Parameter( x type: E_UInteger ) } return type: E_UInteger type: System.Func`2[E_UInteger,E_UInteger] ) -=-=-=-=-=-=-=-=- E_UInteger -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[E_UInteger,System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_UInteger, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: E_Long ) } return type: E_Long type: System.Func`2[E_UInteger,E_Long] ) -=-=-=-=-=-=-=-=- E_UInteger -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Convert( Parameter( x type: E_UInteger ) type: System.UInt32 ) method: Boolean ToBoolean(UInt32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[E_UInteger,System.Boolean] ) -=-=-=-=-=-=-=-=- E_UInteger -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: System.Single ) } return type: System.Single type: System.Func`2[E_UInteger,System.Single] ) -=-=-=-=-=-=-=-=- CType(E_UInteger, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: System.Single ) } return type: System.Single type: System.Func`2[E_UInteger,System.Single] ) -=-=-=-=-=-=-=-=- E_UInteger -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: System.Double ) } return type: System.Double type: System.Func`2[E_UInteger,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_UInteger, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: System.Double ) } return type: System.Double type: System.Func`2[E_UInteger,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_UInteger, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Convert( Parameter( x type: E_UInteger ) type: System.UInt32 ) method: System.Decimal op_Implicit(UInt32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[E_UInteger,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_UInteger, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Convert( Parameter( x type: E_UInteger ) type: System.UInt32 ) method: System.String ToString(UInt32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[E_UInteger,System.String] ) -=-=-=-=-=-=-=-=- E_UInteger? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[E_UInteger],System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_UInteger?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[E_UInteger],E_SByte] ) -=-=-=-=-=-=-=-=- E_UInteger? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[E_UInteger],System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_UInteger?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[E_UInteger],E_Byte] ) -=-=-=-=-=-=-=-=- E_UInteger? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[E_UInteger],System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_UInteger?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[E_UInteger],E_Short] ) -=-=-=-=-=-=-=-=- E_UInteger? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[E_UInteger],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_UInteger?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[E_UInteger],E_UShort] ) -=-=-=-=-=-=-=-=- E_UInteger? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[E_UInteger],System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_UInteger?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[E_UInteger],E_Integer] ) -=-=-=-=-=-=-=-=- E_UInteger? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[E_UInteger],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_UInteger?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) Lifted type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[E_UInteger],E_UInteger] ) -=-=-=-=-=-=-=-=- E_UInteger? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[E_UInteger],System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_UInteger?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[E_UInteger],E_Long] ) -=-=-=-=-=-=-=-=- E_UInteger? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.UInt32 ) method: Boolean ToBoolean(UInt32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[E_UInteger],System.Boolean] ) -=-=-=-=-=-=-=-=- E_UInteger? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_UInteger],System.Single] ) -=-=-=-=-=-=-=-=- CType(E_UInteger?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_UInteger],System.Single] ) -=-=-=-=-=-=-=-=- E_UInteger? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_UInteger],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_UInteger?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_UInteger],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_UInteger?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.UInt32 ) method: System.Decimal op_Implicit(UInt32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[E_UInteger],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_UInteger?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.UInt32 ) method: System.String ToString(UInt32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[E_UInteger],System.String] ) -=-=-=-=-=-=-=-=- Long -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Int64,System.SByte] ) -=-=-=-=-=-=-=-=- CType(Long, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Int64,E_SByte] ) -=-=-=-=-=-=-=-=- Long -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Int64,System.Byte] ) -=-=-=-=-=-=-=-=- CType(Long, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Int64,E_Byte] ) -=-=-=-=-=-=-=-=- Long -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Int64,System.Int16] ) -=-=-=-=-=-=-=-=- CType(Long, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Int64,E_Short] ) -=-=-=-=-=-=-=-=- Long -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Int64,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Long, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Int64,E_UShort] ) -=-=-=-=-=-=-=-=- Long -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Int64,System.Int32] ) -=-=-=-=-=-=-=-=- CType(Long, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Int64,E_Integer] ) -=-=-=-=-=-=-=-=- Long -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Int64,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Long, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Int64,E_UInteger] ) -=-=-=-=-=-=-=-=- Long -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Parameter( x type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Int64,System.Int64] ) -=-=-=-=-=-=-=-=- CType(Long, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Int64,E_Long] ) -=-=-=-=-=-=-=-=- Long -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) method: Boolean ToBoolean(Int64) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Int64,System.Boolean] ) -=-=-=-=-=-=-=-=- Long -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Int64,System.Single] ) -=-=-=-=-=-=-=-=- CType(Long, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Int64,System.Single] ) -=-=-=-=-=-=-=-=- Long -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Int64,System.Double] ) -=-=-=-=-=-=-=-=- CType(Long, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Int64,System.Double] ) -=-=-=-=-=-=-=-=- CType(Long, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) method: System.Decimal op_Implicit(Int64) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Int64,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Long, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) method: System.String ToString(Int64) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Int64,System.String] ) -=-=-=-=-=-=-=-=- Long? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[System.Int64],System.SByte] ) -=-=-=-=-=-=-=-=- CType(Long?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[System.Int64],E_SByte] ) -=-=-=-=-=-=-=-=- Long? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[System.Int64],System.Byte] ) -=-=-=-=-=-=-=-=- CType(Long?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[System.Int64],E_Byte] ) -=-=-=-=-=-=-=-=- Long? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[System.Int64],System.Int16] ) -=-=-=-=-=-=-=-=- CType(Long?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[System.Int64],E_Short] ) -=-=-=-=-=-=-=-=- Long? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[System.Int64],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Long?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[System.Int64],E_UShort] ) -=-=-=-=-=-=-=-=- Long? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[System.Int64],System.Int32] ) -=-=-=-=-=-=-=-=- CType(Long?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[System.Int64],E_Integer] ) -=-=-=-=-=-=-=-=- Long? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[System.Int64],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Long?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[System.Int64],E_UInteger] ) -=-=-=-=-=-=-=-=- Long? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Parameter( x type: System.Nullable`1[System.Int64] ) Lifted type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[System.Int64],System.Int64] ) -=-=-=-=-=-=-=-=- CType(Long?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[System.Int64],E_Long] ) -=-=-=-=-=-=-=-=- Long? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) method: Boolean ToBoolean(Int64) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[System.Int64],System.Boolean] ) -=-=-=-=-=-=-=-=- Long? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Int64],System.Single] ) -=-=-=-=-=-=-=-=- CType(Long?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Int64],System.Single] ) -=-=-=-=-=-=-=-=- Long? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Int64],System.Double] ) -=-=-=-=-=-=-=-=- CType(Long?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Int64],System.Double] ) -=-=-=-=-=-=-=-=- CType(Long?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) method: System.Decimal op_Implicit(Int64) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[System.Int64],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Long?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) method: System.String ToString(Int64) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.Int64],System.String] ) -=-=-=-=-=-=-=-=- E_Long -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: System.SByte ) } return type: System.SByte type: System.Func`2[E_Long,System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_Long, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: E_SByte ) } return type: E_SByte type: System.Func`2[E_Long,E_SByte] ) -=-=-=-=-=-=-=-=- E_Long -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: System.Byte ) } return type: System.Byte type: System.Func`2[E_Long,System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_Long, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: E_Byte ) } return type: E_Byte type: System.Func`2[E_Long,E_Byte] ) -=-=-=-=-=-=-=-=- E_Long -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[E_Long,System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_Long, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: E_Short ) } return type: E_Short type: System.Func`2[E_Long,E_Short] ) -=-=-=-=-=-=-=-=- E_Long -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[E_Long,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_Long, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: E_UShort ) } return type: E_UShort type: System.Func`2[E_Long,E_UShort] ) -=-=-=-=-=-=-=-=- E_Long -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[E_Long,System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_Long, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: E_Integer ) } return type: E_Integer type: System.Func`2[E_Long,E_Integer] ) -=-=-=-=-=-=-=-=- E_Long -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[E_Long,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_Long, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[E_Long,E_UInteger] ) -=-=-=-=-=-=-=-=- E_Long -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[E_Long,System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_Long, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Parameter( x type: E_Long ) } return type: E_Long type: System.Func`2[E_Long,E_Long] ) -=-=-=-=-=-=-=-=- E_Long -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Convert( Parameter( x type: E_Long ) type: System.Int64 ) method: Boolean ToBoolean(Int64) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[E_Long,System.Boolean] ) -=-=-=-=-=-=-=-=- E_Long -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: System.Single ) } return type: System.Single type: System.Func`2[E_Long,System.Single] ) -=-=-=-=-=-=-=-=- CType(E_Long, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: System.Single ) } return type: System.Single type: System.Func`2[E_Long,System.Single] ) -=-=-=-=-=-=-=-=- E_Long -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: System.Double ) } return type: System.Double type: System.Func`2[E_Long,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Long, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: System.Double ) } return type: System.Double type: System.Func`2[E_Long,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Long, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Convert( Parameter( x type: E_Long ) type: System.Int64 ) method: System.Decimal op_Implicit(Int64) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[E_Long,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_Long, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Convert( Parameter( x type: E_Long ) type: System.Int64 ) method: System.String ToString(Int64) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[E_Long,System.String] ) -=-=-=-=-=-=-=-=- E_Long? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[E_Long],System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_Long?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[E_Long],E_SByte] ) -=-=-=-=-=-=-=-=- E_Long? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[E_Long],System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_Long?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[E_Long],E_Byte] ) -=-=-=-=-=-=-=-=- E_Long? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[E_Long],System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_Long?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[E_Long],E_Short] ) -=-=-=-=-=-=-=-=- E_Long? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[E_Long],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_Long?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[E_Long],E_UShort] ) -=-=-=-=-=-=-=-=- E_Long? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[E_Long],System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_Long?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[E_Long],E_Integer] ) -=-=-=-=-=-=-=-=- E_Long? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[E_Long],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_Long?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[E_Long],E_UInteger] ) -=-=-=-=-=-=-=-=- E_Long? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[E_Long],System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_Long?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Parameter( x type: System.Nullable`1[E_Long] ) Lifted type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[E_Long],E_Long] ) -=-=-=-=-=-=-=-=- E_Long? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.Int64 ) method: Boolean ToBoolean(Int64) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[E_Long],System.Boolean] ) -=-=-=-=-=-=-=-=- E_Long? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_Long],System.Single] ) -=-=-=-=-=-=-=-=- CType(E_Long?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_Long],System.Single] ) -=-=-=-=-=-=-=-=- E_Long? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_Long],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Long?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_Long],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Long?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.Int64 ) method: System.Decimal op_Implicit(Int64) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[E_Long],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_Long?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.Int64 ) method: System.String ToString(Int64) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[E_Long],System.String] ) -=-=-=-=-=-=-=-=- Boolean -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Boolean,System.SByte] ) -=-=-=-=-=-=-=-=- CType(Boolean, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Boolean,E_SByte] ) -=-=-=-=-=-=-=-=- Boolean -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Boolean,System.Byte] ) -=-=-=-=-=-=-=-=- CType(Boolean, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Boolean,E_Byte] ) -=-=-=-=-=-=-=-=- Boolean -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int16 ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Boolean,System.Int16] ) -=-=-=-=-=-=-=-=- CType(Boolean, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int16 ) type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Boolean,E_Short] ) -=-=-=-=-=-=-=-=- Boolean -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int16 ) type: System.Int16 ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Boolean,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Boolean, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int16 ) type: System.Int16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Boolean,E_UShort] ) -=-=-=-=-=-=-=-=- Boolean -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Boolean,System.Int32] ) -=-=-=-=-=-=-=-=- CType(Boolean, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Boolean,E_Integer] ) -=-=-=-=-=-=-=-=- Boolean -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Boolean,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Boolean, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Boolean,E_UInteger] ) -=-=-=-=-=-=-=-=- Boolean -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int64 ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Boolean,System.Int64] ) -=-=-=-=-=-=-=-=- CType(Boolean, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int64 ) type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Boolean,E_Long] ) -=-=-=-=-=-=-=-=- Boolean -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Parameter( x type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Boolean,System.Boolean] ) -=-=-=-=-=-=-=-=- Boolean -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Negate( Convert( Parameter( x type: System.Boolean ) type: System.Single ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Boolean,System.Single] ) -=-=-=-=-=-=-=-=- CType(Boolean, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Negate( Convert( Parameter( x type: System.Boolean ) type: System.Single ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Boolean,System.Single] ) -=-=-=-=-=-=-=-=- Boolean -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Negate( Convert( Parameter( x type: System.Boolean ) type: System.Double ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Boolean,System.Double] ) -=-=-=-=-=-=-=-=- CType(Boolean, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Negate( Convert( Parameter( x type: System.Boolean ) type: System.Double ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Boolean,System.Double] ) -=-=-=-=-=-=-=-=- CType(Boolean, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Parameter( x type: System.Boolean ) method: System.Decimal ToDecimal(Boolean) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Boolean,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Boolean, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Parameter( x type: System.Boolean ) method: System.String ToString(Boolean) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Boolean,System.String] ) -=-=-=-=-=-=-=-=- Boolean? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[System.Boolean],System.SByte] ) -=-=-=-=-=-=-=-=- CType(Boolean?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[System.Boolean],E_SByte] ) -=-=-=-=-=-=-=-=- Boolean? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[System.Boolean],System.Byte] ) -=-=-=-=-=-=-=-=- CType(Boolean?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[System.Boolean],E_Byte] ) -=-=-=-=-=-=-=-=- Boolean? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int16 ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[System.Boolean],System.Int16] ) -=-=-=-=-=-=-=-=- CType(Boolean?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int16 ) type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[System.Boolean],E_Short] ) -=-=-=-=-=-=-=-=- Boolean? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int16 ) type: System.Int16 ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[System.Boolean],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Boolean?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int16 ) type: System.Int16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[System.Boolean],E_UShort] ) -=-=-=-=-=-=-=-=- Boolean? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[System.Boolean],System.Int32] ) -=-=-=-=-=-=-=-=- CType(Boolean?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[System.Boolean],E_Integer] ) -=-=-=-=-=-=-=-=- Boolean? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[System.Boolean],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Boolean?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[System.Boolean],E_UInteger] ) -=-=-=-=-=-=-=-=- Boolean? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int64 ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[System.Boolean],System.Int64] ) -=-=-=-=-=-=-=-=- CType(Boolean?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int64 ) type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[System.Boolean],E_Long] ) -=-=-=-=-=-=-=-=- Boolean? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) Lifted type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[System.Boolean],System.Boolean] ) -=-=-=-=-=-=-=-=- Boolean? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Single ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Boolean],System.Single] ) -=-=-=-=-=-=-=-=- CType(Boolean?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Single ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Boolean],System.Single] ) -=-=-=-=-=-=-=-=- Boolean? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Double ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Boolean],System.Double] ) -=-=-=-=-=-=-=-=- CType(Boolean?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Double ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Boolean],System.Double] ) -=-=-=-=-=-=-=-=- CType(Boolean?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) method: System.Decimal ToDecimal(Boolean) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[System.Boolean],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Boolean?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) method: System.String ToString(Boolean) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.Boolean],System.String] ) -=-=-=-=-=-=-=-=- Single -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) method: SByte ToSByte(Single) in System.Convert type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Single,System.SByte] ) -=-=-=-=-=-=-=-=- CType(Single, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Convert( Parameter( x type: System.Single ) method: SByte ToSByte(Single) in System.Convert type: System.SByte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Single,E_SByte] ) -=-=-=-=-=-=-=-=- Single -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) method: Byte ToByte(Single) in System.Convert type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Single,System.Byte] ) -=-=-=-=-=-=-=-=- CType(Single, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Convert( Parameter( x type: System.Single ) method: Byte ToByte(Single) in System.Convert type: System.Byte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Single,E_Byte] ) -=-=-=-=-=-=-=-=- Single -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) method: Int16 ToInt16(Single) in System.Convert type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Single,System.Int16] ) -=-=-=-=-=-=-=-=- CType(Single, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Convert( Parameter( x type: System.Single ) method: Int16 ToInt16(Single) in System.Convert type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Single,E_Short] ) -=-=-=-=-=-=-=-=- Single -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) method: UInt16 ToUInt16(Single) in System.Convert type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Single,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Single, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Convert( Parameter( x type: System.Single ) method: UInt16 ToUInt16(Single) in System.Convert type: System.UInt16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Single,E_UShort] ) -=-=-=-=-=-=-=-=- Single -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) method: Int32 ToInt32(Single) in System.Convert type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Single,System.Int32] ) -=-=-=-=-=-=-=-=- CType(Single, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Convert( Parameter( x type: System.Single ) method: Int32 ToInt32(Single) in System.Convert type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Single,E_Integer] ) -=-=-=-=-=-=-=-=- Single -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) method: UInt32 ToUInt32(Single) in System.Convert type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Single,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Single, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Convert( Parameter( x type: System.Single ) method: UInt32 ToUInt32(Single) in System.Convert type: System.UInt32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Single,E_UInteger] ) -=-=-=-=-=-=-=-=- Single -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) method: Int64 ToInt64(Single) in System.Convert type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Single,System.Int64] ) -=-=-=-=-=-=-=-=- CType(Single, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Convert( Parameter( x type: System.Single ) method: Int64 ToInt64(Single) in System.Convert type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Single,E_Long] ) -=-=-=-=-=-=-=-=- Single -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) method: Boolean ToBoolean(Single) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Single,System.Boolean] ) -=-=-=-=-=-=-=-=- Single -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Parameter( x type: System.Single ) } return type: System.Single type: System.Func`2[System.Single,System.Single] ) -=-=-=-=-=-=-=-=- CType(Single, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Single,System.Single] ) -=-=-=-=-=-=-=-=- Single -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Single,System.Double] ) -=-=-=-=-=-=-=-=- CType(Single, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Single,System.Double] ) -=-=-=-=-=-=-=-=- CType(Single, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) method: System.Decimal op_Explicit(Single) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Single,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Single, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) method: System.String ToString(Single) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Single,System.String] ) -=-=-=-=-=-=-=-=- Single? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: SByte ToSByte(Single) in System.Convert type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[System.Single],System.SByte] ) -=-=-=-=-=-=-=-=- CType(Single?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: SByte ToSByte(Single) in System.Convert type: System.SByte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[System.Single],E_SByte] ) -=-=-=-=-=-=-=-=- Single? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: Byte ToByte(Single) in System.Convert type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[System.Single],System.Byte] ) -=-=-=-=-=-=-=-=- CType(Single?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: Byte ToByte(Single) in System.Convert type: System.Byte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[System.Single],E_Byte] ) -=-=-=-=-=-=-=-=- Single? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: Int16 ToInt16(Single) in System.Convert type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[System.Single],System.Int16] ) -=-=-=-=-=-=-=-=- CType(Single?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: Int16 ToInt16(Single) in System.Convert type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[System.Single],E_Short] ) -=-=-=-=-=-=-=-=- Single? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: UInt16 ToUInt16(Single) in System.Convert type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[System.Single],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Single?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: UInt16 ToUInt16(Single) in System.Convert type: System.UInt16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[System.Single],E_UShort] ) -=-=-=-=-=-=-=-=- Single? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: Int32 ToInt32(Single) in System.Convert type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[System.Single],System.Int32] ) -=-=-=-=-=-=-=-=- CType(Single?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: Int32 ToInt32(Single) in System.Convert type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[System.Single],E_Integer] ) -=-=-=-=-=-=-=-=- Single? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: UInt32 ToUInt32(Single) in System.Convert type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[System.Single],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Single?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: UInt32 ToUInt32(Single) in System.Convert type: System.UInt32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[System.Single],E_UInteger] ) -=-=-=-=-=-=-=-=- Single? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: Int64 ToInt64(Single) in System.Convert type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[System.Single],System.Int64] ) -=-=-=-=-=-=-=-=- CType(Single?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: Int64 ToInt64(Single) in System.Convert type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[System.Single],E_Long] ) -=-=-=-=-=-=-=-=- Single? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: Boolean ToBoolean(Single) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[System.Single],System.Boolean] ) -=-=-=-=-=-=-=-=- Single? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Parameter( x type: System.Nullable`1[System.Single] ) Lifted type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Single],System.Single] ) -=-=-=-=-=-=-=-=- CType(Single?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Parameter( x type: System.Nullable`1[System.Single] ) Lifted type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Single],System.Single] ) -=-=-=-=-=-=-=-=- Single? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Single],System.Double] ) -=-=-=-=-=-=-=-=- CType(Single?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Single],System.Double] ) -=-=-=-=-=-=-=-=- CType(Single?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: System.Decimal op_Explicit(Single) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[System.Single],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Single?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: System.String ToString(Single) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.Single],System.String] ) -=-=-=-=-=-=-=-=- Double -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) method: SByte ToSByte(Double) in System.Convert type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Double,System.SByte] ) -=-=-=-=-=-=-=-=- CType(Double, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Convert( Parameter( x type: System.Double ) method: SByte ToSByte(Double) in System.Convert type: System.SByte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Double,E_SByte] ) -=-=-=-=-=-=-=-=- Double -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) method: Byte ToByte(Double) in System.Convert type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Double,System.Byte] ) -=-=-=-=-=-=-=-=- CType(Double, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Convert( Parameter( x type: System.Double ) method: Byte ToByte(Double) in System.Convert type: System.Byte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Double,E_Byte] ) -=-=-=-=-=-=-=-=- Double -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) method: Int16 ToInt16(Double) in System.Convert type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Double,System.Int16] ) -=-=-=-=-=-=-=-=- CType(Double, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Convert( Parameter( x type: System.Double ) method: Int16 ToInt16(Double) in System.Convert type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Double,E_Short] ) -=-=-=-=-=-=-=-=- Double -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) method: UInt16 ToUInt16(Double) in System.Convert type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Double,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Double, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Convert( Parameter( x type: System.Double ) method: UInt16 ToUInt16(Double) in System.Convert type: System.UInt16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Double,E_UShort] ) -=-=-=-=-=-=-=-=- Double -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) method: Int32 ToInt32(Double) in System.Convert type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Double,System.Int32] ) -=-=-=-=-=-=-=-=- CType(Double, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Convert( Parameter( x type: System.Double ) method: Int32 ToInt32(Double) in System.Convert type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Double,E_Integer] ) -=-=-=-=-=-=-=-=- Double -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) method: UInt32 ToUInt32(Double) in System.Convert type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Double,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Double, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Convert( Parameter( x type: System.Double ) method: UInt32 ToUInt32(Double) in System.Convert type: System.UInt32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Double,E_UInteger] ) -=-=-=-=-=-=-=-=- Double -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) method: Int64 ToInt64(Double) in System.Convert type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Double,System.Int64] ) -=-=-=-=-=-=-=-=- CType(Double, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Convert( Parameter( x type: System.Double ) method: Int64 ToInt64(Double) in System.Convert type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Double,E_Long] ) -=-=-=-=-=-=-=-=- Double -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) method: Boolean ToBoolean(Double) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Double,System.Boolean] ) -=-=-=-=-=-=-=-=- Double -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Double,System.Single] ) -=-=-=-=-=-=-=-=- CType(Double, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Double,System.Single] ) -=-=-=-=-=-=-=-=- Double -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Parameter( x type: System.Double ) } return type: System.Double type: System.Func`2[System.Double,System.Double] ) -=-=-=-=-=-=-=-=- CType(Double, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Double,System.Double] ) -=-=-=-=-=-=-=-=- CType(Double, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) method: System.Decimal op_Explicit(Double) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Double,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Double, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) method: System.String ToString(Double) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Double,System.String] ) -=-=-=-=-=-=-=-=- Double? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: SByte ToSByte(Double) in System.Convert type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[System.Double],System.SByte] ) -=-=-=-=-=-=-=-=- CType(Double?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: SByte ToSByte(Double) in System.Convert type: System.SByte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[System.Double],E_SByte] ) -=-=-=-=-=-=-=-=- Double? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: Byte ToByte(Double) in System.Convert type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[System.Double],System.Byte] ) -=-=-=-=-=-=-=-=- CType(Double?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: Byte ToByte(Double) in System.Convert type: System.Byte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[System.Double],E_Byte] ) -=-=-=-=-=-=-=-=- Double? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: Int16 ToInt16(Double) in System.Convert type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[System.Double],System.Int16] ) -=-=-=-=-=-=-=-=- CType(Double?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: Int16 ToInt16(Double) in System.Convert type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[System.Double],E_Short] ) -=-=-=-=-=-=-=-=- Double? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: UInt16 ToUInt16(Double) in System.Convert type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[System.Double],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Double?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: UInt16 ToUInt16(Double) in System.Convert type: System.UInt16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[System.Double],E_UShort] ) -=-=-=-=-=-=-=-=- Double? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: Int32 ToInt32(Double) in System.Convert type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[System.Double],System.Int32] ) -=-=-=-=-=-=-=-=- CType(Double?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: Int32 ToInt32(Double) in System.Convert type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[System.Double],E_Integer] ) -=-=-=-=-=-=-=-=- Double? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: UInt32 ToUInt32(Double) in System.Convert type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[System.Double],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Double?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: UInt32 ToUInt32(Double) in System.Convert type: System.UInt32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[System.Double],E_UInteger] ) -=-=-=-=-=-=-=-=- Double? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: Int64 ToInt64(Double) in System.Convert type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[System.Double],System.Int64] ) -=-=-=-=-=-=-=-=- CType(Double?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: Int64 ToInt64(Double) in System.Convert type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[System.Double],E_Long] ) -=-=-=-=-=-=-=-=- Double? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: Boolean ToBoolean(Double) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[System.Double],System.Boolean] ) -=-=-=-=-=-=-=-=- Double? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Double],System.Single] ) -=-=-=-=-=-=-=-=- CType(Double?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Double],System.Single] ) -=-=-=-=-=-=-=-=- Double? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Parameter( x type: System.Nullable`1[System.Double] ) Lifted type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Double],System.Double] ) -=-=-=-=-=-=-=-=- CType(Double?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Parameter( x type: System.Nullable`1[System.Double] ) Lifted type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Double],System.Double] ) -=-=-=-=-=-=-=-=- CType(Double?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: System.Decimal op_Explicit(Double) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[System.Double],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Double?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: System.String ToString(Double) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.Double],System.String] ) -=-=-=-=-=-=-=-=- Decimal -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: SByte op_Explicit(System.Decimal) in System.Decimal type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Decimal,System.SByte] ) -=-=-=-=-=-=-=-=- CType(Decimal, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Convert( Parameter( x type: System.Decimal ) method: SByte op_Explicit(System.Decimal) in System.Decimal type: System.SByte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Decimal,E_SByte] ) -=-=-=-=-=-=-=-=- Decimal -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: Byte op_Explicit(System.Decimal) in System.Decimal type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Decimal,System.Byte] ) -=-=-=-=-=-=-=-=- CType(Decimal, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Convert( Parameter( x type: System.Decimal ) method: Byte op_Explicit(System.Decimal) in System.Decimal type: System.Byte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Decimal,E_Byte] ) -=-=-=-=-=-=-=-=- Decimal -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: Int16 op_Explicit(System.Decimal) in System.Decimal type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Decimal,System.Int16] ) -=-=-=-=-=-=-=-=- CType(Decimal, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Convert( Parameter( x type: System.Decimal ) method: Int16 op_Explicit(System.Decimal) in System.Decimal type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Decimal,E_Short] ) -=-=-=-=-=-=-=-=- Decimal -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: UInt16 op_Explicit(System.Decimal) in System.Decimal type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Decimal,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Decimal, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Convert( Parameter( x type: System.Decimal ) method: UInt16 op_Explicit(System.Decimal) in System.Decimal type: System.UInt16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Decimal,E_UShort] ) -=-=-=-=-=-=-=-=- Decimal -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: Int32 op_Explicit(System.Decimal) in System.Decimal type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Decimal,System.Int32] ) -=-=-=-=-=-=-=-=- CType(Decimal, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Convert( Parameter( x type: System.Decimal ) method: Int32 op_Explicit(System.Decimal) in System.Decimal type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Decimal,E_Integer] ) -=-=-=-=-=-=-=-=- Decimal -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: UInt32 op_Explicit(System.Decimal) in System.Decimal type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Decimal,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Decimal, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Convert( Parameter( x type: System.Decimal ) method: UInt32 op_Explicit(System.Decimal) in System.Decimal type: System.UInt32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Decimal,E_UInteger] ) -=-=-=-=-=-=-=-=- Decimal -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: Int64 op_Explicit(System.Decimal) in System.Decimal type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Decimal,System.Int64] ) -=-=-=-=-=-=-=-=- CType(Decimal, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Convert( Parameter( x type: System.Decimal ) method: Int64 op_Explicit(System.Decimal) in System.Decimal type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Decimal,E_Long] ) -=-=-=-=-=-=-=-=- Decimal -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: Boolean ToBoolean(System.Decimal) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Decimal,System.Boolean] ) -=-=-=-=-=-=-=-=- Decimal -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: Single op_Explicit(System.Decimal) in System.Decimal type: System.Single ) } return type: System.Single type: System.Func`2[System.Decimal,System.Single] ) -=-=-=-=-=-=-=-=- CType(Decimal, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: Single op_Explicit(System.Decimal) in System.Decimal type: System.Single ) } return type: System.Single type: System.Func`2[System.Decimal,System.Single] ) -=-=-=-=-=-=-=-=- Decimal -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: Double op_Explicit(System.Decimal) in System.Decimal type: System.Double ) } return type: System.Double type: System.Func`2[System.Decimal,System.Double] ) -=-=-=-=-=-=-=-=- CType(Decimal, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: Double op_Explicit(System.Decimal) in System.Decimal type: System.Double ) } return type: System.Double type: System.Func`2[System.Decimal,System.Double] ) -=-=-=-=-=-=-=-=- CType(Decimal, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Parameter( x type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Decimal,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Decimal, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: System.String ToString(System.Decimal) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Decimal,System.String] ) -=-=-=-=-=-=-=-=- Decimal? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: SByte op_Explicit(System.Decimal) in System.Decimal type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[System.Decimal],System.SByte] ) -=-=-=-=-=-=-=-=- CType(Decimal?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: SByte op_Explicit(System.Decimal) in System.Decimal type: System.SByte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[System.Decimal],E_SByte] ) -=-=-=-=-=-=-=-=- Decimal? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Byte op_Explicit(System.Decimal) in System.Decimal type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[System.Decimal],System.Byte] ) -=-=-=-=-=-=-=-=- CType(Decimal?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Byte op_Explicit(System.Decimal) in System.Decimal type: System.Byte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[System.Decimal],E_Byte] ) -=-=-=-=-=-=-=-=- Decimal? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Int16 op_Explicit(System.Decimal) in System.Decimal type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[System.Decimal],System.Int16] ) -=-=-=-=-=-=-=-=- CType(Decimal?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Int16 op_Explicit(System.Decimal) in System.Decimal type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[System.Decimal],E_Short] ) -=-=-=-=-=-=-=-=- Decimal? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: UInt16 op_Explicit(System.Decimal) in System.Decimal type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[System.Decimal],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Decimal?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: UInt16 op_Explicit(System.Decimal) in System.Decimal type: System.UInt16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[System.Decimal],E_UShort] ) -=-=-=-=-=-=-=-=- Decimal? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Int32 op_Explicit(System.Decimal) in System.Decimal type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[System.Decimal],System.Int32] ) -=-=-=-=-=-=-=-=- CType(Decimal?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Int32 op_Explicit(System.Decimal) in System.Decimal type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[System.Decimal],E_Integer] ) -=-=-=-=-=-=-=-=- Decimal? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: UInt32 op_Explicit(System.Decimal) in System.Decimal type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[System.Decimal],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Decimal?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: UInt32 op_Explicit(System.Decimal) in System.Decimal type: System.UInt32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[System.Decimal],E_UInteger] ) -=-=-=-=-=-=-=-=- Decimal? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Int64 op_Explicit(System.Decimal) in System.Decimal type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[System.Decimal],System.Int64] ) -=-=-=-=-=-=-=-=- CType(Decimal?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Int64 op_Explicit(System.Decimal) in System.Decimal type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[System.Decimal],E_Long] ) -=-=-=-=-=-=-=-=- Decimal? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Boolean ToBoolean(System.Decimal) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[System.Decimal],System.Boolean] ) -=-=-=-=-=-=-=-=- Decimal? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Single op_Explicit(System.Decimal) in System.Decimal type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Decimal],System.Single] ) -=-=-=-=-=-=-=-=- CType(Decimal?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Single op_Explicit(System.Decimal) in System.Decimal type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Decimal],System.Single] ) -=-=-=-=-=-=-=-=- Decimal? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Double op_Explicit(System.Decimal) in System.Decimal type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Decimal],System.Double] ) -=-=-=-=-=-=-=-=- CType(Decimal?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Double op_Explicit(System.Decimal) in System.Decimal type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Decimal],System.Double] ) -=-=-=-=-=-=-=-=- CType(Decimal?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) Lifted type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[System.Decimal],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Decimal?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: System.String ToString(System.Decimal) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.Decimal],System.String] ) -=-=-=-=-=-=-=-=- Date -> Date -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.DateTime ) body { Parameter( x type: System.DateTime ) } return type: System.DateTime type: System.Func`2[System.DateTime,System.DateTime] ) -=-=-=-=-=-=-=-=- CType(Date, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.DateTime ) body { Convert( Parameter( x type: System.DateTime ) method: System.String ToString(System.DateTime) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.DateTime,System.String] ) -=-=-=-=-=-=-=-=- CType(Date?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.DateTime] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.DateTime] ) method: System.DateTime op_Explicit(System.Nullable`1[System.DateTime]) in System.Nullable`1[System.DateTime] type: System.DateTime ) method: System.String ToString(System.DateTime) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.DateTime],System.String] ) -=-=-=-=-=-=-=-=- String -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: SByte ToSByte(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.SByte ) } return type: System.SByte type: System.Func`2[System.String,System.SByte] ) -=-=-=-=-=-=-=-=- CType(String, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Convert( Parameter( x type: System.String ) method: SByte ToSByte(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.SByte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.String,E_SByte] ) -=-=-=-=-=-=-=-=- String -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: Byte ToByte(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Byte ) } return type: System.Byte type: System.Func`2[System.String,System.Byte] ) -=-=-=-=-=-=-=-=- CType(String, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Convert( Parameter( x type: System.String ) method: Byte ToByte(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Byte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.String,E_Byte] ) -=-=-=-=-=-=-=-=- String -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: Int16 ToShort(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.String,System.Int16] ) -=-=-=-=-=-=-=-=- CType(String, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Convert( Parameter( x type: System.String ) method: Int16 ToShort(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.String,E_Short] ) -=-=-=-=-=-=-=-=- String -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: UInt16 ToUShort(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.String,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(String, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Convert( Parameter( x type: System.String ) method: UInt16 ToUShort(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.UInt16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.String,E_UShort] ) -=-=-=-=-=-=-=-=- String -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: Int32 ToInteger(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.String,System.Int32] ) -=-=-=-=-=-=-=-=- CType(String, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Convert( Parameter( x type: System.String ) method: Int32 ToInteger(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.String,E_Integer] ) -=-=-=-=-=-=-=-=- String -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: UInt32 ToUInteger(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.String,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(String, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Convert( Parameter( x type: System.String ) method: UInt32 ToUInteger(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.UInt32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.String,E_UInteger] ) -=-=-=-=-=-=-=-=- String -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: Int64 ToLong(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.String,System.Int64] ) -=-=-=-=-=-=-=-=- CType(String, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Convert( Parameter( x type: System.String ) method: Int64 ToLong(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.String,E_Long] ) -=-=-=-=-=-=-=-=- String -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: Boolean ToBoolean(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.String,System.Boolean] ) -=-=-=-=-=-=-=-=- String -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: Single ToSingle(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Single ) } return type: System.Single type: System.Func`2[System.String,System.Single] ) -=-=-=-=-=-=-=-=- CType(String, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: Single ToSingle(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Single ) } return type: System.Single type: System.Func`2[System.String,System.Single] ) -=-=-=-=-=-=-=-=- String -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: Double ToDouble(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Double ) } return type: System.Double type: System.Func`2[System.String,System.Double] ) -=-=-=-=-=-=-=-=- CType(String, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: Double ToDouble(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Double ) } return type: System.Double type: System.Func`2[System.String,System.Double] ) -=-=-=-=-=-=-=-=- CType(String, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: System.Decimal ToDecimal(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.String,System.Decimal] ) -=-=-=-=-=-=-=-=- String -> Date -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: System.DateTime ToDate(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.DateTime ) } return type: System.DateTime type: System.Func`2[System.String,System.DateTime] ) -=-=-=-=-=-=-=-=- CType(String, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Parameter( x type: System.String ) } return type: System.String type: System.Func`2[System.String,System.String] ) -=-=-=-=-=-=-=-=- Object -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: SByte ToSByte(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Object,System.SByte] ) -=-=-=-=-=-=-=-=- CType(Object, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Convert( Parameter( x type: System.Object ) method: SByte ToSByte(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.SByte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Object,E_SByte] ) -=-=-=-=-=-=-=-=- Object -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: Byte ToByte(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Object,System.Byte] ) -=-=-=-=-=-=-=-=- CType(Object, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Convert( Parameter( x type: System.Object ) method: Byte ToByte(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Byte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Object,E_Byte] ) -=-=-=-=-=-=-=-=- Object -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: Int16 ToShort(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Object,System.Int16] ) -=-=-=-=-=-=-=-=- CType(Object, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Convert( Parameter( x type: System.Object ) method: Int16 ToShort(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Object,E_Short] ) -=-=-=-=-=-=-=-=- Object -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: UInt16 ToUShort(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Object,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Object, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Convert( Parameter( x type: System.Object ) method: UInt16 ToUShort(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.UInt16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Object,E_UShort] ) -=-=-=-=-=-=-=-=- Object -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: Int32 ToInteger(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Object,System.Int32] ) -=-=-=-=-=-=-=-=- CType(Object, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Convert( Parameter( x type: System.Object ) method: Int32 ToInteger(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Object,E_Integer] ) -=-=-=-=-=-=-=-=- Object -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: UInt32 ToUInteger(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Object,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Object, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Convert( Parameter( x type: System.Object ) method: UInt32 ToUInteger(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.UInt32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Object,E_UInteger] ) -=-=-=-=-=-=-=-=- Object -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: Int64 ToLong(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Object,System.Int64] ) -=-=-=-=-=-=-=-=- CType(Object, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Convert( Parameter( x type: System.Object ) method: Int64 ToLong(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Object,E_Long] ) -=-=-=-=-=-=-=-=- Object -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: Boolean ToBoolean(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Object,System.Boolean] ) -=-=-=-=-=-=-=-=- Object -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: Single ToSingle(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Single ) } return type: System.Single type: System.Func`2[System.Object,System.Single] ) -=-=-=-=-=-=-=-=- CType(Object, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: Single ToSingle(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Single ) } return type: System.Single type: System.Func`2[System.Object,System.Single] ) -=-=-=-=-=-=-=-=- Object -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: Double ToDouble(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Double ) } return type: System.Double type: System.Func`2[System.Object,System.Double] ) -=-=-=-=-=-=-=-=- CType(Object, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: Double ToDouble(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Double ) } return type: System.Double type: System.Func`2[System.Object,System.Double] ) -=-=-=-=-=-=-=-=- CType(Object, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: System.Decimal ToDecimal(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Object,System.Decimal] ) -=-=-=-=-=-=-=-=- Object -> Date -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: System.DateTime ToDate(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.DateTime ) } return type: System.DateTime type: System.Func`2[System.Object,System.DateTime] ) -=-=-=-=-=-=-=-=- CType(Object, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: System.String ToString(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Object,System.String] )
-=-=-=-=-=-=-=-=- SByte -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Parameter( x type: System.SByte ) } return type: System.SByte type: System.Func`2[System.SByte,System.SByte] ) -=-=-=-=-=-=-=-=- CType(SByte, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.SByte,E_SByte] ) -=-=-=-=-=-=-=-=- SByte -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.SByte,System.Byte] ) -=-=-=-=-=-=-=-=- CType(SByte, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.SByte,E_Byte] ) -=-=-=-=-=-=-=-=- SByte -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.SByte,System.Int16] ) -=-=-=-=-=-=-=-=- CType(SByte, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: E_Short ) } return type: E_Short type: System.Func`2[System.SByte,E_Short] ) -=-=-=-=-=-=-=-=- SByte -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.SByte,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(SByte, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.SByte,E_UShort] ) -=-=-=-=-=-=-=-=- SByte -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.SByte,System.Int32] ) -=-=-=-=-=-=-=-=- CType(SByte, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.SByte,E_Integer] ) -=-=-=-=-=-=-=-=- SByte -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.SByte,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(SByte, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.SByte,E_UInteger] ) -=-=-=-=-=-=-=-=- SByte -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.SByte,System.Int64] ) -=-=-=-=-=-=-=-=- CType(SByte, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: E_Long ) } return type: E_Long type: System.Func`2[System.SByte,E_Long] ) -=-=-=-=-=-=-=-=- SByte -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Convert( Parameter( x type: System.SByte ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.SByte,System.Boolean] ) -=-=-=-=-=-=-=-=- SByte -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.SByte,System.Single] ) -=-=-=-=-=-=-=-=- CType(SByte, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.SByte,System.Single] ) -=-=-=-=-=-=-=-=- SByte -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.SByte,System.Double] ) -=-=-=-=-=-=-=-=- CType(SByte, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Parameter( x type: System.SByte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.SByte,System.Double] ) -=-=-=-=-=-=-=-=- CType(SByte, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Convert( Parameter( x type: System.SByte ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.SByte,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(SByte, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.SByte ) body { Convert( Convert( Parameter( x type: System.SByte ) type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.SByte,System.String] ) -=-=-=-=-=-=-=-=- SByte? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Parameter( x type: System.Nullable`1[System.SByte] ) Lifted type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[System.SByte],System.SByte] ) -=-=-=-=-=-=-=-=- CType(SByte?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[System.SByte],E_SByte] ) -=-=-=-=-=-=-=-=- SByte? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[System.SByte],System.Byte] ) -=-=-=-=-=-=-=-=- CType(SByte?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[System.SByte],E_Byte] ) -=-=-=-=-=-=-=-=- SByte? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[System.SByte],System.Int16] ) -=-=-=-=-=-=-=-=- CType(SByte?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[System.SByte],E_Short] ) -=-=-=-=-=-=-=-=- SByte? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[System.SByte],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(SByte?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[System.SByte],E_UShort] ) -=-=-=-=-=-=-=-=- SByte? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[System.SByte],System.Int32] ) -=-=-=-=-=-=-=-=- CType(SByte?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[System.SByte],E_Integer] ) -=-=-=-=-=-=-=-=- SByte? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[System.SByte],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(SByte?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[System.SByte],E_UInteger] ) -=-=-=-=-=-=-=-=- SByte? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[System.SByte],System.Int64] ) -=-=-=-=-=-=-=-=- CType(SByte?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[System.SByte],E_Long] ) -=-=-=-=-=-=-=-=- SByte? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[System.SByte],System.Boolean] ) -=-=-=-=-=-=-=-=- SByte? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.SByte],System.Single] ) -=-=-=-=-=-=-=-=- CType(SByte?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.SByte],System.Single] ) -=-=-=-=-=-=-=-=- SByte? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.SByte],System.Double] ) -=-=-=-=-=-=-=-=- CType(SByte?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.SByte],System.Double] ) -=-=-=-=-=-=-=-=- CType(SByte?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[System.SByte],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(SByte?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.SByte] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.SByte] ) method: SByte op_Explicit(System.Nullable`1[System.SByte]) in System.Nullable`1[System.SByte] type: System.SByte ) type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.SByte],System.String] ) -=-=-=-=-=-=-=-=- E_SByte -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: System.SByte ) } return type: System.SByte type: System.Func`2[E_SByte,System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_SByte, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Parameter( x type: E_SByte ) } return type: E_SByte type: System.Func`2[E_SByte,E_SByte] ) -=-=-=-=-=-=-=-=- E_SByte -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: System.Byte ) } return type: System.Byte type: System.Func`2[E_SByte,System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_SByte, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[E_SByte,E_Byte] ) -=-=-=-=-=-=-=-=- E_SByte -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[E_SByte,System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_SByte, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: E_Short ) } return type: E_Short type: System.Func`2[E_SByte,E_Short] ) -=-=-=-=-=-=-=-=- E_SByte -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[E_SByte,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_SByte, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: E_UShort ) } return type: E_UShort type: System.Func`2[E_SByte,E_UShort] ) -=-=-=-=-=-=-=-=- E_SByte -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[E_SByte,System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_SByte, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: E_Integer ) } return type: E_Integer type: System.Func`2[E_SByte,E_Integer] ) -=-=-=-=-=-=-=-=- E_SByte -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[E_SByte,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_SByte, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[E_SByte,E_UInteger] ) -=-=-=-=-=-=-=-=- E_SByte -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[E_SByte,System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_SByte, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: E_Long ) } return type: E_Long type: System.Func`2[E_SByte,E_Long] ) -=-=-=-=-=-=-=-=- E_SByte -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Convert( Parameter( x type: E_SByte ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[E_SByte,System.Boolean] ) -=-=-=-=-=-=-=-=- E_SByte -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: System.Single ) } return type: System.Single type: System.Func`2[E_SByte,System.Single] ) -=-=-=-=-=-=-=-=- CType(E_SByte, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: System.Single ) } return type: System.Single type: System.Func`2[E_SByte,System.Single] ) -=-=-=-=-=-=-=-=- E_SByte -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: System.Double ) } return type: System.Double type: System.Func`2[E_SByte,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_SByte, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Parameter( x type: E_SByte ) type: System.Double ) } return type: System.Double type: System.Func`2[E_SByte,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_SByte, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Convert( Parameter( x type: E_SByte ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[E_SByte,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_SByte, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_SByte ) body { Convert( Convert( Parameter( x type: E_SByte ) type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[E_SByte,System.String] ) -=-=-=-=-=-=-=-=- E_SByte? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[E_SByte],System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_SByte?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Parameter( x type: System.Nullable`1[E_SByte] ) Lifted type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[E_SByte],E_SByte] ) -=-=-=-=-=-=-=-=- E_SByte? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[E_SByte],System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_SByte?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[E_SByte],E_Byte] ) -=-=-=-=-=-=-=-=- E_SByte? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[E_SByte],System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_SByte?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[E_SByte],E_Short] ) -=-=-=-=-=-=-=-=- E_SByte? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[E_SByte],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_SByte?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[E_SByte],E_UShort] ) -=-=-=-=-=-=-=-=- E_SByte? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[E_SByte],System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_SByte?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[E_SByte],E_Integer] ) -=-=-=-=-=-=-=-=- E_SByte? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[E_SByte],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_SByte?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[E_SByte],E_UInteger] ) -=-=-=-=-=-=-=-=- E_SByte? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[E_SByte],System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_SByte?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[E_SByte],E_Long] ) -=-=-=-=-=-=-=-=- E_SByte? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[E_SByte],System.Boolean] ) -=-=-=-=-=-=-=-=- E_SByte? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_SByte],System.Single] ) -=-=-=-=-=-=-=-=- CType(E_SByte?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_SByte],System.Single] ) -=-=-=-=-=-=-=-=- E_SByte? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_SByte],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_SByte?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_SByte],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_SByte?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[E_SByte],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_SByte?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_SByte] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_SByte] ) method: E_SByte op_Explicit(System.Nullable`1[E_SByte]) in System.Nullable`1[E_SByte] type: E_SByte ) type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[E_SByte],System.String] ) -=-=-=-=-=-=-=-=- Byte -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Byte,System.SByte] ) -=-=-=-=-=-=-=-=- CType(Byte, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Byte,E_SByte] ) -=-=-=-=-=-=-=-=- Byte -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Parameter( x type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Byte,System.Byte] ) -=-=-=-=-=-=-=-=- CType(Byte, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Byte,E_Byte] ) -=-=-=-=-=-=-=-=- Byte -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Byte,System.Int16] ) -=-=-=-=-=-=-=-=- CType(Byte, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Byte,E_Short] ) -=-=-=-=-=-=-=-=- Byte -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Byte,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Byte, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Byte,E_UShort] ) -=-=-=-=-=-=-=-=- Byte -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Byte,System.Int32] ) -=-=-=-=-=-=-=-=- CType(Byte, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Byte,E_Integer] ) -=-=-=-=-=-=-=-=- Byte -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Byte,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Byte, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Byte,E_UInteger] ) -=-=-=-=-=-=-=-=- Byte -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Byte,System.Int64] ) -=-=-=-=-=-=-=-=- CType(Byte, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Byte,E_Long] ) -=-=-=-=-=-=-=-=- Byte -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Convert( Parameter( x type: System.Byte ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Byte,System.Boolean] ) -=-=-=-=-=-=-=-=- Byte -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Byte,System.Single] ) -=-=-=-=-=-=-=-=- CType(Byte, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Byte,System.Single] ) -=-=-=-=-=-=-=-=- Byte -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Byte,System.Double] ) -=-=-=-=-=-=-=-=- CType(Byte, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Byte,System.Double] ) -=-=-=-=-=-=-=-=- CType(Byte, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Convert( Parameter( x type: System.Byte ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Byte,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Byte, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Byte ) body { Convert( Parameter( x type: System.Byte ) method: System.String ToString(Byte) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Byte,System.String] ) -=-=-=-=-=-=-=-=- Byte? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[System.Byte],System.SByte] ) -=-=-=-=-=-=-=-=- CType(Byte?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[System.Byte],E_SByte] ) -=-=-=-=-=-=-=-=- Byte? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Parameter( x type: System.Nullable`1[System.Byte] ) Lifted type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[System.Byte],System.Byte] ) -=-=-=-=-=-=-=-=- CType(Byte?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[System.Byte],E_Byte] ) -=-=-=-=-=-=-=-=- Byte? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[System.Byte],System.Int16] ) -=-=-=-=-=-=-=-=- CType(Byte?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[System.Byte],E_Short] ) -=-=-=-=-=-=-=-=- Byte? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[System.Byte],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Byte?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[System.Byte],E_UShort] ) -=-=-=-=-=-=-=-=- Byte? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[System.Byte],System.Int32] ) -=-=-=-=-=-=-=-=- CType(Byte?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[System.Byte],E_Integer] ) -=-=-=-=-=-=-=-=- Byte? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[System.Byte],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Byte?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[System.Byte],E_UInteger] ) -=-=-=-=-=-=-=-=- Byte? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[System.Byte],System.Int64] ) -=-=-=-=-=-=-=-=- CType(Byte?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[System.Byte],E_Long] ) -=-=-=-=-=-=-=-=- Byte? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[System.Byte],System.Boolean] ) -=-=-=-=-=-=-=-=- Byte? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Byte],System.Single] ) -=-=-=-=-=-=-=-=- CType(Byte?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Byte],System.Single] ) -=-=-=-=-=-=-=-=- Byte? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Byte],System.Double] ) -=-=-=-=-=-=-=-=- CType(Byte?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Byte],System.Double] ) -=-=-=-=-=-=-=-=- CType(Byte?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[System.Byte],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Byte?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Byte] ) method: Byte op_Explicit(System.Nullable`1[System.Byte]) in System.Nullable`1[System.Byte] type: System.Byte ) method: System.String ToString(Byte) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.Byte],System.String] ) -=-=-=-=-=-=-=-=- E_Byte -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: System.SByte ) } return type: System.SByte type: System.Func`2[E_Byte,System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_Byte, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[E_Byte,E_SByte] ) -=-=-=-=-=-=-=-=- E_Byte -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: System.Byte ) } return type: System.Byte type: System.Func`2[E_Byte,System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_Byte, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Parameter( x type: E_Byte ) } return type: E_Byte type: System.Func`2[E_Byte,E_Byte] ) -=-=-=-=-=-=-=-=- E_Byte -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[E_Byte,System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_Byte, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: E_Short ) } return type: E_Short type: System.Func`2[E_Byte,E_Short] ) -=-=-=-=-=-=-=-=- E_Byte -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[E_Byte,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_Byte, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: E_UShort ) } return type: E_UShort type: System.Func`2[E_Byte,E_UShort] ) -=-=-=-=-=-=-=-=- E_Byte -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[E_Byte,System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_Byte, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: E_Integer ) } return type: E_Integer type: System.Func`2[E_Byte,E_Integer] ) -=-=-=-=-=-=-=-=- E_Byte -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[E_Byte,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_Byte, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[E_Byte,E_UInteger] ) -=-=-=-=-=-=-=-=- E_Byte -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[E_Byte,System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_Byte, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: E_Long ) } return type: E_Long type: System.Func`2[E_Byte,E_Long] ) -=-=-=-=-=-=-=-=- E_Byte -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Convert( Parameter( x type: E_Byte ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[E_Byte,System.Boolean] ) -=-=-=-=-=-=-=-=- E_Byte -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: System.Single ) } return type: System.Single type: System.Func`2[E_Byte,System.Single] ) -=-=-=-=-=-=-=-=- CType(E_Byte, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: System.Single ) } return type: System.Single type: System.Func`2[E_Byte,System.Single] ) -=-=-=-=-=-=-=-=- E_Byte -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: System.Double ) } return type: System.Double type: System.Func`2[E_Byte,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Byte, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Parameter( x type: E_Byte ) type: System.Double ) } return type: System.Double type: System.Func`2[E_Byte,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Byte, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Convert( Parameter( x type: E_Byte ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[E_Byte,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_Byte, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Byte ) body { Convert( Convert( Parameter( x type: E_Byte ) type: System.Byte ) method: System.String ToString(Byte) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[E_Byte,System.String] ) -=-=-=-=-=-=-=-=- E_Byte? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[E_Byte],System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_Byte?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[E_Byte],E_SByte] ) -=-=-=-=-=-=-=-=- E_Byte? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[E_Byte],System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_Byte?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Parameter( x type: System.Nullable`1[E_Byte] ) Lifted type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[E_Byte],E_Byte] ) -=-=-=-=-=-=-=-=- E_Byte? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[E_Byte],System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_Byte?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[E_Byte],E_Short] ) -=-=-=-=-=-=-=-=- E_Byte? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[E_Byte],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_Byte?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[E_Byte],E_UShort] ) -=-=-=-=-=-=-=-=- E_Byte? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[E_Byte],System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_Byte?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[E_Byte],E_Integer] ) -=-=-=-=-=-=-=-=- E_Byte? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[E_Byte],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_Byte?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[E_Byte],E_UInteger] ) -=-=-=-=-=-=-=-=- E_Byte? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[E_Byte],System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_Byte?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[E_Byte],E_Long] ) -=-=-=-=-=-=-=-=- E_Byte? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[E_Byte],System.Boolean] ) -=-=-=-=-=-=-=-=- E_Byte? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_Byte],System.Single] ) -=-=-=-=-=-=-=-=- CType(E_Byte?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_Byte],System.Single] ) -=-=-=-=-=-=-=-=- E_Byte? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_Byte],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Byte?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_Byte],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Byte?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[E_Byte],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_Byte?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Byte] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Byte] ) method: E_Byte op_Explicit(System.Nullable`1[E_Byte]) in System.Nullable`1[E_Byte] type: E_Byte ) type: System.Byte ) method: System.String ToString(Byte) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[E_Byte],System.String] ) -=-=-=-=-=-=-=-=- Short -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Int16,System.SByte] ) -=-=-=-=-=-=-=-=- CType(Short, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Int16,E_SByte] ) -=-=-=-=-=-=-=-=- Short -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Int16,System.Byte] ) -=-=-=-=-=-=-=-=- CType(Short, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Int16,E_Byte] ) -=-=-=-=-=-=-=-=- Short -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Parameter( x type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Int16,System.Int16] ) -=-=-=-=-=-=-=-=- CType(Short, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Int16,E_Short] ) -=-=-=-=-=-=-=-=- Short -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Int16,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Short, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Int16,E_UShort] ) -=-=-=-=-=-=-=-=- Short -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Int16,System.Int32] ) -=-=-=-=-=-=-=-=- CType(Short, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Int16,E_Integer] ) -=-=-=-=-=-=-=-=- Short -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Int16,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Short, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Int16,E_UInteger] ) -=-=-=-=-=-=-=-=- Short -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Int16,System.Int64] ) -=-=-=-=-=-=-=-=- CType(Short, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Int16,E_Long] ) -=-=-=-=-=-=-=-=- Short -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Convert( Parameter( x type: System.Int16 ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Int16,System.Boolean] ) -=-=-=-=-=-=-=-=- Short -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Int16,System.Single] ) -=-=-=-=-=-=-=-=- CType(Short, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Int16,System.Single] ) -=-=-=-=-=-=-=-=- Short -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Int16,System.Double] ) -=-=-=-=-=-=-=-=- CType(Short, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Parameter( x type: System.Int16 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Int16,System.Double] ) -=-=-=-=-=-=-=-=- CType(Short, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Convert( Parameter( x type: System.Int16 ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Int16,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Short, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int16 ) body { Convert( Convert( Parameter( x type: System.Int16 ) type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Int16,System.String] ) -=-=-=-=-=-=-=-=- Short? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[System.Int16],System.SByte] ) -=-=-=-=-=-=-=-=- CType(Short?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[System.Int16],E_SByte] ) -=-=-=-=-=-=-=-=- Short? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[System.Int16],System.Byte] ) -=-=-=-=-=-=-=-=- CType(Short?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[System.Int16],E_Byte] ) -=-=-=-=-=-=-=-=- Short? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Parameter( x type: System.Nullable`1[System.Int16] ) Lifted type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[System.Int16],System.Int16] ) -=-=-=-=-=-=-=-=- CType(Short?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[System.Int16],E_Short] ) -=-=-=-=-=-=-=-=- Short? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[System.Int16],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Short?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[System.Int16],E_UShort] ) -=-=-=-=-=-=-=-=- Short? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[System.Int16],System.Int32] ) -=-=-=-=-=-=-=-=- CType(Short?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[System.Int16],E_Integer] ) -=-=-=-=-=-=-=-=- Short? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[System.Int16],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Short?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[System.Int16],E_UInteger] ) -=-=-=-=-=-=-=-=- Short? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[System.Int16],System.Int64] ) -=-=-=-=-=-=-=-=- CType(Short?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[System.Int16],E_Long] ) -=-=-=-=-=-=-=-=- Short? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[System.Int16],System.Boolean] ) -=-=-=-=-=-=-=-=- Short? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Int16],System.Single] ) -=-=-=-=-=-=-=-=- CType(Short?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Int16],System.Single] ) -=-=-=-=-=-=-=-=- Short? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Int16],System.Double] ) -=-=-=-=-=-=-=-=- CType(Short?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Int16],System.Double] ) -=-=-=-=-=-=-=-=- CType(Short?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[System.Int16],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Short?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int16] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Int16] ) method: Int16 op_Explicit(System.Nullable`1[System.Int16]) in System.Nullable`1[System.Int16] type: System.Int16 ) type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.Int16],System.String] ) -=-=-=-=-=-=-=-=- E_Short -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: System.SByte ) } return type: System.SByte type: System.Func`2[E_Short,System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_Short, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: E_SByte ) } return type: E_SByte type: System.Func`2[E_Short,E_SByte] ) -=-=-=-=-=-=-=-=- E_Short -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: System.Byte ) } return type: System.Byte type: System.Func`2[E_Short,System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_Short, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: E_Byte ) } return type: E_Byte type: System.Func`2[E_Short,E_Byte] ) -=-=-=-=-=-=-=-=- E_Short -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[E_Short,System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_Short, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Parameter( x type: E_Short ) } return type: E_Short type: System.Func`2[E_Short,E_Short] ) -=-=-=-=-=-=-=-=- E_Short -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[E_Short,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_Short, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: E_UShort ) } return type: E_UShort type: System.Func`2[E_Short,E_UShort] ) -=-=-=-=-=-=-=-=- E_Short -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[E_Short,System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_Short, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: E_Integer ) } return type: E_Integer type: System.Func`2[E_Short,E_Integer] ) -=-=-=-=-=-=-=-=- E_Short -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[E_Short,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_Short, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[E_Short,E_UInteger] ) -=-=-=-=-=-=-=-=- E_Short -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[E_Short,System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_Short, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: E_Long ) } return type: E_Long type: System.Func`2[E_Short,E_Long] ) -=-=-=-=-=-=-=-=- E_Short -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Convert( Parameter( x type: E_Short ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[E_Short,System.Boolean] ) -=-=-=-=-=-=-=-=- E_Short -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: System.Single ) } return type: System.Single type: System.Func`2[E_Short,System.Single] ) -=-=-=-=-=-=-=-=- CType(E_Short, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: System.Single ) } return type: System.Single type: System.Func`2[E_Short,System.Single] ) -=-=-=-=-=-=-=-=- E_Short -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: System.Double ) } return type: System.Double type: System.Func`2[E_Short,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Short, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Parameter( x type: E_Short ) type: System.Double ) } return type: System.Double type: System.Func`2[E_Short,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Short, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Convert( Parameter( x type: E_Short ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[E_Short,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_Short, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Short ) body { Convert( Convert( Parameter( x type: E_Short ) type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[E_Short,System.String] ) -=-=-=-=-=-=-=-=- E_Short? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[E_Short],System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_Short?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[E_Short],E_SByte] ) -=-=-=-=-=-=-=-=- E_Short? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[E_Short],System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_Short?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[E_Short],E_Byte] ) -=-=-=-=-=-=-=-=- E_Short? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[E_Short],System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_Short?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Parameter( x type: System.Nullable`1[E_Short] ) Lifted type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[E_Short],E_Short] ) -=-=-=-=-=-=-=-=- E_Short? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[E_Short],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_Short?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[E_Short],E_UShort] ) -=-=-=-=-=-=-=-=- E_Short? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[E_Short],System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_Short?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[E_Short],E_Integer] ) -=-=-=-=-=-=-=-=- E_Short? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[E_Short],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_Short?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[E_Short],E_UInteger] ) -=-=-=-=-=-=-=-=- E_Short? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[E_Short],System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_Short?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[E_Short],E_Long] ) -=-=-=-=-=-=-=-=- E_Short? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[E_Short],System.Boolean] ) -=-=-=-=-=-=-=-=- E_Short? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_Short],System.Single] ) -=-=-=-=-=-=-=-=- CType(E_Short?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_Short],System.Single] ) -=-=-=-=-=-=-=-=- E_Short? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_Short],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Short?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_Short],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Short?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[E_Short],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_Short?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Short] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Short] ) method: E_Short op_Explicit(System.Nullable`1[E_Short]) in System.Nullable`1[E_Short] type: E_Short ) type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[E_Short],System.String] ) -=-=-=-=-=-=-=-=- UShort -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.UInt16,System.SByte] ) -=-=-=-=-=-=-=-=- CType(UShort, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.UInt16,E_SByte] ) -=-=-=-=-=-=-=-=- UShort -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.UInt16,System.Byte] ) -=-=-=-=-=-=-=-=- CType(UShort, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.UInt16,E_Byte] ) -=-=-=-=-=-=-=-=- UShort -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.UInt16,System.Int16] ) -=-=-=-=-=-=-=-=- CType(UShort, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.UInt16,E_Short] ) -=-=-=-=-=-=-=-=- UShort -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Parameter( x type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.UInt16,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(UShort, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.UInt16,E_UShort] ) -=-=-=-=-=-=-=-=- UShort -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.UInt16,System.Int32] ) -=-=-=-=-=-=-=-=- CType(UShort, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.UInt16,E_Integer] ) -=-=-=-=-=-=-=-=- UShort -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.UInt16,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(UShort, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.UInt16,E_UInteger] ) -=-=-=-=-=-=-=-=- UShort -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.UInt16,System.Int64] ) -=-=-=-=-=-=-=-=- CType(UShort, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.UInt16,E_Long] ) -=-=-=-=-=-=-=-=- UShort -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Convert( Parameter( x type: System.UInt16 ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.UInt16,System.Boolean] ) -=-=-=-=-=-=-=-=- UShort -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.UInt16,System.Single] ) -=-=-=-=-=-=-=-=- CType(UShort, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.UInt16,System.Single] ) -=-=-=-=-=-=-=-=- UShort -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.UInt16,System.Double] ) -=-=-=-=-=-=-=-=- CType(UShort, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Parameter( x type: System.UInt16 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.UInt16,System.Double] ) -=-=-=-=-=-=-=-=- CType(UShort, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Convert( Parameter( x type: System.UInt16 ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.UInt16,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(UShort, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt16 ) body { Convert( Convert( Parameter( x type: System.UInt16 ) type: System.UInt32 ) method: System.String ToString(UInt32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.UInt16,System.String] ) -=-=-=-=-=-=-=-=- UShort? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[System.UInt16],System.SByte] ) -=-=-=-=-=-=-=-=- CType(UShort?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[System.UInt16],E_SByte] ) -=-=-=-=-=-=-=-=- UShort? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[System.UInt16],System.Byte] ) -=-=-=-=-=-=-=-=- CType(UShort?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[System.UInt16],E_Byte] ) -=-=-=-=-=-=-=-=- UShort? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[System.UInt16],System.Int16] ) -=-=-=-=-=-=-=-=- CType(UShort?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[System.UInt16],E_Short] ) -=-=-=-=-=-=-=-=- UShort? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) Lifted type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[System.UInt16],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(UShort?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[System.UInt16],E_UShort] ) -=-=-=-=-=-=-=-=- UShort? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[System.UInt16],System.Int32] ) -=-=-=-=-=-=-=-=- CType(UShort?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[System.UInt16],E_Integer] ) -=-=-=-=-=-=-=-=- UShort? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[System.UInt16],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(UShort?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[System.UInt16],E_UInteger] ) -=-=-=-=-=-=-=-=- UShort? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[System.UInt16],System.Int64] ) -=-=-=-=-=-=-=-=- CType(UShort?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[System.UInt16],E_Long] ) -=-=-=-=-=-=-=-=- UShort? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[System.UInt16],System.Boolean] ) -=-=-=-=-=-=-=-=- UShort? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.UInt16],System.Single] ) -=-=-=-=-=-=-=-=- CType(UShort?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.UInt16],System.Single] ) -=-=-=-=-=-=-=-=- UShort? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.UInt16],System.Double] ) -=-=-=-=-=-=-=-=- CType(UShort?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.UInt16],System.Double] ) -=-=-=-=-=-=-=-=- CType(UShort?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[System.UInt16],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(UShort?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt16] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt16] ) method: UInt16 op_Explicit(System.Nullable`1[System.UInt16]) in System.Nullable`1[System.UInt16] type: System.UInt16 ) type: System.UInt32 ) method: System.String ToString(UInt32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.UInt16],System.String] ) -=-=-=-=-=-=-=-=- E_UShort -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: System.SByte ) } return type: System.SByte type: System.Func`2[E_UShort,System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_UShort, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: E_SByte ) } return type: E_SByte type: System.Func`2[E_UShort,E_SByte] ) -=-=-=-=-=-=-=-=- E_UShort -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: System.Byte ) } return type: System.Byte type: System.Func`2[E_UShort,System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_UShort, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: E_Byte ) } return type: E_Byte type: System.Func`2[E_UShort,E_Byte] ) -=-=-=-=-=-=-=-=- E_UShort -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[E_UShort,System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_UShort, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: E_Short ) } return type: E_Short type: System.Func`2[E_UShort,E_Short] ) -=-=-=-=-=-=-=-=- E_UShort -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[E_UShort,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_UShort, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Parameter( x type: E_UShort ) } return type: E_UShort type: System.Func`2[E_UShort,E_UShort] ) -=-=-=-=-=-=-=-=- E_UShort -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[E_UShort,System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_UShort, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: E_Integer ) } return type: E_Integer type: System.Func`2[E_UShort,E_Integer] ) -=-=-=-=-=-=-=-=- E_UShort -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[E_UShort,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_UShort, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[E_UShort,E_UInteger] ) -=-=-=-=-=-=-=-=- E_UShort -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[E_UShort,System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_UShort, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: E_Long ) } return type: E_Long type: System.Func`2[E_UShort,E_Long] ) -=-=-=-=-=-=-=-=- E_UShort -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Convert( Parameter( x type: E_UShort ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[E_UShort,System.Boolean] ) -=-=-=-=-=-=-=-=- E_UShort -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: System.Single ) } return type: System.Single type: System.Func`2[E_UShort,System.Single] ) -=-=-=-=-=-=-=-=- CType(E_UShort, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: System.Single ) } return type: System.Single type: System.Func`2[E_UShort,System.Single] ) -=-=-=-=-=-=-=-=- E_UShort -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: System.Double ) } return type: System.Double type: System.Func`2[E_UShort,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_UShort, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Parameter( x type: E_UShort ) type: System.Double ) } return type: System.Double type: System.Func`2[E_UShort,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_UShort, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Convert( Parameter( x type: E_UShort ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[E_UShort,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_UShort, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UShort ) body { Convert( Convert( Parameter( x type: E_UShort ) type: System.UInt32 ) method: System.String ToString(UInt32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[E_UShort,System.String] ) -=-=-=-=-=-=-=-=- E_UShort? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[E_UShort],System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_UShort?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[E_UShort],E_SByte] ) -=-=-=-=-=-=-=-=- E_UShort? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[E_UShort],System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_UShort?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[E_UShort],E_Byte] ) -=-=-=-=-=-=-=-=- E_UShort? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[E_UShort],System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_UShort?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[E_UShort],E_Short] ) -=-=-=-=-=-=-=-=- E_UShort? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[E_UShort],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_UShort?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Parameter( x type: System.Nullable`1[E_UShort] ) Lifted type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[E_UShort],E_UShort] ) -=-=-=-=-=-=-=-=- E_UShort? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[E_UShort],System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_UShort?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[E_UShort],E_Integer] ) -=-=-=-=-=-=-=-=- E_UShort? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[E_UShort],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_UShort?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[E_UShort],E_UInteger] ) -=-=-=-=-=-=-=-=- E_UShort? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[E_UShort],System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_UShort?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[E_UShort],E_Long] ) -=-=-=-=-=-=-=-=- E_UShort? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[E_UShort],System.Boolean] ) -=-=-=-=-=-=-=-=- E_UShort? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_UShort],System.Single] ) -=-=-=-=-=-=-=-=- CType(E_UShort?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_UShort],System.Single] ) -=-=-=-=-=-=-=-=- E_UShort? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_UShort],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_UShort?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_UShort],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_UShort?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[E_UShort],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_UShort?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UShort] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_UShort] ) method: E_UShort op_Explicit(System.Nullable`1[E_UShort]) in System.Nullable`1[E_UShort] type: E_UShort ) type: System.UInt32 ) method: System.String ToString(UInt32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[E_UShort],System.String] ) -=-=-=-=-=-=-=-=- Integer -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Int32,System.SByte] ) -=-=-=-=-=-=-=-=- CType(Integer, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Int32,E_SByte] ) -=-=-=-=-=-=-=-=- Integer -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Int32,System.Byte] ) -=-=-=-=-=-=-=-=- CType(Integer, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Int32,E_Byte] ) -=-=-=-=-=-=-=-=- Integer -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Int32,System.Int16] ) -=-=-=-=-=-=-=-=- CType(Integer, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Int32,E_Short] ) -=-=-=-=-=-=-=-=- Integer -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Int32,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Integer, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Int32,E_UShort] ) -=-=-=-=-=-=-=-=- Integer -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Parameter( x type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Int32,System.Int32] ) -=-=-=-=-=-=-=-=- CType(Integer, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Int32,E_Integer] ) -=-=-=-=-=-=-=-=- Integer -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Int32,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Integer, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Int32,E_UInteger] ) -=-=-=-=-=-=-=-=- Integer -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Int32,System.Int64] ) -=-=-=-=-=-=-=-=- CType(Integer, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Int32,E_Long] ) -=-=-=-=-=-=-=-=- Integer -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Int32,System.Boolean] ) -=-=-=-=-=-=-=-=- Integer -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Int32,System.Single] ) -=-=-=-=-=-=-=-=- CType(Integer, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Int32,System.Single] ) -=-=-=-=-=-=-=-=- Integer -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Int32,System.Double] ) -=-=-=-=-=-=-=-=- CType(Integer, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Int32,System.Double] ) -=-=-=-=-=-=-=-=- CType(Integer, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Int32,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Integer, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int32 ) body { Convert( Parameter( x type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Int32,System.String] ) -=-=-=-=-=-=-=-=- Integer? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[System.Int32],System.SByte] ) -=-=-=-=-=-=-=-=- CType(Integer?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[System.Int32],E_SByte] ) -=-=-=-=-=-=-=-=- Integer? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[System.Int32],System.Byte] ) -=-=-=-=-=-=-=-=- CType(Integer?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[System.Int32],E_Byte] ) -=-=-=-=-=-=-=-=- Integer? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[System.Int32],System.Int16] ) -=-=-=-=-=-=-=-=- CType(Integer?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[System.Int32],E_Short] ) -=-=-=-=-=-=-=-=- Integer? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[System.Int32],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Integer?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[System.Int32],E_UShort] ) -=-=-=-=-=-=-=-=- Integer? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Parameter( x type: System.Nullable`1[System.Int32] ) Lifted type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[System.Int32],System.Int32] ) -=-=-=-=-=-=-=-=- CType(Integer?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[System.Int32],E_Integer] ) -=-=-=-=-=-=-=-=- Integer? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[System.Int32],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Integer?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[System.Int32],E_UInteger] ) -=-=-=-=-=-=-=-=- Integer? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[System.Int32],System.Int64] ) -=-=-=-=-=-=-=-=- CType(Integer?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[System.Int32],E_Long] ) -=-=-=-=-=-=-=-=- Integer? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[System.Int32],System.Boolean] ) -=-=-=-=-=-=-=-=- Integer? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Int32],System.Single] ) -=-=-=-=-=-=-=-=- CType(Integer?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Int32],System.Single] ) -=-=-=-=-=-=-=-=- Integer? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Int32],System.Double] ) -=-=-=-=-=-=-=-=- CType(Integer?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Int32],System.Double] ) -=-=-=-=-=-=-=-=- CType(Integer?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[System.Int32],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Integer?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int32] ) method: Int32 op_Explicit(System.Nullable`1[System.Int32]) in System.Nullable`1[System.Int32] type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.Int32],System.String] ) -=-=-=-=-=-=-=-=- E_Integer -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: System.SByte ) } return type: System.SByte type: System.Func`2[E_Integer,System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_Integer, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: E_SByte ) } return type: E_SByte type: System.Func`2[E_Integer,E_SByte] ) -=-=-=-=-=-=-=-=- E_Integer -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: System.Byte ) } return type: System.Byte type: System.Func`2[E_Integer,System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_Integer, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: E_Byte ) } return type: E_Byte type: System.Func`2[E_Integer,E_Byte] ) -=-=-=-=-=-=-=-=- E_Integer -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[E_Integer,System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_Integer, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: E_Short ) } return type: E_Short type: System.Func`2[E_Integer,E_Short] ) -=-=-=-=-=-=-=-=- E_Integer -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[E_Integer,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_Integer, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: E_UShort ) } return type: E_UShort type: System.Func`2[E_Integer,E_UShort] ) -=-=-=-=-=-=-=-=- E_Integer -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[E_Integer,System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_Integer, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Parameter( x type: E_Integer ) } return type: E_Integer type: System.Func`2[E_Integer,E_Integer] ) -=-=-=-=-=-=-=-=- E_Integer -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[E_Integer,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_Integer, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[E_Integer,E_UInteger] ) -=-=-=-=-=-=-=-=- E_Integer -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[E_Integer,System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_Integer, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: E_Long ) } return type: E_Long type: System.Func`2[E_Integer,E_Long] ) -=-=-=-=-=-=-=-=- E_Integer -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Convert( Parameter( x type: E_Integer ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[E_Integer,System.Boolean] ) -=-=-=-=-=-=-=-=- E_Integer -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: System.Single ) } return type: System.Single type: System.Func`2[E_Integer,System.Single] ) -=-=-=-=-=-=-=-=- CType(E_Integer, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: System.Single ) } return type: System.Single type: System.Func`2[E_Integer,System.Single] ) -=-=-=-=-=-=-=-=- E_Integer -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: System.Double ) } return type: System.Double type: System.Func`2[E_Integer,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Integer, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Parameter( x type: E_Integer ) type: System.Double ) } return type: System.Double type: System.Func`2[E_Integer,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Integer, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Convert( Parameter( x type: E_Integer ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[E_Integer,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_Integer, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Integer ) body { Convert( Convert( Parameter( x type: E_Integer ) type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[E_Integer,System.String] ) -=-=-=-=-=-=-=-=- E_Integer? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[E_Integer],System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_Integer?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[E_Integer],E_SByte] ) -=-=-=-=-=-=-=-=- E_Integer? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[E_Integer],System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_Integer?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[E_Integer],E_Byte] ) -=-=-=-=-=-=-=-=- E_Integer? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[E_Integer],System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_Integer?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[E_Integer],E_Short] ) -=-=-=-=-=-=-=-=- E_Integer? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[E_Integer],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_Integer?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[E_Integer],E_UShort] ) -=-=-=-=-=-=-=-=- E_Integer? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[E_Integer],System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_Integer?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Parameter( x type: System.Nullable`1[E_Integer] ) Lifted type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[E_Integer],E_Integer] ) -=-=-=-=-=-=-=-=- E_Integer? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[E_Integer],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_Integer?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[E_Integer],E_UInteger] ) -=-=-=-=-=-=-=-=- E_Integer? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[E_Integer],System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_Integer?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[E_Integer],E_Long] ) -=-=-=-=-=-=-=-=- E_Integer? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.Int32 ) method: Boolean ToBoolean(Int32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[E_Integer],System.Boolean] ) -=-=-=-=-=-=-=-=- E_Integer? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_Integer],System.Single] ) -=-=-=-=-=-=-=-=- CType(E_Integer?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_Integer],System.Single] ) -=-=-=-=-=-=-=-=- E_Integer? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_Integer],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Integer?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_Integer],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Integer?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.Int32 ) method: System.Decimal op_Implicit(Int32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[E_Integer],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_Integer?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Integer] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Integer] ) method: E_Integer op_Explicit(System.Nullable`1[E_Integer]) in System.Nullable`1[E_Integer] type: E_Integer ) type: System.Int32 ) method: System.String ToString(Int32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[E_Integer],System.String] ) -=-=-=-=-=-=-=-=- UInteger -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.UInt32,System.SByte] ) -=-=-=-=-=-=-=-=- CType(UInteger, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.UInt32,E_SByte] ) -=-=-=-=-=-=-=-=- UInteger -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.UInt32,System.Byte] ) -=-=-=-=-=-=-=-=- CType(UInteger, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.UInt32,E_Byte] ) -=-=-=-=-=-=-=-=- UInteger -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.UInt32,System.Int16] ) -=-=-=-=-=-=-=-=- CType(UInteger, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.UInt32,E_Short] ) -=-=-=-=-=-=-=-=- UInteger -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.UInt32,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(UInteger, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.UInt32,E_UShort] ) -=-=-=-=-=-=-=-=- UInteger -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.UInt32,System.Int32] ) -=-=-=-=-=-=-=-=- CType(UInteger, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.UInt32,E_Integer] ) -=-=-=-=-=-=-=-=- UInteger -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Parameter( x type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.UInt32,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(UInteger, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.UInt32,E_UInteger] ) -=-=-=-=-=-=-=-=- UInteger -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.UInt32,System.Int64] ) -=-=-=-=-=-=-=-=- CType(UInteger, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.UInt32,E_Long] ) -=-=-=-=-=-=-=-=- UInteger -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) method: Boolean ToBoolean(UInt32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.UInt32,System.Boolean] ) -=-=-=-=-=-=-=-=- UInteger -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.UInt32,System.Single] ) -=-=-=-=-=-=-=-=- CType(UInteger, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.UInt32,System.Single] ) -=-=-=-=-=-=-=-=- UInteger -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.UInt32,System.Double] ) -=-=-=-=-=-=-=-=- CType(UInteger, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.UInt32,System.Double] ) -=-=-=-=-=-=-=-=- CType(UInteger, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) method: System.Decimal op_Implicit(UInt32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.UInt32,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(UInteger, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.UInt32 ) body { Convert( Parameter( x type: System.UInt32 ) method: System.String ToString(UInt32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.UInt32,System.String] ) -=-=-=-=-=-=-=-=- UInteger? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[System.UInt32],System.SByte] ) -=-=-=-=-=-=-=-=- CType(UInteger?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[System.UInt32],E_SByte] ) -=-=-=-=-=-=-=-=- UInteger? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[System.UInt32],System.Byte] ) -=-=-=-=-=-=-=-=- CType(UInteger?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[System.UInt32],E_Byte] ) -=-=-=-=-=-=-=-=- UInteger? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[System.UInt32],System.Int16] ) -=-=-=-=-=-=-=-=- CType(UInteger?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[System.UInt32],E_Short] ) -=-=-=-=-=-=-=-=- UInteger? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[System.UInt32],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(UInteger?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[System.UInt32],E_UShort] ) -=-=-=-=-=-=-=-=- UInteger? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[System.UInt32],System.Int32] ) -=-=-=-=-=-=-=-=- CType(UInteger?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[System.UInt32],E_Integer] ) -=-=-=-=-=-=-=-=- UInteger? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) Lifted type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[System.UInt32],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(UInteger?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[System.UInt32],E_UInteger] ) -=-=-=-=-=-=-=-=- UInteger? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[System.UInt32],System.Int64] ) -=-=-=-=-=-=-=-=- CType(UInteger?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[System.UInt32],E_Long] ) -=-=-=-=-=-=-=-=- UInteger? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) method: Boolean ToBoolean(UInt32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[System.UInt32],System.Boolean] ) -=-=-=-=-=-=-=-=- UInteger? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.UInt32],System.Single] ) -=-=-=-=-=-=-=-=- CType(UInteger?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.UInt32],System.Single] ) -=-=-=-=-=-=-=-=- UInteger? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.UInt32],System.Double] ) -=-=-=-=-=-=-=-=- CType(UInteger?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.UInt32],System.Double] ) -=-=-=-=-=-=-=-=- CType(UInteger?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) method: System.Decimal op_Implicit(UInt32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[System.UInt32],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(UInteger?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.UInt32] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.UInt32] ) method: UInt32 op_Explicit(System.Nullable`1[System.UInt32]) in System.Nullable`1[System.UInt32] type: System.UInt32 ) method: System.String ToString(UInt32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.UInt32],System.String] ) -=-=-=-=-=-=-=-=- E_UInteger -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: System.SByte ) } return type: System.SByte type: System.Func`2[E_UInteger,System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_UInteger, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: E_SByte ) } return type: E_SByte type: System.Func`2[E_UInteger,E_SByte] ) -=-=-=-=-=-=-=-=- E_UInteger -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: System.Byte ) } return type: System.Byte type: System.Func`2[E_UInteger,System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_UInteger, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: E_Byte ) } return type: E_Byte type: System.Func`2[E_UInteger,E_Byte] ) -=-=-=-=-=-=-=-=- E_UInteger -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[E_UInteger,System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_UInteger, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: E_Short ) } return type: E_Short type: System.Func`2[E_UInteger,E_Short] ) -=-=-=-=-=-=-=-=- E_UInteger -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[E_UInteger,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_UInteger, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: E_UShort ) } return type: E_UShort type: System.Func`2[E_UInteger,E_UShort] ) -=-=-=-=-=-=-=-=- E_UInteger -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[E_UInteger,System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_UInteger, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: E_Integer ) } return type: E_Integer type: System.Func`2[E_UInteger,E_Integer] ) -=-=-=-=-=-=-=-=- E_UInteger -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[E_UInteger,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_UInteger, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Parameter( x type: E_UInteger ) } return type: E_UInteger type: System.Func`2[E_UInteger,E_UInteger] ) -=-=-=-=-=-=-=-=- E_UInteger -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[E_UInteger,System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_UInteger, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: E_Long ) } return type: E_Long type: System.Func`2[E_UInteger,E_Long] ) -=-=-=-=-=-=-=-=- E_UInteger -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Convert( Parameter( x type: E_UInteger ) type: System.UInt32 ) method: Boolean ToBoolean(UInt32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[E_UInteger,System.Boolean] ) -=-=-=-=-=-=-=-=- E_UInteger -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: System.Single ) } return type: System.Single type: System.Func`2[E_UInteger,System.Single] ) -=-=-=-=-=-=-=-=- CType(E_UInteger, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: System.Single ) } return type: System.Single type: System.Func`2[E_UInteger,System.Single] ) -=-=-=-=-=-=-=-=- E_UInteger -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: System.Double ) } return type: System.Double type: System.Func`2[E_UInteger,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_UInteger, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Parameter( x type: E_UInteger ) type: System.Double ) } return type: System.Double type: System.Func`2[E_UInteger,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_UInteger, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Convert( Parameter( x type: E_UInteger ) type: System.UInt32 ) method: System.Decimal op_Implicit(UInt32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[E_UInteger,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_UInteger, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_UInteger ) body { Convert( Convert( Parameter( x type: E_UInteger ) type: System.UInt32 ) method: System.String ToString(UInt32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[E_UInteger,System.String] ) -=-=-=-=-=-=-=-=- E_UInteger? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[E_UInteger],System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_UInteger?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[E_UInteger],E_SByte] ) -=-=-=-=-=-=-=-=- E_UInteger? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[E_UInteger],System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_UInteger?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[E_UInteger],E_Byte] ) -=-=-=-=-=-=-=-=- E_UInteger? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[E_UInteger],System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_UInteger?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[E_UInteger],E_Short] ) -=-=-=-=-=-=-=-=- E_UInteger? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[E_UInteger],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_UInteger?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[E_UInteger],E_UShort] ) -=-=-=-=-=-=-=-=- E_UInteger? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[E_UInteger],System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_UInteger?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[E_UInteger],E_Integer] ) -=-=-=-=-=-=-=-=- E_UInteger? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[E_UInteger],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_UInteger?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) Lifted type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[E_UInteger],E_UInteger] ) -=-=-=-=-=-=-=-=- E_UInteger? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[E_UInteger],System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_UInteger?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[E_UInteger],E_Long] ) -=-=-=-=-=-=-=-=- E_UInteger? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.UInt32 ) method: Boolean ToBoolean(UInt32) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[E_UInteger],System.Boolean] ) -=-=-=-=-=-=-=-=- E_UInteger? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_UInteger],System.Single] ) -=-=-=-=-=-=-=-=- CType(E_UInteger?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_UInteger],System.Single] ) -=-=-=-=-=-=-=-=- E_UInteger? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_UInteger],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_UInteger?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_UInteger],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_UInteger?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.UInt32 ) method: System.Decimal op_Implicit(UInt32) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[E_UInteger],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_UInteger?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_UInteger] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_UInteger] ) method: E_UInteger op_Explicit(System.Nullable`1[E_UInteger]) in System.Nullable`1[E_UInteger] type: E_UInteger ) type: System.UInt32 ) method: System.String ToString(UInt32) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[E_UInteger],System.String] ) -=-=-=-=-=-=-=-=- Long -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Int64,System.SByte] ) -=-=-=-=-=-=-=-=- CType(Long, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Int64,E_SByte] ) -=-=-=-=-=-=-=-=- Long -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Int64,System.Byte] ) -=-=-=-=-=-=-=-=- CType(Long, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Int64,E_Byte] ) -=-=-=-=-=-=-=-=- Long -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Int64,System.Int16] ) -=-=-=-=-=-=-=-=- CType(Long, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Int64,E_Short] ) -=-=-=-=-=-=-=-=- Long -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Int64,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Long, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Int64,E_UShort] ) -=-=-=-=-=-=-=-=- Long -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Int64,System.Int32] ) -=-=-=-=-=-=-=-=- CType(Long, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Int64,E_Integer] ) -=-=-=-=-=-=-=-=- Long -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Int64,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Long, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Int64,E_UInteger] ) -=-=-=-=-=-=-=-=- Long -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Parameter( x type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Int64,System.Int64] ) -=-=-=-=-=-=-=-=- CType(Long, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Int64,E_Long] ) -=-=-=-=-=-=-=-=- Long -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) method: Boolean ToBoolean(Int64) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Int64,System.Boolean] ) -=-=-=-=-=-=-=-=- Long -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Int64,System.Single] ) -=-=-=-=-=-=-=-=- CType(Long, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Int64,System.Single] ) -=-=-=-=-=-=-=-=- Long -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Int64,System.Double] ) -=-=-=-=-=-=-=-=- CType(Long, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Int64,System.Double] ) -=-=-=-=-=-=-=-=- CType(Long, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) method: System.Decimal op_Implicit(Int64) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Int64,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Long, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Int64 ) body { Convert( Parameter( x type: System.Int64 ) method: System.String ToString(Int64) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Int64,System.String] ) -=-=-=-=-=-=-=-=- Long? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[System.Int64],System.SByte] ) -=-=-=-=-=-=-=-=- CType(Long?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[System.Int64],E_SByte] ) -=-=-=-=-=-=-=-=- Long? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[System.Int64],System.Byte] ) -=-=-=-=-=-=-=-=- CType(Long?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[System.Int64],E_Byte] ) -=-=-=-=-=-=-=-=- Long? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[System.Int64],System.Int16] ) -=-=-=-=-=-=-=-=- CType(Long?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[System.Int64],E_Short] ) -=-=-=-=-=-=-=-=- Long? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[System.Int64],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Long?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[System.Int64],E_UShort] ) -=-=-=-=-=-=-=-=- Long? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[System.Int64],System.Int32] ) -=-=-=-=-=-=-=-=- CType(Long?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[System.Int64],E_Integer] ) -=-=-=-=-=-=-=-=- Long? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[System.Int64],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Long?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[System.Int64],E_UInteger] ) -=-=-=-=-=-=-=-=- Long? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Parameter( x type: System.Nullable`1[System.Int64] ) Lifted type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[System.Int64],System.Int64] ) -=-=-=-=-=-=-=-=- CType(Long?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[System.Int64],E_Long] ) -=-=-=-=-=-=-=-=- Long? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) method: Boolean ToBoolean(Int64) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[System.Int64],System.Boolean] ) -=-=-=-=-=-=-=-=- Long? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Int64],System.Single] ) -=-=-=-=-=-=-=-=- CType(Long?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Int64],System.Single] ) -=-=-=-=-=-=-=-=- Long? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Int64],System.Double] ) -=-=-=-=-=-=-=-=- CType(Long?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Int64],System.Double] ) -=-=-=-=-=-=-=-=- CType(Long?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) method: System.Decimal op_Implicit(Int64) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[System.Int64],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Long?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Int64] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Int64] ) method: Int64 op_Explicit(System.Nullable`1[System.Int64]) in System.Nullable`1[System.Int64] type: System.Int64 ) method: System.String ToString(Int64) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.Int64],System.String] ) -=-=-=-=-=-=-=-=- E_Long -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: System.SByte ) } return type: System.SByte type: System.Func`2[E_Long,System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_Long, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: E_SByte ) } return type: E_SByte type: System.Func`2[E_Long,E_SByte] ) -=-=-=-=-=-=-=-=- E_Long -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: System.Byte ) } return type: System.Byte type: System.Func`2[E_Long,System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_Long, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: E_Byte ) } return type: E_Byte type: System.Func`2[E_Long,E_Byte] ) -=-=-=-=-=-=-=-=- E_Long -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[E_Long,System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_Long, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: E_Short ) } return type: E_Short type: System.Func`2[E_Long,E_Short] ) -=-=-=-=-=-=-=-=- E_Long -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[E_Long,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_Long, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: E_UShort ) } return type: E_UShort type: System.Func`2[E_Long,E_UShort] ) -=-=-=-=-=-=-=-=- E_Long -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[E_Long,System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_Long, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: E_Integer ) } return type: E_Integer type: System.Func`2[E_Long,E_Integer] ) -=-=-=-=-=-=-=-=- E_Long -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[E_Long,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_Long, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[E_Long,E_UInteger] ) -=-=-=-=-=-=-=-=- E_Long -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[E_Long,System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_Long, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Parameter( x type: E_Long ) } return type: E_Long type: System.Func`2[E_Long,E_Long] ) -=-=-=-=-=-=-=-=- E_Long -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Convert( Parameter( x type: E_Long ) type: System.Int64 ) method: Boolean ToBoolean(Int64) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[E_Long,System.Boolean] ) -=-=-=-=-=-=-=-=- E_Long -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: System.Single ) } return type: System.Single type: System.Func`2[E_Long,System.Single] ) -=-=-=-=-=-=-=-=- CType(E_Long, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: System.Single ) } return type: System.Single type: System.Func`2[E_Long,System.Single] ) -=-=-=-=-=-=-=-=- E_Long -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: System.Double ) } return type: System.Double type: System.Func`2[E_Long,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Long, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Parameter( x type: E_Long ) type: System.Double ) } return type: System.Double type: System.Func`2[E_Long,System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Long, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Convert( Parameter( x type: E_Long ) type: System.Int64 ) method: System.Decimal op_Implicit(Int64) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[E_Long,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_Long, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: E_Long ) body { Convert( Convert( Parameter( x type: E_Long ) type: System.Int64 ) method: System.String ToString(Int64) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[E_Long,System.String] ) -=-=-=-=-=-=-=-=- E_Long? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[E_Long],System.SByte] ) -=-=-=-=-=-=-=-=- CType(E_Long?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[E_Long],E_SByte] ) -=-=-=-=-=-=-=-=- E_Long? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[E_Long],System.Byte] ) -=-=-=-=-=-=-=-=- CType(E_Long?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[E_Long],E_Byte] ) -=-=-=-=-=-=-=-=- E_Long? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[E_Long],System.Int16] ) -=-=-=-=-=-=-=-=- CType(E_Long?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[E_Long],E_Short] ) -=-=-=-=-=-=-=-=- E_Long? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[E_Long],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(E_Long?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[E_Long],E_UShort] ) -=-=-=-=-=-=-=-=- E_Long? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[E_Long],System.Int32] ) -=-=-=-=-=-=-=-=- CType(E_Long?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[E_Long],E_Integer] ) -=-=-=-=-=-=-=-=- E_Long? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[E_Long],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(E_Long?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[E_Long],E_UInteger] ) -=-=-=-=-=-=-=-=- E_Long? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[E_Long],System.Int64] ) -=-=-=-=-=-=-=-=- CType(E_Long?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Parameter( x type: System.Nullable`1[E_Long] ) Lifted type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[E_Long],E_Long] ) -=-=-=-=-=-=-=-=- E_Long? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.Int64 ) method: Boolean ToBoolean(Int64) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[E_Long],System.Boolean] ) -=-=-=-=-=-=-=-=- E_Long? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_Long],System.Single] ) -=-=-=-=-=-=-=-=- CType(E_Long?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[E_Long],System.Single] ) -=-=-=-=-=-=-=-=- E_Long? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_Long],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Long?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[E_Long],System.Double] ) -=-=-=-=-=-=-=-=- CType(E_Long?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.Int64 ) method: System.Decimal op_Implicit(Int64) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[E_Long],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(E_Long?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[E_Long] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[E_Long] ) method: E_Long op_Explicit(System.Nullable`1[E_Long]) in System.Nullable`1[E_Long] type: E_Long ) type: System.Int64 ) method: System.String ToString(Int64) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[E_Long],System.String] ) -=-=-=-=-=-=-=-=- Boolean -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Boolean,System.SByte] ) -=-=-=-=-=-=-=-=- CType(Boolean, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Boolean,E_SByte] ) -=-=-=-=-=-=-=-=- Boolean -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Boolean,System.Byte] ) -=-=-=-=-=-=-=-=- CType(Boolean, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Boolean,E_Byte] ) -=-=-=-=-=-=-=-=- Boolean -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int16 ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Boolean,System.Int16] ) -=-=-=-=-=-=-=-=- CType(Boolean, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int16 ) type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Boolean,E_Short] ) -=-=-=-=-=-=-=-=- Boolean -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int16 ) type: System.Int16 ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Boolean,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Boolean, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int16 ) type: System.Int16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Boolean,E_UShort] ) -=-=-=-=-=-=-=-=- Boolean -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Boolean,System.Int32] ) -=-=-=-=-=-=-=-=- CType(Boolean, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Boolean,E_Integer] ) -=-=-=-=-=-=-=-=- Boolean -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Boolean,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Boolean, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Boolean,E_UInteger] ) -=-=-=-=-=-=-=-=- Boolean -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int64 ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Boolean,System.Int64] ) -=-=-=-=-=-=-=-=- CType(Boolean, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Negate( Convert( Parameter( x type: System.Boolean ) type: System.Int64 ) type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Boolean,E_Long] ) -=-=-=-=-=-=-=-=- Boolean -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Parameter( x type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Boolean,System.Boolean] ) -=-=-=-=-=-=-=-=- Boolean -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Negate( Convert( Parameter( x type: System.Boolean ) type: System.Single ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Boolean,System.Single] ) -=-=-=-=-=-=-=-=- CType(Boolean, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Negate( Convert( Parameter( x type: System.Boolean ) type: System.Single ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Boolean,System.Single] ) -=-=-=-=-=-=-=-=- Boolean -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Negate( Convert( Parameter( x type: System.Boolean ) type: System.Double ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Boolean,System.Double] ) -=-=-=-=-=-=-=-=- CType(Boolean, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Negate( Convert( Parameter( x type: System.Boolean ) type: System.Double ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Boolean,System.Double] ) -=-=-=-=-=-=-=-=- CType(Boolean, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Parameter( x type: System.Boolean ) method: System.Decimal ToDecimal(Boolean) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Boolean,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Boolean, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Boolean ) body { Convert( Parameter( x type: System.Boolean ) method: System.String ToString(Boolean) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Boolean,System.String] ) -=-=-=-=-=-=-=-=- Boolean? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[System.Boolean],System.SByte] ) -=-=-=-=-=-=-=-=- CType(Boolean?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[System.Boolean],E_SByte] ) -=-=-=-=-=-=-=-=- Boolean? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[System.Boolean],System.Byte] ) -=-=-=-=-=-=-=-=- CType(Boolean?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[System.Boolean],E_Byte] ) -=-=-=-=-=-=-=-=- Boolean? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int16 ) type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[System.Boolean],System.Int16] ) -=-=-=-=-=-=-=-=- CType(Boolean?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int16 ) type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[System.Boolean],E_Short] ) -=-=-=-=-=-=-=-=- Boolean? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int16 ) type: System.Int16 ) type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[System.Boolean],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Boolean?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int16 ) type: System.Int16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[System.Boolean],E_UShort] ) -=-=-=-=-=-=-=-=- Boolean? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[System.Boolean],System.Int32] ) -=-=-=-=-=-=-=-=- CType(Boolean?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[System.Boolean],E_Integer] ) -=-=-=-=-=-=-=-=- Boolean? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[System.Boolean],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Boolean?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int32 ) type: System.Int32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[System.Boolean],E_UInteger] ) -=-=-=-=-=-=-=-=- Boolean? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int64 ) type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[System.Boolean],System.Int64] ) -=-=-=-=-=-=-=-=- CType(Boolean?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Int64 ) type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[System.Boolean],E_Long] ) -=-=-=-=-=-=-=-=- Boolean? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) Lifted type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[System.Boolean],System.Boolean] ) -=-=-=-=-=-=-=-=- Boolean? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Single ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Boolean],System.Single] ) -=-=-=-=-=-=-=-=- CType(Boolean?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Single ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Boolean],System.Single] ) -=-=-=-=-=-=-=-=- Boolean? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Double ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Boolean],System.Double] ) -=-=-=-=-=-=-=-=- CType(Boolean?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Negate( Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) type: System.Double ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Boolean],System.Double] ) -=-=-=-=-=-=-=-=- CType(Boolean?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) method: System.Decimal ToDecimal(Boolean) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[System.Boolean],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Boolean?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Boolean] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Boolean] ) method: Boolean op_Explicit(System.Nullable`1[System.Boolean]) in System.Nullable`1[System.Boolean] type: System.Boolean ) method: System.String ToString(Boolean) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.Boolean],System.String] ) -=-=-=-=-=-=-=-=- Single -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) method: SByte ToSByte(Single) in System.Convert type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Single,System.SByte] ) -=-=-=-=-=-=-=-=- CType(Single, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Convert( Parameter( x type: System.Single ) method: SByte ToSByte(Single) in System.Convert type: System.SByte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Single,E_SByte] ) -=-=-=-=-=-=-=-=- Single -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) method: Byte ToByte(Single) in System.Convert type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Single,System.Byte] ) -=-=-=-=-=-=-=-=- CType(Single, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Convert( Parameter( x type: System.Single ) method: Byte ToByte(Single) in System.Convert type: System.Byte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Single,E_Byte] ) -=-=-=-=-=-=-=-=- Single -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) method: Int16 ToInt16(Single) in System.Convert type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Single,System.Int16] ) -=-=-=-=-=-=-=-=- CType(Single, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Convert( Parameter( x type: System.Single ) method: Int16 ToInt16(Single) in System.Convert type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Single,E_Short] ) -=-=-=-=-=-=-=-=- Single -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) method: UInt16 ToUInt16(Single) in System.Convert type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Single,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Single, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Convert( Parameter( x type: System.Single ) method: UInt16 ToUInt16(Single) in System.Convert type: System.UInt16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Single,E_UShort] ) -=-=-=-=-=-=-=-=- Single -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) method: Int32 ToInt32(Single) in System.Convert type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Single,System.Int32] ) -=-=-=-=-=-=-=-=- CType(Single, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Convert( Parameter( x type: System.Single ) method: Int32 ToInt32(Single) in System.Convert type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Single,E_Integer] ) -=-=-=-=-=-=-=-=- Single -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) method: UInt32 ToUInt32(Single) in System.Convert type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Single,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Single, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Convert( Parameter( x type: System.Single ) method: UInt32 ToUInt32(Single) in System.Convert type: System.UInt32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Single,E_UInteger] ) -=-=-=-=-=-=-=-=- Single -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) method: Int64 ToInt64(Single) in System.Convert type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Single,System.Int64] ) -=-=-=-=-=-=-=-=- CType(Single, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Convert( Parameter( x type: System.Single ) method: Int64 ToInt64(Single) in System.Convert type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Single,E_Long] ) -=-=-=-=-=-=-=-=- Single -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) method: Boolean ToBoolean(Single) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Single,System.Boolean] ) -=-=-=-=-=-=-=-=- Single -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Parameter( x type: System.Single ) } return type: System.Single type: System.Func`2[System.Single,System.Single] ) -=-=-=-=-=-=-=-=- CType(Single, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Single,System.Single] ) -=-=-=-=-=-=-=-=- Single -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Single,System.Double] ) -=-=-=-=-=-=-=-=- CType(Single, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Single,System.Double] ) -=-=-=-=-=-=-=-=- CType(Single, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) method: System.Decimal op_Explicit(Single) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Single,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Single, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Single ) body { Convert( Parameter( x type: System.Single ) method: System.String ToString(Single) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Single,System.String] ) -=-=-=-=-=-=-=-=- Single? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: SByte ToSByte(Single) in System.Convert type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[System.Single],System.SByte] ) -=-=-=-=-=-=-=-=- CType(Single?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: SByte ToSByte(Single) in System.Convert type: System.SByte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[System.Single],E_SByte] ) -=-=-=-=-=-=-=-=- Single? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: Byte ToByte(Single) in System.Convert type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[System.Single],System.Byte] ) -=-=-=-=-=-=-=-=- CType(Single?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: Byte ToByte(Single) in System.Convert type: System.Byte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[System.Single],E_Byte] ) -=-=-=-=-=-=-=-=- Single? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: Int16 ToInt16(Single) in System.Convert type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[System.Single],System.Int16] ) -=-=-=-=-=-=-=-=- CType(Single?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: Int16 ToInt16(Single) in System.Convert type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[System.Single],E_Short] ) -=-=-=-=-=-=-=-=- Single? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: UInt16 ToUInt16(Single) in System.Convert type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[System.Single],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Single?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: UInt16 ToUInt16(Single) in System.Convert type: System.UInt16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[System.Single],E_UShort] ) -=-=-=-=-=-=-=-=- Single? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: Int32 ToInt32(Single) in System.Convert type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[System.Single],System.Int32] ) -=-=-=-=-=-=-=-=- CType(Single?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: Int32 ToInt32(Single) in System.Convert type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[System.Single],E_Integer] ) -=-=-=-=-=-=-=-=- Single? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: UInt32 ToUInt32(Single) in System.Convert type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[System.Single],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Single?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: UInt32 ToUInt32(Single) in System.Convert type: System.UInt32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[System.Single],E_UInteger] ) -=-=-=-=-=-=-=-=- Single? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: Int64 ToInt64(Single) in System.Convert type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[System.Single],System.Int64] ) -=-=-=-=-=-=-=-=- CType(Single?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: Int64 ToInt64(Single) in System.Convert type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[System.Single],E_Long] ) -=-=-=-=-=-=-=-=- Single? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: Boolean ToBoolean(Single) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[System.Single],System.Boolean] ) -=-=-=-=-=-=-=-=- Single? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Parameter( x type: System.Nullable`1[System.Single] ) Lifted type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Single],System.Single] ) -=-=-=-=-=-=-=-=- CType(Single?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Parameter( x type: System.Nullable`1[System.Single] ) Lifted type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Single],System.Single] ) -=-=-=-=-=-=-=-=- Single? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Single],System.Double] ) -=-=-=-=-=-=-=-=- CType(Single?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Single],System.Double] ) -=-=-=-=-=-=-=-=- CType(Single?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: System.Decimal op_Explicit(Single) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[System.Single],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Single?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Single] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Single] ) method: Single op_Explicit(System.Nullable`1[System.Single]) in System.Nullable`1[System.Single] type: System.Single ) method: System.String ToString(Single) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.Single],System.String] ) -=-=-=-=-=-=-=-=- Double -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) method: SByte ToSByte(Double) in System.Convert type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Double,System.SByte] ) -=-=-=-=-=-=-=-=- CType(Double, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Convert( Parameter( x type: System.Double ) method: SByte ToSByte(Double) in System.Convert type: System.SByte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Double,E_SByte] ) -=-=-=-=-=-=-=-=- Double -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) method: Byte ToByte(Double) in System.Convert type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Double,System.Byte] ) -=-=-=-=-=-=-=-=- CType(Double, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Convert( Parameter( x type: System.Double ) method: Byte ToByte(Double) in System.Convert type: System.Byte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Double,E_Byte] ) -=-=-=-=-=-=-=-=- Double -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) method: Int16 ToInt16(Double) in System.Convert type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Double,System.Int16] ) -=-=-=-=-=-=-=-=- CType(Double, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Convert( Parameter( x type: System.Double ) method: Int16 ToInt16(Double) in System.Convert type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Double,E_Short] ) -=-=-=-=-=-=-=-=- Double -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) method: UInt16 ToUInt16(Double) in System.Convert type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Double,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Double, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Convert( Parameter( x type: System.Double ) method: UInt16 ToUInt16(Double) in System.Convert type: System.UInt16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Double,E_UShort] ) -=-=-=-=-=-=-=-=- Double -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) method: Int32 ToInt32(Double) in System.Convert type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Double,System.Int32] ) -=-=-=-=-=-=-=-=- CType(Double, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Convert( Parameter( x type: System.Double ) method: Int32 ToInt32(Double) in System.Convert type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Double,E_Integer] ) -=-=-=-=-=-=-=-=- Double -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) method: UInt32 ToUInt32(Double) in System.Convert type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Double,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Double, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Convert( Parameter( x type: System.Double ) method: UInt32 ToUInt32(Double) in System.Convert type: System.UInt32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Double,E_UInteger] ) -=-=-=-=-=-=-=-=- Double -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) method: Int64 ToInt64(Double) in System.Convert type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Double,System.Int64] ) -=-=-=-=-=-=-=-=- CType(Double, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Convert( Parameter( x type: System.Double ) method: Int64 ToInt64(Double) in System.Convert type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Double,E_Long] ) -=-=-=-=-=-=-=-=- Double -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) method: Boolean ToBoolean(Double) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Double,System.Boolean] ) -=-=-=-=-=-=-=-=- Double -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Double,System.Single] ) -=-=-=-=-=-=-=-=- CType(Double, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Double,System.Single] ) -=-=-=-=-=-=-=-=- Double -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Parameter( x type: System.Double ) } return type: System.Double type: System.Func`2[System.Double,System.Double] ) -=-=-=-=-=-=-=-=- CType(Double, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) type: System.Double ) } return type: System.Double type: System.Func`2[System.Double,System.Double] ) -=-=-=-=-=-=-=-=- CType(Double, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) method: System.Decimal op_Explicit(Double) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Double,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Double, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Double ) body { Convert( Parameter( x type: System.Double ) method: System.String ToString(Double) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Double,System.String] ) -=-=-=-=-=-=-=-=- Double? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: SByte ToSByte(Double) in System.Convert type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[System.Double],System.SByte] ) -=-=-=-=-=-=-=-=- CType(Double?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: SByte ToSByte(Double) in System.Convert type: System.SByte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[System.Double],E_SByte] ) -=-=-=-=-=-=-=-=- Double? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: Byte ToByte(Double) in System.Convert type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[System.Double],System.Byte] ) -=-=-=-=-=-=-=-=- CType(Double?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: Byte ToByte(Double) in System.Convert type: System.Byte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[System.Double],E_Byte] ) -=-=-=-=-=-=-=-=- Double? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: Int16 ToInt16(Double) in System.Convert type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[System.Double],System.Int16] ) -=-=-=-=-=-=-=-=- CType(Double?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: Int16 ToInt16(Double) in System.Convert type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[System.Double],E_Short] ) -=-=-=-=-=-=-=-=- Double? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: UInt16 ToUInt16(Double) in System.Convert type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[System.Double],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Double?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: UInt16 ToUInt16(Double) in System.Convert type: System.UInt16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[System.Double],E_UShort] ) -=-=-=-=-=-=-=-=- Double? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: Int32 ToInt32(Double) in System.Convert type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[System.Double],System.Int32] ) -=-=-=-=-=-=-=-=- CType(Double?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: Int32 ToInt32(Double) in System.Convert type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[System.Double],E_Integer] ) -=-=-=-=-=-=-=-=- Double? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: UInt32 ToUInt32(Double) in System.Convert type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[System.Double],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Double?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: UInt32 ToUInt32(Double) in System.Convert type: System.UInt32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[System.Double],E_UInteger] ) -=-=-=-=-=-=-=-=- Double? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: Int64 ToInt64(Double) in System.Convert type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[System.Double],System.Int64] ) -=-=-=-=-=-=-=-=- CType(Double?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: Int64 ToInt64(Double) in System.Convert type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[System.Double],E_Long] ) -=-=-=-=-=-=-=-=- Double? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: Boolean ToBoolean(Double) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[System.Double],System.Boolean] ) -=-=-=-=-=-=-=-=- Double? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Double],System.Single] ) -=-=-=-=-=-=-=-=- CType(Double?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Double],System.Single] ) -=-=-=-=-=-=-=-=- Double? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Parameter( x type: System.Nullable`1[System.Double] ) Lifted type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Double],System.Double] ) -=-=-=-=-=-=-=-=- CType(Double?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Parameter( x type: System.Nullable`1[System.Double] ) Lifted type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Double],System.Double] ) -=-=-=-=-=-=-=-=- CType(Double?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: System.Decimal op_Explicit(Double) in System.Decimal type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[System.Double],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Double?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Double] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Double] ) method: Double op_Explicit(System.Nullable`1[System.Double]) in System.Nullable`1[System.Double] type: System.Double ) method: System.String ToString(Double) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.Double],System.String] ) -=-=-=-=-=-=-=-=- Decimal -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: SByte op_Explicit(System.Decimal) in System.Decimal type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Decimal,System.SByte] ) -=-=-=-=-=-=-=-=- CType(Decimal, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Convert( Parameter( x type: System.Decimal ) method: SByte op_Explicit(System.Decimal) in System.Decimal type: System.SByte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Decimal,E_SByte] ) -=-=-=-=-=-=-=-=- Decimal -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: Byte op_Explicit(System.Decimal) in System.Decimal type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Decimal,System.Byte] ) -=-=-=-=-=-=-=-=- CType(Decimal, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Convert( Parameter( x type: System.Decimal ) method: Byte op_Explicit(System.Decimal) in System.Decimal type: System.Byte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Decimal,E_Byte] ) -=-=-=-=-=-=-=-=- Decimal -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: Int16 op_Explicit(System.Decimal) in System.Decimal type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Decimal,System.Int16] ) -=-=-=-=-=-=-=-=- CType(Decimal, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Convert( Parameter( x type: System.Decimal ) method: Int16 op_Explicit(System.Decimal) in System.Decimal type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Decimal,E_Short] ) -=-=-=-=-=-=-=-=- Decimal -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: UInt16 op_Explicit(System.Decimal) in System.Decimal type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Decimal,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Decimal, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Convert( Parameter( x type: System.Decimal ) method: UInt16 op_Explicit(System.Decimal) in System.Decimal type: System.UInt16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Decimal,E_UShort] ) -=-=-=-=-=-=-=-=- Decimal -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: Int32 op_Explicit(System.Decimal) in System.Decimal type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Decimal,System.Int32] ) -=-=-=-=-=-=-=-=- CType(Decimal, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Convert( Parameter( x type: System.Decimal ) method: Int32 op_Explicit(System.Decimal) in System.Decimal type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Decimal,E_Integer] ) -=-=-=-=-=-=-=-=- Decimal -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: UInt32 op_Explicit(System.Decimal) in System.Decimal type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Decimal,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Decimal, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Convert( Parameter( x type: System.Decimal ) method: UInt32 op_Explicit(System.Decimal) in System.Decimal type: System.UInt32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Decimal,E_UInteger] ) -=-=-=-=-=-=-=-=- Decimal -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: Int64 op_Explicit(System.Decimal) in System.Decimal type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Decimal,System.Int64] ) -=-=-=-=-=-=-=-=- CType(Decimal, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Convert( Parameter( x type: System.Decimal ) method: Int64 op_Explicit(System.Decimal) in System.Decimal type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Decimal,E_Long] ) -=-=-=-=-=-=-=-=- Decimal -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: Boolean ToBoolean(System.Decimal) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Decimal,System.Boolean] ) -=-=-=-=-=-=-=-=- Decimal -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: Single op_Explicit(System.Decimal) in System.Decimal type: System.Single ) } return type: System.Single type: System.Func`2[System.Decimal,System.Single] ) -=-=-=-=-=-=-=-=- CType(Decimal, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: Single op_Explicit(System.Decimal) in System.Decimal type: System.Single ) } return type: System.Single type: System.Func`2[System.Decimal,System.Single] ) -=-=-=-=-=-=-=-=- Decimal -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: Double op_Explicit(System.Decimal) in System.Decimal type: System.Double ) } return type: System.Double type: System.Func`2[System.Decimal,System.Double] ) -=-=-=-=-=-=-=-=- CType(Decimal, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: Double op_Explicit(System.Decimal) in System.Decimal type: System.Double ) } return type: System.Double type: System.Func`2[System.Decimal,System.Double] ) -=-=-=-=-=-=-=-=- CType(Decimal, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Parameter( x type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Decimal,System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Decimal, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Decimal ) body { Convert( Parameter( x type: System.Decimal ) method: System.String ToString(System.Decimal) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Decimal,System.String] ) -=-=-=-=-=-=-=-=- Decimal? -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: SByte op_Explicit(System.Decimal) in System.Decimal type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Nullable`1[System.Decimal],System.SByte] ) -=-=-=-=-=-=-=-=- CType(Decimal?, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: SByte op_Explicit(System.Decimal) in System.Decimal type: System.SByte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Nullable`1[System.Decimal],E_SByte] ) -=-=-=-=-=-=-=-=- Decimal? -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Byte op_Explicit(System.Decimal) in System.Decimal type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Nullable`1[System.Decimal],System.Byte] ) -=-=-=-=-=-=-=-=- CType(Decimal?, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Byte op_Explicit(System.Decimal) in System.Decimal type: System.Byte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Nullable`1[System.Decimal],E_Byte] ) -=-=-=-=-=-=-=-=- Decimal? -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Int16 op_Explicit(System.Decimal) in System.Decimal type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Nullable`1[System.Decimal],System.Int16] ) -=-=-=-=-=-=-=-=- CType(Decimal?, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Int16 op_Explicit(System.Decimal) in System.Decimal type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Nullable`1[System.Decimal],E_Short] ) -=-=-=-=-=-=-=-=- Decimal? -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: UInt16 op_Explicit(System.Decimal) in System.Decimal type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Nullable`1[System.Decimal],System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Decimal?, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: UInt16 op_Explicit(System.Decimal) in System.Decimal type: System.UInt16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Nullable`1[System.Decimal],E_UShort] ) -=-=-=-=-=-=-=-=- Decimal? -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Int32 op_Explicit(System.Decimal) in System.Decimal type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Nullable`1[System.Decimal],System.Int32] ) -=-=-=-=-=-=-=-=- CType(Decimal?, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Int32 op_Explicit(System.Decimal) in System.Decimal type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Nullable`1[System.Decimal],E_Integer] ) -=-=-=-=-=-=-=-=- Decimal? -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: UInt32 op_Explicit(System.Decimal) in System.Decimal type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Nullable`1[System.Decimal],System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Decimal?, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: UInt32 op_Explicit(System.Decimal) in System.Decimal type: System.UInt32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Nullable`1[System.Decimal],E_UInteger] ) -=-=-=-=-=-=-=-=- Decimal? -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Int64 op_Explicit(System.Decimal) in System.Decimal type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Nullable`1[System.Decimal],System.Int64] ) -=-=-=-=-=-=-=-=- CType(Decimal?, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Int64 op_Explicit(System.Decimal) in System.Decimal type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Nullable`1[System.Decimal],E_Long] ) -=-=-=-=-=-=-=-=- Decimal? -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Boolean ToBoolean(System.Decimal) in System.Convert type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Nullable`1[System.Decimal],System.Boolean] ) -=-=-=-=-=-=-=-=- Decimal? -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Single op_Explicit(System.Decimal) in System.Decimal type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Decimal],System.Single] ) -=-=-=-=-=-=-=-=- CType(Decimal?, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Single op_Explicit(System.Decimal) in System.Decimal type: System.Single ) } return type: System.Single type: System.Func`2[System.Nullable`1[System.Decimal],System.Single] ) -=-=-=-=-=-=-=-=- Decimal? -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Double op_Explicit(System.Decimal) in System.Decimal type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Decimal],System.Double] ) -=-=-=-=-=-=-=-=- CType(Decimal?, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: Double op_Explicit(System.Decimal) in System.Decimal type: System.Double ) } return type: System.Double type: System.Func`2[System.Nullable`1[System.Decimal],System.Double] ) -=-=-=-=-=-=-=-=- CType(Decimal?, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) Lifted type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Nullable`1[System.Decimal],System.Decimal] ) -=-=-=-=-=-=-=-=- CType(Decimal?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.Decimal] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.Decimal] ) method: System.Decimal op_Explicit(System.Nullable`1[System.Decimal]) in System.Nullable`1[System.Decimal] type: System.Decimal ) method: System.String ToString(System.Decimal) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.Decimal],System.String] ) -=-=-=-=-=-=-=-=- Date -> Date -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.DateTime ) body { Parameter( x type: System.DateTime ) } return type: System.DateTime type: System.Func`2[System.DateTime,System.DateTime] ) -=-=-=-=-=-=-=-=- CType(Date, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.DateTime ) body { Convert( Parameter( x type: System.DateTime ) method: System.String ToString(System.DateTime) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.DateTime,System.String] ) -=-=-=-=-=-=-=-=- CType(Date?, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Nullable`1[System.DateTime] ) body { Convert( Convert( Parameter( x type: System.Nullable`1[System.DateTime] ) method: System.DateTime op_Explicit(System.Nullable`1[System.DateTime]) in System.Nullable`1[System.DateTime] type: System.DateTime ) method: System.String ToString(System.DateTime) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Nullable`1[System.DateTime],System.String] ) -=-=-=-=-=-=-=-=- String -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: SByte ToSByte(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.SByte ) } return type: System.SByte type: System.Func`2[System.String,System.SByte] ) -=-=-=-=-=-=-=-=- CType(String, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Convert( Parameter( x type: System.String ) method: SByte ToSByte(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.SByte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.String,E_SByte] ) -=-=-=-=-=-=-=-=- String -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: Byte ToByte(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Byte ) } return type: System.Byte type: System.Func`2[System.String,System.Byte] ) -=-=-=-=-=-=-=-=- CType(String, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Convert( Parameter( x type: System.String ) method: Byte ToByte(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Byte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.String,E_Byte] ) -=-=-=-=-=-=-=-=- String -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: Int16 ToShort(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.String,System.Int16] ) -=-=-=-=-=-=-=-=- CType(String, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Convert( Parameter( x type: System.String ) method: Int16 ToShort(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.String,E_Short] ) -=-=-=-=-=-=-=-=- String -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: UInt16 ToUShort(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.String,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(String, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Convert( Parameter( x type: System.String ) method: UInt16 ToUShort(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.UInt16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.String,E_UShort] ) -=-=-=-=-=-=-=-=- String -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: Int32 ToInteger(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.String,System.Int32] ) -=-=-=-=-=-=-=-=- CType(String, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Convert( Parameter( x type: System.String ) method: Int32 ToInteger(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.String,E_Integer] ) -=-=-=-=-=-=-=-=- String -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: UInt32 ToUInteger(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.String,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(String, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Convert( Parameter( x type: System.String ) method: UInt32 ToUInteger(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.UInt32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.String,E_UInteger] ) -=-=-=-=-=-=-=-=- String -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: Int64 ToLong(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.String,System.Int64] ) -=-=-=-=-=-=-=-=- CType(String, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Convert( Parameter( x type: System.String ) method: Int64 ToLong(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.String,E_Long] ) -=-=-=-=-=-=-=-=- String -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: Boolean ToBoolean(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.String,System.Boolean] ) -=-=-=-=-=-=-=-=- String -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: Single ToSingle(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Single ) } return type: System.Single type: System.Func`2[System.String,System.Single] ) -=-=-=-=-=-=-=-=- CType(String, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: Single ToSingle(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Single ) } return type: System.Single type: System.Func`2[System.String,System.Single] ) -=-=-=-=-=-=-=-=- String -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: Double ToDouble(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Double ) } return type: System.Double type: System.Func`2[System.String,System.Double] ) -=-=-=-=-=-=-=-=- CType(String, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: Double ToDouble(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Double ) } return type: System.Double type: System.Func`2[System.String,System.Double] ) -=-=-=-=-=-=-=-=- CType(String, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: System.Decimal ToDecimal(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.String,System.Decimal] ) -=-=-=-=-=-=-=-=- String -> Date -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Convert( Parameter( x type: System.String ) method: System.DateTime ToDate(System.String) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.DateTime ) } return type: System.DateTime type: System.Func`2[System.String,System.DateTime] ) -=-=-=-=-=-=-=-=- CType(String, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.String ) body { Parameter( x type: System.String ) } return type: System.String type: System.Func`2[System.String,System.String] ) -=-=-=-=-=-=-=-=- Object -> SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: SByte ToSByte(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.SByte ) } return type: System.SByte type: System.Func`2[System.Object,System.SByte] ) -=-=-=-=-=-=-=-=- CType(Object, E_SByte) -> E_SByte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Convert( Parameter( x type: System.Object ) method: SByte ToSByte(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.SByte ) type: E_SByte ) } return type: E_SByte type: System.Func`2[System.Object,E_SByte] ) -=-=-=-=-=-=-=-=- Object -> Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: Byte ToByte(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Byte ) } return type: System.Byte type: System.Func`2[System.Object,System.Byte] ) -=-=-=-=-=-=-=-=- CType(Object, E_Byte) -> E_Byte -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Convert( Parameter( x type: System.Object ) method: Byte ToByte(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Byte ) type: E_Byte ) } return type: E_Byte type: System.Func`2[System.Object,E_Byte] ) -=-=-=-=-=-=-=-=- Object -> Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: Int16 ToShort(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int16 ) } return type: System.Int16 type: System.Func`2[System.Object,System.Int16] ) -=-=-=-=-=-=-=-=- CType(Object, E_Short) -> E_Short -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Convert( Parameter( x type: System.Object ) method: Int16 ToShort(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int16 ) type: E_Short ) } return type: E_Short type: System.Func`2[System.Object,E_Short] ) -=-=-=-=-=-=-=-=- Object -> UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: UInt16 ToUShort(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.UInt16 ) } return type: System.UInt16 type: System.Func`2[System.Object,System.UInt16] ) -=-=-=-=-=-=-=-=- CType(Object, E_UShort) -> E_UShort -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Convert( Parameter( x type: System.Object ) method: UInt16 ToUShort(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.UInt16 ) type: E_UShort ) } return type: E_UShort type: System.Func`2[System.Object,E_UShort] ) -=-=-=-=-=-=-=-=- Object -> Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: Int32 ToInteger(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int32 ) } return type: System.Int32 type: System.Func`2[System.Object,System.Int32] ) -=-=-=-=-=-=-=-=- CType(Object, E_Integer) -> E_Integer -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Convert( Parameter( x type: System.Object ) method: Int32 ToInteger(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int32 ) type: E_Integer ) } return type: E_Integer type: System.Func`2[System.Object,E_Integer] ) -=-=-=-=-=-=-=-=- Object -> UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: UInt32 ToUInteger(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.UInt32 ) } return type: System.UInt32 type: System.Func`2[System.Object,System.UInt32] ) -=-=-=-=-=-=-=-=- CType(Object, E_UInteger) -> E_UInteger -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Convert( Parameter( x type: System.Object ) method: UInt32 ToUInteger(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.UInt32 ) type: E_UInteger ) } return type: E_UInteger type: System.Func`2[System.Object,E_UInteger] ) -=-=-=-=-=-=-=-=- Object -> Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: Int64 ToLong(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int64 ) } return type: System.Int64 type: System.Func`2[System.Object,System.Int64] ) -=-=-=-=-=-=-=-=- CType(Object, E_Long) -> E_Long -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Convert( Parameter( x type: System.Object ) method: Int64 ToLong(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Int64 ) type: E_Long ) } return type: E_Long type: System.Func`2[System.Object,E_Long] ) -=-=-=-=-=-=-=-=- Object -> Boolean -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: Boolean ToBoolean(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Boolean ) } return type: System.Boolean type: System.Func`2[System.Object,System.Boolean] ) -=-=-=-=-=-=-=-=- Object -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: Single ToSingle(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Single ) } return type: System.Single type: System.Func`2[System.Object,System.Single] ) -=-=-=-=-=-=-=-=- CType(Object, Single) -> Single -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: Single ToSingle(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Single ) } return type: System.Single type: System.Func`2[System.Object,System.Single] ) -=-=-=-=-=-=-=-=- Object -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: Double ToDouble(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Double ) } return type: System.Double type: System.Func`2[System.Object,System.Double] ) -=-=-=-=-=-=-=-=- CType(Object, Double) -> Double -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: Double ToDouble(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Double ) } return type: System.Double type: System.Func`2[System.Object,System.Double] ) -=-=-=-=-=-=-=-=- CType(Object, Decimal) -> Decimal -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: System.Decimal ToDecimal(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.Decimal ) } return type: System.Decimal type: System.Func`2[System.Object,System.Decimal] ) -=-=-=-=-=-=-=-=- Object -> Date -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: System.DateTime ToDate(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.DateTime ) } return type: System.DateTime type: System.Func`2[System.Object,System.DateTime] ) -=-=-=-=-=-=-=-=- CType(Object, String) -> String -=-=-=-=-=-=-=-=- Lambda( Parameter( x type: System.Object ) body { Convert( Parameter( x type: System.Object ) method: System.String ToString(System.Object) in Microsoft.VisualBasic.CompilerServices.Conversions type: System.String ) } return type: System.String type: System.Func`2[System.Object,System.String] )
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/VisualStudio/Core/Test/CodeModel/AbstractCodeModelObjectTests.InterfaceData.vb
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.CodeModel Partial Public MustInherit Class AbstractCodeModelObjectTests(Of TCodeModelObject As Class) Protected Class InterfaceData Public Property Name As String Public Property Position As Object = 0 Public Property Bases As Object Public Property Access As EnvDTE.vsCMAccess = EnvDTE.vsCMAccess.vsCMAccessDefault End Class End Class End Namespace
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.CodeModel Partial Public MustInherit Class AbstractCodeModelObjectTests(Of TCodeModelObject As Class) Protected Class InterfaceData Public Property Name As String Public Property Position As Object = 0 Public Property Bases As Object Public Property Access As EnvDTE.vsCMAccess = EnvDTE.vsCMAccess.vsCMAccessDefault End Class End Class End Namespace
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Features/CSharp/Portable/AddDebuggerDisplay/CSharpAddDebuggerDisplayCodeRefactoringProvider.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Composition; using Microsoft.CodeAnalysis.AddDebuggerDisplay; using Microsoft.CodeAnalysis.CodeRefactorings; using Microsoft.CodeAnalysis.CSharp.Shared.Extensions; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Host.Mef; namespace Microsoft.CodeAnalysis.CSharp.AddDebuggerDisplay { [ExportCodeRefactoringProvider(LanguageNames.CSharp, Name = PredefinedCodeRefactoringProviderNames.AddDebuggerDisplay), Shared] internal sealed class CSharpAddDebuggerDisplayCodeRefactoringProvider : AbstractAddDebuggerDisplayCodeRefactoringProvider< TypeDeclarationSyntax, MethodDeclarationSyntax> { [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] public CSharpAddDebuggerDisplayCodeRefactoringProvider() { } protected override bool CanNameofAccessNonPublicMembersFromAttributeArgument => true; protected override bool SupportsConstantInterpolatedStrings(Document document) => ((CSharpParseOptions)document.Project.ParseOptions!).LanguageVersion.HasConstantInterpolatedStrings(); } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Composition; using Microsoft.CodeAnalysis.AddDebuggerDisplay; using Microsoft.CodeAnalysis.CodeRefactorings; using Microsoft.CodeAnalysis.CSharp.Shared.Extensions; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Host.Mef; namespace Microsoft.CodeAnalysis.CSharp.AddDebuggerDisplay { [ExportCodeRefactoringProvider(LanguageNames.CSharp, Name = PredefinedCodeRefactoringProviderNames.AddDebuggerDisplay), Shared] internal sealed class CSharpAddDebuggerDisplayCodeRefactoringProvider : AbstractAddDebuggerDisplayCodeRefactoringProvider< TypeDeclarationSyntax, MethodDeclarationSyntax> { [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] public CSharpAddDebuggerDisplayCodeRefactoringProvider() { } protected override bool CanNameofAccessNonPublicMembersFromAttributeArgument => true; protected override bool SupportsConstantInterpolatedStrings(Document document) => ((CSharpParseOptions)document.Project.ParseOptions!).LanguageVersion.HasConstantInterpolatedStrings(); } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/EditorFeatures/CSharpTest2/Recommendations/CaseKeywordRecommenderTests.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Threading.Tasks; using Microsoft.CodeAnalysis.Test.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Recommendations { public class CaseKeywordRecommenderTests : KeywordRecommenderTests { [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotAtRoot_Interactive() { await VerifyAbsenceAsync(SourceCodeKind.Script, @"$$"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotAfterClass_Interactive() { await VerifyAbsenceAsync(SourceCodeKind.Script, @"class C { } $$"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotAfterGlobalStatement_Interactive() { await VerifyAbsenceAsync(SourceCodeKind.Script, @"System.Console.WriteLine(); $$"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotAfterGlobalVariableDeclaration_Interactive() { await VerifyAbsenceAsync(SourceCodeKind.Script, @"int i = 0; $$"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotInUsingAlias() { await VerifyAbsenceAsync( @"using Goo = $$"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotInGlobalUsingAlias() { await VerifyAbsenceAsync( @"global using Goo = $$"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotInEmptyStatement() { await VerifyAbsenceAsync(AddInsideMethod( @"$$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotAfterExpr() { await VerifyAbsenceAsync(AddInsideMethod( @"var q = goo $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotAfterDottedName() { await VerifyAbsenceAsync(AddInsideMethod( @"var q = goo.Current $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterSwitch() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterCase() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { case 0: $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterDefault() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { default: $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterPatternCase() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { case String s: $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterOneStatement() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { default: Console.WriteLine(); $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterOneStatementPatternCase() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { case String s: Console.WriteLine(); $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterTwoStatements() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { default: Console.WriteLine(); Console.WriteLine(); $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterBlock() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { default: { } $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterBlockPatternCase() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { case String s: { } $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterIfElse() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { default: if (goo) { } else { } $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotAfterIncompleteStatement() { await VerifyAbsenceAsync(AddInsideMethod( @"switch (expr) { default: Console.WriteLine( $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotInsideBlock() { await VerifyAbsenceAsync(AddInsideMethod( @"switch (expr) { default: { $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterIf() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { default: if (goo) Console.WriteLine(); $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotAfterIf() { await VerifyAbsenceAsync(AddInsideMethod( @"switch (expr) { default: if (goo) $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterWhile() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { default: while (true) { } $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterGotoInSwitch() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { default: goto $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotAfterGotoOutsideSwitch() { await VerifyAbsenceAsync(AddInsideMethod( @"goto $$")); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Threading.Tasks; using Microsoft.CodeAnalysis.Test.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Recommendations { public class CaseKeywordRecommenderTests : KeywordRecommenderTests { [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotAtRoot_Interactive() { await VerifyAbsenceAsync(SourceCodeKind.Script, @"$$"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotAfterClass_Interactive() { await VerifyAbsenceAsync(SourceCodeKind.Script, @"class C { } $$"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotAfterGlobalStatement_Interactive() { await VerifyAbsenceAsync(SourceCodeKind.Script, @"System.Console.WriteLine(); $$"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotAfterGlobalVariableDeclaration_Interactive() { await VerifyAbsenceAsync(SourceCodeKind.Script, @"int i = 0; $$"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotInUsingAlias() { await VerifyAbsenceAsync( @"using Goo = $$"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotInGlobalUsingAlias() { await VerifyAbsenceAsync( @"global using Goo = $$"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotInEmptyStatement() { await VerifyAbsenceAsync(AddInsideMethod( @"$$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotAfterExpr() { await VerifyAbsenceAsync(AddInsideMethod( @"var q = goo $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotAfterDottedName() { await VerifyAbsenceAsync(AddInsideMethod( @"var q = goo.Current $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterSwitch() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterCase() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { case 0: $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterDefault() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { default: $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterPatternCase() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { case String s: $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterOneStatement() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { default: Console.WriteLine(); $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterOneStatementPatternCase() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { case String s: Console.WriteLine(); $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterTwoStatements() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { default: Console.WriteLine(); Console.WriteLine(); $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterBlock() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { default: { } $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterBlockPatternCase() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { case String s: { } $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterIfElse() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { default: if (goo) { } else { } $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotAfterIncompleteStatement() { await VerifyAbsenceAsync(AddInsideMethod( @"switch (expr) { default: Console.WriteLine( $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotInsideBlock() { await VerifyAbsenceAsync(AddInsideMethod( @"switch (expr) { default: { $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterIf() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { default: if (goo) Console.WriteLine(); $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotAfterIf() { await VerifyAbsenceAsync(AddInsideMethod( @"switch (expr) { default: if (goo) $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterWhile() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { default: while (true) { } $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestAfterGotoInSwitch() { await VerifyKeywordAsync(AddInsideMethod( @"switch (expr) { default: goto $$")); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotAfterGotoOutsideSwitch() { await VerifyAbsenceAsync(AddInsideMethod( @"goto $$")); } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Compilers/Test/Resources/Core/SymbolsTests/MDTestLib1.vb
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. ' ' vbc /t:library /vbruntime- MDTestLib1.vb ' Public Class C1(Of C1_T) Public Class C2(Of C2_T) End Class Public Class C3 Public Class C4(Of C4_T) End Class End Class End Class Public Class TC2(Of TC2_T1, TC2_T2) Inherits C1(Of TC2_T1).C2(Of TC2_T2) End Class Public Class TC3(Of TC3_T1) Inherits C1(Of TC3_T1).C3 End Class Public Class TC4(Of TC4_T1, TC4_T2) Inherits C1(Of TC4_T1).C3.C4(Of TC4_T2) End Class Public Interface C100(Of Out T) End Interface Public Interface C101(Of In T) End Interface Public Class C102(Of T As New) End Class Public Class C103(Of T As Class) End Class Public Class C104(Of T As Structure) End Class Public Class C105(Of T As {New, Class}) End Class Public Interface C106(Of Out T As {New, Class}) End Interface Public Class C107 Public Class C108(Of C108_T) End Class End Class Public Class C201(Of T As I101) End Class Public Class C202(Of T As {I101, I102}) End Class Public Class C203 Implements I101 End Class Public Class C204 Implements I101, I102 End Class Public Interface I101 End Interface Public Interface I102 End Interface
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. ' ' vbc /t:library /vbruntime- MDTestLib1.vb ' Public Class C1(Of C1_T) Public Class C2(Of C2_T) End Class Public Class C3 Public Class C4(Of C4_T) End Class End Class End Class Public Class TC2(Of TC2_T1, TC2_T2) Inherits C1(Of TC2_T1).C2(Of TC2_T2) End Class Public Class TC3(Of TC3_T1) Inherits C1(Of TC3_T1).C3 End Class Public Class TC4(Of TC4_T1, TC4_T2) Inherits C1(Of TC4_T1).C3.C4(Of TC4_T2) End Class Public Interface C100(Of Out T) End Interface Public Interface C101(Of In T) End Interface Public Class C102(Of T As New) End Class Public Class C103(Of T As Class) End Class Public Class C104(Of T As Structure) End Class Public Class C105(Of T As {New, Class}) End Class Public Interface C106(Of Out T As {New, Class}) End Interface Public Class C107 Public Class C108(Of C108_T) End Class End Class Public Class C201(Of T As I101) End Class Public Class C202(Of T As {I101, I102}) End Class Public Class C203 Implements I101 End Class Public Class C204 Implements I101, I102 End Class Public Interface I101 End Interface Public Interface I102 End Interface
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/EditorFeatures/CSharpTest/KeywordHighlighting/SwitchStatementHighlighterTests.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Editor.CSharp.KeywordHighlighting.KeywordHighlighters; using Microsoft.CodeAnalysis.Test.Utilities; using Roslyn.Test.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.KeywordHighlighting { public class SwitchStatementHighlighterTests : AbstractCSharpKeywordHighlighterTests { internal override Type GetHighlighterType() => typeof(SwitchStatementHighlighter); [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestExample1_OnSwitchKeyword() { await TestAsync( @"class C { void M() { {|Cursor:[|switch|]|} (i) { [|case|] 0: CaseZero(); [|break|]; [|case|] 1: CaseOne(); [|break|]; [|default|]: CaseOthers(); [|break|]; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestExample1_OnCaseKeyword() { await TestAsync( @"class C { void M() { [|switch|] (i) { {|Cursor:[|case|]|} 0: CaseZero(); [|break|]; [|case|] 1: CaseOne(); [|break|]; [|default|]: CaseOthers(); [|break|]; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestExample1_AfterCaseColon() { await TestAsync( @"class C { void M() { [|switch|] (i) { [|case|] 0:{|Cursor:|} CaseZero(); [|break|]; [|case|] 1: CaseOne(); [|break|]; [|default|]: CaseOthers(); [|break|]; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestExample1_NotOnCaseValue() { await TestAsync( @"class C { void M() { switch (i) { case {|Cursor:0|}: CaseZero(); break; case 1: CaseOne(); break; default: CaseOthers(); break; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestExample1_OnBreakStatement() { await TestAsync( @"class C { void M() { [|switch|] (i) { [|case|] 0: CaseZero(); {|Cursor:[|break|];|} [|case|] 1: CaseOne(); [|break|]; [|default|]: CaseOthers(); [|break|]; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestExample1_OnDefaultLabel() { await TestAsync( @"class C { void M() { [|switch|] (i) { [|case|] 0: CaseZero(); [|break|]; [|case|] 1: CaseOne(); [|break|]; {|Cursor:[|default|]:|} CaseOthers(); [|break|]; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestExample2_OnGotoCaseKeywords() { await TestAsync( @"class C { void M() { [|switch|] (i) { [|case|] 0: CaseZero(); {|Cursor:[|goto case|]|} 1; [|case|] 1: CaseOne(); [|goto default|]; [|default|]: CaseOthers(); [|break|]; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestExample2_AfterGotoCaseSemicolon() { await TestAsync( @"class C { void M() { [|switch|] (i) { [|case|] 0: CaseZero(); [|goto case|] 1;{|Cursor:|} [|case|] 1: CaseOne(); [|goto default|]; [|default|]: CaseOthers(); [|break|]; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestExample2_NotOnGotoCaseValue() { await TestAsync( @"class C { void M() { switch (i) { case 0: CaseZero(); goto case {|Cursor:1|}; case 1: CaseOne(); goto default; default: CaseOthers(); break; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestExample2_OnGotoDefaultStatement() { await TestAsync( @"class C { void M() { [|switch|] (i) { [|case|] 0: CaseZero(); [|goto case|] 1; [|case|] 1: CaseOne(); {|Cursor:[|goto default|];|} [|default|]: CaseOthers(); [|break|]; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestNestedExample1_OnSwitchKeyword() { await TestAsync( @"class C { void M() { foreach (var a in x) { if (a) { break; } else { {|Cursor:[|switch|]|} (b) { [|case|] 0: while (true) { do { break; } while (false); break; } [|break|]; } } for (int i = 0; i < 10; i++) { break; } } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestNestedExample1_OnCaseKeyword() { await TestAsync( @"class C { void M() { foreach (var a in x) { if (a) { break; } else { [|switch|] (b) { {|Cursor:[|case|]|} 0: while (true) { do { break; } while (false); break; } [|break|]; } } for (int i = 0; i < 10; i++) { break; } } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestNestedExample1_NotBeforeCaseValue() { await TestAsync( @"class C { void M() { foreach (var a in x) { if (a) { break; } else { switch (b) { case {|Cursor:|}0: while (true) { do { break; } while (false); break; } break; } } for (int i = 0; i < 10; i++) { break; } } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestNestedExample1_AfterCaseColon() { await TestAsync( @"class C { void M() { foreach (var a in x) { if (a) { break; } else { [|switch|] (b) { [|case|] 0:{|Cursor:|} while (true) { do { break; } while (false); break; } [|break|]; } } for (int i = 0; i < 10; i++) { break; } } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestNestedExample1_OnBreakStatement() { await TestAsync( @"class C { void M() { foreach (var a in x) { if (a) { break; } else { [|switch|] (b) { [|case|] 0: while (true) { do { break; } while (false); break; } {|Cursor:[|break|];|} } } for (int i = 0; i < 10; i++) { break; } } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task Bug3483() { await TestAsync( @"class C { static void M() { [|switch|] (2) { [|case|] 1: {|Cursor:[|goto|]|} } } }"); } [WorkItem(25039, "https://github.com/dotnet/roslyn/issues/25039")] [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithUnrelatedGotoStatement_OnGotoCaseGotoKeyword() { await TestAsync( @"class C { void M() { label: [|switch|] (i) { [|case|] 0: CaseZero(); [|{|Cursor:goto|} case|] 1; [|case|] 1: CaseOne(); [|goto default|]; [|default|]: CaseOthers(); goto label; } } }"); } [WorkItem(25039, "https://github.com/dotnet/roslyn/issues/25039")] [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithUnrelatedGotoStatement_OnGotoDefaultGotoKeyword() { await TestAsync( @"class C { void M() { label: [|switch|] (i) { [|case|] 0: CaseZero(); [|goto case|] 1; [|case|] 1: CaseOne(); [|{|Cursor:goto|} default|]; [|default|]: CaseOthers(); goto label; } } }"); } [WorkItem(25039, "https://github.com/dotnet/roslyn/issues/25039")] [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithUnrelatedGotoStatement_NotOnGotoLabelGotoKeyword() { await TestAsync( @"class C { void M() { label: switch (i) { case 0: CaseZero(); goto case 1; case 1: CaseOne(); goto default; default: CaseOthers(); {|Cursor:goto|} label; } } }"); } [WorkItem(25039, "https://github.com/dotnet/roslyn/issues/25039")] [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithNestedStatements_OnSwitchKeyword() { await TestAsync( @"class C { void M() { {|Cursor:[|switch|]|} (i) { [|case|] 0: { CaseZero(); [|goto case|] 1; } [|case|] 1: { CaseOne(); [|goto default|]; } [|default|]: { CaseOthers(); [|break|]; } } } }"); } [WorkItem(25039, "https://github.com/dotnet/roslyn/issues/25039")] [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithNestedStatements_OnBreakKeyword() { await TestAsync( @"class C { void M() { [|switch|] (i) { [|case|] 0: { CaseZero(); [|goto case|] 1; } [|case|] 1: { CaseOne(); [|goto default|]; } [|default|]: { CaseOthers(); {|Cursor:[|break|]|}; } } } }"); } [WorkItem(25039, "https://github.com/dotnet/roslyn/issues/25039")] [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithGotoCaseAndBreakInsideLoop_OnSwitchKeyword() { await TestAsync( @"class C { void M() { {|Cursor:[|switch|]|} (true) { [|case|] true: while (true) { [|goto case|] true; break; switch (true) { case true: goto case true; break; } } } } }"); } [WorkItem(25039, "https://github.com/dotnet/roslyn/issues/25039")] [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithGotoCaseAndBreakInsideLoop_OnGotoCaseGotoKeyword() { await TestAsync( @"class C { void M() { [|switch|] (true) { [|case|] true: while (true) { [|{|Cursor:goto|} case|] true; break; switch (true) { case true: goto case true; break; } } } } }"); } [WorkItem(25039, "https://github.com/dotnet/roslyn/issues/25039")] [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithGotoCaseAndBreakInsideLoop_NotOnLoopBreakKeyword() { await TestAsync( @"class C { void M() { switch (true) { case true: while (true) { goto case true; {|Cursor:break|}; switch (true) { case true: goto case true; break; } } } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithWhenClauseAndPattern_OnSwitchKeyword() { await TestAsync( @"class C { void M() { {|Cursor:[|switch|]|} (true) { [|case|] true when true: [|break|]; [|case|] bool b: [|break|]; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithWhenClauseAndPattern_NotOnWhenKeyword() { await TestAsync( @"class C { void M() { switch (true) { case true {|Cursor:when|} true: break; case bool b: break; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithWhenClauseAndPattern_AfterWhenCaseColon() { await TestAsync( @"class C { void M() { [|switch|] (true) { [|case|] true when true:{|Cursor:|} [|break|]; [|case|] bool b: [|break|]; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithWhenClauseAndPattern_AfterPatternCaseColon() { await TestAsync( @"class C { void M() { [|switch|] (true) { [|case|] true when true: [|break|]; [|case|] bool b:{|Cursor:|} [|break|]; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithWhenClauseAndPattern_NotOnWhenValue() { await TestAsync( @"class C { void M() { switch (true) { case true when {|Cursor:true|}: break; case bool b: break; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithWhenClauseAndPattern_NotOnPattern() { await TestAsync( @"class C { void M() { switch (true) { case true when true: break; case {|Cursor:bool b|}: break; } } }"); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Editor.CSharp.KeywordHighlighting.KeywordHighlighters; using Microsoft.CodeAnalysis.Test.Utilities; using Roslyn.Test.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.KeywordHighlighting { public class SwitchStatementHighlighterTests : AbstractCSharpKeywordHighlighterTests { internal override Type GetHighlighterType() => typeof(SwitchStatementHighlighter); [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestExample1_OnSwitchKeyword() { await TestAsync( @"class C { void M() { {|Cursor:[|switch|]|} (i) { [|case|] 0: CaseZero(); [|break|]; [|case|] 1: CaseOne(); [|break|]; [|default|]: CaseOthers(); [|break|]; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestExample1_OnCaseKeyword() { await TestAsync( @"class C { void M() { [|switch|] (i) { {|Cursor:[|case|]|} 0: CaseZero(); [|break|]; [|case|] 1: CaseOne(); [|break|]; [|default|]: CaseOthers(); [|break|]; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestExample1_AfterCaseColon() { await TestAsync( @"class C { void M() { [|switch|] (i) { [|case|] 0:{|Cursor:|} CaseZero(); [|break|]; [|case|] 1: CaseOne(); [|break|]; [|default|]: CaseOthers(); [|break|]; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestExample1_NotOnCaseValue() { await TestAsync( @"class C { void M() { switch (i) { case {|Cursor:0|}: CaseZero(); break; case 1: CaseOne(); break; default: CaseOthers(); break; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestExample1_OnBreakStatement() { await TestAsync( @"class C { void M() { [|switch|] (i) { [|case|] 0: CaseZero(); {|Cursor:[|break|];|} [|case|] 1: CaseOne(); [|break|]; [|default|]: CaseOthers(); [|break|]; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestExample1_OnDefaultLabel() { await TestAsync( @"class C { void M() { [|switch|] (i) { [|case|] 0: CaseZero(); [|break|]; [|case|] 1: CaseOne(); [|break|]; {|Cursor:[|default|]:|} CaseOthers(); [|break|]; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestExample2_OnGotoCaseKeywords() { await TestAsync( @"class C { void M() { [|switch|] (i) { [|case|] 0: CaseZero(); {|Cursor:[|goto case|]|} 1; [|case|] 1: CaseOne(); [|goto default|]; [|default|]: CaseOthers(); [|break|]; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestExample2_AfterGotoCaseSemicolon() { await TestAsync( @"class C { void M() { [|switch|] (i) { [|case|] 0: CaseZero(); [|goto case|] 1;{|Cursor:|} [|case|] 1: CaseOne(); [|goto default|]; [|default|]: CaseOthers(); [|break|]; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestExample2_NotOnGotoCaseValue() { await TestAsync( @"class C { void M() { switch (i) { case 0: CaseZero(); goto case {|Cursor:1|}; case 1: CaseOne(); goto default; default: CaseOthers(); break; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestExample2_OnGotoDefaultStatement() { await TestAsync( @"class C { void M() { [|switch|] (i) { [|case|] 0: CaseZero(); [|goto case|] 1; [|case|] 1: CaseOne(); {|Cursor:[|goto default|];|} [|default|]: CaseOthers(); [|break|]; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestNestedExample1_OnSwitchKeyword() { await TestAsync( @"class C { void M() { foreach (var a in x) { if (a) { break; } else { {|Cursor:[|switch|]|} (b) { [|case|] 0: while (true) { do { break; } while (false); break; } [|break|]; } } for (int i = 0; i < 10; i++) { break; } } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestNestedExample1_OnCaseKeyword() { await TestAsync( @"class C { void M() { foreach (var a in x) { if (a) { break; } else { [|switch|] (b) { {|Cursor:[|case|]|} 0: while (true) { do { break; } while (false); break; } [|break|]; } } for (int i = 0; i < 10; i++) { break; } } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestNestedExample1_NotBeforeCaseValue() { await TestAsync( @"class C { void M() { foreach (var a in x) { if (a) { break; } else { switch (b) { case {|Cursor:|}0: while (true) { do { break; } while (false); break; } break; } } for (int i = 0; i < 10; i++) { break; } } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestNestedExample1_AfterCaseColon() { await TestAsync( @"class C { void M() { foreach (var a in x) { if (a) { break; } else { [|switch|] (b) { [|case|] 0:{|Cursor:|} while (true) { do { break; } while (false); break; } [|break|]; } } for (int i = 0; i < 10; i++) { break; } } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestNestedExample1_OnBreakStatement() { await TestAsync( @"class C { void M() { foreach (var a in x) { if (a) { break; } else { [|switch|] (b) { [|case|] 0: while (true) { do { break; } while (false); break; } {|Cursor:[|break|];|} } } for (int i = 0; i < 10; i++) { break; } } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task Bug3483() { await TestAsync( @"class C { static void M() { [|switch|] (2) { [|case|] 1: {|Cursor:[|goto|]|} } } }"); } [WorkItem(25039, "https://github.com/dotnet/roslyn/issues/25039")] [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithUnrelatedGotoStatement_OnGotoCaseGotoKeyword() { await TestAsync( @"class C { void M() { label: [|switch|] (i) { [|case|] 0: CaseZero(); [|{|Cursor:goto|} case|] 1; [|case|] 1: CaseOne(); [|goto default|]; [|default|]: CaseOthers(); goto label; } } }"); } [WorkItem(25039, "https://github.com/dotnet/roslyn/issues/25039")] [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithUnrelatedGotoStatement_OnGotoDefaultGotoKeyword() { await TestAsync( @"class C { void M() { label: [|switch|] (i) { [|case|] 0: CaseZero(); [|goto case|] 1; [|case|] 1: CaseOne(); [|{|Cursor:goto|} default|]; [|default|]: CaseOthers(); goto label; } } }"); } [WorkItem(25039, "https://github.com/dotnet/roslyn/issues/25039")] [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithUnrelatedGotoStatement_NotOnGotoLabelGotoKeyword() { await TestAsync( @"class C { void M() { label: switch (i) { case 0: CaseZero(); goto case 1; case 1: CaseOne(); goto default; default: CaseOthers(); {|Cursor:goto|} label; } } }"); } [WorkItem(25039, "https://github.com/dotnet/roslyn/issues/25039")] [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithNestedStatements_OnSwitchKeyword() { await TestAsync( @"class C { void M() { {|Cursor:[|switch|]|} (i) { [|case|] 0: { CaseZero(); [|goto case|] 1; } [|case|] 1: { CaseOne(); [|goto default|]; } [|default|]: { CaseOthers(); [|break|]; } } } }"); } [WorkItem(25039, "https://github.com/dotnet/roslyn/issues/25039")] [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithNestedStatements_OnBreakKeyword() { await TestAsync( @"class C { void M() { [|switch|] (i) { [|case|] 0: { CaseZero(); [|goto case|] 1; } [|case|] 1: { CaseOne(); [|goto default|]; } [|default|]: { CaseOthers(); {|Cursor:[|break|]|}; } } } }"); } [WorkItem(25039, "https://github.com/dotnet/roslyn/issues/25039")] [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithGotoCaseAndBreakInsideLoop_OnSwitchKeyword() { await TestAsync( @"class C { void M() { {|Cursor:[|switch|]|} (true) { [|case|] true: while (true) { [|goto case|] true; break; switch (true) { case true: goto case true; break; } } } } }"); } [WorkItem(25039, "https://github.com/dotnet/roslyn/issues/25039")] [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithGotoCaseAndBreakInsideLoop_OnGotoCaseGotoKeyword() { await TestAsync( @"class C { void M() { [|switch|] (true) { [|case|] true: while (true) { [|{|Cursor:goto|} case|] true; break; switch (true) { case true: goto case true; break; } } } } }"); } [WorkItem(25039, "https://github.com/dotnet/roslyn/issues/25039")] [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithGotoCaseAndBreakInsideLoop_NotOnLoopBreakKeyword() { await TestAsync( @"class C { void M() { switch (true) { case true: while (true) { goto case true; {|Cursor:break|}; switch (true) { case true: goto case true; break; } } } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithWhenClauseAndPattern_OnSwitchKeyword() { await TestAsync( @"class C { void M() { {|Cursor:[|switch|]|} (true) { [|case|] true when true: [|break|]; [|case|] bool b: [|break|]; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithWhenClauseAndPattern_NotOnWhenKeyword() { await TestAsync( @"class C { void M() { switch (true) { case true {|Cursor:when|} true: break; case bool b: break; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithWhenClauseAndPattern_AfterWhenCaseColon() { await TestAsync( @"class C { void M() { [|switch|] (true) { [|case|] true when true:{|Cursor:|} [|break|]; [|case|] bool b: [|break|]; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithWhenClauseAndPattern_AfterPatternCaseColon() { await TestAsync( @"class C { void M() { [|switch|] (true) { [|case|] true when true: [|break|]; [|case|] bool b:{|Cursor:|} [|break|]; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithWhenClauseAndPattern_NotOnWhenValue() { await TestAsync( @"class C { void M() { switch (true) { case true when {|Cursor:true|}: break; case bool b: break; } } }"); } [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] public async Task TestWithWhenClauseAndPattern_NotOnPattern() { await TestAsync( @"class C { void M() { switch (true) { case true when true: break; case {|Cursor:bool b|}: break; } } }"); } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Features/Core/Portable/ExtractInterface/IExtractInterfaceOptionsService.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.LanguageServices; using Microsoft.CodeAnalysis.Notification; namespace Microsoft.CodeAnalysis.ExtractInterface { internal interface IExtractInterfaceOptionsService : IWorkspaceService { Task<ExtractInterfaceOptionsResult> GetExtractInterfaceOptionsAsync( ISyntaxFactsService syntaxFactsService, INotificationService notificationService, List<ISymbol> extractableMembers, string defaultInterfaceName, List<string> conflictingTypeNames, string defaultNamespace, string generatedNameTypeParameterSuffix, string languageName); } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.LanguageServices; using Microsoft.CodeAnalysis.Notification; namespace Microsoft.CodeAnalysis.ExtractInterface { internal interface IExtractInterfaceOptionsService : IWorkspaceService { Task<ExtractInterfaceOptionsResult> GetExtractInterfaceOptionsAsync( ISyntaxFactsService syntaxFactsService, INotificationService notificationService, List<ISymbol> extractableMembers, string defaultInterfaceName, List<string> conflictingTypeNames, string defaultNamespace, string generatedNameTypeParameterSuffix, string languageName); } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Compilers/Core/Portable/MetadataReference/MetadataReferenceProperties.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Linq; using System.Collections.Generic; using System.Collections.Immutable; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis { /// <summary> /// Information about a metadata reference. /// </summary> public struct MetadataReferenceProperties : IEquatable<MetadataReferenceProperties> { private readonly MetadataImageKind _kind; private readonly ImmutableArray<string> _aliases; private readonly bool _embedInteropTypes; /// <summary> /// Default properties for a module reference. /// </summary> public static MetadataReferenceProperties Module => new MetadataReferenceProperties(MetadataImageKind.Module); /// <summary> /// Default properties for an assembly reference. /// </summary> public static MetadataReferenceProperties Assembly => new MetadataReferenceProperties(MetadataImageKind.Assembly); /// <summary> /// Initializes reference properties. /// </summary> /// <param name="kind">The image kind - assembly or module.</param> /// <param name="aliases">Assembly aliases. Can't be set for a module.</param> /// <param name="embedInteropTypes">True to embed interop types from the referenced assembly to the referencing compilation. Must be false for a module.</param> public MetadataReferenceProperties(MetadataImageKind kind = MetadataImageKind.Assembly, ImmutableArray<string> aliases = default, bool embedInteropTypes = false) { if (!kind.IsValid()) { throw new ArgumentOutOfRangeException(nameof(kind)); } if (kind == MetadataImageKind.Module) { if (embedInteropTypes) { throw new ArgumentException(CodeAnalysisResources.CannotEmbedInteropTypesFromModule, nameof(embedInteropTypes)); } if (!aliases.IsDefaultOrEmpty) { throw new ArgumentException(CodeAnalysisResources.CannotAliasModule, nameof(aliases)); } } if (!aliases.IsDefaultOrEmpty) { foreach (var alias in aliases) { if (!alias.IsValidClrTypeName()) { throw new ArgumentException(CodeAnalysisResources.InvalidAlias, nameof(aliases)); } } } _kind = kind; _aliases = aliases; _embedInteropTypes = embedInteropTypes; HasRecursiveAliases = false; } internal MetadataReferenceProperties(MetadataImageKind kind, ImmutableArray<string> aliases, bool embedInteropTypes, bool hasRecursiveAliases) : this(kind, aliases, embedInteropTypes) { HasRecursiveAliases = hasRecursiveAliases; } /// <summary> /// Returns <see cref="MetadataReferenceProperties"/> with specified aliases. /// </summary> /// <exception cref="ArgumentException"> /// <see cref="Kind"/> is <see cref="MetadataImageKind.Module"/>, as modules can't be aliased. /// </exception> public MetadataReferenceProperties WithAliases(IEnumerable<string> aliases) { return WithAliases(aliases.AsImmutableOrEmpty()); } /// <summary> /// Returns <see cref="MetadataReferenceProperties"/> with specified aliases. /// </summary> /// <exception cref="ArgumentException"> /// <see cref="Kind"/> is <see cref="MetadataImageKind.Module"/>, as modules can't be aliased. /// </exception> public MetadataReferenceProperties WithAliases(ImmutableArray<string> aliases) { return new MetadataReferenceProperties(_kind, aliases, _embedInteropTypes, HasRecursiveAliases); } /// <summary> /// Returns <see cref="MetadataReferenceProperties"/> with <see cref="EmbedInteropTypes"/> set to specified value. /// </summary> /// <exception cref="ArgumentException"><see cref="Kind"/> is <see cref="MetadataImageKind.Module"/>, as interop types can't be embedded from modules.</exception> public MetadataReferenceProperties WithEmbedInteropTypes(bool embedInteropTypes) { return new MetadataReferenceProperties(_kind, _aliases, embedInteropTypes, HasRecursiveAliases); } /// <summary> /// Returns <see cref="MetadataReferenceProperties"/> with <see cref="HasRecursiveAliases"/> set to specified value. /// </summary> internal MetadataReferenceProperties WithRecursiveAliases(bool value) { return new MetadataReferenceProperties(_kind, _aliases, _embedInteropTypes, value); } /// <summary> /// The image kind (assembly or module) the reference refers to. /// </summary> public MetadataImageKind Kind => _kind; /// <summary> /// Alias that represents a global declaration space. /// </summary> /// <remarks> /// Namespaces in references whose <see cref="Aliases"/> contain <see cref="GlobalAlias"/> are available in global declaration space. /// </remarks> public static string GlobalAlias => "global"; /// <summary> /// Aliases for the metadata reference. Empty if the reference has no aliases. /// </summary> /// <remarks> /// In C# these aliases can be used in "extern alias" syntax to disambiguate type names. /// </remarks> public ImmutableArray<string> Aliases { get { // Simplify usage - we can't avoid the _aliases field being null but we can always return empty array here: return _aliases.NullToEmpty(); } } /// <summary> /// True if interop types defined in the referenced metadata should be embedded into the compilation referencing the metadata. /// </summary> public bool EmbedInteropTypes => _embedInteropTypes; /// <summary> /// True to apply <see cref="Aliases"/> recursively on the target assembly and on all its transitive dependencies. /// False to apply <see cref="Aliases"/> only on the target assembly. /// </summary> internal bool HasRecursiveAliases { get; private set; } public override bool Equals(object? obj) { return obj is MetadataReferenceProperties && Equals((MetadataReferenceProperties)obj); } public bool Equals(MetadataReferenceProperties other) { return Aliases.SequenceEqual(other.Aliases) && _embedInteropTypes == other._embedInteropTypes && _kind == other._kind && HasRecursiveAliases == other.HasRecursiveAliases; } public override int GetHashCode() { return Hash.Combine(Hash.CombineValues(Aliases), Hash.Combine(_embedInteropTypes, Hash.Combine(HasRecursiveAliases, _kind.GetHashCode()))); } public static bool operator ==(MetadataReferenceProperties left, MetadataReferenceProperties right) { return left.Equals(right); } public static bool operator !=(MetadataReferenceProperties left, MetadataReferenceProperties right) { return !left.Equals(right); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Linq; using System.Collections.Generic; using System.Collections.Immutable; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis { /// <summary> /// Information about a metadata reference. /// </summary> public struct MetadataReferenceProperties : IEquatable<MetadataReferenceProperties> { private readonly MetadataImageKind _kind; private readonly ImmutableArray<string> _aliases; private readonly bool _embedInteropTypes; /// <summary> /// Default properties for a module reference. /// </summary> public static MetadataReferenceProperties Module => new MetadataReferenceProperties(MetadataImageKind.Module); /// <summary> /// Default properties for an assembly reference. /// </summary> public static MetadataReferenceProperties Assembly => new MetadataReferenceProperties(MetadataImageKind.Assembly); /// <summary> /// Initializes reference properties. /// </summary> /// <param name="kind">The image kind - assembly or module.</param> /// <param name="aliases">Assembly aliases. Can't be set for a module.</param> /// <param name="embedInteropTypes">True to embed interop types from the referenced assembly to the referencing compilation. Must be false for a module.</param> public MetadataReferenceProperties(MetadataImageKind kind = MetadataImageKind.Assembly, ImmutableArray<string> aliases = default, bool embedInteropTypes = false) { if (!kind.IsValid()) { throw new ArgumentOutOfRangeException(nameof(kind)); } if (kind == MetadataImageKind.Module) { if (embedInteropTypes) { throw new ArgumentException(CodeAnalysisResources.CannotEmbedInteropTypesFromModule, nameof(embedInteropTypes)); } if (!aliases.IsDefaultOrEmpty) { throw new ArgumentException(CodeAnalysisResources.CannotAliasModule, nameof(aliases)); } } if (!aliases.IsDefaultOrEmpty) { foreach (var alias in aliases) { if (!alias.IsValidClrTypeName()) { throw new ArgumentException(CodeAnalysisResources.InvalidAlias, nameof(aliases)); } } } _kind = kind; _aliases = aliases; _embedInteropTypes = embedInteropTypes; HasRecursiveAliases = false; } internal MetadataReferenceProperties(MetadataImageKind kind, ImmutableArray<string> aliases, bool embedInteropTypes, bool hasRecursiveAliases) : this(kind, aliases, embedInteropTypes) { HasRecursiveAliases = hasRecursiveAliases; } /// <summary> /// Returns <see cref="MetadataReferenceProperties"/> with specified aliases. /// </summary> /// <exception cref="ArgumentException"> /// <see cref="Kind"/> is <see cref="MetadataImageKind.Module"/>, as modules can't be aliased. /// </exception> public MetadataReferenceProperties WithAliases(IEnumerable<string> aliases) { return WithAliases(aliases.AsImmutableOrEmpty()); } /// <summary> /// Returns <see cref="MetadataReferenceProperties"/> with specified aliases. /// </summary> /// <exception cref="ArgumentException"> /// <see cref="Kind"/> is <see cref="MetadataImageKind.Module"/>, as modules can't be aliased. /// </exception> public MetadataReferenceProperties WithAliases(ImmutableArray<string> aliases) { return new MetadataReferenceProperties(_kind, aliases, _embedInteropTypes, HasRecursiveAliases); } /// <summary> /// Returns <see cref="MetadataReferenceProperties"/> with <see cref="EmbedInteropTypes"/> set to specified value. /// </summary> /// <exception cref="ArgumentException"><see cref="Kind"/> is <see cref="MetadataImageKind.Module"/>, as interop types can't be embedded from modules.</exception> public MetadataReferenceProperties WithEmbedInteropTypes(bool embedInteropTypes) { return new MetadataReferenceProperties(_kind, _aliases, embedInteropTypes, HasRecursiveAliases); } /// <summary> /// Returns <see cref="MetadataReferenceProperties"/> with <see cref="HasRecursiveAliases"/> set to specified value. /// </summary> internal MetadataReferenceProperties WithRecursiveAliases(bool value) { return new MetadataReferenceProperties(_kind, _aliases, _embedInteropTypes, value); } /// <summary> /// The image kind (assembly or module) the reference refers to. /// </summary> public MetadataImageKind Kind => _kind; /// <summary> /// Alias that represents a global declaration space. /// </summary> /// <remarks> /// Namespaces in references whose <see cref="Aliases"/> contain <see cref="GlobalAlias"/> are available in global declaration space. /// </remarks> public static string GlobalAlias => "global"; /// <summary> /// Aliases for the metadata reference. Empty if the reference has no aliases. /// </summary> /// <remarks> /// In C# these aliases can be used in "extern alias" syntax to disambiguate type names. /// </remarks> public ImmutableArray<string> Aliases { get { // Simplify usage - we can't avoid the _aliases field being null but we can always return empty array here: return _aliases.NullToEmpty(); } } /// <summary> /// True if interop types defined in the referenced metadata should be embedded into the compilation referencing the metadata. /// </summary> public bool EmbedInteropTypes => _embedInteropTypes; /// <summary> /// True to apply <see cref="Aliases"/> recursively on the target assembly and on all its transitive dependencies. /// False to apply <see cref="Aliases"/> only on the target assembly. /// </summary> internal bool HasRecursiveAliases { get; private set; } public override bool Equals(object? obj) { return obj is MetadataReferenceProperties && Equals((MetadataReferenceProperties)obj); } public bool Equals(MetadataReferenceProperties other) { return Aliases.SequenceEqual(other.Aliases) && _embedInteropTypes == other._embedInteropTypes && _kind == other._kind && HasRecursiveAliases == other.HasRecursiveAliases; } public override int GetHashCode() { return Hash.Combine(Hash.CombineValues(Aliases), Hash.Combine(_embedInteropTypes, Hash.Combine(HasRecursiveAliases, _kind.GetHashCode()))); } public static bool operator ==(MetadataReferenceProperties left, MetadataReferenceProperties right) { return left.Equals(right); } public static bool operator !=(MetadataReferenceProperties left, MetadataReferenceProperties right) { return !left.Equals(right); } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Features/VisualBasic/Portable/Completion/KeywordRecommenders/Expressions/IfKeywordRecommender.vb
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports System.Collections.Immutable Imports System.Threading Imports Microsoft.CodeAnalysis.Completion.Providers Imports Microsoft.CodeAnalysis.VisualBasic.Extensions.ContextQuery Imports Microsoft.CodeAnalysis.VisualBasic.Utilities.IntrinsicOperators Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.KeywordRecommenders.Expressions ''' <summary> ''' Recommends the "If" keyword when used for the null coalescing or ternary operator ''' </summary> Friend Class IfKeywordRecommender Inherits AbstractKeywordRecommender Private Shared ReadOnly s_keywords As ImmutableArray(Of RecommendedKeyword) = ImmutableArray.Create( CreateRecommendedKeywordForIntrinsicOperator(SyntaxKind.IfKeyword, $"{String.Format(VBFeaturesResources._0_function, "If")} (+1 {FeaturesResources.overload})", Glyph.MethodPublic, New TernaryConditionalExpressionDocumentation())) Protected Overrides Function RecommendKeywords(context As VisualBasicSyntaxContext, cancellationToken As CancellationToken) As ImmutableArray(Of RecommendedKeyword) Return If(context.IsAnyExpressionContext, s_keywords, ImmutableArray(Of RecommendedKeyword).Empty) End Function End Class End Namespace
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports System.Collections.Immutable Imports System.Threading Imports Microsoft.CodeAnalysis.Completion.Providers Imports Microsoft.CodeAnalysis.VisualBasic.Extensions.ContextQuery Imports Microsoft.CodeAnalysis.VisualBasic.Utilities.IntrinsicOperators Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.KeywordRecommenders.Expressions ''' <summary> ''' Recommends the "If" keyword when used for the null coalescing or ternary operator ''' </summary> Friend Class IfKeywordRecommender Inherits AbstractKeywordRecommender Private Shared ReadOnly s_keywords As ImmutableArray(Of RecommendedKeyword) = ImmutableArray.Create( CreateRecommendedKeywordForIntrinsicOperator(SyntaxKind.IfKeyword, $"{String.Format(VBFeaturesResources._0_function, "If")} (+1 {FeaturesResources.overload})", Glyph.MethodPublic, New TernaryConditionalExpressionDocumentation())) Protected Overrides Function RecommendKeywords(context As VisualBasicSyntaxContext, cancellationToken As CancellationToken) As ImmutableArray(Of RecommendedKeyword) Return If(context.IsAnyExpressionContext, s_keywords, ImmutableArray(Of RecommendedKeyword).Empty) End Function End Class End Namespace
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Compilers/VisualBasic/Test/Semantic/Binding/UsingTests.vb
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports Microsoft.CodeAnalysis.Test.Utilities Imports Microsoft.CodeAnalysis.Text Imports Microsoft.CodeAnalysis.VisualBasic.Symbols Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Imports Microsoft.CodeAnalysis.VisualBasic.UnitTests.Emit Imports Roslyn.Test.Utilities Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests Public Class UsingTests Inherits BasicTestBase <Fact()> Public Sub UsingSimpleWithSingleAsNewDeclarations() Dim source = <compilation name="UsingSimpleWithSingleAsNewDeclarations"> <file name="a.vb"> Option Strict On Option Infer Off Option Explicit Off Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Shared Sub Main() Using goo As New MyDisposable() Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> CompileAndVerify(source, expectedOutput:=<![CDATA[ Inside Using. ]]>).VerifyIL("C1.Main", <![CDATA[ { // Code size 29 (0x1d) .maxstack 1 .locals init (MyDisposable V_0) //goo IL_0000: newobj "Sub MyDisposable..ctor()" IL_0005: stloc.0 .try { IL_0006: ldstr "Inside Using." IL_000b: call "Sub System.Console.WriteLine(String)" IL_0010: leave.s IL_001c } finally { IL_0012: ldloc.0 IL_0013: brfalse.s IL_001b IL_0015: ldloc.0 IL_0016: callvirt "Sub System.IDisposable.Dispose()" IL_001b: endfinally } IL_001c: ret } ]]>) End Sub <Fact()> Public Sub UsingSimpleWithAsNewDeclarations() Dim source = <compilation name="UsingSimpleWithAsNewDeclarations"> <file name="a.vb"> Option Strict On Option Infer Off Option Explicit Off Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Shared Sub Main() Using goo As New MyDisposable(), goo2 as New MyDisposable() Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> CompileAndVerify(source, expectedOutput:=<![CDATA[ Inside Using. ]]>).VerifyIL("C1.Main", <![CDATA[ { // Code size 45 (0x2d) .maxstack 1 .locals init (MyDisposable V_0, //goo MyDisposable V_1) //goo2 IL_0000: newobj "Sub MyDisposable..ctor()" IL_0005: stloc.0 .try { IL_0006: newobj "Sub MyDisposable..ctor()" IL_000b: stloc.1 .try { IL_000c: ldstr "Inside Using." IL_0011: call "Sub System.Console.WriteLine(String)" IL_0016: leave.s IL_002c } finally { IL_0018: ldloc.1 IL_0019: brfalse.s IL_0021 IL_001b: ldloc.1 IL_001c: callvirt "Sub System.IDisposable.Dispose()" IL_0021: endfinally } } finally { IL_0022: ldloc.0 IL_0023: brfalse.s IL_002b IL_0025: ldloc.0 IL_0026: callvirt "Sub System.IDisposable.Dispose()" IL_002b: endfinally } IL_002c: ret } ]]>) End Sub <Fact()> Public Sub UsingSimpleWithMultipleVariablesInAsNewDeclarations() Dim source = <compilation name="UsingSimpleWithMultipleVariablesInAsNewDeclarations"> <file name="a.vb"> Option Strict On Option Infer Off Option Explicit Off Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Shared Sub Main() Using goo, goo2 As New MyDisposable(), goo3, goo4 As New MyDisposable() Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> CompileAndVerify(source, expectedOutput:=<![CDATA[ Inside Using. ]]>).VerifyIL("C1.Main", <![CDATA[ { // Code size 77 (0x4d) .maxstack 1 .locals init (MyDisposable V_0, //goo MyDisposable V_1, //goo2 MyDisposable V_2, //goo3 MyDisposable V_3) //goo4 IL_0000: newobj "Sub MyDisposable..ctor()" IL_0005: stloc.0 .try { IL_0006: newobj "Sub MyDisposable..ctor()" IL_000b: stloc.1 .try { IL_000c: newobj "Sub MyDisposable..ctor()" IL_0011: stloc.2 .try { IL_0012: newobj "Sub MyDisposable..ctor()" IL_0017: stloc.3 .try { IL_0018: ldstr "Inside Using." IL_001d: call "Sub System.Console.WriteLine(String)" IL_0022: leave.s IL_004c } finally { IL_0024: ldloc.3 IL_0025: brfalse.s IL_002d IL_0027: ldloc.3 IL_0028: callvirt "Sub System.IDisposable.Dispose()" IL_002d: endfinally } } finally { IL_002e: ldloc.2 IL_002f: brfalse.s IL_0037 IL_0031: ldloc.2 IL_0032: callvirt "Sub System.IDisposable.Dispose()" IL_0037: endfinally } } finally { IL_0038: ldloc.1 IL_0039: brfalse.s IL_0041 IL_003b: ldloc.1 IL_003c: callvirt "Sub System.IDisposable.Dispose()" IL_0041: endfinally } } finally { IL_0042: ldloc.0 IL_0043: brfalse.s IL_004b IL_0045: ldloc.0 IL_0046: callvirt "Sub System.IDisposable.Dispose()" IL_004b: endfinally } IL_004c: ret } ]]>) End Sub <Fact()> Public Sub UsingSimpleWithAsDeclarations() Dim source = <compilation name="UsingSimpleWithAsDeclarations"> <file name="a.vb"> Option Strict On Option Infer Off Option Explicit Off Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Shared Sub Main() Using goo As MyDisposable = new MyDisposable(), goo2 as MyDisposable = New MyDisposable() Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> CompileAndVerify(source, expectedOutput:=<![CDATA[ Inside Using. ]]>).VerifyIL("C1.Main", <![CDATA[ { // Code size 45 (0x2d) .maxstack 1 .locals init (MyDisposable V_0, //goo MyDisposable V_1) //goo2 IL_0000: newobj "Sub MyDisposable..ctor()" IL_0005: stloc.0 .try { IL_0006: newobj "Sub MyDisposable..ctor()" IL_000b: stloc.1 .try { IL_000c: ldstr "Inside Using." IL_0011: call "Sub System.Console.WriteLine(String)" IL_0016: leave.s IL_002c } finally { IL_0018: ldloc.1 IL_0019: brfalse.s IL_0021 IL_001b: ldloc.1 IL_001c: callvirt "Sub System.IDisposable.Dispose()" IL_0021: endfinally } } finally { IL_0022: ldloc.0 IL_0023: brfalse.s IL_002b IL_0025: ldloc.0 IL_0026: callvirt "Sub System.IDisposable.Dispose()" IL_002b: endfinally } IL_002c: ret } ]]>) End Sub <Fact()> Public Sub UsingSimpleWithExpression() Dim source = <compilation name="UsingSimpleWithExpression"> <file name="a.vb"> Option Strict On Option Infer Off Option Explicit Off Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Shared Sub Main() Using new MyDisposable() Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> CompileAndVerify(source, expectedOutput:=<![CDATA[ Inside Using. ]]>).VerifyIL("C1.Main", <![CDATA[ { // Code size 29 (0x1d) .maxstack 1 .locals init (MyDisposable V_0) IL_0000: newobj "Sub MyDisposable..ctor()" IL_0005: stloc.0 .try { IL_0006: ldstr "Inside Using." IL_000b: call "Sub System.Console.WriteLine(String)" IL_0010: leave.s IL_001c } finally { IL_0012: ldloc.0 IL_0013: brfalse.s IL_001b IL_0015: ldloc.0 IL_0016: callvirt "Sub System.IDisposable.Dispose()" IL_001b: endfinally } IL_001c: ret } ]]>) End Sub <Fact()> Public Sub UsingSimpleWithValueTypeExpression() Dim source = <compilation name="UsingSimpleWithValueTypeExpression"> <file name="a.vb"> Option Strict On Option Infer Off Option Explicit Off Imports System Structure MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Structure Class C1 Public Shared Sub Main() Using new MyDisposable() Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> CompileAndVerify(source, expectedOutput:=<![CDATA[ Inside Using. ]]>).VerifyIL("C1.Main", <![CDATA[ { // Code size 35 (0x23) .maxstack 1 .locals init (MyDisposable V_0) IL_0000: ldloca.s V_0 IL_0002: initobj "MyDisposable" .try { IL_0008: ldstr "Inside Using." IL_000d: call "Sub System.Console.WriteLine(String)" IL_0012: leave.s IL_0022 } finally { IL_0014: ldloca.s V_0 IL_0016: constrained. "MyDisposable" IL_001c: callvirt "Sub System.IDisposable.Dispose()" IL_0021: endfinally } IL_0022: ret } ]]>) End Sub <Fact()> Public Sub UsingSimpleWithPropertyAccessExpression() Dim source = <compilation name="UsingSimpleWithPropertyAccessExpression"> <file name="a.vb"> Option Strict On Option Infer On Option Explicit On Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Readonly Property ADisposable as IDisposable Get return new MyDisposable() End Get End Property Public Sub DoStuff() Using ADisposable Console.WriteLine("Inside Using.") End Using End Sub Public Shared Sub Main() dim x = new C1() x.DoStuff End Sub End Class </file> </compilation> CompileAndVerify(source, expectedOutput:=<![CDATA[ Inside Using. ]]>) End Sub <Fact()> Public Sub UsingSimpleWithPropertyAccessInitialization() Dim source = <compilation name="UsingSimpleWithPropertyAccessInitialization"> <file name="a.vb"> Option Strict On Option Infer On Option Explicit On Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Readonly Property ADisposable as IDisposable Get return new MyDisposable() End Get End Property Public Sub DoStuff() Using goo As IDisposable = ADisposable Console.WriteLine("Inside Using.") End Using End Sub Public Shared Sub Main() dim x = new C1() x.DoStuff End Sub End Class </file> </compilation> CompileAndVerify(source, expectedOutput:=<![CDATA[ Inside Using. ]]>) End Sub <Fact()> Public Sub UsingHideFieldsAndProperties() Dim source = <compilation name="UsingHideFieldsAndProperties"> <file name="a.vb"> Option Strict On Option Infer Off Option Explicit Off Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Field as MyDisposable Public Property MyProperty as MyDisposable Public Shared Sub Main() Using field as New MyDisposable(), MyProperty as New MyDisposable() Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> CompileAndVerify(source, expectedOutput:=<![CDATA[ Inside Using. ]]>) End Sub <Fact()> Public Sub UsingCannotHideLocalsParametersAndTypeParameters() Dim source = <compilation name="UsingCannotHideLocalsParametersAndTypeParameters"> <file name="a.vb"> Option Strict On Option Infer Off Option Explicit Off Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Field as MyDisposable Public Property MyProperty as MyDisposable Public Shared Sub Main() Dim local as Object = nothing Using local as New MyDisposable() Console.WriteLine("Inside Using.") End Using Using usingLocal as New MyDisposable() Dim usingLocal as New MyDisposable() Console.WriteLine("Inside Using.") End Using End Sub Public Sub DoStuff(Of P)(param as P) Using p as New MyDisposable(), param as new MyDisposable() Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> Dim compilation = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source) AssertTheseDiagnostics(compilation, <expected> BC30616: Variable 'local' hides a variable in an enclosing block. Using local as New MyDisposable() ~~~~~ BC30616: Variable 'usingLocal' hides a variable in an enclosing block. Dim usingLocal as New MyDisposable() ~~~~~~~~~~ BC32089: 'p' is already declared as a type parameter of this method. Using p as New MyDisposable(), param as new MyDisposable() ~ BC30734: 'param' is already declared as a parameter of this method. Using p as New MyDisposable(), param as new MyDisposable() ~~~~~ </expected>) End Sub <Fact()> Public Sub UsingSimpleWithInferredType() Dim source = <compilation name="UsingSimpleWithInferredType"> <file name="a.vb"> Option Strict On Option Infer On Option Explicit On Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Shared Sub Main() Using goo = New MyDisposable() Console.WriteLine("Inside Using.") End Using Using goo2 = New Integer() Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> Dim compilation = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source) AssertTheseDiagnostics(compilation, <expected> BC36010: 'Using' operand of type 'Integer' must implement 'System.IDisposable'. Using goo2 = New Integer() ~~~~~~~~~~~~~~~~~~~~ </expected>) End Sub <Fact()> Public Sub UsingSimpleWithImplicitType() Dim source = <compilation name="UsingSimpleWithImplicitType"> <file name="a.vb"> Option Strict On Option Infer Off Option Explicit Off Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Shared Sub Main() goo = New MyDisposable() ' not type inference means this is an object Using goo Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> Dim compilation = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source) AssertTheseDiagnostics(compilation, <expected> BC36010: 'Using' operand of type 'Object' must implement 'System.IDisposable'. Using goo ~~~ </expected>) End Sub <Fact()> Public Sub UsingMultipleNullableVariablesInAsNew() Dim source = <compilation name="UsingMultipleNullableVariablesInAsNew"> <file name="a.vb"> Option Strict Off Option Infer Off Option Explicit Off Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Shared Sub Main() Using a?, b? as new MyDisposable() Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> Dim compilation = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source) AssertTheseDiagnostics(compilation, <expected> BC33101: Type 'MyDisposable' must be a value type or a type argument constrained to 'Structure' in order to be used with 'Nullable' or nullable modifier '?'. Using a?, b? as new MyDisposable() ~~ BC33101: Type 'MyDisposable' must be a value type or a type argument constrained to 'Structure' in order to be used with 'Nullable' or nullable modifier '?'. Using a?, b? as new MyDisposable() ~~ BC33109: Nullable modifier cannot be specified in variable declarations with 'As New'. Using a?, b? as new MyDisposable() ~~~~~~~~~~~~~~~~~~~~~ BC33109: Nullable modifier cannot be specified in variable declarations with 'As New'. Using a?, b? as new MyDisposable() ~~~~~~~~~~~~~~~~~~~~~ </expected>) End Sub <Fact()> Public Sub UsingMultipleVariablesInAsNewWithMutableStructType() Dim source = <compilation name="UsingMultipleVariablesInAsNewWithMutableStructType"> <file name="a.vb"> Option Strict Off Option Infer Off Option Explicit Off Imports System Structure MyDisposable Implements IDisposable Public Goo As Integer Public Sub Dispose() Implements IDisposable.Dispose End Sub End Structure Class C1 Public Shared Sub Main() Using a, b as new MyDisposable() Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> Dim compilation = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source) AssertTheseDiagnostics(compilation, <expected> BC42351: Local variable 'a' is read-only and its type is a structure. Invoking its members or passing it ByRef does not change its content and might lead to unexpected results. Consider declaring this variable outside of the 'Using' block. Using a, b as new MyDisposable() ~ BC42351: Local variable 'b' is read-only and its type is a structure. Invoking its members or passing it ByRef does not change its content and might lead to unexpected results. Consider declaring this variable outside of the 'Using' block. Using a, b as new MyDisposable() ~ </expected>) End Sub <Fact()> Public Sub EmptyUsing() Dim source = <compilation name="EmptyUsing"> <file name="a.vb"> Imports System Class C1 Public Shared Sub Main() Using End Using End Sub End Class </file> </compilation> Dim compilation = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source) AssertTheseDiagnostics(compilation, <expected> BC30201: Expression expected. Using ~ </expected>) End Sub <Fact()> Public Sub UsingWithLocalInferenceAndCrossReference() Dim source = <compilation name="UsingWithLocalInferenceAndCrossReference"> <file name="a.vb"> Option Strict On Option Infer On Option Explicit Off Imports System Class MyDisposable Implements IDisposable Public Identity as String Public Readonly Other as MyDisposable Public Sub Dispose() Implements IDisposable.Dispose Console.WriteLine("Disposing " + Identity) End Sub Public Sub New(id as String) Identity = id Other = new MyDisposable() Other.Identity = "Other" End Sub Public Sub New() End Sub End Class Class C1 Public Shared Sub Main() Using goo = New MyDisposable("goo"), goo2 = goo.Other Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> CompileAndVerify(source, expectedOutput:=<![CDATA[ Inside Using. Disposing Other Disposing goo ]]>) End Sub <Fact()> Public Sub UsingWithLocalInferenceAndCrossReferenceInvalid() Dim source = <compilation name="UsingWithLocalInferenceAndCrossReferenceInvalid"> <file name="a.vb"> Option Strict On Option Infer On Option Explicit Off Imports System Class MyDisposable Implements IDisposable Public Identity as String Public Readonly Other as MyDisposable Public Sub Dispose() Implements IDisposable.Dispose Console.WriteLine("Disposing " + Identity) End Sub Public Sub New(id as String) Identity = id Other = new MyDisposable() Other.Identity = "Other" End Sub Public Sub New() End Sub End Class Class C1 Public Shared Sub Main() Using beforefoo = goo, goo = New MyDisposable("goo"), goo2 = goo.Other Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> Dim compilation = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source) AssertTheseDiagnostics(compilation, <expected> BC32000: Local variable 'goo' cannot be referred to before it is declared. Using beforefoo = goo, goo = New MyDisposable("goo"), goo2 = goo.Other ~~~ </expected>) End Sub <Fact()> Public Sub UsingResourceIsNothingLiteralNotOptimizedInVB() Dim source = <compilation name="UsingResourceIsNothingLiteralNotOptimizedInVB"> <file name="a.vb"> Option Strict On Option Infer On Option Explicit Off Imports System Class C1 Public Shared Sub Main() Using goo As IDisposable = nothing Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> CompileAndVerify(source, expectedOutput:=<![CDATA[ Inside Using. ]]>).VerifyIL("C1.Main", <![CDATA[ { // Code size 25 (0x19) .maxstack 1 .locals init (System.IDisposable V_0) //goo IL_0000: ldnull IL_0001: stloc.0 .try { IL_0002: ldstr "Inside Using." IL_0007: call "Sub System.Console.WriteLine(String)" IL_000c: leave.s IL_0018 } finally { IL_000e: ldloc.0 IL_000f: brfalse.s IL_0017 IL_0011: ldloc.0 IL_0012: callvirt "Sub System.IDisposable.Dispose()" IL_0017: endfinally } IL_0018: ret } ]]>) End Sub <Fact()> Public Sub BC30610ERR_BaseOnlyClassesMustBeExplicit2_1() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40( <compilation name="BaseOnlyClassesMustBeExplicit2"> <file name="a.vb"> Imports System Class M1 Implements IDisposable Sub DISPOSE() Implements IDisposable.Dispose End Sub Event MyEvent() Sub Fun() Using MyClass ' using Myclass End Using Using MyBase ' using MyBase End Using Using Me End Using Using System.Exception ' using Type End Using Using M1 ' using class End Using Using E1 End Using Using Main() ' using result of sub End Using Using AddressOf main ' using result of AddressOf End Using Using C1 ' using constant End Using End Sub Shared Sub Main() End Sub End Class </file> </compilation>) VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_ExpectedDotAfterMyClass, "MyClass"), Diagnostic(ERRID.ERR_ExpectedDotAfterMyBase, "MyBase"), Diagnostic(ERRID.ERR_ClassNotExpression1, "System.Exception").WithArguments("System.Exception"), Diagnostic(ERRID.ERR_ClassNotExpression1, "M1").WithArguments("M1"), Diagnostic(ERRID.ERR_NameNotDeclared1, "E1").WithArguments("E1"), Diagnostic(ERRID.ERR_VoidValue, "Main()"), Diagnostic(ERRID.ERR_VoidValue, "AddressOf main"), Diagnostic(ERRID.ERR_NameNotDeclared1, "C1").WithArguments("C1")) End Sub ' Take the parameter as object <Fact()> Public Sub BC30610ERR_BaseOnlyClassesMustBeExplicit2_TypeParameter() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40( <compilation name="BaseOnlyClassesMustBeExplicit2"> <file name="a.vb"> Class Gen(Of T) Public Shared Sub TestUsing(obj As T) Using obj End Using End Sub End Class </file> </compilation>) VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "obj").WithArguments("T")) End Sub ' Using block must implement the IDisposable interface <Fact()> Public Sub BC30610ERR_BaseOnlyClassesMustBeExplicit2_Invalid() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40( <compilation name="BaseOnlyClassesMustBeExplicit2"> <file name="a.vb"> Option Infer On Option Strict Off Class MyManagedClass1 Sub Dispose() End Sub End Class Class C1 Shared Sub main() Using mnObj = New MyManagedClass1() ' Invalid End Using Using mnObj1 As String = "123" ' Invalid End Using End Sub End Class </file> </compilation>) VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "mnObj = New MyManagedClass1()").WithArguments("MyManagedClass1"), Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "mnObj1 As String = ""123""").WithArguments("String")) End Sub ' Nullable type as resource <Fact()> Public Sub BC30610ERR_BaseOnlyClassesMustBeExplicit2_Invalid_Nullable() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40( <compilation name="BaseOnlyClassesMustBeExplicit2"> <file name="a.vb"> Option Infer On Option Strict Off Imports System Class C1 Shared mnObj As Nullable(Of MyManagedClass) Shared Sub main() Using mnObj ' Invalid End Using Using mnObj1 As Nullable(Of MyManagedClass) = Nothing ' Invalid End Using End Sub End Class Structure MyManagedClass Implements IDisposable Sub dispose() Implements IDisposable.Dispose End Sub End Structure </file> </compilation>) VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "mnObj").WithArguments("MyManagedClass?"), Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "mnObj1 As Nullable(Of MyManagedClass) = Nothing").WithArguments("MyManagedClass?"), Diagnostic(ERRID.WRN_MutableStructureInUsing, "mnObj1 As Nullable(Of MyManagedClass) = Nothing").WithArguments("mnObj1")) End Sub ' Using same named variables in different blocks <Fact()> Public Sub UsableScope() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40( <compilation name="UsableScope"> <file name="a.vb"> Imports System Structure cls1 Implements IDisposable Public Sub Dispose() Implements System.IDisposable.Dispose Console.WriteLine("Dispose") End Sub Sub New(ByRef x As cls1) x = Me End Sub Sub goo() Do Dim x As New cls1 Using x End Using Exit Do Loop For i As Integer = 1 To 1 Dim x As New cls1 Using x End Using Next While True Dim x As New cls1 Using x End Using Exit While End While End Sub Shared Sub Main() Dim x = New cls1() x.goo() End Sub End Structure </file> </compilation>) VerifyDiagnostics(compilation1) End Sub <Fact()> Public Sub LateBind() CompileAndVerify( <compilation name="LateBind"> <file name="a.vb"> Option Infer On Option Strict Off Imports System Class cls1 Implements IDisposable Public disposed As Boolean = False Public Sub Dispose() Implements System.IDisposable.Dispose disposed = True End Sub Public Function GetBoxedInstance() As Object Return Me End Function End Class Class C1 Sub Main() Dim o1 As New cls1 Using o1.GetBoxedInstance End Using Dim o2 As Object = New cls1 goo(o2) End Sub Sub goo(ByVal o As Object) Using o.GetBoxedInstance End Using End Sub End Class </file> </compilation>) End Sub ' The incorrect control flow (jumps outter to inner) <Fact()> Public Sub IncorrectJump() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime( <compilation name="IncorrectJump"> <file name="a.vb"> Imports System Module Program Sub Main(args As String()) Dim obj = New s1() Using obj Using obj GoTo label4 label5: End Using label4: GoTo label5 ' Invalid jumps from inner block into outer one (ok) and back(err) End Using End Sub End Module Structure s1 Implements IDisposable Sub Dispose() Implements IDisposable.Dispose End Sub End Structure </file> </compilation>) VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_GotoIntoUsing, "label5").WithArguments("label5")) End Sub ' Assigning stuff to the Using variable <Fact()> Public Sub Assignment() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime( <compilation name="Assignment"> <file name="a.vb"> Imports System Module Program Dim mnObj As MyManagedClass Sub GOO() Dim obj1 As New MyManagedClass Dim obj1a As New MyManagedClass Dim obj1b As MyManagedClass = obj1 Using obj1b obj1b = obj1a End Using Dim obj2 As New MyManagedClass Using obj2 obj2 = obj2 End Using End Sub Sub Main(args As String()) End Sub End Module Structure MyManagedClass Implements IDisposable Sub Dispose() Implements IDisposable.Dispose End Sub End Structure </file> </compilation>) VerifyDiagnostics(compilation1) End Sub ' Assigning stuff to the Using variable <Fact()> Public Sub Assignment_2() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime( <compilation name="Assignment"> <file name="a.vb"> Imports System Module Program Sub Main(args As String()) Dim obj1 As New MyManagedClass Dim obj1a As New MyManagedClass Dim obj1b As MyManagedClass = obj1 Using obj1b obj1a = obj1b End Using End Sub End Module Structure MyManagedClass Implements IDisposable Sub Dispose() Implements IDisposable.Dispose End Sub End Structure </file> </compilation>) VerifyDiagnostics(compilation1) End Sub <WorkItem(543059, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543059")> <Fact()> Public Sub MultipleResource() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime( <compilation> <file name="a.vb"> Option Infer On Imports System Class Program Shared Sub Main() Using x, = New MyManagedClass, y = New MyManagedClass1 End Using End Sub End Class Class MyManagedClass Implements System.IDisposable Sub Dispose() Implements System.IDisposable.Dispose System.Console.WriteLine("Dispose") End Sub End Class Class MyManagedClass1 Implements System.IDisposable Sub Dispose() Implements System.IDisposable.Dispose System.Console.WriteLine("Dispose1") End Sub End Class </file> </compilation>) CompilationUtils.AssertTheseDiagnostics(compilation1, <expected> BC36011: 'Using' resource variable must have an explicit initialization. Using x, = New MyManagedClass, y = New MyManagedClass1 ~ BC30671: Explicit initialization is not permitted with multiple variables declared with a single type specifier. Using x, = New MyManagedClass, y = New MyManagedClass1 ~~~~~~~~~~~~~~~~~~~~~~~ BC30203: Identifier expected. Using x, = New MyManagedClass, y = New MyManagedClass1 ~ </expected>) End Sub <WorkItem(543059, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543059")> <Fact()> Public Sub MultipleResource_2() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime( <compilation> <file name="a.vb"> Option Infer On Option Strict On Imports System Imports System.Collections.Generic Class Program Shared Sub Main() Dim objs = GetList() Using x As MyManagedClass = (From y In objs Select y).First, goo3, goo4 = x End Using End Sub Shared Function GetList() As List(Of MyManagedClass) Return Nothing End Function End Class Public Class MyManagedClass Implements System.IDisposable Public Sub Dispose() Implements System.IDisposable.Dispose Console.Write("Dispose") End Sub End Class </file> </compilation>) VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_ExpectedQueryableSource, "objs").WithArguments("System.Collections.Generic.List(Of MyManagedClass)"), Diagnostic(ERRID.ERR_InitWithMultipleDeclarators, "goo3, goo4 = x"), Diagnostic(ERRID.ERR_StrictDisallowImplicitObject, "goo3"), Diagnostic(ERRID.ERR_UsingResourceVarNeedsInitializer, "goo3"), Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "goo3").WithArguments("Object")) End Sub <WorkItem(528963, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/528963")> <Fact()> Public Sub InitWithMultipleDeclarators() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40( <compilation name="InitWithMultipleDeclarators"> <file name="a.vb"> Option Infer On Option Strict On Imports System Imports System.Collections.Generic Class Program Shared Sub Main() Dim objs = GetList() Using goo As MyManagedClass = New MyManagedClass(), goo3, goo4 As New MyManagedClass() Console.WriteLine("Inside Using.") End Using End Sub Shared Function GetList() As List(Of MyManagedClass) Return Nothing End Function End Class Public Class MyManagedClass Implements System.IDisposable Public Sub Dispose() Implements System.IDisposable.Dispose Console.Write("Dispose") End Sub End Class </file> </compilation>) VerifyDiagnostics(compilation1) End Sub ' Query expression in using statement <Fact()> Public Sub QueryInUsing() Dim compilation1 = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="QueryInUsing"> <file name="a.vb"> Option Infer On Option Strict On Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim objs = GetList() Using x As MyManagedClass = (From y In objs Select y).First End Using End Sub Shared Function GetList() As List(Of MyManagedClass) Return Nothing End Function End Class Public Class MyManagedClass Implements System.IDisposable Public Sub Dispose() Implements System.IDisposable.Dispose Console.Write("Dispose") End Sub End Class </file> </compilation>, {SystemCoreRef}) VerifyDiagnostics(compilation1) End Sub ' Error when using a lambda in a using() <Fact()> Public Sub LambdaInUsing() Dim compilation1 = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="LambdaInUsing"> <file name="a.vb"> Option Infer On Option Strict On Imports System Class Program Shared Sub Main() Using Function(x) x ' err End Using Using Function():End Function ' err End Using Using Function(x As MyManagedClass) x ' err End Using End Sub End Class Public Class MyManagedClass Implements System.IDisposable Public Sub Dispose() Implements System.IDisposable.Dispose Console.Write("Dispose") End Sub End Class </file> </compilation>, {SystemCoreRef}) VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_ExpectedExpression, ""), Diagnostic(ERRID.ERR_InvalidEndFunction, "End Function"), Diagnostic(ERRID.ERR_StrictDisallowImplicitObjectLambda, "x"), Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "Function(x) x").WithArguments("Function <generated method>(x As Object) As Object"), Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "Function()").WithArguments("Function <generated method>() As ?"), Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "Function(x As MyManagedClass) x").WithArguments("Function <generated method>(x As MyManagedClass) As MyManagedClass")) End Sub ' Anonymous types cannot appear in using <Fact()> Public Sub AnonymousInUsing() Dim compilation1 = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="AnonymousInUsing"> <file name="a.vb"> Option Infer On Option Strict On Class Program Shared Sub Main() Using c = New With {Key.p1 = 10.0, Key.p2 = "a"c} End Using End Sub End Class </file> </compilation>) VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "c = New With {Key.p1 = 10.0, Key.p2 = ""a""c}").WithArguments("<anonymous type: Key p1 As Double, Key p2 As Char>")) End Sub 'Anonymous Delegate in using block <WorkItem(528974, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/528974")> <Fact()> Public Sub AnonymousDelegateInUsing() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime( <compilation name="AnonymousDelegateInUsing"> <file name="a.vb"> Option Infer On Option Strict On Imports System Delegate Function D1(Of T)(t As T) As T Class A1 Private Shared Sub Goo(Of T As IDisposable)(x As T) Dim local As T = x Using t1 As T = DirectCast(Function(tt As T) x, D1(Of T))(x) ' warning End Using End Sub Shared Sub Main() End Sub End Class </file> </compilation>) VerifyDiagnostics(compilation, Diagnostic(ERRID.WRN_MutableGenericStructureInUsing, "t1 As T = DirectCast(Function(tt As T) x, D1(Of T))(x)").WithArguments("t1")) End Sub ' Using used before calling Mybase.New <WorkItem(10570, "DevDiv_Projects/Roslyn")> <Fact()> Public Sub UsingBeforeConstructCall() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime( <compilation name="UsingBeforeConstructCall"> <file name="a.vb"> Imports System Class cls1 Implements IDisposable Sub New() Using x as IDisposable = nothing MyBase.New() End Using End Sub Public Sub Dispose() Implements System.IDisposable.Dispose End Sub End Class Class cls2 Implements IDisposable Sub New() Using Me MyBase.New() End Using End Sub Public Sub Dispose() Implements System.IDisposable.Dispose End Sub End Class Class cls3 Implements IDisposable Sub New() Using MyBase.New() End Using End Sub Public Sub Dispose() Implements System.IDisposable.Dispose End Sub End Class </file> </compilation>) VerifyDiagnostics(compilation, Diagnostic(ERRID.ERR_InvalidConstructorCall, "MyBase.New"), Diagnostic(ERRID.ERR_InvalidConstructorCall, "MyBase.New"), Diagnostic(ERRID.ERR_InvalidConstructorCall, "MyBase.New")) End Sub <WorkItem(528975, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/528975")> <Fact> Public Sub InitMultipleResourceWithUsingDecl() CompileAndVerify( <compilation name="InitResourceWithUsingDecl"> <file name="a.vb"> Option Infer On Imports System Class Program Shared Sub Main() Dim x = 1 Using goo, goo2 As New MyManagedClass(x), goo3, goo4 As New MyManagedClass(x) Console.WriteLine("Inside Using.") End Using End Sub End Class Class MyManagedClass Implements System.IDisposable Sub New(x As Integer) End Sub Sub Dispose() Implements System.IDisposable.Dispose System.Console.WriteLine("Dispose") End Sub End Class </file> </compilation>) End Sub <WorkItem(543059, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543059")> <Fact()> Public Sub MultipleResource_3() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime( <compilation> <file name="a.vb"> Option Infer On Class Program Shared Sub Main() Using x, = New MyManagedClass, y = New MyManagedClass1 End Using End Sub End Class Class MyManagedClass Implements System.IDisposable Sub Dispose() Implements System.IDisposable.Dispose System.Console.WriteLine("Dispose") End Sub End Class Class MyManagedClass1 Implements System.IDisposable Sub Dispose() Implements System.IDisposable.Dispose System.Console.WriteLine("Dispose1") End Sub End Class </file> </compilation>) VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), Diagnostic(ERRID.ERR_InitWithMultipleDeclarators, "x, = New MyManagedClass"), Diagnostic(ERRID.ERR_UsingResourceVarNeedsInitializer, "x")) End Sub <WorkItem(543059, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543059")> <Fact()> Public Sub MultipleResource_4() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime( <compilation> <file name="a.vb"> Option Infer On Option Strict On Imports System Imports System.Collections.Generic Class Program Shared Sub Main() Dim objs = GetList() Using x As MyManagedClass = (From y In objs Select y).First, goo3, goo4 = x End Using End Sub Shared Function GetList() As List(Of MyManagedClass) Return Nothing End Function End Class Public Class MyManagedClass Implements System.IDisposable Public Sub Dispose() Implements System.IDisposable.Dispose Console.Write("Dispose") End Sub End Class </file> </compilation>) VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_ExpectedQueryableSource, "objs").WithArguments("System.Collections.Generic.List(Of MyManagedClass)"), Diagnostic(ERRID.ERR_InitWithMultipleDeclarators, "goo3, goo4 = x"), Diagnostic(ERRID.ERR_StrictDisallowImplicitObject, "goo3"), Diagnostic(ERRID.ERR_UsingResourceVarNeedsInitializer, "goo3"), Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "goo3").WithArguments("Object")) End Sub <WorkItem(529046, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/529046")> <Fact> Public Sub UsingOutOfMethod() CreateCompilationWithMscorlib40AndVBRuntime( <compilation name="SyncLockOutOfMethod"> <file name="a.vb"> Class m1 Using Nothing End Using End Class </file> </compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Using Nothing"), Diagnostic(ERRID.ERR_EndUsingWithoutUsing, "End Using")) End Sub <WorkItem(529046, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/529046")> <Fact> Public Sub UsingOutOfMethod_1() CreateCompilationWithMscorlib40AndVBRuntime( <compilation name="SyncLockOutOfMethod"> <file name="a.vb"> Using Nothing End Using </file> </compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Using Nothing"), Diagnostic(ERRID.ERR_EndUsingWithoutUsing, "End Using")) End Sub End Class End Namespace
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports Microsoft.CodeAnalysis.Test.Utilities Imports Microsoft.CodeAnalysis.Text Imports Microsoft.CodeAnalysis.VisualBasic.Symbols Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Imports Microsoft.CodeAnalysis.VisualBasic.UnitTests.Emit Imports Roslyn.Test.Utilities Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests Public Class UsingTests Inherits BasicTestBase <Fact()> Public Sub UsingSimpleWithSingleAsNewDeclarations() Dim source = <compilation name="UsingSimpleWithSingleAsNewDeclarations"> <file name="a.vb"> Option Strict On Option Infer Off Option Explicit Off Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Shared Sub Main() Using goo As New MyDisposable() Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> CompileAndVerify(source, expectedOutput:=<![CDATA[ Inside Using. ]]>).VerifyIL("C1.Main", <![CDATA[ { // Code size 29 (0x1d) .maxstack 1 .locals init (MyDisposable V_0) //goo IL_0000: newobj "Sub MyDisposable..ctor()" IL_0005: stloc.0 .try { IL_0006: ldstr "Inside Using." IL_000b: call "Sub System.Console.WriteLine(String)" IL_0010: leave.s IL_001c } finally { IL_0012: ldloc.0 IL_0013: brfalse.s IL_001b IL_0015: ldloc.0 IL_0016: callvirt "Sub System.IDisposable.Dispose()" IL_001b: endfinally } IL_001c: ret } ]]>) End Sub <Fact()> Public Sub UsingSimpleWithAsNewDeclarations() Dim source = <compilation name="UsingSimpleWithAsNewDeclarations"> <file name="a.vb"> Option Strict On Option Infer Off Option Explicit Off Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Shared Sub Main() Using goo As New MyDisposable(), goo2 as New MyDisposable() Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> CompileAndVerify(source, expectedOutput:=<![CDATA[ Inside Using. ]]>).VerifyIL("C1.Main", <![CDATA[ { // Code size 45 (0x2d) .maxstack 1 .locals init (MyDisposable V_0, //goo MyDisposable V_1) //goo2 IL_0000: newobj "Sub MyDisposable..ctor()" IL_0005: stloc.0 .try { IL_0006: newobj "Sub MyDisposable..ctor()" IL_000b: stloc.1 .try { IL_000c: ldstr "Inside Using." IL_0011: call "Sub System.Console.WriteLine(String)" IL_0016: leave.s IL_002c } finally { IL_0018: ldloc.1 IL_0019: brfalse.s IL_0021 IL_001b: ldloc.1 IL_001c: callvirt "Sub System.IDisposable.Dispose()" IL_0021: endfinally } } finally { IL_0022: ldloc.0 IL_0023: brfalse.s IL_002b IL_0025: ldloc.0 IL_0026: callvirt "Sub System.IDisposable.Dispose()" IL_002b: endfinally } IL_002c: ret } ]]>) End Sub <Fact()> Public Sub UsingSimpleWithMultipleVariablesInAsNewDeclarations() Dim source = <compilation name="UsingSimpleWithMultipleVariablesInAsNewDeclarations"> <file name="a.vb"> Option Strict On Option Infer Off Option Explicit Off Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Shared Sub Main() Using goo, goo2 As New MyDisposable(), goo3, goo4 As New MyDisposable() Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> CompileAndVerify(source, expectedOutput:=<![CDATA[ Inside Using. ]]>).VerifyIL("C1.Main", <![CDATA[ { // Code size 77 (0x4d) .maxstack 1 .locals init (MyDisposable V_0, //goo MyDisposable V_1, //goo2 MyDisposable V_2, //goo3 MyDisposable V_3) //goo4 IL_0000: newobj "Sub MyDisposable..ctor()" IL_0005: stloc.0 .try { IL_0006: newobj "Sub MyDisposable..ctor()" IL_000b: stloc.1 .try { IL_000c: newobj "Sub MyDisposable..ctor()" IL_0011: stloc.2 .try { IL_0012: newobj "Sub MyDisposable..ctor()" IL_0017: stloc.3 .try { IL_0018: ldstr "Inside Using." IL_001d: call "Sub System.Console.WriteLine(String)" IL_0022: leave.s IL_004c } finally { IL_0024: ldloc.3 IL_0025: brfalse.s IL_002d IL_0027: ldloc.3 IL_0028: callvirt "Sub System.IDisposable.Dispose()" IL_002d: endfinally } } finally { IL_002e: ldloc.2 IL_002f: brfalse.s IL_0037 IL_0031: ldloc.2 IL_0032: callvirt "Sub System.IDisposable.Dispose()" IL_0037: endfinally } } finally { IL_0038: ldloc.1 IL_0039: brfalse.s IL_0041 IL_003b: ldloc.1 IL_003c: callvirt "Sub System.IDisposable.Dispose()" IL_0041: endfinally } } finally { IL_0042: ldloc.0 IL_0043: brfalse.s IL_004b IL_0045: ldloc.0 IL_0046: callvirt "Sub System.IDisposable.Dispose()" IL_004b: endfinally } IL_004c: ret } ]]>) End Sub <Fact()> Public Sub UsingSimpleWithAsDeclarations() Dim source = <compilation name="UsingSimpleWithAsDeclarations"> <file name="a.vb"> Option Strict On Option Infer Off Option Explicit Off Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Shared Sub Main() Using goo As MyDisposable = new MyDisposable(), goo2 as MyDisposable = New MyDisposable() Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> CompileAndVerify(source, expectedOutput:=<![CDATA[ Inside Using. ]]>).VerifyIL("C1.Main", <![CDATA[ { // Code size 45 (0x2d) .maxstack 1 .locals init (MyDisposable V_0, //goo MyDisposable V_1) //goo2 IL_0000: newobj "Sub MyDisposable..ctor()" IL_0005: stloc.0 .try { IL_0006: newobj "Sub MyDisposable..ctor()" IL_000b: stloc.1 .try { IL_000c: ldstr "Inside Using." IL_0011: call "Sub System.Console.WriteLine(String)" IL_0016: leave.s IL_002c } finally { IL_0018: ldloc.1 IL_0019: brfalse.s IL_0021 IL_001b: ldloc.1 IL_001c: callvirt "Sub System.IDisposable.Dispose()" IL_0021: endfinally } } finally { IL_0022: ldloc.0 IL_0023: brfalse.s IL_002b IL_0025: ldloc.0 IL_0026: callvirt "Sub System.IDisposable.Dispose()" IL_002b: endfinally } IL_002c: ret } ]]>) End Sub <Fact()> Public Sub UsingSimpleWithExpression() Dim source = <compilation name="UsingSimpleWithExpression"> <file name="a.vb"> Option Strict On Option Infer Off Option Explicit Off Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Shared Sub Main() Using new MyDisposable() Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> CompileAndVerify(source, expectedOutput:=<![CDATA[ Inside Using. ]]>).VerifyIL("C1.Main", <![CDATA[ { // Code size 29 (0x1d) .maxstack 1 .locals init (MyDisposable V_0) IL_0000: newobj "Sub MyDisposable..ctor()" IL_0005: stloc.0 .try { IL_0006: ldstr "Inside Using." IL_000b: call "Sub System.Console.WriteLine(String)" IL_0010: leave.s IL_001c } finally { IL_0012: ldloc.0 IL_0013: brfalse.s IL_001b IL_0015: ldloc.0 IL_0016: callvirt "Sub System.IDisposable.Dispose()" IL_001b: endfinally } IL_001c: ret } ]]>) End Sub <Fact()> Public Sub UsingSimpleWithValueTypeExpression() Dim source = <compilation name="UsingSimpleWithValueTypeExpression"> <file name="a.vb"> Option Strict On Option Infer Off Option Explicit Off Imports System Structure MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Structure Class C1 Public Shared Sub Main() Using new MyDisposable() Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> CompileAndVerify(source, expectedOutput:=<![CDATA[ Inside Using. ]]>).VerifyIL("C1.Main", <![CDATA[ { // Code size 35 (0x23) .maxstack 1 .locals init (MyDisposable V_0) IL_0000: ldloca.s V_0 IL_0002: initobj "MyDisposable" .try { IL_0008: ldstr "Inside Using." IL_000d: call "Sub System.Console.WriteLine(String)" IL_0012: leave.s IL_0022 } finally { IL_0014: ldloca.s V_0 IL_0016: constrained. "MyDisposable" IL_001c: callvirt "Sub System.IDisposable.Dispose()" IL_0021: endfinally } IL_0022: ret } ]]>) End Sub <Fact()> Public Sub UsingSimpleWithPropertyAccessExpression() Dim source = <compilation name="UsingSimpleWithPropertyAccessExpression"> <file name="a.vb"> Option Strict On Option Infer On Option Explicit On Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Readonly Property ADisposable as IDisposable Get return new MyDisposable() End Get End Property Public Sub DoStuff() Using ADisposable Console.WriteLine("Inside Using.") End Using End Sub Public Shared Sub Main() dim x = new C1() x.DoStuff End Sub End Class </file> </compilation> CompileAndVerify(source, expectedOutput:=<![CDATA[ Inside Using. ]]>) End Sub <Fact()> Public Sub UsingSimpleWithPropertyAccessInitialization() Dim source = <compilation name="UsingSimpleWithPropertyAccessInitialization"> <file name="a.vb"> Option Strict On Option Infer On Option Explicit On Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Readonly Property ADisposable as IDisposable Get return new MyDisposable() End Get End Property Public Sub DoStuff() Using goo As IDisposable = ADisposable Console.WriteLine("Inside Using.") End Using End Sub Public Shared Sub Main() dim x = new C1() x.DoStuff End Sub End Class </file> </compilation> CompileAndVerify(source, expectedOutput:=<![CDATA[ Inside Using. ]]>) End Sub <Fact()> Public Sub UsingHideFieldsAndProperties() Dim source = <compilation name="UsingHideFieldsAndProperties"> <file name="a.vb"> Option Strict On Option Infer Off Option Explicit Off Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Field as MyDisposable Public Property MyProperty as MyDisposable Public Shared Sub Main() Using field as New MyDisposable(), MyProperty as New MyDisposable() Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> CompileAndVerify(source, expectedOutput:=<![CDATA[ Inside Using. ]]>) End Sub <Fact()> Public Sub UsingCannotHideLocalsParametersAndTypeParameters() Dim source = <compilation name="UsingCannotHideLocalsParametersAndTypeParameters"> <file name="a.vb"> Option Strict On Option Infer Off Option Explicit Off Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Field as MyDisposable Public Property MyProperty as MyDisposable Public Shared Sub Main() Dim local as Object = nothing Using local as New MyDisposable() Console.WriteLine("Inside Using.") End Using Using usingLocal as New MyDisposable() Dim usingLocal as New MyDisposable() Console.WriteLine("Inside Using.") End Using End Sub Public Sub DoStuff(Of P)(param as P) Using p as New MyDisposable(), param as new MyDisposable() Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> Dim compilation = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source) AssertTheseDiagnostics(compilation, <expected> BC30616: Variable 'local' hides a variable in an enclosing block. Using local as New MyDisposable() ~~~~~ BC30616: Variable 'usingLocal' hides a variable in an enclosing block. Dim usingLocal as New MyDisposable() ~~~~~~~~~~ BC32089: 'p' is already declared as a type parameter of this method. Using p as New MyDisposable(), param as new MyDisposable() ~ BC30734: 'param' is already declared as a parameter of this method. Using p as New MyDisposable(), param as new MyDisposable() ~~~~~ </expected>) End Sub <Fact()> Public Sub UsingSimpleWithInferredType() Dim source = <compilation name="UsingSimpleWithInferredType"> <file name="a.vb"> Option Strict On Option Infer On Option Explicit On Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Shared Sub Main() Using goo = New MyDisposable() Console.WriteLine("Inside Using.") End Using Using goo2 = New Integer() Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> Dim compilation = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source) AssertTheseDiagnostics(compilation, <expected> BC36010: 'Using' operand of type 'Integer' must implement 'System.IDisposable'. Using goo2 = New Integer() ~~~~~~~~~~~~~~~~~~~~ </expected>) End Sub <Fact()> Public Sub UsingSimpleWithImplicitType() Dim source = <compilation name="UsingSimpleWithImplicitType"> <file name="a.vb"> Option Strict On Option Infer Off Option Explicit Off Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Shared Sub Main() goo = New MyDisposable() ' not type inference means this is an object Using goo Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> Dim compilation = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source) AssertTheseDiagnostics(compilation, <expected> BC36010: 'Using' operand of type 'Object' must implement 'System.IDisposable'. Using goo ~~~ </expected>) End Sub <Fact()> Public Sub UsingMultipleNullableVariablesInAsNew() Dim source = <compilation name="UsingMultipleNullableVariablesInAsNew"> <file name="a.vb"> Option Strict Off Option Infer Off Option Explicit Off Imports System Class MyDisposable Implements IDisposable Public Sub Dispose() Implements IDisposable.Dispose End Sub End Class Class C1 Public Shared Sub Main() Using a?, b? as new MyDisposable() Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> Dim compilation = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source) AssertTheseDiagnostics(compilation, <expected> BC33101: Type 'MyDisposable' must be a value type or a type argument constrained to 'Structure' in order to be used with 'Nullable' or nullable modifier '?'. Using a?, b? as new MyDisposable() ~~ BC33101: Type 'MyDisposable' must be a value type or a type argument constrained to 'Structure' in order to be used with 'Nullable' or nullable modifier '?'. Using a?, b? as new MyDisposable() ~~ BC33109: Nullable modifier cannot be specified in variable declarations with 'As New'. Using a?, b? as new MyDisposable() ~~~~~~~~~~~~~~~~~~~~~ BC33109: Nullable modifier cannot be specified in variable declarations with 'As New'. Using a?, b? as new MyDisposable() ~~~~~~~~~~~~~~~~~~~~~ </expected>) End Sub <Fact()> Public Sub UsingMultipleVariablesInAsNewWithMutableStructType() Dim source = <compilation name="UsingMultipleVariablesInAsNewWithMutableStructType"> <file name="a.vb"> Option Strict Off Option Infer Off Option Explicit Off Imports System Structure MyDisposable Implements IDisposable Public Goo As Integer Public Sub Dispose() Implements IDisposable.Dispose End Sub End Structure Class C1 Public Shared Sub Main() Using a, b as new MyDisposable() Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> Dim compilation = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source) AssertTheseDiagnostics(compilation, <expected> BC42351: Local variable 'a' is read-only and its type is a structure. Invoking its members or passing it ByRef does not change its content and might lead to unexpected results. Consider declaring this variable outside of the 'Using' block. Using a, b as new MyDisposable() ~ BC42351: Local variable 'b' is read-only and its type is a structure. Invoking its members or passing it ByRef does not change its content and might lead to unexpected results. Consider declaring this variable outside of the 'Using' block. Using a, b as new MyDisposable() ~ </expected>) End Sub <Fact()> Public Sub EmptyUsing() Dim source = <compilation name="EmptyUsing"> <file name="a.vb"> Imports System Class C1 Public Shared Sub Main() Using End Using End Sub End Class </file> </compilation> Dim compilation = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source) AssertTheseDiagnostics(compilation, <expected> BC30201: Expression expected. Using ~ </expected>) End Sub <Fact()> Public Sub UsingWithLocalInferenceAndCrossReference() Dim source = <compilation name="UsingWithLocalInferenceAndCrossReference"> <file name="a.vb"> Option Strict On Option Infer On Option Explicit Off Imports System Class MyDisposable Implements IDisposable Public Identity as String Public Readonly Other as MyDisposable Public Sub Dispose() Implements IDisposable.Dispose Console.WriteLine("Disposing " + Identity) End Sub Public Sub New(id as String) Identity = id Other = new MyDisposable() Other.Identity = "Other" End Sub Public Sub New() End Sub End Class Class C1 Public Shared Sub Main() Using goo = New MyDisposable("goo"), goo2 = goo.Other Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> CompileAndVerify(source, expectedOutput:=<![CDATA[ Inside Using. Disposing Other Disposing goo ]]>) End Sub <Fact()> Public Sub UsingWithLocalInferenceAndCrossReferenceInvalid() Dim source = <compilation name="UsingWithLocalInferenceAndCrossReferenceInvalid"> <file name="a.vb"> Option Strict On Option Infer On Option Explicit Off Imports System Class MyDisposable Implements IDisposable Public Identity as String Public Readonly Other as MyDisposable Public Sub Dispose() Implements IDisposable.Dispose Console.WriteLine("Disposing " + Identity) End Sub Public Sub New(id as String) Identity = id Other = new MyDisposable() Other.Identity = "Other" End Sub Public Sub New() End Sub End Class Class C1 Public Shared Sub Main() Using beforefoo = goo, goo = New MyDisposable("goo"), goo2 = goo.Other Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> Dim compilation = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source) AssertTheseDiagnostics(compilation, <expected> BC32000: Local variable 'goo' cannot be referred to before it is declared. Using beforefoo = goo, goo = New MyDisposable("goo"), goo2 = goo.Other ~~~ </expected>) End Sub <Fact()> Public Sub UsingResourceIsNothingLiteralNotOptimizedInVB() Dim source = <compilation name="UsingResourceIsNothingLiteralNotOptimizedInVB"> <file name="a.vb"> Option Strict On Option Infer On Option Explicit Off Imports System Class C1 Public Shared Sub Main() Using goo As IDisposable = nothing Console.WriteLine("Inside Using.") End Using End Sub End Class </file> </compilation> CompileAndVerify(source, expectedOutput:=<![CDATA[ Inside Using. ]]>).VerifyIL("C1.Main", <![CDATA[ { // Code size 25 (0x19) .maxstack 1 .locals init (System.IDisposable V_0) //goo IL_0000: ldnull IL_0001: stloc.0 .try { IL_0002: ldstr "Inside Using." IL_0007: call "Sub System.Console.WriteLine(String)" IL_000c: leave.s IL_0018 } finally { IL_000e: ldloc.0 IL_000f: brfalse.s IL_0017 IL_0011: ldloc.0 IL_0012: callvirt "Sub System.IDisposable.Dispose()" IL_0017: endfinally } IL_0018: ret } ]]>) End Sub <Fact()> Public Sub BC30610ERR_BaseOnlyClassesMustBeExplicit2_1() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40( <compilation name="BaseOnlyClassesMustBeExplicit2"> <file name="a.vb"> Imports System Class M1 Implements IDisposable Sub DISPOSE() Implements IDisposable.Dispose End Sub Event MyEvent() Sub Fun() Using MyClass ' using Myclass End Using Using MyBase ' using MyBase End Using Using Me End Using Using System.Exception ' using Type End Using Using M1 ' using class End Using Using E1 End Using Using Main() ' using result of sub End Using Using AddressOf main ' using result of AddressOf End Using Using C1 ' using constant End Using End Sub Shared Sub Main() End Sub End Class </file> </compilation>) VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_ExpectedDotAfterMyClass, "MyClass"), Diagnostic(ERRID.ERR_ExpectedDotAfterMyBase, "MyBase"), Diagnostic(ERRID.ERR_ClassNotExpression1, "System.Exception").WithArguments("System.Exception"), Diagnostic(ERRID.ERR_ClassNotExpression1, "M1").WithArguments("M1"), Diagnostic(ERRID.ERR_NameNotDeclared1, "E1").WithArguments("E1"), Diagnostic(ERRID.ERR_VoidValue, "Main()"), Diagnostic(ERRID.ERR_VoidValue, "AddressOf main"), Diagnostic(ERRID.ERR_NameNotDeclared1, "C1").WithArguments("C1")) End Sub ' Take the parameter as object <Fact()> Public Sub BC30610ERR_BaseOnlyClassesMustBeExplicit2_TypeParameter() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40( <compilation name="BaseOnlyClassesMustBeExplicit2"> <file name="a.vb"> Class Gen(Of T) Public Shared Sub TestUsing(obj As T) Using obj End Using End Sub End Class </file> </compilation>) VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "obj").WithArguments("T")) End Sub ' Using block must implement the IDisposable interface <Fact()> Public Sub BC30610ERR_BaseOnlyClassesMustBeExplicit2_Invalid() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40( <compilation name="BaseOnlyClassesMustBeExplicit2"> <file name="a.vb"> Option Infer On Option Strict Off Class MyManagedClass1 Sub Dispose() End Sub End Class Class C1 Shared Sub main() Using mnObj = New MyManagedClass1() ' Invalid End Using Using mnObj1 As String = "123" ' Invalid End Using End Sub End Class </file> </compilation>) VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "mnObj = New MyManagedClass1()").WithArguments("MyManagedClass1"), Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "mnObj1 As String = ""123""").WithArguments("String")) End Sub ' Nullable type as resource <Fact()> Public Sub BC30610ERR_BaseOnlyClassesMustBeExplicit2_Invalid_Nullable() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40( <compilation name="BaseOnlyClassesMustBeExplicit2"> <file name="a.vb"> Option Infer On Option Strict Off Imports System Class C1 Shared mnObj As Nullable(Of MyManagedClass) Shared Sub main() Using mnObj ' Invalid End Using Using mnObj1 As Nullable(Of MyManagedClass) = Nothing ' Invalid End Using End Sub End Class Structure MyManagedClass Implements IDisposable Sub dispose() Implements IDisposable.Dispose End Sub End Structure </file> </compilation>) VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "mnObj").WithArguments("MyManagedClass?"), Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "mnObj1 As Nullable(Of MyManagedClass) = Nothing").WithArguments("MyManagedClass?"), Diagnostic(ERRID.WRN_MutableStructureInUsing, "mnObj1 As Nullable(Of MyManagedClass) = Nothing").WithArguments("mnObj1")) End Sub ' Using same named variables in different blocks <Fact()> Public Sub UsableScope() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40( <compilation name="UsableScope"> <file name="a.vb"> Imports System Structure cls1 Implements IDisposable Public Sub Dispose() Implements System.IDisposable.Dispose Console.WriteLine("Dispose") End Sub Sub New(ByRef x As cls1) x = Me End Sub Sub goo() Do Dim x As New cls1 Using x End Using Exit Do Loop For i As Integer = 1 To 1 Dim x As New cls1 Using x End Using Next While True Dim x As New cls1 Using x End Using Exit While End While End Sub Shared Sub Main() Dim x = New cls1() x.goo() End Sub End Structure </file> </compilation>) VerifyDiagnostics(compilation1) End Sub <Fact()> Public Sub LateBind() CompileAndVerify( <compilation name="LateBind"> <file name="a.vb"> Option Infer On Option Strict Off Imports System Class cls1 Implements IDisposable Public disposed As Boolean = False Public Sub Dispose() Implements System.IDisposable.Dispose disposed = True End Sub Public Function GetBoxedInstance() As Object Return Me End Function End Class Class C1 Sub Main() Dim o1 As New cls1 Using o1.GetBoxedInstance End Using Dim o2 As Object = New cls1 goo(o2) End Sub Sub goo(ByVal o As Object) Using o.GetBoxedInstance End Using End Sub End Class </file> </compilation>) End Sub ' The incorrect control flow (jumps outter to inner) <Fact()> Public Sub IncorrectJump() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime( <compilation name="IncorrectJump"> <file name="a.vb"> Imports System Module Program Sub Main(args As String()) Dim obj = New s1() Using obj Using obj GoTo label4 label5: End Using label4: GoTo label5 ' Invalid jumps from inner block into outer one (ok) and back(err) End Using End Sub End Module Structure s1 Implements IDisposable Sub Dispose() Implements IDisposable.Dispose End Sub End Structure </file> </compilation>) VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_GotoIntoUsing, "label5").WithArguments("label5")) End Sub ' Assigning stuff to the Using variable <Fact()> Public Sub Assignment() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime( <compilation name="Assignment"> <file name="a.vb"> Imports System Module Program Dim mnObj As MyManagedClass Sub GOO() Dim obj1 As New MyManagedClass Dim obj1a As New MyManagedClass Dim obj1b As MyManagedClass = obj1 Using obj1b obj1b = obj1a End Using Dim obj2 As New MyManagedClass Using obj2 obj2 = obj2 End Using End Sub Sub Main(args As String()) End Sub End Module Structure MyManagedClass Implements IDisposable Sub Dispose() Implements IDisposable.Dispose End Sub End Structure </file> </compilation>) VerifyDiagnostics(compilation1) End Sub ' Assigning stuff to the Using variable <Fact()> Public Sub Assignment_2() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime( <compilation name="Assignment"> <file name="a.vb"> Imports System Module Program Sub Main(args As String()) Dim obj1 As New MyManagedClass Dim obj1a As New MyManagedClass Dim obj1b As MyManagedClass = obj1 Using obj1b obj1a = obj1b End Using End Sub End Module Structure MyManagedClass Implements IDisposable Sub Dispose() Implements IDisposable.Dispose End Sub End Structure </file> </compilation>) VerifyDiagnostics(compilation1) End Sub <WorkItem(543059, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543059")> <Fact()> Public Sub MultipleResource() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime( <compilation> <file name="a.vb"> Option Infer On Imports System Class Program Shared Sub Main() Using x, = New MyManagedClass, y = New MyManagedClass1 End Using End Sub End Class Class MyManagedClass Implements System.IDisposable Sub Dispose() Implements System.IDisposable.Dispose System.Console.WriteLine("Dispose") End Sub End Class Class MyManagedClass1 Implements System.IDisposable Sub Dispose() Implements System.IDisposable.Dispose System.Console.WriteLine("Dispose1") End Sub End Class </file> </compilation>) CompilationUtils.AssertTheseDiagnostics(compilation1, <expected> BC36011: 'Using' resource variable must have an explicit initialization. Using x, = New MyManagedClass, y = New MyManagedClass1 ~ BC30671: Explicit initialization is not permitted with multiple variables declared with a single type specifier. Using x, = New MyManagedClass, y = New MyManagedClass1 ~~~~~~~~~~~~~~~~~~~~~~~ BC30203: Identifier expected. Using x, = New MyManagedClass, y = New MyManagedClass1 ~ </expected>) End Sub <WorkItem(543059, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543059")> <Fact()> Public Sub MultipleResource_2() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime( <compilation> <file name="a.vb"> Option Infer On Option Strict On Imports System Imports System.Collections.Generic Class Program Shared Sub Main() Dim objs = GetList() Using x As MyManagedClass = (From y In objs Select y).First, goo3, goo4 = x End Using End Sub Shared Function GetList() As List(Of MyManagedClass) Return Nothing End Function End Class Public Class MyManagedClass Implements System.IDisposable Public Sub Dispose() Implements System.IDisposable.Dispose Console.Write("Dispose") End Sub End Class </file> </compilation>) VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_ExpectedQueryableSource, "objs").WithArguments("System.Collections.Generic.List(Of MyManagedClass)"), Diagnostic(ERRID.ERR_InitWithMultipleDeclarators, "goo3, goo4 = x"), Diagnostic(ERRID.ERR_StrictDisallowImplicitObject, "goo3"), Diagnostic(ERRID.ERR_UsingResourceVarNeedsInitializer, "goo3"), Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "goo3").WithArguments("Object")) End Sub <WorkItem(528963, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/528963")> <Fact()> Public Sub InitWithMultipleDeclarators() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40( <compilation name="InitWithMultipleDeclarators"> <file name="a.vb"> Option Infer On Option Strict On Imports System Imports System.Collections.Generic Class Program Shared Sub Main() Dim objs = GetList() Using goo As MyManagedClass = New MyManagedClass(), goo3, goo4 As New MyManagedClass() Console.WriteLine("Inside Using.") End Using End Sub Shared Function GetList() As List(Of MyManagedClass) Return Nothing End Function End Class Public Class MyManagedClass Implements System.IDisposable Public Sub Dispose() Implements System.IDisposable.Dispose Console.Write("Dispose") End Sub End Class </file> </compilation>) VerifyDiagnostics(compilation1) End Sub ' Query expression in using statement <Fact()> Public Sub QueryInUsing() Dim compilation1 = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="QueryInUsing"> <file name="a.vb"> Option Infer On Option Strict On Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim objs = GetList() Using x As MyManagedClass = (From y In objs Select y).First End Using End Sub Shared Function GetList() As List(Of MyManagedClass) Return Nothing End Function End Class Public Class MyManagedClass Implements System.IDisposable Public Sub Dispose() Implements System.IDisposable.Dispose Console.Write("Dispose") End Sub End Class </file> </compilation>, {SystemCoreRef}) VerifyDiagnostics(compilation1) End Sub ' Error when using a lambda in a using() <Fact()> Public Sub LambdaInUsing() Dim compilation1 = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="LambdaInUsing"> <file name="a.vb"> Option Infer On Option Strict On Imports System Class Program Shared Sub Main() Using Function(x) x ' err End Using Using Function():End Function ' err End Using Using Function(x As MyManagedClass) x ' err End Using End Sub End Class Public Class MyManagedClass Implements System.IDisposable Public Sub Dispose() Implements System.IDisposable.Dispose Console.Write("Dispose") End Sub End Class </file> </compilation>, {SystemCoreRef}) VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_ExpectedExpression, ""), Diagnostic(ERRID.ERR_InvalidEndFunction, "End Function"), Diagnostic(ERRID.ERR_StrictDisallowImplicitObjectLambda, "x"), Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "Function(x) x").WithArguments("Function <generated method>(x As Object) As Object"), Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "Function()").WithArguments("Function <generated method>() As ?"), Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "Function(x As MyManagedClass) x").WithArguments("Function <generated method>(x As MyManagedClass) As MyManagedClass")) End Sub ' Anonymous types cannot appear in using <Fact()> Public Sub AnonymousInUsing() Dim compilation1 = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="AnonymousInUsing"> <file name="a.vb"> Option Infer On Option Strict On Class Program Shared Sub Main() Using c = New With {Key.p1 = 10.0, Key.p2 = "a"c} End Using End Sub End Class </file> </compilation>) VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "c = New With {Key.p1 = 10.0, Key.p2 = ""a""c}").WithArguments("<anonymous type: Key p1 As Double, Key p2 As Char>")) End Sub 'Anonymous Delegate in using block <WorkItem(528974, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/528974")> <Fact()> Public Sub AnonymousDelegateInUsing() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime( <compilation name="AnonymousDelegateInUsing"> <file name="a.vb"> Option Infer On Option Strict On Imports System Delegate Function D1(Of T)(t As T) As T Class A1 Private Shared Sub Goo(Of T As IDisposable)(x As T) Dim local As T = x Using t1 As T = DirectCast(Function(tt As T) x, D1(Of T))(x) ' warning End Using End Sub Shared Sub Main() End Sub End Class </file> </compilation>) VerifyDiagnostics(compilation, Diagnostic(ERRID.WRN_MutableGenericStructureInUsing, "t1 As T = DirectCast(Function(tt As T) x, D1(Of T))(x)").WithArguments("t1")) End Sub ' Using used before calling Mybase.New <WorkItem(10570, "DevDiv_Projects/Roslyn")> <Fact()> Public Sub UsingBeforeConstructCall() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime( <compilation name="UsingBeforeConstructCall"> <file name="a.vb"> Imports System Class cls1 Implements IDisposable Sub New() Using x as IDisposable = nothing MyBase.New() End Using End Sub Public Sub Dispose() Implements System.IDisposable.Dispose End Sub End Class Class cls2 Implements IDisposable Sub New() Using Me MyBase.New() End Using End Sub Public Sub Dispose() Implements System.IDisposable.Dispose End Sub End Class Class cls3 Implements IDisposable Sub New() Using MyBase.New() End Using End Sub Public Sub Dispose() Implements System.IDisposable.Dispose End Sub End Class </file> </compilation>) VerifyDiagnostics(compilation, Diagnostic(ERRID.ERR_InvalidConstructorCall, "MyBase.New"), Diagnostic(ERRID.ERR_InvalidConstructorCall, "MyBase.New"), Diagnostic(ERRID.ERR_InvalidConstructorCall, "MyBase.New")) End Sub <WorkItem(528975, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/528975")> <Fact> Public Sub InitMultipleResourceWithUsingDecl() CompileAndVerify( <compilation name="InitResourceWithUsingDecl"> <file name="a.vb"> Option Infer On Imports System Class Program Shared Sub Main() Dim x = 1 Using goo, goo2 As New MyManagedClass(x), goo3, goo4 As New MyManagedClass(x) Console.WriteLine("Inside Using.") End Using End Sub End Class Class MyManagedClass Implements System.IDisposable Sub New(x As Integer) End Sub Sub Dispose() Implements System.IDisposable.Dispose System.Console.WriteLine("Dispose") End Sub End Class </file> </compilation>) End Sub <WorkItem(543059, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543059")> <Fact()> Public Sub MultipleResource_3() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime( <compilation> <file name="a.vb"> Option Infer On Class Program Shared Sub Main() Using x, = New MyManagedClass, y = New MyManagedClass1 End Using End Sub End Class Class MyManagedClass Implements System.IDisposable Sub Dispose() Implements System.IDisposable.Dispose System.Console.WriteLine("Dispose") End Sub End Class Class MyManagedClass1 Implements System.IDisposable Sub Dispose() Implements System.IDisposable.Dispose System.Console.WriteLine("Dispose1") End Sub End Class </file> </compilation>) VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), Diagnostic(ERRID.ERR_InitWithMultipleDeclarators, "x, = New MyManagedClass"), Diagnostic(ERRID.ERR_UsingResourceVarNeedsInitializer, "x")) End Sub <WorkItem(543059, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543059")> <Fact()> Public Sub MultipleResource_4() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime( <compilation> <file name="a.vb"> Option Infer On Option Strict On Imports System Imports System.Collections.Generic Class Program Shared Sub Main() Dim objs = GetList() Using x As MyManagedClass = (From y In objs Select y).First, goo3, goo4 = x End Using End Sub Shared Function GetList() As List(Of MyManagedClass) Return Nothing End Function End Class Public Class MyManagedClass Implements System.IDisposable Public Sub Dispose() Implements System.IDisposable.Dispose Console.Write("Dispose") End Sub End Class </file> </compilation>) VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_ExpectedQueryableSource, "objs").WithArguments("System.Collections.Generic.List(Of MyManagedClass)"), Diagnostic(ERRID.ERR_InitWithMultipleDeclarators, "goo3, goo4 = x"), Diagnostic(ERRID.ERR_StrictDisallowImplicitObject, "goo3"), Diagnostic(ERRID.ERR_UsingResourceVarNeedsInitializer, "goo3"), Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "goo3").WithArguments("Object")) End Sub <WorkItem(529046, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/529046")> <Fact> Public Sub UsingOutOfMethod() CreateCompilationWithMscorlib40AndVBRuntime( <compilation name="SyncLockOutOfMethod"> <file name="a.vb"> Class m1 Using Nothing End Using End Class </file> </compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Using Nothing"), Diagnostic(ERRID.ERR_EndUsingWithoutUsing, "End Using")) End Sub <WorkItem(529046, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/529046")> <Fact> Public Sub UsingOutOfMethod_1() CreateCompilationWithMscorlib40AndVBRuntime( <compilation name="SyncLockOutOfMethod"> <file name="a.vb"> Using Nothing End Using </file> </compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Using Nothing"), Diagnostic(ERRID.ERR_EndUsingWithoutUsing, "End Using")) End Sub End Class End Namespace
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Compilers/CSharp/Portable/Symbols/Attributes/WellKnownAttributeData/PropertyEarlyWellKnownAttributeData.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Diagnostics; using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Text; namespace Microsoft.CodeAnalysis.CSharp.Symbols { /// <summary> /// Information decoded from early well-known custom attributes applied on a property. /// </summary> internal sealed class PropertyEarlyWellKnownAttributeData : CommonPropertyEarlyWellKnownAttributeData { #region IndexerNameAttribute private string _indexerName; public string IndexerName { get { VerifySealed(expected: true); return _indexerName; } set { VerifySealed(expected: false); Debug.Assert(value != null); // This can be false if there are duplicate IndexerNameAttributes. // Just ignore the second one and let a later pass report an // appropriate diagnostic. if (_indexerName == null) { _indexerName = value; SetDataStored(); } } } #endregion } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Diagnostics; using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Text; namespace Microsoft.CodeAnalysis.CSharp.Symbols { /// <summary> /// Information decoded from early well-known custom attributes applied on a property. /// </summary> internal sealed class PropertyEarlyWellKnownAttributeData : CommonPropertyEarlyWellKnownAttributeData { #region IndexerNameAttribute private string _indexerName; public string IndexerName { get { VerifySealed(expected: true); return _indexerName; } set { VerifySealed(expected: false); Debug.Assert(value != null); // This can be false if there are duplicate IndexerNameAttributes. // Just ignore the second one and let a later pass report an // appropriate diagnostic. if (_indexerName == null) { _indexerName = value; SetDataStored(); } } } #endregion } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Features/CSharp/Portable/Completion/KeywordRecommenders/AnnotationsKeywordRecommender.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Threading; using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; namespace Microsoft.CodeAnalysis.CSharp.Completion.KeywordRecommenders { internal class AnnotationsKeywordRecommender : AbstractSyntacticSingleKeywordRecommender { public AnnotationsKeywordRecommender() : base(SyntaxKind.AnnotationsKeyword, isValidInPreprocessorContext: true) { } protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken) { var previousToken1 = context.TargetToken; var previousToken2 = previousToken1.GetPreviousToken(includeSkipped: true); var previousToken3 = previousToken2.GetPreviousToken(includeSkipped: true); // # nullable enable | // # nullable enable a| return (previousToken1.Kind() == SyntaxKind.EnableKeyword || previousToken1.Kind() == SyntaxKind.DisableKeyword || previousToken1.Kind() == SyntaxKind.RestoreKeyword) && previousToken2.Kind() == SyntaxKind.NullableKeyword && previousToken3.Kind() == SyntaxKind.HashToken; } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Threading; using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; namespace Microsoft.CodeAnalysis.CSharp.Completion.KeywordRecommenders { internal class AnnotationsKeywordRecommender : AbstractSyntacticSingleKeywordRecommender { public AnnotationsKeywordRecommender() : base(SyntaxKind.AnnotationsKeyword, isValidInPreprocessorContext: true) { } protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken) { var previousToken1 = context.TargetToken; var previousToken2 = previousToken1.GetPreviousToken(includeSkipped: true); var previousToken3 = previousToken2.GetPreviousToken(includeSkipped: true); // # nullable enable | // # nullable enable a| return (previousToken1.Kind() == SyntaxKind.EnableKeyword || previousToken1.Kind() == SyntaxKind.DisableKeyword || previousToken1.Kind() == SyntaxKind.RestoreKeyword) && previousToken2.Kind() == SyntaxKind.NullableKeyword && previousToken3.Kind() == SyntaxKind.HashToken; } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/ConstructorSymbolReferenceFinder.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.LanguageServices; using Microsoft.CodeAnalysis.PooledObjects; using Microsoft.CodeAnalysis.Shared.Extensions; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.FindSymbols.Finders { internal class ConstructorSymbolReferenceFinder : AbstractReferenceFinder<IMethodSymbol> { public static readonly ConstructorSymbolReferenceFinder Instance = new(); private ConstructorSymbolReferenceFinder() { } protected override bool CanFind(IMethodSymbol symbol) => symbol.MethodKind switch { MethodKind.Constructor => true, MethodKind.StaticConstructor => true, _ => false, }; protected override Task<ImmutableArray<string>> DetermineGlobalAliasesAsync(IMethodSymbol symbol, Project project, CancellationToken cancellationToken) { var containingType = symbol.ContainingType; return GetAllMatchingGlobalAliasNamesAsync(project, containingType.Name, containingType.Arity, cancellationToken); } protected override async Task<ImmutableArray<Document>> DetermineDocumentsToSearchAsync( IMethodSymbol symbol, HashSet<string>? globalAliases, Project project, IImmutableSet<Document>? documents, FindReferencesSearchOptions options, CancellationToken cancellationToken) { var containingType = symbol.ContainingType; var typeName = symbol.ContainingType.Name; using var _ = ArrayBuilder<Document>.GetInstance(out var result); await AddDocumentsAsync( project, documents, typeName, result, cancellationToken).ConfigureAwait(false); if (globalAliases != null) { foreach (var globalAlias in globalAliases) { await AddDocumentsAsync( project, documents, globalAlias, result, cancellationToken).ConfigureAwait(false); } } result.AddRange(await FindDocumentsAsync( project, documents, containingType.SpecialType.ToPredefinedType(), cancellationToken).ConfigureAwait(false)); result.AddRange(await FindDocumentsWithGlobalAttributesAsync( project, documents, cancellationToken).ConfigureAwait(false)); result.AddRange(symbol.MethodKind == MethodKind.Constructor ? await FindDocumentsWithImplicitObjectCreationExpressionAsync(project, documents, cancellationToken).ConfigureAwait(false) : ImmutableArray<Document>.Empty); return result.ToImmutable(); } private static async Task AddDocumentsAsync( Project project, IImmutableSet<Document>? documents, string typeName, ArrayBuilder<Document> result, CancellationToken cancellationToken) { var documentsWithName = await FindDocumentsAsync(project, documents, cancellationToken, typeName).ConfigureAwait(false); var documentsWithAttribute = TryGetNameWithoutAttributeSuffix(typeName, project.LanguageServices.GetRequiredService<ISyntaxFactsService>(), out var simpleName) ? await FindDocumentsAsync(project, documents, cancellationToken, simpleName).ConfigureAwait(false) : ImmutableArray<Document>.Empty; result.AddRange(documentsWithName); result.AddRange(documentsWithAttribute); } private static bool IsPotentialReference( PredefinedType predefinedType, ISyntaxFactsService syntaxFacts, SyntaxToken token) { return syntaxFacts.TryGetPredefinedType(token, out var actualType) && predefinedType == actualType; } protected override async ValueTask<ImmutableArray<FinderLocation>> FindReferencesInDocumentAsync( IMethodSymbol methodSymbol, HashSet<string>? globalAliases, Document document, SemanticModel semanticModel, FindReferencesSearchOptions options, CancellationToken cancellationToken) { var syntaxFacts = document.GetRequiredLanguageService<ISyntaxFactsService>(); using var _1 = ArrayBuilder<FinderLocation>.GetInstance(out var result); var findParentNode = GetNamedTypeOrConstructorFindParentNodeFunction(document, methodSymbol); // First just look for this normal constructor references using the name of it's containing type. var name = methodSymbol.ContainingType.Name; await AddReferencesInDocumentWorkerAsync( methodSymbol, name, document, semanticModel, findParentNode, result, cancellationToken).ConfigureAwait(false); // Next, look for constructor references through a global alias to our containing type. if (globalAliases != null) { foreach (var globalAlias in globalAliases) { // ignore the cases where the global alias might match the type name (i.e. // global alias Console = System.Console). We'll already find those references // above. if (syntaxFacts.StringComparer.Equals(name, globalAlias)) continue; await AddReferencesInDocumentWorkerAsync( methodSymbol, globalAlias, document, semanticModel, findParentNode, result, cancellationToken).ConfigureAwait(false); } } // Nest, our containing type might itself have local aliases to it in this particular file. // If so, see what the local aliases are and then search for constructor references to that. using var _2 = ArrayBuilder<FinderLocation>.GetInstance(out var typeReferences); await NamedTypeSymbolReferenceFinder.AddReferencesToTypeOrGlobalAliasToItAsync( methodSymbol.ContainingType, globalAliases, document, semanticModel, typeReferences, cancellationToken).ConfigureAwait(false); var aliasReferences = await FindLocalAliasReferencesAsync( typeReferences, methodSymbol, document, semanticModel, findParentNode, cancellationToken).ConfigureAwait(false); // Finally, look for constructor references to predefined types (like `new int()`), // implicit object references, and inside global suppression attributes. result.AddRange(await FindPredefinedTypeReferencesAsync( methodSymbol, document, semanticModel, cancellationToken).ConfigureAwait(false)); result.AddRange(await FindReferencesInImplicitObjectCreationExpressionAsync( methodSymbol, document, semanticModel, cancellationToken).ConfigureAwait(false)); result.AddRange(await FindReferencesInDocumentInsideGlobalSuppressionsAsync( document, semanticModel, methodSymbol, cancellationToken).ConfigureAwait(false)); return result.ToImmutable(); } /// <summary> /// Finds references to <paramref name="symbol"/> in this <paramref name="document"/>, but /// only if it referenced though <paramref name="name"/> (which might be the actual name /// of the type, or a global alias to it). /// </summary> private static async Task AddReferencesInDocumentWorkerAsync( IMethodSymbol symbol, string name, Document document, SemanticModel semanticModel, Func<SyntaxToken, SyntaxNode>? findParentNode, ArrayBuilder<FinderLocation> result, CancellationToken cancellationToken) { result.AddRange(await FindOrdinaryReferencesAsync( symbol, name, document, semanticModel, findParentNode, cancellationToken).ConfigureAwait(false)); result.AddRange(await FindAttributeReferencesAsync( symbol, name, document, semanticModel, cancellationToken).ConfigureAwait(false)); } private static ValueTask<ImmutableArray<FinderLocation>> FindOrdinaryReferencesAsync( IMethodSymbol symbol, string name, Document document, SemanticModel semanticModel, Func<SyntaxToken, SyntaxNode>? findParentNode, CancellationToken cancellationToken) { return FindReferencesInDocumentUsingIdentifierAsync( symbol, name, document, semanticModel, findParentNode, cancellationToken); } private static ValueTask<ImmutableArray<FinderLocation>> FindPredefinedTypeReferencesAsync( IMethodSymbol symbol, Document document, SemanticModel semanticModel, CancellationToken cancellationToken) { var predefinedType = symbol.ContainingType.SpecialType.ToPredefinedType(); if (predefinedType == PredefinedType.None) { return new ValueTask<ImmutableArray<FinderLocation>>(ImmutableArray<FinderLocation>.Empty); } var syntaxFacts = document.GetRequiredLanguageService<ISyntaxFactsService>(); return FindReferencesInDocumentAsync(symbol, document, semanticModel, t => IsPotentialReference(predefinedType, syntaxFacts, t), cancellationToken); } private static ValueTask<ImmutableArray<FinderLocation>> FindAttributeReferencesAsync( IMethodSymbol symbol, string name, Document document, SemanticModel semanticModel, CancellationToken cancellationToken) { var syntaxFacts = document.GetRequiredLanguageService<ISyntaxFactsService>(); return TryGetNameWithoutAttributeSuffix(name, syntaxFacts, out var simpleName) ? FindReferencesInDocumentUsingIdentifierAsync(symbol, simpleName, document, semanticModel, cancellationToken) : new ValueTask<ImmutableArray<FinderLocation>>(ImmutableArray<FinderLocation>.Empty); } private Task<ImmutableArray<FinderLocation>> FindReferencesInImplicitObjectCreationExpressionAsync( IMethodSymbol symbol, Document document, SemanticModel semanticModel, CancellationToken cancellationToken) { // Only check `new (...)` calls that supply enough arguments to match all the required parameters for the constructor. var minimumArgumentCount = symbol.Parameters.Count(p => !p.IsOptional && !p.IsParams); var maximumArgumentCount = symbol.Parameters.Length > 0 && symbol.Parameters.Last().IsParams ? int.MaxValue : symbol.Parameters.Length; var exactArgumentCount = symbol.Parameters.Any(p => p.IsOptional || p.IsParams) ? -1 : symbol.Parameters.Length; return FindReferencesInDocumentAsync(document, IsRelevantDocument, CollectMatchingReferences, cancellationToken); static bool IsRelevantDocument(SyntaxTreeIndex syntaxTreeInfo) => syntaxTreeInfo.ContainsImplicitObjectCreation; void CollectMatchingReferences( SyntaxNode node, ISyntaxFactsService syntaxFacts, ISemanticFactsService semanticFacts, ArrayBuilder<FinderLocation> locations) { if (!syntaxFacts.IsImplicitObjectCreationExpression(node)) return; // if there are too few or too many arguments, then don't bother checking. var actualArgumentCount = syntaxFacts.GetArgumentsOfObjectCreationExpression(node).Count; if (actualArgumentCount < minimumArgumentCount || actualArgumentCount > maximumArgumentCount) return; // if we need an exact count then make sure that the count we have fits the count we need. if (exactArgumentCount != -1 && exactArgumentCount != actualArgumentCount) return; var constructor = semanticModel.GetSymbolInfo(node, cancellationToken).Symbol; if (Matches(constructor, symbol)) { var location = node.GetFirstToken().GetLocation(); var symbolUsageInfo = GetSymbolUsageInfo(node, semanticModel, syntaxFacts, semanticFacts, cancellationToken); locations.Add(new FinderLocation(node, new ReferenceLocation( document, alias: null, location, isImplicit: true, symbolUsageInfo, GetAdditionalFindUsagesProperties(node, semanticModel, syntaxFacts), CandidateReason.None))); } } } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.LanguageServices; using Microsoft.CodeAnalysis.PooledObjects; using Microsoft.CodeAnalysis.Shared.Extensions; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.FindSymbols.Finders { internal class ConstructorSymbolReferenceFinder : AbstractReferenceFinder<IMethodSymbol> { public static readonly ConstructorSymbolReferenceFinder Instance = new(); private ConstructorSymbolReferenceFinder() { } protected override bool CanFind(IMethodSymbol symbol) => symbol.MethodKind switch { MethodKind.Constructor => true, MethodKind.StaticConstructor => true, _ => false, }; protected override Task<ImmutableArray<string>> DetermineGlobalAliasesAsync(IMethodSymbol symbol, Project project, CancellationToken cancellationToken) { var containingType = symbol.ContainingType; return GetAllMatchingGlobalAliasNamesAsync(project, containingType.Name, containingType.Arity, cancellationToken); } protected override async Task<ImmutableArray<Document>> DetermineDocumentsToSearchAsync( IMethodSymbol symbol, HashSet<string>? globalAliases, Project project, IImmutableSet<Document>? documents, FindReferencesSearchOptions options, CancellationToken cancellationToken) { var containingType = symbol.ContainingType; var typeName = symbol.ContainingType.Name; using var _ = ArrayBuilder<Document>.GetInstance(out var result); await AddDocumentsAsync( project, documents, typeName, result, cancellationToken).ConfigureAwait(false); if (globalAliases != null) { foreach (var globalAlias in globalAliases) { await AddDocumentsAsync( project, documents, globalAlias, result, cancellationToken).ConfigureAwait(false); } } result.AddRange(await FindDocumentsAsync( project, documents, containingType.SpecialType.ToPredefinedType(), cancellationToken).ConfigureAwait(false)); result.AddRange(await FindDocumentsWithGlobalAttributesAsync( project, documents, cancellationToken).ConfigureAwait(false)); result.AddRange(symbol.MethodKind == MethodKind.Constructor ? await FindDocumentsWithImplicitObjectCreationExpressionAsync(project, documents, cancellationToken).ConfigureAwait(false) : ImmutableArray<Document>.Empty); return result.ToImmutable(); } private static async Task AddDocumentsAsync( Project project, IImmutableSet<Document>? documents, string typeName, ArrayBuilder<Document> result, CancellationToken cancellationToken) { var documentsWithName = await FindDocumentsAsync(project, documents, cancellationToken, typeName).ConfigureAwait(false); var documentsWithAttribute = TryGetNameWithoutAttributeSuffix(typeName, project.LanguageServices.GetRequiredService<ISyntaxFactsService>(), out var simpleName) ? await FindDocumentsAsync(project, documents, cancellationToken, simpleName).ConfigureAwait(false) : ImmutableArray<Document>.Empty; result.AddRange(documentsWithName); result.AddRange(documentsWithAttribute); } private static bool IsPotentialReference( PredefinedType predefinedType, ISyntaxFactsService syntaxFacts, SyntaxToken token) { return syntaxFacts.TryGetPredefinedType(token, out var actualType) && predefinedType == actualType; } protected override async ValueTask<ImmutableArray<FinderLocation>> FindReferencesInDocumentAsync( IMethodSymbol methodSymbol, HashSet<string>? globalAliases, Document document, SemanticModel semanticModel, FindReferencesSearchOptions options, CancellationToken cancellationToken) { var syntaxFacts = document.GetRequiredLanguageService<ISyntaxFactsService>(); using var _1 = ArrayBuilder<FinderLocation>.GetInstance(out var result); var findParentNode = GetNamedTypeOrConstructorFindParentNodeFunction(document, methodSymbol); // First just look for this normal constructor references using the name of it's containing type. var name = methodSymbol.ContainingType.Name; await AddReferencesInDocumentWorkerAsync( methodSymbol, name, document, semanticModel, findParentNode, result, cancellationToken).ConfigureAwait(false); // Next, look for constructor references through a global alias to our containing type. if (globalAliases != null) { foreach (var globalAlias in globalAliases) { // ignore the cases where the global alias might match the type name (i.e. // global alias Console = System.Console). We'll already find those references // above. if (syntaxFacts.StringComparer.Equals(name, globalAlias)) continue; await AddReferencesInDocumentWorkerAsync( methodSymbol, globalAlias, document, semanticModel, findParentNode, result, cancellationToken).ConfigureAwait(false); } } // Nest, our containing type might itself have local aliases to it in this particular file. // If so, see what the local aliases are and then search for constructor references to that. using var _2 = ArrayBuilder<FinderLocation>.GetInstance(out var typeReferences); await NamedTypeSymbolReferenceFinder.AddReferencesToTypeOrGlobalAliasToItAsync( methodSymbol.ContainingType, globalAliases, document, semanticModel, typeReferences, cancellationToken).ConfigureAwait(false); var aliasReferences = await FindLocalAliasReferencesAsync( typeReferences, methodSymbol, document, semanticModel, findParentNode, cancellationToken).ConfigureAwait(false); // Finally, look for constructor references to predefined types (like `new int()`), // implicit object references, and inside global suppression attributes. result.AddRange(await FindPredefinedTypeReferencesAsync( methodSymbol, document, semanticModel, cancellationToken).ConfigureAwait(false)); result.AddRange(await FindReferencesInImplicitObjectCreationExpressionAsync( methodSymbol, document, semanticModel, cancellationToken).ConfigureAwait(false)); result.AddRange(await FindReferencesInDocumentInsideGlobalSuppressionsAsync( document, semanticModel, methodSymbol, cancellationToken).ConfigureAwait(false)); return result.ToImmutable(); } /// <summary> /// Finds references to <paramref name="symbol"/> in this <paramref name="document"/>, but /// only if it referenced though <paramref name="name"/> (which might be the actual name /// of the type, or a global alias to it). /// </summary> private static async Task AddReferencesInDocumentWorkerAsync( IMethodSymbol symbol, string name, Document document, SemanticModel semanticModel, Func<SyntaxToken, SyntaxNode>? findParentNode, ArrayBuilder<FinderLocation> result, CancellationToken cancellationToken) { result.AddRange(await FindOrdinaryReferencesAsync( symbol, name, document, semanticModel, findParentNode, cancellationToken).ConfigureAwait(false)); result.AddRange(await FindAttributeReferencesAsync( symbol, name, document, semanticModel, cancellationToken).ConfigureAwait(false)); } private static ValueTask<ImmutableArray<FinderLocation>> FindOrdinaryReferencesAsync( IMethodSymbol symbol, string name, Document document, SemanticModel semanticModel, Func<SyntaxToken, SyntaxNode>? findParentNode, CancellationToken cancellationToken) { return FindReferencesInDocumentUsingIdentifierAsync( symbol, name, document, semanticModel, findParentNode, cancellationToken); } private static ValueTask<ImmutableArray<FinderLocation>> FindPredefinedTypeReferencesAsync( IMethodSymbol symbol, Document document, SemanticModel semanticModel, CancellationToken cancellationToken) { var predefinedType = symbol.ContainingType.SpecialType.ToPredefinedType(); if (predefinedType == PredefinedType.None) { return new ValueTask<ImmutableArray<FinderLocation>>(ImmutableArray<FinderLocation>.Empty); } var syntaxFacts = document.GetRequiredLanguageService<ISyntaxFactsService>(); return FindReferencesInDocumentAsync(symbol, document, semanticModel, t => IsPotentialReference(predefinedType, syntaxFacts, t), cancellationToken); } private static ValueTask<ImmutableArray<FinderLocation>> FindAttributeReferencesAsync( IMethodSymbol symbol, string name, Document document, SemanticModel semanticModel, CancellationToken cancellationToken) { var syntaxFacts = document.GetRequiredLanguageService<ISyntaxFactsService>(); return TryGetNameWithoutAttributeSuffix(name, syntaxFacts, out var simpleName) ? FindReferencesInDocumentUsingIdentifierAsync(symbol, simpleName, document, semanticModel, cancellationToken) : new ValueTask<ImmutableArray<FinderLocation>>(ImmutableArray<FinderLocation>.Empty); } private Task<ImmutableArray<FinderLocation>> FindReferencesInImplicitObjectCreationExpressionAsync( IMethodSymbol symbol, Document document, SemanticModel semanticModel, CancellationToken cancellationToken) { // Only check `new (...)` calls that supply enough arguments to match all the required parameters for the constructor. var minimumArgumentCount = symbol.Parameters.Count(p => !p.IsOptional && !p.IsParams); var maximumArgumentCount = symbol.Parameters.Length > 0 && symbol.Parameters.Last().IsParams ? int.MaxValue : symbol.Parameters.Length; var exactArgumentCount = symbol.Parameters.Any(p => p.IsOptional || p.IsParams) ? -1 : symbol.Parameters.Length; return FindReferencesInDocumentAsync(document, IsRelevantDocument, CollectMatchingReferences, cancellationToken); static bool IsRelevantDocument(SyntaxTreeIndex syntaxTreeInfo) => syntaxTreeInfo.ContainsImplicitObjectCreation; void CollectMatchingReferences( SyntaxNode node, ISyntaxFactsService syntaxFacts, ISemanticFactsService semanticFacts, ArrayBuilder<FinderLocation> locations) { if (!syntaxFacts.IsImplicitObjectCreationExpression(node)) return; // if there are too few or too many arguments, then don't bother checking. var actualArgumentCount = syntaxFacts.GetArgumentsOfObjectCreationExpression(node).Count; if (actualArgumentCount < minimumArgumentCount || actualArgumentCount > maximumArgumentCount) return; // if we need an exact count then make sure that the count we have fits the count we need. if (exactArgumentCount != -1 && exactArgumentCount != actualArgumentCount) return; var constructor = semanticModel.GetSymbolInfo(node, cancellationToken).Symbol; if (Matches(constructor, symbol)) { var location = node.GetFirstToken().GetLocation(); var symbolUsageInfo = GetSymbolUsageInfo(node, semanticModel, syntaxFacts, semanticFacts, cancellationToken); locations.Add(new FinderLocation(node, new ReferenceLocation( document, alias: null, location, isImplicit: true, symbolUsageInfo, GetAdditionalFindUsagesProperties(node, semanticModel, syntaxFacts), CandidateReason.None))); } } } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Compilers/CSharp/Test/Semantic/Semantics/RecordStructTests.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using System.Threading; using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE; using Microsoft.CodeAnalysis.CSharp.Symbols.Retargeting; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Test.Utilities; using Roslyn.Test.Utilities; using Roslyn.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.CSharp.UnitTests.Semantics { [CompilerTrait(CompilerFeature.RecordStructs)] public class RecordStructTests : CompilingTestBase { private static CSharpCompilation CreateCompilation(CSharpTestSource source) => CSharpTestBase.CreateCompilation(new[] { source, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview); private CompilationVerifier CompileAndVerify( CSharpTestSource src, string? expectedOutput = null, IEnumerable<MetadataReference>? references = null) => base.CompileAndVerify( new[] { src, IsExternalInitTypeDefinition }, expectedOutput: expectedOutput, parseOptions: TestOptions.RegularPreview, references: references, // init-only is unverifiable verify: Verification.Skipped); [Fact] public void StructRecord1() { var src = @" record struct Point(int X, int Y);"; var verifier = CompileAndVerify(src).VerifyDiagnostics(); verifier.VerifyIL("Point.Equals(object)", @" { // Code size 23 (0x17) .maxstack 2 IL_0000: ldarg.1 IL_0001: isinst ""Point"" IL_0006: brfalse.s IL_0015 IL_0008: ldarg.0 IL_0009: ldarg.1 IL_000a: unbox.any ""Point"" IL_000f: call ""readonly bool Point.Equals(Point)"" IL_0014: ret IL_0015: ldc.i4.0 IL_0016: ret }"); verifier.VerifyIL("Point.Equals(Point)", @" { // Code size 49 (0x31) .maxstack 3 IL_0000: call ""System.Collections.Generic.EqualityComparer<int> System.Collections.Generic.EqualityComparer<int>.Default.get"" IL_0005: ldarg.0 IL_0006: ldfld ""int Point.<X>k__BackingField"" IL_000b: ldarg.1 IL_000c: ldfld ""int Point.<X>k__BackingField"" IL_0011: callvirt ""bool System.Collections.Generic.EqualityComparer<int>.Equals(int, int)"" IL_0016: brfalse.s IL_002f IL_0018: call ""System.Collections.Generic.EqualityComparer<int> System.Collections.Generic.EqualityComparer<int>.Default.get"" IL_001d: ldarg.0 IL_001e: ldfld ""int Point.<Y>k__BackingField"" IL_0023: ldarg.1 IL_0024: ldfld ""int Point.<Y>k__BackingField"" IL_0029: callvirt ""bool System.Collections.Generic.EqualityComparer<int>.Equals(int, int)"" IL_002e: ret IL_002f: ldc.i4.0 IL_0030: ret }"); } [Fact] public void StructRecord2() { var src = @" using System; record struct S(int X, int Y) { public static void Main() { var s1 = new S(0, 1); var s2 = new S(0, 1); Console.WriteLine(s1.X); Console.WriteLine(s1.Y); Console.WriteLine(s1.Equals(s2)); Console.WriteLine(s1.Equals(new S(1, 0))); } }"; var verifier = CompileAndVerify(src, expectedOutput: @"0 1 True False").VerifyDiagnostics(); } [Fact] public void StructRecord3() { var src = @" using System; record struct S(int X, int Y) { public bool Equals(S s) => false; public static void Main() { var s1 = new S(0, 1); Console.WriteLine(s1.Equals(s1)); } }"; var verifier = CompileAndVerify(src, expectedOutput: @"False") .VerifyDiagnostics( // (5,17): warning CS8851: 'S' defines 'Equals' but not 'GetHashCode' // public bool Equals(S s) => false; Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("S").WithLocation(5, 17)); verifier.VerifyIL("S.Main", @" { // Code size 23 (0x17) .maxstack 3 .locals init (S V_0) //s1 IL_0000: ldloca.s V_0 IL_0002: ldc.i4.0 IL_0003: ldc.i4.1 IL_0004: call ""S..ctor(int, int)"" IL_0009: ldloca.s V_0 IL_000b: ldloc.0 IL_000c: call ""bool S.Equals(S)"" IL_0011: call ""void System.Console.WriteLine(bool)"" IL_0016: ret }"); } [Fact] public void StructRecord5() { var src = @" using System; record struct S(int X, int Y) { public bool Equals(S s) { Console.Write(""s""); return true; } public static void Main() { var s1 = new S(0, 1); s1.Equals((object)s1); s1.Equals(s1); } }"; CompileAndVerify(src, expectedOutput: @"ss") .VerifyDiagnostics( // (5,17): warning CS8851: 'S' defines 'Equals' but not 'GetHashCode' // public bool Equals(S s) Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("S").WithLocation(5, 17)); } [Fact] public void StructRecordDefaultCtor() { const string src = @" public record struct S(int X);"; const string src2 = @" class C { public S M() => new S(); }"; var comp = CreateCompilation(src + src2); comp.VerifyDiagnostics(); comp = CreateCompilation(src); var comp2 = CreateCompilation(src2, references: new[] { comp.EmitToImageReference() }); comp2.VerifyDiagnostics(); } [Fact] public void Equality_01() { var source = @"using static System.Console; record struct S; class Program { static void Main() { var x = new S(); var y = new S(); WriteLine(x.Equals(y)); WriteLine(((object)x).Equals(y)); } }"; var comp = CreateCompilation(source, parseOptions: TestOptions.RegularPreview, options: TestOptions.ReleaseExe); var verifier = CompileAndVerify(comp, expectedOutput: @"True True").VerifyDiagnostics(); verifier.VerifyIL("S.Equals(S)", @" { // Code size 2 (0x2) .maxstack 1 IL_0000: ldc.i4.1 IL_0001: ret }"); verifier.VerifyIL("S.Equals(object)", @" { // Code size 23 (0x17) .maxstack 2 IL_0000: ldarg.1 IL_0001: isinst ""S"" IL_0006: brfalse.s IL_0015 IL_0008: ldarg.0 IL_0009: ldarg.1 IL_000a: unbox.any ""S"" IL_000f: call ""readonly bool S.Equals(S)"" IL_0014: ret IL_0015: ldc.i4.0 IL_0016: ret }"); } [Fact] public void RecordStructLanguageVersion() { var src1 = @" struct Point(int x, int y); "; var src2 = @" record struct Point { } "; var src3 = @" record struct Point(int x, int y); "; var comp = CreateCompilation(new[] { src1, IsExternalInitTypeDefinition }, parseOptions: TestOptions.Regular9, options: TestOptions.ReleaseDll); comp.VerifyDiagnostics( // (2,13): error CS1514: { expected // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_LbraceExpected, "(").WithLocation(2, 13), // (2,13): error CS1513: } expected // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_RbraceExpected, "(").WithLocation(2, 13), // (2,13): error CS8803: Top-level statements must precede namespace and type declarations. // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "(int x, int y);").WithLocation(2, 13), // (2,13): error CS8805: Program using top-level statements must be an executable. // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_SimpleProgramNotAnExecutable, "(int x, int y);").WithLocation(2, 13), // (2,13): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_IllegalStatement, "(int x, int y)").WithLocation(2, 13), // (2,14): error CS8185: A declaration is not allowed in this context. // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_DeclarationExpressionNotPermitted, "int x").WithLocation(2, 14), // (2,14): error CS0165: Use of unassigned local variable 'x' // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_UseDefViolation, "int x").WithArguments("x").WithLocation(2, 14), // (2,21): error CS8185: A declaration is not allowed in this context. // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_DeclarationExpressionNotPermitted, "int y").WithLocation(2, 21), // (2,21): error CS0165: Use of unassigned local variable 'y' // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_UseDefViolation, "int y").WithArguments("y").WithLocation(2, 21) ); comp = CreateCompilation(new[] { src2, IsExternalInitTypeDefinition }, parseOptions: TestOptions.Regular9, options: TestOptions.ReleaseDll); comp.VerifyDiagnostics( // (2,8): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct Point { } Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(2, 8) ); comp = CreateCompilation(new[] { src3, IsExternalInitTypeDefinition }, parseOptions: TestOptions.Regular9, options: TestOptions.ReleaseDll); comp.VerifyDiagnostics( // (2,8): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct Point { } Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(2, 8) ); comp = CreateCompilation(new[] { src1, IsExternalInitTypeDefinition }, parseOptions: TestOptions.Regular10, options: TestOptions.ReleaseDll); comp.VerifyDiagnostics( // (2,13): error CS1514: { expected // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_LbraceExpected, "(").WithLocation(2, 13), // (2,13): error CS1513: } expected // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_RbraceExpected, "(").WithLocation(2, 13), // (2,13): error CS8803: Top-level statements must precede namespace and type declarations. // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "(int x, int y);").WithLocation(2, 13), // (2,13): error CS8805: Program using top-level statements must be an executable. // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_SimpleProgramNotAnExecutable, "(int x, int y);").WithLocation(2, 13), // (2,13): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_IllegalStatement, "(int x, int y)").WithLocation(2, 13), // (2,14): error CS8185: A declaration is not allowed in this context. // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_DeclarationExpressionNotPermitted, "int x").WithLocation(2, 14), // (2,14): error CS0165: Use of unassigned local variable 'x' // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_UseDefViolation, "int x").WithArguments("x").WithLocation(2, 14), // (2,21): error CS8185: A declaration is not allowed in this context. // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_DeclarationExpressionNotPermitted, "int y").WithLocation(2, 21), // (2,21): error CS0165: Use of unassigned local variable 'y' // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_UseDefViolation, "int y").WithArguments("y").WithLocation(2, 21) ); comp = CreateCompilation(new[] { src2, IsExternalInitTypeDefinition }, parseOptions: TestOptions.Regular10, options: TestOptions.ReleaseDll); comp.VerifyDiagnostics(); comp = CreateCompilation(new[] { src3, IsExternalInitTypeDefinition }, parseOptions: TestOptions.Regular10, options: TestOptions.ReleaseDll); comp.VerifyDiagnostics(); } [Fact] public void RecordStructLanguageVersion_Nested() { var src1 = @" class C { struct Point(int x, int y); } "; var src2 = @" class D { record struct Point { } } "; var src3 = @" struct E { record struct Point(int x, int y); } "; var src4 = @" namespace NS { record struct Point { } } "; var comp = CreateCompilation(src1, parseOptions: TestOptions.Regular9); comp.VerifyDiagnostics( // (4,17): error CS1514: { expected // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_LbraceExpected, "(").WithLocation(4, 17), // (4,17): error CS1513: } expected // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_RbraceExpected, "(").WithLocation(4, 17), // (4,31): error CS1519: Invalid token ';' in class, record, struct, or interface member declaration // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_InvalidMemberDecl, ";").WithArguments(";").WithLocation(4, 31), // (4,31): error CS1519: Invalid token ';' in class, record, struct, or interface member declaration // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_InvalidMemberDecl, ";").WithArguments(";").WithLocation(4, 31) ); comp = CreateCompilation(new[] { src2, IsExternalInitTypeDefinition }, parseOptions: TestOptions.Regular9); comp.VerifyDiagnostics( // (4,12): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct Point { } Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(4, 12) ); comp = CreateCompilation(new[] { src3, IsExternalInitTypeDefinition }, parseOptions: TestOptions.Regular9); comp.VerifyDiagnostics( // (4,12): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct Point(int x, int y); Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(4, 12) ); comp = CreateCompilation(src4, parseOptions: TestOptions.Regular9); comp.VerifyDiagnostics( // (4,12): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct Point { } Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(4, 12) ); comp = CreateCompilation(src1); comp.VerifyDiagnostics( // (4,17): error CS1514: { expected // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_LbraceExpected, "(").WithLocation(4, 17), // (4,17): error CS1513: } expected // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_RbraceExpected, "(").WithLocation(4, 17), // (4,31): error CS1519: Invalid token ';' in class, record, struct, or interface member declaration // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_InvalidMemberDecl, ";").WithArguments(";").WithLocation(4, 31), // (4,31): error CS1519: Invalid token ';' in class, record, struct, or interface member declaration // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_InvalidMemberDecl, ";").WithArguments(";").WithLocation(4, 31) ); comp = CreateCompilation(src2); comp.VerifyDiagnostics(); comp = CreateCompilation(src3); comp.VerifyDiagnostics(); comp = CreateCompilation(src4); comp.VerifyDiagnostics(); } [Fact] public void TypeDeclaration_IsStruct() { var src = @" record struct Point(int x, int y); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); CompileAndVerify(comp, symbolValidator: validateModule, sourceSymbolValidator: validateModule); Assert.True(SyntaxFacts.IsTypeDeclaration(SyntaxKind.RecordStructDeclaration)); static void validateModule(ModuleSymbol module) { var isSourceSymbol = module is SourceModuleSymbol; var point = module.GlobalNamespace.GetTypeMember("Point"); Assert.True(point.IsValueType); Assert.False(point.IsReferenceType); Assert.False(point.IsRecord); Assert.Equal(TypeKind.Struct, point.TypeKind); Assert.Equal(SpecialType.System_ValueType, point.BaseTypeNoUseSiteDiagnostics.SpecialType); Assert.Equal("Point", point.ToTestDisplayString()); if (isSourceSymbol) { Assert.True(point is SourceNamedTypeSymbol); Assert.True(point.IsRecordStruct); Assert.True(point.GetPublicSymbol().IsRecord); Assert.Equal("record struct Point", point.ToDisplayString(SymbolDisplayFormat.TestFormat.AddKindOptions(SymbolDisplayKindOptions.IncludeTypeKeyword))); } else { Assert.True(point is PENamedTypeSymbol); Assert.False(point.IsRecordStruct); Assert.False(point.GetPublicSymbol().IsRecord); Assert.Equal("struct Point", point.ToDisplayString(SymbolDisplayFormat.TestFormat.AddKindOptions(SymbolDisplayKindOptions.IncludeTypeKeyword))); } } } [Fact] public void TypeDeclaration_IsStruct_InConstraints() { var src = @" record struct Point(int x, int y); class C<T> where T : struct { void M(C<Point> c) { } } class C2<T> where T : new() { void M(C2<Point> c) { } } class C3<T> where T : class { void M(C3<Point> c) { } // 1 } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (16,22): error CS0452: The type 'Point' must be a reference type in order to use it as parameter 'T' in the generic type or method 'C3<T>' // void M(C3<Point> c) { } // 1 Diagnostic(ErrorCode.ERR_RefConstraintNotSatisfied, "c").WithArguments("C3<T>", "T", "Point").WithLocation(16, 22) ); } [Fact] public void TypeDeclaration_IsStruct_Unmanaged() { var src = @" record struct Point(int x, int y); record struct Point2(string x, string y); class C<T> where T : unmanaged { void M(C<Point> c) { } void M2(C<Point2> c) { } // 1 } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (8,23): error CS8377: The type 'Point2' must be a non-nullable value type, along with all fields at any level of nesting, in order to use it as parameter 'T' in the generic type or method 'C<T>' // void M2(C<Point2> c) { } // 1 Diagnostic(ErrorCode.ERR_UnmanagedConstraintNotSatisfied, "c").WithArguments("C<T>", "T", "Point2").WithLocation(8, 23) ); } [Fact] public void IsRecord_Generic() { var src = @" record struct Point<T>(T x, T y); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); CompileAndVerify(comp, symbolValidator: validateModule, sourceSymbolValidator: validateModule); static void validateModule(ModuleSymbol module) { var isSourceSymbol = module is SourceModuleSymbol; var point = module.GlobalNamespace.GetTypeMember("Point"); Assert.True(point.IsValueType); Assert.False(point.IsReferenceType); Assert.False(point.IsRecord); Assert.Equal(TypeKind.Struct, point.TypeKind); Assert.Equal(SpecialType.System_ValueType, point.BaseTypeNoUseSiteDiagnostics.SpecialType); Assert.True(SyntaxFacts.IsTypeDeclaration(SyntaxKind.RecordStructDeclaration)); if (isSourceSymbol) { Assert.True(point is SourceNamedTypeSymbol); Assert.True(point.IsRecordStruct); Assert.True(point.GetPublicSymbol().IsRecord); } else { Assert.True(point is PENamedTypeSymbol); Assert.False(point.IsRecordStruct); Assert.False(point.GetPublicSymbol().IsRecord); } } } [Fact] public void IsRecord_Retargeting() { var src = @" public record struct Point(int x, int y); "; var comp = CreateCompilation(src, targetFramework: TargetFramework.Mscorlib40); var comp2 = CreateCompilation("", targetFramework: TargetFramework.Mscorlib46, references: new[] { comp.ToMetadataReference() }); var point = comp2.GlobalNamespace.GetTypeMember("Point"); Assert.Equal("Point", point.ToTestDisplayString()); Assert.IsType<RetargetingNamedTypeSymbol>(point); Assert.True(point.IsRecordStruct); Assert.True(point.GetPublicSymbol().IsRecord); } [Fact] public void IsRecord_AnonymousType() { var src = @" class C { void M() { var x = new { X = 1 }; } } "; var comp = CreateCompilation(src); var tree = comp.SyntaxTrees.First(); var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); var creation = tree.GetRoot().DescendantNodes().OfType<AnonymousObjectCreationExpressionSyntax>().Single(); var type = model.GetTypeInfo(creation).Type!; Assert.Equal("<anonymous type: System.Int32 X>", type.ToTestDisplayString()); Assert.IsType<AnonymousTypeManager.AnonymousTypePublicSymbol>(((Symbols.PublicModel.NonErrorNamedTypeSymbol)type).UnderlyingNamedTypeSymbol); Assert.False(type.IsRecord); } [Fact] public void IsRecord_ErrorType() { var src = @" class C { Error M() => throw null; } "; var comp = CreateCompilation(src); var tree = comp.SyntaxTrees.First(); var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); var method = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(); var type = model.GetDeclaredSymbol(method)!.ReturnType; Assert.Equal("Error", type.ToTestDisplayString()); Assert.IsType<ExtendedErrorTypeSymbol>(((Symbols.PublicModel.ErrorTypeSymbol)type).UnderlyingNamedTypeSymbol); Assert.False(type.IsRecord); } [Fact] public void IsRecord_Pointer() { var src = @" class C { int* M() => throw null; } "; var comp = CreateCompilation(src, options: TestOptions.UnsafeReleaseDll); var tree = comp.SyntaxTrees.First(); var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); var method = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(); var type = model.GetDeclaredSymbol(method)!.ReturnType; Assert.Equal("System.Int32*", type.ToTestDisplayString()); Assert.IsType<PointerTypeSymbol>(((Symbols.PublicModel.PointerTypeSymbol)type).UnderlyingTypeSymbol); Assert.False(type.IsRecord); } [Fact] public void IsRecord_Dynamic() { var src = @" class C { void M(dynamic d) { } } "; var comp = CreateCompilation(src); var tree = comp.SyntaxTrees.First(); var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); var method = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(); var type = model.GetDeclaredSymbol(method)!.GetParameterType(0); Assert.Equal("dynamic", type.ToTestDisplayString()); Assert.IsType<DynamicTypeSymbol>(((Symbols.PublicModel.DynamicTypeSymbol)type).UnderlyingTypeSymbol); Assert.False(type.IsRecord); } [Fact] public void TypeDeclaration_MayNotHaveBaseType() { var src = @" record struct Point(int x, int y) : object; record struct Point2(int x, int y) : System.ValueType; "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,37): error CS0527: Type 'object' in interface list is not an interface // record struct Point(int x, int y) : object; Diagnostic(ErrorCode.ERR_NonInterfaceInInterfaceList, "object").WithArguments("object").WithLocation(2, 37), // (3,38): error CS0527: Type 'ValueType' in interface list is not an interface // record struct Point2(int x, int y) : System.ValueType; Diagnostic(ErrorCode.ERR_NonInterfaceInInterfaceList, "System.ValueType").WithArguments("System.ValueType").WithLocation(3, 38) ); } [Fact] public void TypeDeclaration_MayNotHaveTypeConstraintsWithoutTypeParameters() { var src = @" record struct Point(int x, int y) where T : struct; "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,35): error CS0080: Constraints are not allowed on non-generic declarations // record struct Point(int x, int y) where T : struct; Diagnostic(ErrorCode.ERR_ConstraintOnlyAllowedOnGenericDecl, "where").WithLocation(2, 35) ); } [Fact] public void TypeDeclaration_AllowedModifiers() { var src = @" readonly partial record struct S1; public record struct S2; internal record struct S3; public class Base { public int S6; } public class C : Base { private protected record struct S4; protected internal record struct S5; new record struct S6; } unsafe record struct S7; "; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview, options: TestOptions.UnsafeDebugDll); comp.VerifyDiagnostics(); Assert.Equal(Accessibility.Internal, comp.GlobalNamespace.GetTypeMember("S1").DeclaredAccessibility); Assert.Equal(Accessibility.Public, comp.GlobalNamespace.GetTypeMember("S2").DeclaredAccessibility); Assert.Equal(Accessibility.Internal, comp.GlobalNamespace.GetTypeMember("S3").DeclaredAccessibility); Assert.Equal(Accessibility.ProtectedAndInternal, comp.GlobalNamespace.GetTypeMember("C").GetTypeMember("S4").DeclaredAccessibility); Assert.Equal(Accessibility.ProtectedOrInternal, comp.GlobalNamespace.GetTypeMember("C").GetTypeMember("S5").DeclaredAccessibility); } [Fact] public void TypeDeclaration_DisallowedModifiers() { var src = @" abstract record struct S1; volatile record struct S2; extern record struct S3; virtual record struct S4; override record struct S5; async record struct S6; ref record struct S7; unsafe record struct S8; static record struct S9; sealed record struct S10; "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,24): error CS0106: The modifier 'abstract' is not valid for this item // abstract record struct S1; Diagnostic(ErrorCode.ERR_BadMemberFlag, "S1").WithArguments("abstract").WithLocation(2, 24), // (3,24): error CS0106: The modifier 'volatile' is not valid for this item // volatile record struct S2; Diagnostic(ErrorCode.ERR_BadMemberFlag, "S2").WithArguments("volatile").WithLocation(3, 24), // (4,22): error CS0106: The modifier 'extern' is not valid for this item // extern record struct S3; Diagnostic(ErrorCode.ERR_BadMemberFlag, "S3").WithArguments("extern").WithLocation(4, 22), // (5,23): error CS0106: The modifier 'virtual' is not valid for this item // virtual record struct S4; Diagnostic(ErrorCode.ERR_BadMemberFlag, "S4").WithArguments("virtual").WithLocation(5, 23), // (6,24): error CS0106: The modifier 'override' is not valid for this item // override record struct S5; Diagnostic(ErrorCode.ERR_BadMemberFlag, "S5").WithArguments("override").WithLocation(6, 24), // (7,21): error CS0106: The modifier 'async' is not valid for this item // async record struct S6; Diagnostic(ErrorCode.ERR_BadMemberFlag, "S6").WithArguments("async").WithLocation(7, 21), // (8,19): error CS0106: The modifier 'ref' is not valid for this item // ref record struct S7; Diagnostic(ErrorCode.ERR_BadMemberFlag, "S7").WithArguments("ref").WithLocation(8, 19), // (9,22): error CS0227: Unsafe code may only appear if compiling with /unsafe // unsafe record struct S8; Diagnostic(ErrorCode.ERR_IllegalUnsafe, "S8").WithLocation(9, 22), // (10,22): error CS0106: The modifier 'static' is not valid for this item // static record struct S9; Diagnostic(ErrorCode.ERR_BadMemberFlag, "S9").WithArguments("static").WithLocation(10, 22), // (11,22): error CS0106: The modifier 'sealed' is not valid for this item // sealed record struct S10; Diagnostic(ErrorCode.ERR_BadMemberFlag, "S10").WithArguments("sealed").WithLocation(11, 22) ); } [Fact] public void TypeDeclaration_DuplicatesModifiers() { var src = @" public public record struct S2; "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,8): error CS1004: Duplicate 'public' modifier // public public record struct S2; Diagnostic(ErrorCode.ERR_DuplicateModifier, "public").WithArguments("public").WithLocation(2, 8) ); } [Fact] public void TypeDeclaration_BeforeTopLevelStatement() { var src = @" record struct S; System.Console.WriteLine(); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (3,1): error CS8803: Top-level statements must precede namespace and type declarations. // System.Console.WriteLine(); Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "System.Console.WriteLine();").WithLocation(3, 1) ); } [Fact] public void TypeDeclaration_WithTypeParameters() { var src = @" S<string> local = default; local.ToString(); record struct S<T>; "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); Assert.Equal(new[] { "T" }, comp.GlobalNamespace.GetTypeMember("S").TypeParameters.ToTestDisplayStrings()); } [Fact] public void TypeDeclaration_AllowedModifiersForMembers() { var src = @" record struct S { protected int Property { get; set; } // 1 internal protected string field; // 2, 3 abstract void M(); // 4 virtual void M2() { } // 5 }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (4,19): error CS0666: 'S.Property': new protected member declared in struct // protected int Property { get; set; } // 1 Diagnostic(ErrorCode.ERR_ProtectedInStruct, "Property").WithArguments("S.Property").WithLocation(4, 19), // (5,31): error CS0666: 'S.field': new protected member declared in struct // internal protected string field; // 2, 3 Diagnostic(ErrorCode.ERR_ProtectedInStruct, "field").WithArguments("S.field").WithLocation(5, 31), // (5,31): warning CS0649: Field 'S.field' is never assigned to, and will always have its default value null // internal protected string field; // 2, 3 Diagnostic(ErrorCode.WRN_UnassignedInternalField, "field").WithArguments("S.field", "null").WithLocation(5, 31), // (6,19): error CS0621: 'S.M()': virtual or abstract members cannot be private // abstract void M(); // 4 Diagnostic(ErrorCode.ERR_VirtualPrivate, "M").WithArguments("S.M()").WithLocation(6, 19), // (7,18): error CS0621: 'S.M2()': virtual or abstract members cannot be private // virtual void M2() { } // 5 Diagnostic(ErrorCode.ERR_VirtualPrivate, "M2").WithArguments("S.M2()").WithLocation(7, 18) ); } [Fact] public void TypeDeclaration_ImplementInterface() { var src = @" I i = (I)default(S); System.Console.Write(i.M(""four"")); I i2 = (I)default(S2); System.Console.Write(i2.M(""four"")); interface I { int M(string s); } public record struct S : I { public int M(string s) => s.Length; } public record struct S2 : I { int I.M(string s) => s.Length + 1; } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); CompileAndVerify(comp, expectedOutput: "45"); AssertEx.Equal(new[] { "System.Int32 S.M(System.String s)", "readonly System.String S.ToString()", "readonly System.Boolean S.PrintMembers(System.Text.StringBuilder builder)", "System.Boolean S.op_Inequality(S left, S right)", "System.Boolean S.op_Equality(S left, S right)", "readonly System.Int32 S.GetHashCode()", "readonly System.Boolean S.Equals(System.Object obj)", "readonly System.Boolean S.Equals(S other)", "S..ctor()" }, comp.GetMember<NamedTypeSymbol>("S").GetMembers().ToTestDisplayStrings()); } [Fact] public void TypeDeclaration_SatisfiesStructConstraint() { var src = @" S s = default; System.Console.Write(M(s)); static int M<T>(T t) where T : struct, I => t.Property; public interface I { int Property { get; } } public record struct S : I { public int Property => 42; } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); CompileAndVerify(comp, expectedOutput: "42"); } [Fact] public void TypeDeclaration_AccessingThis() { var src = @" S s = new S(); System.Console.Write(s.M()); public record struct S { public int Property => 42; public int M() => this.Property; } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "42"); verifier.VerifyIL("S.M", @" { // Code size 7 (0x7) .maxstack 1 IL_0000: ldarg.0 IL_0001: call ""int S.Property.get"" IL_0006: ret } "); } [Fact] public void TypeDeclaration_NoBaseInitializer() { var src = @" public record struct S { public S(int i) : base() { } } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (4,12): error CS0522: 'S': structs cannot call base class constructors // public S(int i) : base() { } Diagnostic(ErrorCode.ERR_StructWithBaseConstructorCall, "S").WithArguments("S").WithLocation(4, 12) ); } [Fact] public void TypeDeclaration_ParameterlessConstructor_01() { var src = @"record struct S0(); record struct S1; record struct S2 { public S2() { } }"; var comp = CreateCompilation(src, parseOptions: TestOptions.Regular9); comp.VerifyDiagnostics( // (1,8): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct S0(); Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(1, 8), // (2,8): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct S1; Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(2, 8), // (3,8): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct S2 Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(3, 8), // (5,12): error CS8773: Feature 'parameterless struct constructors' is not available in C# 9.0. Please use language version 10.0 or greater. // public S2() { } Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "S2").WithArguments("parameterless struct constructors", "10.0").WithLocation(5, 12)); var verifier = CompileAndVerify(src); verifier.VerifyIL("S0..ctor()", @"{ // Code size 1 (0x1) .maxstack 0 IL_0000: ret }"); verifier.VerifyMissing("S1..ctor()"); verifier.VerifyIL("S2..ctor()", @"{ // Code size 1 (0x1) .maxstack 0 IL_0000: ret }"); } [Fact] public void TypeDeclaration_ParameterlessConstructor_02() { var src = @"record struct S1 { S1() { } } record struct S2 { internal S2() { } }"; var comp = CreateCompilation(src, parseOptions: TestOptions.Regular9); comp.VerifyDiagnostics( // (1,8): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct S1 Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(1, 8), // (3,5): error CS8773: Feature 'parameterless struct constructors' is not available in C# 9.0. Please use language version 10.0 or greater. // S1() { } Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "S1").WithArguments("parameterless struct constructors", "10.0").WithLocation(3, 5), // (3,5): error CS8938: The parameterless struct constructor must be 'public'. // S1() { } Diagnostic(ErrorCode.ERR_NonPublicParameterlessStructConstructor, "S1").WithLocation(3, 5), // (5,8): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct S2 Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(5, 8), // (7,14): error CS8773: Feature 'parameterless struct constructors' is not available in C# 9.0. Please use language version 10.0 or greater. // internal S2() { } Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "S2").WithArguments("parameterless struct constructors", "10.0").WithLocation(7, 14), // (7,14): error CS8938: The parameterless struct constructor must be 'public'. // internal S2() { } Diagnostic(ErrorCode.ERR_NonPublicParameterlessStructConstructor, "S2").WithLocation(7, 14)); comp = CreateCompilation(src); comp.VerifyDiagnostics( // (3,5): error CS8918: The parameterless struct constructor must be 'public'. // S1() { } Diagnostic(ErrorCode.ERR_NonPublicParameterlessStructConstructor, "S1").WithLocation(3, 5), // (7,14): error CS8918: The parameterless struct constructor must be 'public'. // internal S2() { } Diagnostic(ErrorCode.ERR_NonPublicParameterlessStructConstructor, "S2").WithLocation(7, 14)); } [Fact] public void TypeDeclaration_ParameterlessConstructor_OtherConstructors() { var src = @" record struct S1 { public S1() { } S1(object o) { } // ok because no record parameter list } record struct S2 { S2(object o) { } } record struct S3() { S3(object o) { } // 1 } record struct S4() { S4(object o) : this() { } } record struct S5(object o) { public S5() { } // 2 } record struct S6(object o) { public S6() : this(null) { } } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (13,5): error CS8862: A constructor declared in a record with parameter list must have 'this' constructor initializer. // S3(object o) { } // 1 Diagnostic(ErrorCode.ERR_UnexpectedOrMissingConstructorInitializerInRecord, "S3").WithLocation(13, 5), // (21,12): error CS8862: A constructor declared in a record with parameter list must have 'this' constructor initializer. // public S5() { } // 2 Diagnostic(ErrorCode.ERR_UnexpectedOrMissingConstructorInitializerInRecord, "S5").WithLocation(21, 12) ); } [Fact] public void TypeDeclaration_ParameterlessConstructor_Initializers() { var src = @" var s1 = new S1(); var s2 = new S2(null); var s2b = new S2(); var s3 = new S3(); var s4 = new S4(new object()); var s5 = new S5(); var s6 = new S6(""s6.other""); System.Console.Write((s1.field, s2.field, s2b.field is null, s3.field, s4.field, s5.field, s6.field, s6.other)); record struct S1 { public string field = ""s1""; public S1() { } } record struct S2 { public string field = ""s2""; public S2(object o) { } } record struct S3() { public string field = ""s3""; } record struct S4 { public string field = ""s4""; public S4(object o) : this() { } } record struct S5() { public string field = ""s5""; public S5(object o) : this() { } } record struct S6(string other) { public string field = ""s6.field""; public S6() : this(""ignored"") { } } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); CompileAndVerify(comp, expectedOutput: "(s1, s2, True, s3, s4, s5, s6.field, s6.other)"); } [Fact] public void TypeDeclaration_InstanceInitializers() { var src = @" public record struct S { public int field = 42; public int Property { get; set; } = 43; } "; var comp = CreateCompilation(src, parseOptions: TestOptions.Regular9); comp.VerifyDiagnostics( // (2,15): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // public record struct S Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(2, 15), // (4,16): error CS8773: Feature 'struct field initializers' is not available in C# 9.0. Please use language version 10.0 or greater. // public int field = 42; Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "field").WithArguments("struct field initializers", "10.0").WithLocation(4, 16), // (5,16): error CS8773: Feature 'struct field initializers' is not available in C# 9.0. Please use language version 10.0 or greater. // public int Property { get; set; } = 43; Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "Property").WithArguments("struct field initializers", "10.0").WithLocation(5, 16)); comp = CreateCompilation(src); comp.VerifyDiagnostics(); } [Fact] public void TypeDeclaration_NoDestructor() { var src = @" public record struct S { ~S() { } } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (4,6): error CS0575: Only class types can contain destructors // ~S() { } Diagnostic(ErrorCode.ERR_OnlyClassesCanContainDestructors, "S").WithArguments("S.~S()").WithLocation(4, 6) ); } [Fact] public void TypeDeclaration_DifferentPartials() { var src = @" partial record struct S1; partial struct S1 { } partial struct S2 { } partial record struct S2; partial record struct S3; partial record S3 { } partial record struct S4; partial record class S4 { } partial record struct S5; partial class S5 { } partial record struct S6; partial interface S6 { } partial record class C1; partial struct C1 { } partial record class C2; partial record struct C2 { } partial record class C3 { } partial record C3; partial record class C4; partial class C4 { } partial record class C5; partial interface C5 { } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (3,16): error CS0261: Partial declarations of 'S1' must be all classes, all record classes, all structs, all record structs, or all interfaces // partial struct S1 { } Diagnostic(ErrorCode.ERR_PartialTypeKindConflict, "S1").WithArguments("S1").WithLocation(3, 16), // (6,23): error CS0261: Partial declarations of 'S2' must be all classes, all record classes, all structs, all record structs, or all interfaces // partial record struct S2; Diagnostic(ErrorCode.ERR_PartialTypeKindConflict, "S2").WithArguments("S2").WithLocation(6, 23), // (9,16): error CS0261: Partial declarations of 'S3' must be all classes, all record classes, all structs, all record structs, or all interfaces // partial record S3 { } Diagnostic(ErrorCode.ERR_PartialTypeKindConflict, "S3").WithArguments("S3").WithLocation(9, 16), // (12,22): error CS0261: Partial declarations of 'S4' must be all classes, all record classes, all structs, all record structs, or all interfaces // partial record class S4 { } Diagnostic(ErrorCode.ERR_PartialTypeKindConflict, "S4").WithArguments("S4").WithLocation(12, 22), // (15,15): error CS0261: Partial declarations of 'S5' must be all classes, all record classes, all structs, all record structs, or all interfaces // partial class S5 { } Diagnostic(ErrorCode.ERR_PartialTypeKindConflict, "S5").WithArguments("S5").WithLocation(15, 15), // (18,19): error CS0261: Partial declarations of 'S6' must be all classes, all record classes, all structs, all record structs, or all interfaces // partial interface S6 { } Diagnostic(ErrorCode.ERR_PartialTypeKindConflict, "S6").WithArguments("S6").WithLocation(18, 19), // (21,16): error CS0261: Partial declarations of 'C1' must be all classes, all record classes, all structs, all record structs, or all interfaces // partial struct C1 { } Diagnostic(ErrorCode.ERR_PartialTypeKindConflict, "C1").WithArguments("C1").WithLocation(21, 16), // (24,23): error CS0261: Partial declarations of 'C2' must be all classes, all record classes, all structs, all record structs, or all interfaces // partial record struct C2 { } Diagnostic(ErrorCode.ERR_PartialTypeKindConflict, "C2").WithArguments("C2").WithLocation(24, 23), // (30,15): error CS0261: Partial declarations of 'C4' must be all classes, all record classes, all structs, all record structs, or all interfaces // partial class C4 { } Diagnostic(ErrorCode.ERR_PartialTypeKindConflict, "C4").WithArguments("C4").WithLocation(30, 15), // (33,19): error CS0261: Partial declarations of 'C5' must be all classes, all record classes, all structs, all record structs, or all interfaces // partial interface C5 { } Diagnostic(ErrorCode.ERR_PartialTypeKindConflict, "C5").WithArguments("C5").WithLocation(33, 19) ); } [Fact] public void PartialRecord_OnlyOnePartialHasParameterList() { var src = @" partial record struct S(int i); partial record struct S(int i); partial record struct S2(int i); partial record struct S2(); partial record struct S3(); partial record struct S3(); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (3,24): error CS8863: Only a single record partial declaration may have a parameter list // partial record struct S(int i); Diagnostic(ErrorCode.ERR_MultipleRecordParameterLists, "(int i)").WithLocation(3, 24), // (6,25): error CS8863: Only a single record partial declaration may have a parameter list // partial record struct S2(); Diagnostic(ErrorCode.ERR_MultipleRecordParameterLists, "()").WithLocation(6, 25), // (9,25): error CS8863: Only a single record partial declaration may have a parameter list // partial record struct S3(); Diagnostic(ErrorCode.ERR_MultipleRecordParameterLists, "()").WithLocation(9, 25) ); } [Fact] public void PartialRecord_ParametersInScopeOfBothParts() { var src = @" var c = new C(2); System.Console.Write((c.P1, c.P2)); public partial record struct C(int X) { public int P1 { get; set; } = X; } public partial record struct C { public int P2 { get; set; } = X; } "; var comp = CreateCompilation(src); CompileAndVerify(comp, expectedOutput: "(2, 2)", verify: Verification.Skipped /* init-only */) .VerifyDiagnostics( // (5,30): warning CS0282: There is no defined ordering between fields in multiple declarations of partial struct 'C'. To specify an ordering, all instance fields must be in the same declaration. // public partial record struct C(int X) Diagnostic(ErrorCode.WRN_SequentialOnPartialClass, "C").WithArguments("C").WithLocation(5, 30) ); } [Fact] public void PartialRecord_DuplicateMemberNames() { var src = @" public partial record struct C(int X) { public void M(int i) { } } public partial record struct C { public void M(string s) { } } "; var comp = CreateCompilation(src); var expectedMemberNames = new string[] { ".ctor", "<X>k__BackingField", "get_X", "set_X", "X", "M", "M", "ToString", "PrintMembers", "op_Inequality", "op_Equality", "GetHashCode", "Equals", "Equals", "Deconstruct", ".ctor", }; AssertEx.Equal(expectedMemberNames, comp.GetMember<NamedTypeSymbol>("C").GetPublicSymbol().MemberNames); } [Fact] public void RecordInsideGenericType() { var src = @" var c = new C<int>.Nested(2); System.Console.Write(c.T); public class C<T> { public record struct Nested(T T); } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); CompileAndVerify(comp, expectedOutput: "2"); } [Fact] public void PositionalMemberModifiers_RefOrOut() { var src = @" record struct R(ref int P1, out int P2); "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (2,15): error CS0177: The out parameter 'P2' must be assigned to before control leaves the current method // record struct R(ref int P1, out int P2); Diagnostic(ErrorCode.ERR_ParamUnassigned, "R").WithArguments("P2").WithLocation(2, 15), // (2,17): error CS0631: ref and out are not valid in this context // record struct R(ref int P1, out int P2); Diagnostic(ErrorCode.ERR_IllegalRefParam, "ref").WithLocation(2, 17), // (2,29): error CS0631: ref and out are not valid in this context // record struct R(ref int P1, out int P2); Diagnostic(ErrorCode.ERR_IllegalRefParam, "out").WithLocation(2, 29) ); } [Fact, WorkItem(45008, "https://github.com/dotnet/roslyn/issues/45008")] public void PositionalMemberModifiers_This() { var src = @" record struct R(this int i); "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (2,17): error CS0027: Keyword 'this' is not available in the current context // record struct R(this int i); Diagnostic(ErrorCode.ERR_ThisInBadContext, "this").WithLocation(2, 17) ); } [Fact, WorkItem(45591, "https://github.com/dotnet/roslyn/issues/45591")] public void Clone_DisallowedInSource() { var src = @" record struct C1(string Clone); // 1 record struct C2 { string Clone; // 2 } record struct C3 { string Clone { get; set; } // 3 } record struct C5 { void Clone() { } // 4 void Clone(int i) { } // 5 } record struct C6 { class Clone { } // 6 } record struct C7 { delegate void Clone(); // 7 } record struct C8 { event System.Action Clone; // 8 } record struct Clone { Clone(int i) => throw null; } record struct C9 : System.ICloneable { object System.ICloneable.Clone() => throw null; } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,25): error CS8859: Members named 'Clone' are disallowed in records. // record struct C1(string Clone); // 1 Diagnostic(ErrorCode.ERR_CloneDisallowedInRecord, "Clone").WithLocation(2, 25), // (5,12): error CS8859: Members named 'Clone' are disallowed in records. // string Clone; // 2 Diagnostic(ErrorCode.ERR_CloneDisallowedInRecord, "Clone").WithLocation(5, 12), // (5,12): warning CS0169: The field 'C2.Clone' is never used // string Clone; // 2 Diagnostic(ErrorCode.WRN_UnreferencedField, "Clone").WithArguments("C2.Clone").WithLocation(5, 12), // (9,12): error CS8859: Members named 'Clone' are disallowed in records. // string Clone { get; set; } // 3 Diagnostic(ErrorCode.ERR_CloneDisallowedInRecord, "Clone").WithLocation(9, 12), // (13,10): error CS8859: Members named 'Clone' are disallowed in records. // void Clone() { } // 4 Diagnostic(ErrorCode.ERR_CloneDisallowedInRecord, "Clone").WithLocation(13, 10), // (14,10): error CS8859: Members named 'Clone' are disallowed in records. // void Clone(int i) { } // 5 Diagnostic(ErrorCode.ERR_CloneDisallowedInRecord, "Clone").WithLocation(14, 10), // (18,11): error CS8859: Members named 'Clone' are disallowed in records. // class Clone { } // 6 Diagnostic(ErrorCode.ERR_CloneDisallowedInRecord, "Clone").WithLocation(18, 11), // (22,19): error CS8859: Members named 'Clone' are disallowed in records. // delegate void Clone(); // 7 Diagnostic(ErrorCode.ERR_CloneDisallowedInRecord, "Clone").WithLocation(22, 19), // (26,25): error CS8859: Members named 'Clone' are disallowed in records. // event System.Action Clone; // 8 Diagnostic(ErrorCode.ERR_CloneDisallowedInRecord, "Clone").WithLocation(26, 25), // (26,25): warning CS0067: The event 'C8.Clone' is never used // event System.Action Clone; // 8 Diagnostic(ErrorCode.WRN_UnreferencedEvent, "Clone").WithArguments("C8.Clone").WithLocation(26, 25) ); } [ConditionalFact(typeof(DesktopOnly), Reason = ConditionalSkipReason.RestrictedTypesNeedDesktop)] [WorkItem(48115, "https://github.com/dotnet/roslyn/issues/48115")] public void RestrictedTypesAndPointerTypes() { var src = @" class C<T> { } static class C2 { } ref struct RefLike{} unsafe record struct C( // 1 int* P1, // 2 int*[] P2, // 3 C<int*[]> P3, delegate*<int, int> P4, // 4 void P5, // 5 C2 P6, // 6, 7 System.ArgIterator P7, // 8 System.TypedReference P8, // 9 RefLike P9); // 10 "; var comp = CreateCompilation(new[] { src, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview, options: TestOptions.UnsafeDebugDll); comp.VerifyEmitDiagnostics( // (6,22): error CS0721: 'C2': static types cannot be used as parameters // unsafe record struct C( // 1 Diagnostic(ErrorCode.ERR_ParameterIsStaticClass, "C").WithArguments("C2").WithLocation(6, 22), // (7,10): error CS8908: The type 'int*' may not be used for a field of a record. // int* P1, // 2 Diagnostic(ErrorCode.ERR_BadFieldTypeInRecord, "P1").WithArguments("int*").WithLocation(7, 10), // (8,12): error CS8908: The type 'int*[]' may not be used for a field of a record. // int*[] P2, // 3 Diagnostic(ErrorCode.ERR_BadFieldTypeInRecord, "P2").WithArguments("int*[]").WithLocation(8, 12), // (10,25): error CS8908: The type 'delegate*<int, int>' may not be used for a field of a record. // delegate*<int, int> P4, // 4 Diagnostic(ErrorCode.ERR_BadFieldTypeInRecord, "P4").WithArguments("delegate*<int, int>").WithLocation(10, 25), // (11,5): error CS1536: Invalid parameter type 'void' // void P5, // 5 Diagnostic(ErrorCode.ERR_NoVoidParameter, "void").WithLocation(11, 5), // (12,8): error CS0722: 'C2': static types cannot be used as return types // C2 P6, // 6, 7 Diagnostic(ErrorCode.ERR_ReturnTypeIsStaticClass, "P6").WithArguments("C2").WithLocation(12, 8), // (12,8): error CS0721: 'C2': static types cannot be used as parameters // C2 P6, // 6, 7 Diagnostic(ErrorCode.ERR_ParameterIsStaticClass, "P6").WithArguments("C2").WithLocation(12, 8), // (13,5): error CS0610: Field or property cannot be of type 'ArgIterator' // System.ArgIterator P7, // 8 Diagnostic(ErrorCode.ERR_FieldCantBeRefAny, "System.ArgIterator").WithArguments("System.ArgIterator").WithLocation(13, 5), // (14,5): error CS0610: Field or property cannot be of type 'TypedReference' // System.TypedReference P8, // 9 Diagnostic(ErrorCode.ERR_FieldCantBeRefAny, "System.TypedReference").WithArguments("System.TypedReference").WithLocation(14, 5), // (15,5): error CS8345: Field or auto-implemented property cannot be of type 'RefLike' unless it is an instance member of a ref struct. // RefLike P9); // 10 Diagnostic(ErrorCode.ERR_FieldAutoPropCantBeByRefLike, "RefLike").WithArguments("RefLike").WithLocation(15, 5) ); } [ConditionalFact(typeof(DesktopOnly), Reason = ConditionalSkipReason.RestrictedTypesNeedDesktop)] [WorkItem(48115, "https://github.com/dotnet/roslyn/issues/48115")] public void RestrictedTypesAndPointerTypes_NominalMembers() { var src = @" public class C<T> { } public static class C2 { } public ref struct RefLike{} public unsafe record struct C { public int* f1; // 1 public int*[] f2; // 2 public C<int*[]> f3; public delegate*<int, int> f4; // 3 public void f5; // 4 public C2 f6; // 5 public System.ArgIterator f7; // 6 public System.TypedReference f8; // 7 public RefLike f9; // 8 } "; var comp = CreateCompilation(new[] { src, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview, options: TestOptions.UnsafeDebugDll); comp.VerifyEmitDiagnostics( // (8,17): error CS8908: The type 'int*' may not be used for a field of a record. // public int* f1; // 1 Diagnostic(ErrorCode.ERR_BadFieldTypeInRecord, "f1").WithArguments("int*").WithLocation(8, 17), // (9,19): error CS8908: The type 'int*[]' may not be used for a field of a record. // public int*[] f2; // 2 Diagnostic(ErrorCode.ERR_BadFieldTypeInRecord, "f2").WithArguments("int*[]").WithLocation(9, 19), // (11,32): error CS8908: The type 'delegate*<int, int>' may not be used for a field of a record. // public delegate*<int, int> f4; // 3 Diagnostic(ErrorCode.ERR_BadFieldTypeInRecord, "f4").WithArguments("delegate*<int, int>").WithLocation(11, 32), // (12,12): error CS0670: Field cannot have void type // public void f5; // 4 Diagnostic(ErrorCode.ERR_FieldCantHaveVoidType, "void").WithLocation(12, 12), // (13,15): error CS0723: Cannot declare a variable of static type 'C2' // public C2 f6; // 5 Diagnostic(ErrorCode.ERR_VarDeclIsStaticClass, "f6").WithArguments("C2").WithLocation(13, 15), // (14,12): error CS0610: Field or property cannot be of type 'ArgIterator' // public System.ArgIterator f7; // 6 Diagnostic(ErrorCode.ERR_FieldCantBeRefAny, "System.ArgIterator").WithArguments("System.ArgIterator").WithLocation(14, 12), // (15,12): error CS0610: Field or property cannot be of type 'TypedReference' // public System.TypedReference f8; // 7 Diagnostic(ErrorCode.ERR_FieldCantBeRefAny, "System.TypedReference").WithArguments("System.TypedReference").WithLocation(15, 12), // (16,12): error CS8345: Field or auto-implemented property cannot be of type 'RefLike' unless it is an instance member of a ref struct. // public RefLike f9; // 8 Diagnostic(ErrorCode.ERR_FieldAutoPropCantBeByRefLike, "RefLike").WithArguments("RefLike").WithLocation(16, 12) ); } [ConditionalFact(typeof(DesktopOnly), Reason = ConditionalSkipReason.RestrictedTypesNeedDesktop)] [WorkItem(48115, "https://github.com/dotnet/roslyn/issues/48115")] public void RestrictedTypesAndPointerTypes_NominalMembers_AutoProperties() { var src = @" public class C<T> { } public static class C2 { } public ref struct RefLike{} public unsafe record struct C { public int* f1 { get; set; } // 1 public int*[] f2 { get; set; } // 2 public C<int*[]> f3 { get; set; } public delegate*<int, int> f4 { get; set; } // 3 public void f5 { get; set; } // 4 public C2 f6 { get; set; } // 5, 6 public System.ArgIterator f7 { get; set; } // 6 public System.TypedReference f8 { get; set; } // 7 public RefLike f9 { get; set; } // 8 } "; var comp = CreateCompilation(new[] { src, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview, options: TestOptions.UnsafeDebugDll); comp.VerifyEmitDiagnostics( // (8,17): error CS8908: The type 'int*' may not be used for a field of a record. // public int* f1 { get; set; } // 1 Diagnostic(ErrorCode.ERR_BadFieldTypeInRecord, "f1").WithArguments("int*").WithLocation(8, 17), // (9,19): error CS8908: The type 'int*[]' may not be used for a field of a record. // public int*[] f2 { get; set; } // 2 Diagnostic(ErrorCode.ERR_BadFieldTypeInRecord, "f2").WithArguments("int*[]").WithLocation(9, 19), // (11,32): error CS8908: The type 'delegate*<int, int>' may not be used for a field of a record. // public delegate*<int, int> f4 { get; set; } // 3 Diagnostic(ErrorCode.ERR_BadFieldTypeInRecord, "f4").WithArguments("delegate*<int, int>").WithLocation(11, 32), // (12,17): error CS0547: 'C.f5': property or indexer cannot have void type // public void f5 { get; set; } // 4 Diagnostic(ErrorCode.ERR_PropertyCantHaveVoidType, "f5").WithArguments("C.f5").WithLocation(12, 17), // (13,20): error CS0722: 'C2': static types cannot be used as return types // public C2 f6 { get; set; } // 5, 6 Diagnostic(ErrorCode.ERR_ReturnTypeIsStaticClass, "get").WithArguments("C2").WithLocation(13, 20), // (13,25): error CS0721: 'C2': static types cannot be used as parameters // public C2 f6 { get; set; } // 5, 6 Diagnostic(ErrorCode.ERR_ParameterIsStaticClass, "set").WithArguments("C2").WithLocation(13, 25), // (14,12): error CS0610: Field or property cannot be of type 'ArgIterator' // public System.ArgIterator f7 { get; set; } // 6 Diagnostic(ErrorCode.ERR_FieldCantBeRefAny, "System.ArgIterator").WithArguments("System.ArgIterator").WithLocation(14, 12), // (15,12): error CS0610: Field or property cannot be of type 'TypedReference' // public System.TypedReference f8 { get; set; } // 7 Diagnostic(ErrorCode.ERR_FieldCantBeRefAny, "System.TypedReference").WithArguments("System.TypedReference").WithLocation(15, 12), // (16,12): error CS8345: Field or auto-implemented property cannot be of type 'RefLike' unless it is an instance member of a ref struct. // public RefLike f9 { get; set; } // 8 Diagnostic(ErrorCode.ERR_FieldAutoPropCantBeByRefLike, "RefLike").WithArguments("RefLike").WithLocation(16, 12) ); } [Fact] [WorkItem(48115, "https://github.com/dotnet/roslyn/issues/48115")] public void RestrictedTypesAndPointerTypes_PointerTypeAllowedForParameterAndProperty() { var src = @" class C<T> { } unsafe record struct C(int* P1, int*[] P2, C<int*[]> P3) { int* P1 { get { System.Console.Write(""P1 ""); return null; } init { } } int*[] P2 { get { System.Console.Write(""P2 ""); return null; } init { } } C<int*[]> P3 { get { System.Console.Write(""P3 ""); return null; } init { } } public unsafe static void Main() { var x = new C(null, null, null); var (x1, x2, x3) = x; System.Console.Write(""RAN""); } } "; var comp = CreateCompilation(new[] { src, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview, options: TestOptions.UnsafeDebugExe); comp.VerifyEmitDiagnostics( // (4,29): warning CS8907: Parameter 'P1' is unread. Did you forget to use it to initialize the property with that name? // unsafe record struct C(int* P1, int*[] P2, C<int*[]> P3) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "P1").WithArguments("P1").WithLocation(4, 29), // (4,40): warning CS8907: Parameter 'P2' is unread. Did you forget to use it to initialize the property with that name? // unsafe record struct C(int* P1, int*[] P2, C<int*[]> P3) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "P2").WithArguments("P2").WithLocation(4, 40), // (4,54): warning CS8907: Parameter 'P3' is unread. Did you forget to use it to initialize the property with that name? // unsafe record struct C(int* P1, int*[] P2, C<int*[]> P3) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "P3").WithArguments("P3").WithLocation(4, 54) ); CompileAndVerify(comp, expectedOutput: "P1 P2 P3 RAN", verify: Verification.Skipped /* pointers */); } [ConditionalFact(typeof(DesktopOnly), Reason = ConditionalSkipReason.RestrictedTypesNeedDesktop)] [WorkItem(48115, "https://github.com/dotnet/roslyn/issues/48115")] public void RestrictedTypesAndPointerTypes_StaticFields() { var src = @" public class C<T> { } public static class C2 { } public ref struct RefLike{} public unsafe record C { public static int* f1; public static int*[] f2; public static C<int*[]> f3; public static delegate*<int, int> f4; public static C2 f6; // 1 public static System.ArgIterator f7; // 2 public static System.TypedReference f8; // 3 public static RefLike f9; // 4 } "; var comp = CreateCompilation(new[] { src, IsExternalInitTypeDefinition }, options: TestOptions.UnsafeDebugDll); comp.VerifyEmitDiagnostics( // (12,22): error CS0723: Cannot declare a variable of static type 'C2' // public static C2 f6; // 1 Diagnostic(ErrorCode.ERR_VarDeclIsStaticClass, "f6").WithArguments("C2").WithLocation(12, 22), // (13,19): error CS0610: Field or property cannot be of type 'ArgIterator' // public static System.ArgIterator f7; // 2 Diagnostic(ErrorCode.ERR_FieldCantBeRefAny, "System.ArgIterator").WithArguments("System.ArgIterator").WithLocation(13, 19), // (14,19): error CS0610: Field or property cannot be of type 'TypedReference' // public static System.TypedReference f8; // 3 Diagnostic(ErrorCode.ERR_FieldCantBeRefAny, "System.TypedReference").WithArguments("System.TypedReference").WithLocation(14, 19), // (15,19): error CS8345: Field or auto-implemented property cannot be of type 'RefLike' unless it is an instance member of a ref struct. // public static RefLike f9; // 4 Diagnostic(ErrorCode.ERR_FieldAutoPropCantBeByRefLike, "RefLike").WithArguments("RefLike").WithLocation(15, 19) ); } [Fact] public void RecordProperties_01() { var src = @" using System; record struct C(int X, int Y) { int Z = 345; public static void Main() { var c = new C(1, 2); Console.Write(c.X); Console.Write(c.Y); Console.Write(c.Z); } }"; var verifier = CompileAndVerify(src, expectedOutput: @"12345").VerifyDiagnostics(); verifier.VerifyIL("C..ctor(int, int)", @" { // Code size 26 (0x1a) .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: stfld ""int C.<X>k__BackingField"" IL_0007: ldarg.0 IL_0008: ldarg.2 IL_0009: stfld ""int C.<Y>k__BackingField"" IL_000e: ldarg.0 IL_000f: ldc.i4 0x159 IL_0014: stfld ""int C.Z"" IL_0019: ret } "); var c = verifier.Compilation.GlobalNamespace.GetTypeMember("C"); Assert.False(c.IsReadOnly); var x = (IPropertySymbol)c.GetMember("X"); Assert.Equal("readonly System.Int32 C.X.get", x.GetMethod.ToTestDisplayString()); Assert.Equal("void C.X.set", x.SetMethod.ToTestDisplayString()); Assert.False(x.SetMethod!.IsInitOnly); var xBackingField = (IFieldSymbol)c.GetMember("<X>k__BackingField"); Assert.Equal("System.Int32 C.<X>k__BackingField", xBackingField.ToTestDisplayString()); Assert.False(xBackingField.IsReadOnly); } [Fact] public void RecordProperties_01_EmptyParameterList() { var src = @" using System; record struct C() { int Z = 345; public static void Main() { var c = new C(); Console.Write(c.Z); } }"; CreateCompilation(src).VerifyEmitDiagnostics(); } [Fact] public void RecordProperties_01_Readonly() { var src = @" using System; readonly record struct C(int X, int Y) { readonly int Z = 345; public static void Main() { var c = new C(1, 2); Console.Write(c.X); Console.Write(c.Y); Console.Write(c.Z); } }"; var verifier = CompileAndVerify(src, expectedOutput: @"12345").VerifyDiagnostics(); var c = verifier.Compilation.GlobalNamespace.GetTypeMember("C"); Assert.True(c.IsReadOnly); var x = (IPropertySymbol)c.GetMember("X"); Assert.Equal("System.Int32 C.X.get", x.GetMethod.ToTestDisplayString()); Assert.Equal("void modreq(System.Runtime.CompilerServices.IsExternalInit) C.X.init", x.SetMethod.ToTestDisplayString()); Assert.True(x.SetMethod!.IsInitOnly); var xBackingField = (IFieldSymbol)c.GetMember("<X>k__BackingField"); Assert.Equal("System.Int32 C.<X>k__BackingField", xBackingField.ToTestDisplayString()); Assert.True(xBackingField.IsReadOnly); } [Fact] public void RecordProperties_01_ReadonlyMismatch() { var src = @" readonly record struct C(int X) { public int X { get; set; } = X; // 1 } record struct C2(int X) { public int X { get; init; } = X; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (4,16): error CS8341: Auto-implemented instance properties in readonly structs must be readonly. // public int X { get; set; } = X; // 1 Diagnostic(ErrorCode.ERR_AutoPropsInRoStruct, "X").WithLocation(4, 16) ); } [Fact] public void RecordProperties_02() { var src = @" using System; record struct C(int X, int Y) { public C(int a, int b) { } public static void Main() { var c = new C(1, 2); Console.WriteLine(c.X); Console.WriteLine(c.Y); } private int X1 = X; }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (5,12): error CS0111: Type 'C' already defines a member called 'C' with the same parameter types // public C(int a, int b) Diagnostic(ErrorCode.ERR_MemberAlreadyExists, "C").WithArguments("C", "C").WithLocation(5, 12), // (5,12): error CS8862: A constructor declared in a record with parameter list must have 'this' constructor initializer. // public C(int a, int b) Diagnostic(ErrorCode.ERR_UnexpectedOrMissingConstructorInitializerInRecord, "C").WithLocation(5, 12), // (11,21): error CS0121: The call is ambiguous between the following methods or properties: 'C.C(int, int)' and 'C.C(int, int)' // var c = new C(1, 2); Diagnostic(ErrorCode.ERR_AmbigCall, "C").WithArguments("C.C(int, int)", "C.C(int, int)").WithLocation(11, 21) ); } [Fact] public void RecordProperties_03() { var src = @" using System; record struct C(int X, int Y) { public int X { get; } public static void Main() { var c = new C(1, 2); Console.WriteLine(c.X); Console.WriteLine(c.Y); } }"; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (3,15): error CS0843: Auto-implemented property 'C.X' must be fully assigned before control is returned to the caller. // record struct C(int X, int Y) Diagnostic(ErrorCode.ERR_UnassignedThisAutoProperty, "C").WithArguments("C.X").WithLocation(3, 15), // (3,21): warning CS8907: Parameter 'X' is unread. Did you forget to use it to initialize the property with that name? // record struct C(int X, int Y) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "X").WithArguments("X").WithLocation(3, 21) ); } [Fact] public void RecordProperties_03_InitializedWithY() { var src = @" using System; record struct C(int X, int Y) { public int X { get; } = Y; public static void Main() { var c = new C(1, 2); Console.Write(c.X); Console.Write(c.Y); } }"; CompileAndVerify(src, expectedOutput: "22") .VerifyDiagnostics( // (3,21): warning CS8907: Parameter 'X' is unread. Did you forget to use it to initialize the property with that name? // record struct C(int X, int Y) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "X").WithArguments("X").WithLocation(3, 21) ); } [Fact] public void RecordProperties_04() { var src = @" using System; record struct C(int X, int Y) { public int X { get; } = 3; public static void Main() { var c = new C(1, 2); Console.Write(c.X); Console.Write(c.Y); } }"; CompileAndVerify(src, expectedOutput: "32") .VerifyDiagnostics( // (3,21): warning CS8907: Parameter 'X' is unread. Did you forget to use it to initialize the property with that name? // record struct C(int X, int Y) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "X").WithArguments("X").WithLocation(3, 21) ); } [Fact] public void RecordProperties_05() { var src = @" record struct C(int X, int X) { }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,28): error CS0100: The parameter name 'X' is a duplicate // record struct C(int X, int X) Diagnostic(ErrorCode.ERR_DuplicateParamName, "X").WithArguments("X").WithLocation(2, 28), // (2,28): error CS0102: The type 'C' already contains a definition for 'X' // record struct C(int X, int X) Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "X").WithArguments("C", "X").WithLocation(2, 28) ); var expectedMembers = new[] { "System.Int32 C.X { get; set; }", "System.Int32 C.X { get; set; }" }; AssertEx.Equal(expectedMembers, comp.GetMember<NamedTypeSymbol>("C").GetMembers().OfType<PropertySymbol>().ToTestDisplayStrings()); var expectedMemberNames = new[] { ".ctor", "<X>k__BackingField", "get_X", "set_X", "X", "<X>k__BackingField", "get_X", "set_X", "X", "ToString", "PrintMembers", "op_Inequality", "op_Equality", "GetHashCode", "Equals", "Equals", "Deconstruct", ".ctor" }; AssertEx.Equal(expectedMemberNames, comp.GetMember<NamedTypeSymbol>("C").GetPublicSymbol().MemberNames); } [Fact] public void RecordProperties_06() { var src = @" record struct C(int X, int Y) { public void get_X() { } public void set_X() { } int get_Y(int value) => value; int set_Y(int value) => value; }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,21): error CS0082: Type 'C' already reserves a member called 'get_X' with the same parameter types // record struct C(int X, int Y) Diagnostic(ErrorCode.ERR_MemberReserved, "X").WithArguments("get_X", "C").WithLocation(2, 21), // (2,28): error CS0082: Type 'C' already reserves a member called 'set_Y' with the same parameter types // record struct C(int X, int Y) Diagnostic(ErrorCode.ERR_MemberReserved, "Y").WithArguments("set_Y", "C").WithLocation(2, 28) ); var actualMembers = comp.GetMember<NamedTypeSymbol>("C").GetMembers().ToTestDisplayStrings(); var expectedMembers = new[] { "C..ctor(System.Int32 X, System.Int32 Y)", "System.Int32 C.<X>k__BackingField", "readonly System.Int32 C.X.get", "void C.X.set", "System.Int32 C.X { get; set; }", "System.Int32 C.<Y>k__BackingField", "readonly System.Int32 C.Y.get", "void C.Y.set", "System.Int32 C.Y { get; set; }", "void C.get_X()", "void C.set_X()", "System.Int32 C.get_Y(System.Int32 value)", "System.Int32 C.set_Y(System.Int32 value)", "readonly System.String C.ToString()", "readonly System.Boolean C.PrintMembers(System.Text.StringBuilder builder)", "System.Boolean C.op_Inequality(C left, C right)", "System.Boolean C.op_Equality(C left, C right)", "readonly System.Int32 C.GetHashCode()", "readonly System.Boolean C.Equals(System.Object obj)", "readonly System.Boolean C.Equals(C other)", "readonly void C.Deconstruct(out System.Int32 X, out System.Int32 Y)", "C..ctor()", }; AssertEx.Equal(expectedMembers, actualMembers); } [Fact] public void RecordProperties_07() { var comp = CreateCompilation(@" record struct C1(object P, object get_P); record struct C2(object get_P, object P);"); comp.VerifyDiagnostics( // (2,25): error CS0102: The type 'C1' already contains a definition for 'get_P' // record struct C1(object P, object get_P); Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "P").WithArguments("C1", "get_P").WithLocation(2, 25), // (3,39): error CS0102: The type 'C2' already contains a definition for 'get_P' // record struct C2(object get_P, object P); Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "P").WithArguments("C2", "get_P").WithLocation(3, 39) ); } [Fact] public void RecordProperties_08() { var comp = CreateCompilation(@" record struct C1(object O1) { public object O1 { get; } = O1; public object O2 { get; } = O1; }"); comp.VerifyDiagnostics(); } [Fact] public void RecordProperties_09() { var src = @" record struct C(object P1, object P2, object P3, object P4) { class P1 { } object P2 = 2; int P3(object o) => 3; int P4<T>(T t) => 4; }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,24): error CS0102: The type 'C' already contains a definition for 'P1' // record struct C(object P1, object P2, object P3, object P4) Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "P1").WithArguments("C", "P1").WithLocation(2, 24), // (2,35): warning CS8907: Parameter 'P2' is unread. Did you forget to use it to initialize the property with that name? // record struct C(object P1, object P2, object P3, object P4) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "P2").WithArguments("P2").WithLocation(2, 35), // (6,9): error CS0102: The type 'C' already contains a definition for 'P3' // int P3(object o) => 3; Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "P3").WithArguments("C", "P3").WithLocation(6, 9), // (7,9): error CS0102: The type 'C' already contains a definition for 'P4' // int P4<T>(T t) => 4; Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "P4").WithArguments("C", "P4").WithLocation(7, 9) ); } [Fact] public void RecordProperties_10() { var src = @" record struct C(object P) { const int P = 4; }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,24): error CS8866: Record member 'C.P' must be a readable instance property or field of type 'object' to match positional parameter 'P'. // record struct C(object P) Diagnostic(ErrorCode.ERR_BadRecordMemberForPositionalParameter, "P").WithArguments("C.P", "object", "P").WithLocation(2, 24), // (2,24): warning CS8907: Parameter 'P' is unread. Did you forget to use it to initialize the property with that name? // record struct C(object P) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "P").WithArguments("P").WithLocation(2, 24) ); } [Fact] public void RecordProperties_11_UnreadPositionalParameter() { var comp = CreateCompilation(@" record struct C1(object O1, object O2, object O3) // 1, 2 { public object O1 { get; init; } public object O2 { get; init; } = M(O2); public object O3 { get; init; } = M(O3 = null); private static object M(object o) => o; } "); comp.VerifyDiagnostics( // (2,15): error CS0843: Auto-implemented property 'C1.O1' must be fully assigned before control is returned to the caller. // record struct C1(object O1, object O2, object O3) // 1, 2 Diagnostic(ErrorCode.ERR_UnassignedThisAutoProperty, "C1").WithArguments("C1.O1").WithLocation(2, 15), // (2,25): warning CS8907: Parameter 'O1' is unread. Did you forget to use it to initialize the property with that name? // record struct C1(object O1, object O2, object O3) // 1, 2 Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "O1").WithArguments("O1").WithLocation(2, 25), // (2,47): warning CS8907: Parameter 'O3' is unread. Did you forget to use it to initialize the property with that name? // record struct C1(object O1, object O2, object O3) // 1, 2 Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "O3").WithArguments("O3").WithLocation(2, 47) ); } [Fact] public void RecordProperties_11_UnreadPositionalParameter_InRefOut() { var comp = CreateCompilation(@" record struct C1(object O1, object O2, object O3) // 1 { public object O1 { get; init; } = MIn(in O1); public object O2 { get; init; } = MRef(ref O2); public object O3 { get; init; } = MOut(out O3); static object MIn(in object o) => o; static object MRef(ref object o) => o; static object MOut(out object o) => throw null; } "); comp.VerifyDiagnostics( // (2,47): warning CS8907: Parameter 'O3' is unread. Did you forget to use it to initialize the property with that name? // record struct C1(object O1, object O2, object O3) // 1 Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "O3").WithArguments("O3").WithLocation(2, 47) ); } [Fact] public void RecordProperties_SelfContainedStruct() { var comp = CreateCompilation(@" record struct C(C c); "); comp.VerifyDiagnostics( // (2,19): error CS0523: Struct member 'C.c' of type 'C' causes a cycle in the struct layout // record struct C(C c); Diagnostic(ErrorCode.ERR_StructLayoutCycle, "c").WithArguments("C.c", "C").WithLocation(2, 19) ); } [Fact] public void RecordProperties_PropertyInValueType() { var corlib_cs = @" namespace System { public class Object { public virtual bool Equals(object x) => throw null; public virtual int GetHashCode() => throw null; public virtual string ToString() => throw null; } public class Exception { } public class ValueType { public bool X { get; set; } } public class Attribute { } public class String { } public struct Void { } public struct Boolean { } public struct Char { } public struct Int32 { } public interface IEquatable<T> { } } namespace System.Collections.Generic { public abstract class EqualityComparer<T> { public static EqualityComparer<T> Default => throw null; public abstract int GetHashCode(T t); } } namespace System.Text { public class StringBuilder { public StringBuilder Append(string s) => null; public StringBuilder Append(char c) => null; public StringBuilder Append(object o) => null; } } "; var corlibRef = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); { var src = @" record struct C(bool X) { bool M() { return X; } } "; var comp = CreateEmptyCompilation(src, parseOptions: TestOptions.RegularPreview, references: new[] { corlibRef }); comp.VerifyEmitDiagnostics( // (2,22): warning CS8907: Parameter 'X' is unread. Did you forget to use it to initialize the property with that name? // record struct C(bool X) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "X").WithArguments("X").WithLocation(2, 22) ); Assert.Null(comp.GlobalNamespace.GetTypeMember("C").GetMember("X")); var tree = comp.SyntaxTrees.Single(); var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); var x = tree.GetRoot().DescendantNodes().OfType<ReturnStatementSyntax>().Single().Expression; Assert.Equal("System.Boolean System.ValueType.X { get; set; }", model.GetSymbolInfo(x!).Symbol.ToTestDisplayString()); } { var src = @" readonly record struct C(bool X) { bool M() { return X; } } "; var comp = CreateEmptyCompilation(src, parseOptions: TestOptions.RegularPreview, references: new[] { corlibRef }); comp.VerifyEmitDiagnostics( // (2,31): warning CS8907: Parameter 'X' is unread. Did you forget to use it to initialize the property with that name? // readonly record struct C(bool X) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "X").WithArguments("X").WithLocation(2, 31) ); Assert.Null(comp.GlobalNamespace.GetTypeMember("C").GetMember("X")); var tree = comp.SyntaxTrees.Single(); var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); var x = tree.GetRoot().DescendantNodes().OfType<ReturnStatementSyntax>().Single().Expression; Assert.Equal("System.Boolean System.ValueType.X { get; set; }", model.GetSymbolInfo(x!).Symbol.ToTestDisplayString()); } } [Fact] public void RecordProperties_PropertyInValueType_Static() { var corlib_cs = @" namespace System { public class Object { public virtual bool Equals(object x) => throw null; public virtual int GetHashCode() => throw null; public virtual string ToString() => throw null; } public class Exception { } public class ValueType { public static bool X { get; set; } } public class Attribute { } public class String { } public struct Void { } public struct Boolean { } public struct Char { } public struct Int32 { } public interface IEquatable<T> { } } namespace System.Collections.Generic { public abstract class EqualityComparer<T> { public static EqualityComparer<T> Default => throw null; public abstract int GetHashCode(T t); } } namespace System.Text { public class StringBuilder { public StringBuilder Append(string s) => null; public StringBuilder Append(char c) => null; public StringBuilder Append(object o) => null; } } "; var corlibRef = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); var src = @" record struct C(bool X) { bool M() { return X; } } "; var comp = CreateEmptyCompilation(src, parseOptions: TestOptions.RegularPreview, references: new[] { corlibRef }); comp.VerifyEmitDiagnostics( // (2,22): error CS8866: Record member 'System.ValueType.X' must be a readable instance property or field of type 'bool' to match positional parameter 'X'. // record struct C(bool X) Diagnostic(ErrorCode.ERR_BadRecordMemberForPositionalParameter, "X").WithArguments("System.ValueType.X", "bool", "X").WithLocation(2, 22), // (2,22): warning CS8907: Parameter 'X' is unread. Did you forget to use it to initialize the property with that name? // record struct C(bool X) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "X").WithArguments("X").WithLocation(2, 22) ); } [Fact] public void StaticCtor() { var src = @" record R(int x) { static void Main() { } static R() { System.Console.Write(""static ctor""); } } "; var comp = CreateCompilation(new[] { src, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview, options: TestOptions.DebugExe); comp.VerifyEmitDiagnostics(); CompileAndVerify(comp, expectedOutput: "static ctor", verify: Verification.Skipped /* init-only */); } [Fact] public void StaticCtor_ParameterlessPrimaryCtor() { var src = @" record struct R(int I) { static R() { } } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(); } [Fact] public void StaticCtor_CopyCtor() { var src = @" record struct R(int I) { static R(R r) { } } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (4,12): error CS0132: 'R.R(R)': a static constructor must be parameterless // static R(R r) { } Diagnostic(ErrorCode.ERR_StaticConstParam, "R").WithArguments("R.R(R)").WithLocation(4, 12) ); } [Fact] public void InterfaceImplementation_NotReadonly() { var source = @" I r = new R(42); r.P2 = 43; r.P3 = 44; System.Console.Write((r.P1, r.P2, r.P3)); interface I { int P1 { get; set; } int P2 { get; set; } int P3 { get; set; } } record struct R(int P1) : I { public int P2 { get; set; } = 0; int I.P3 { get; set; } = 0; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics(); CompileAndVerify(comp, expectedOutput: "(42, 43, 44)"); } [Fact] public void InterfaceImplementation_NotReadonly_InitOnlyInterface() { var source = @" interface I { int P1 { get; init; } } record struct R(int P1) : I; "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (6,27): error CS8854: 'R' does not implement interface member 'I.P1.init'. 'R.P1.set' cannot implement 'I.P1.init'. // record struct R(int P1) : I; Diagnostic(ErrorCode.ERR_CloseUnimplementedInterfaceMemberWrongInitOnly, "I").WithArguments("R", "I.P1.init", "R.P1.set").WithLocation(6, 27) ); } [Fact] public void InterfaceImplementation_Readonly() { var source = @" I r = new R(42) { P2 = 43 }; System.Console.Write((r.P1, r.P2)); interface I { int P1 { get; init; } int P2 { get; init; } } readonly record struct R(int P1) : I { public int P2 { get; init; } = 0; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics(); CompileAndVerify(comp, expectedOutput: "(42, 43)", verify: Verification.Skipped /* init-only */); } [Fact] public void InterfaceImplementation_Readonly_SetInterface() { var source = @" interface I { int P1 { get; set; } } readonly record struct R(int P1) : I; "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (6,36): error CS8854: 'R' does not implement interface member 'I.P1.set'. 'R.P1.init' cannot implement 'I.P1.set'. // readonly record struct R(int P1) : I; Diagnostic(ErrorCode.ERR_CloseUnimplementedInterfaceMemberWrongInitOnly, "I").WithArguments("R", "I.P1.set", "R.P1.init").WithLocation(6, 36) ); } [Fact] public void InterfaceImplementation_Readonly_PrivateImplementation() { var source = @" I r = new R(42) { P2 = 43, P3 = 44 }; System.Console.Write((r.P1, r.P2, r.P3)); interface I { int P1 { get; init; } int P2 { get; init; } int P3 { get; init; } } readonly record struct R(int P1) : I { public int P2 { get; init; } = 0; int I.P3 { get; init; } = 0; // not practically initializable } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (2,28): error CS0117: 'R' does not contain a definition for 'P3' // I r = new R(42) { P2 = 43, P3 = 44 }; Diagnostic(ErrorCode.ERR_NoSuchMember, "P3").WithArguments("R", "P3").WithLocation(2, 28) ); } [Fact] public void Initializers_01() { var src = @" using System; record struct C(int X) { int Z = X + 1; public static void Main() { var c = new C(1); Console.WriteLine(c.Z); } }"; var verifier = CompileAndVerify(src, expectedOutput: @"2").VerifyDiagnostics(); var comp = CreateCompilation(src); var tree = comp.SyntaxTrees.First(); var model = comp.GetSemanticModel(tree); var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); Assert.Equal("= X + 1", x.Parent!.Parent!.ToString()); var symbol = model.GetSymbolInfo(x).Symbol; Assert.Equal(SymbolKind.Parameter, symbol!.Kind); Assert.Equal("System.Int32 X", symbol.ToTestDisplayString()); Assert.Equal("C..ctor(System.Int32 X)", symbol.ContainingSymbol.ToTestDisplayString()); Assert.Equal("System.Int32 C.Z", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); Assert.Contains("X", model.LookupNames(x.SpanStart)); var recordDeclaration = tree.GetRoot().DescendantNodes().OfType<RecordDeclarationSyntax>().Single(); Assert.Equal("C", recordDeclaration.Identifier.ValueText); Assert.Null(model.GetOperation(recordDeclaration)); } [Fact] public void Initializers_02() { var src = @" record struct C(int X) { static int Z = X + 1; }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (4,20): error CS0236: A field initializer cannot reference the non-static field, method, or property 'C.X' // static int Z = X + 1; Diagnostic(ErrorCode.ERR_FieldInitRefNonstatic, "X").WithArguments("C.X").WithLocation(4, 20) ); var tree = comp.SyntaxTrees.First(); var model = comp.GetSemanticModel(tree); var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); Assert.Equal("= X + 1", x.Parent!.Parent!.ToString()); var symbol = model.GetSymbolInfo(x).Symbol; Assert.Equal(SymbolKind.Property, symbol!.Kind); Assert.Equal("System.Int32 C.X { get; set; }", symbol.ToTestDisplayString()); Assert.Equal("C", symbol.ContainingSymbol.ToTestDisplayString()); Assert.Equal("System.Int32 C.Z", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); Assert.Contains("X", model.LookupNames(x.SpanStart)); } [Fact] public void Initializers_03() { var src = @" record struct C(int X) { const int Z = X + 1; }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (4,19): error CS0236: A field initializer cannot reference the non-static field, method, or property 'C.X' // const int Z = X + 1; Diagnostic(ErrorCode.ERR_FieldInitRefNonstatic, "X").WithArguments("C.X").WithLocation(4, 19) ); var tree = comp.SyntaxTrees.First(); var model = comp.GetSemanticModel(tree); var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); Assert.Equal("= X + 1", x.Parent!.Parent!.ToString()); var symbol = model.GetSymbolInfo(x).Symbol; Assert.Equal(SymbolKind.Property, symbol!.Kind); Assert.Equal("System.Int32 C.X { get; set; }", symbol.ToTestDisplayString()); Assert.Equal("C", symbol.ContainingSymbol.ToTestDisplayString()); Assert.Equal("System.Int32 C.Z", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); Assert.Contains("X", model.LookupNames(x.SpanStart)); } [Fact] public void Initializers_04() { var src = @" using System; record struct C(int X) { Func<int> Z = () => X + 1; public static void Main() { var c = new C(1); Console.WriteLine(c.Z()); } }"; var verifier = CompileAndVerify(src, expectedOutput: @"2").VerifyDiagnostics(); var comp = CreateCompilation(src); var tree = comp.SyntaxTrees.First(); var model = comp.GetSemanticModel(tree); var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); Assert.Equal("() => X + 1", x.Parent!.Parent!.ToString()); var symbol = model.GetSymbolInfo(x).Symbol; Assert.Equal(SymbolKind.Parameter, symbol!.Kind); Assert.Equal("System.Int32 X", symbol.ToTestDisplayString()); Assert.Equal("C..ctor(System.Int32 X)", symbol.ContainingSymbol.ToTestDisplayString()); Assert.Equal("lambda expression", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); Assert.Contains("X", model.LookupNames(x.SpanStart)); } [Fact] public void SynthesizedRecordPointerProperty() { var src = @" record struct R(int P1, int* P2, delegate*<int> P3);"; var comp = CreateCompilation(src); var p = comp.GlobalNamespace.GetTypeMember("R").GetMember<SourcePropertySymbolBase>("P1"); Assert.False(p.HasPointerType); p = comp.GlobalNamespace.GetTypeMember("R").GetMember<SourcePropertySymbolBase>("P2"); Assert.True(p.HasPointerType); p = comp.GlobalNamespace.GetTypeMember("R").GetMember<SourcePropertySymbolBase>("P3"); Assert.True(p.HasPointerType); } [Fact] public void PositionalMemberModifiers_In() { var src = @" var r = new R(42); int i = 43; var r2 = new R(in i); System.Console.Write((r.P1, r2.P1)); record struct R(in int P1); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "(42, 43)"); var actualMembers = comp.GetMember<NamedTypeSymbol>("R").Constructors.ToTestDisplayStrings(); var expectedMembers = new[] { "R..ctor(in System.Int32 P1)", "R..ctor()" }; AssertEx.Equal(expectedMembers, actualMembers); } [Fact] public void PositionalMemberModifiers_Params() { var src = @" var r = new R(42, 43); var r2 = new R(new[] { 44, 45 }); System.Console.Write((r.Array[0], r.Array[1], r2.Array[0], r2.Array[1])); record struct R(params int[] Array); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); CompileAndVerify(comp, expectedOutput: "(42, 43, 44, 45)"); var actualMembers = comp.GetMember<NamedTypeSymbol>("R").Constructors.ToTestDisplayStrings(); var expectedMembers = new[] { "R..ctor(params System.Int32[] Array)", "R..ctor()" }; AssertEx.Equal(expectedMembers, actualMembers); } [Fact] public void PositionalMemberDefaultValue() { var src = @" var r = new R(); // This uses the parameterless constructor System.Console.Write(r.P); record struct R(int P = 42); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); CompileAndVerify(comp, expectedOutput: "0"); } [Fact] public void PositionalMemberDefaultValue_PassingOneArgument() { var src = @" var r = new R(41); System.Console.Write(r.O); System.Console.Write("" ""); System.Console.Write(r.P); record struct R(int O, int P = 42); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); CompileAndVerify(comp, expectedOutput: "41 42"); } [Fact] public void PositionalMemberDefaultValue_AndPropertyWithInitializer() { var src = @" var r = new R(0); System.Console.Write(r.P); record struct R(int O, int P = 1) { public int P { get; init; } = 42; } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (5,28): warning CS8907: Parameter 'P' is unread. Did you forget to use it to initialize the property with that name? // record struct R(int O, int P = 1) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "P").WithArguments("P").WithLocation(5, 28) ); var verifier = CompileAndVerify(comp, expectedOutput: "42", verify: Verification.Skipped /* init-only */); verifier.VerifyIL("R..ctor(int, int)", @" { // Code size 16 (0x10) .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: stfld ""int R.<O>k__BackingField"" IL_0007: ldarg.0 IL_0008: ldc.i4.s 42 IL_000a: stfld ""int R.<P>k__BackingField"" IL_000f: ret }"); } [Fact] public void PositionalMemberDefaultValue_AndPropertyWithoutInitializer() { var src = @" record struct R(int P = 42) { public int P { get; init; } public static void Main() { var r = new R(); System.Console.Write(r.P); } } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,15): error CS0843: Auto-implemented property 'R.P' must be fully assigned before control is returned to the caller. // record struct R(int P = 42) Diagnostic(ErrorCode.ERR_UnassignedThisAutoProperty, "R").WithArguments("R.P").WithLocation(2, 15), // (2,21): warning CS8907: Parameter 'P' is unread. Did you forget to use it to initialize the property with that name? // record struct R(int P = 42) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "P").WithArguments("P").WithLocation(2, 21) ); } [Fact] public void PositionalMemberDefaultValue_AndPropertyWithInitializer_CopyingParameter() { var src = @" var r = new R(0); System.Console.Write(r.P); record struct R(int O, int P = 42) { public int P { get; init; } = P; } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "42", verify: Verification.Skipped /* init-only */); verifier.VerifyIL("R..ctor(int, int)", @" { // Code size 15 (0xf) .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: stfld ""int R.<O>k__BackingField"" IL_0007: ldarg.0 IL_0008: ldarg.2 IL_0009: stfld ""int R.<P>k__BackingField"" IL_000e: ret }"); } [Fact] public void RecordWithConstraints_NullableWarning() { var src = @" #nullable enable var r = new R<string?>(""R""); var r2 = new R2<string?>(""R2""); System.Console.Write((r.P, r2.P)); record struct R<T>(T P) where T : class; record struct R2<T>(T P) where T : class { } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (3,15): warning CS8634: The type 'string?' cannot be used as type parameter 'T' in the generic type or method 'R<T>'. Nullability of type argument 'string?' doesn't match 'class' constraint. // var r = new R<string?>("R"); Diagnostic(ErrorCode.WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint, "string?").WithArguments("R<T>", "T", "string?").WithLocation(3, 15), // (4,17): warning CS8634: The type 'string?' cannot be used as type parameter 'T' in the generic type or method 'R2<T>'. Nullability of type argument 'string?' doesn't match 'class' constraint. // var r2 = new R2<string?>("R2"); Diagnostic(ErrorCode.WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint, "string?").WithArguments("R2<T>", "T", "string?").WithLocation(4, 17) ); CompileAndVerify(comp, expectedOutput: "(R, R2)"); } [Fact] public void RecordWithConstraints_ConstraintError() { var src = @" record struct R<T>(T P) where T : class; record struct R2<T>(T P) where T : class { } public class C { public static void Main() { _ = new R<int>(1); _ = new R2<int>(2); } }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (9,19): error CS0452: The type 'int' must be a reference type in order to use it as parameter 'T' in the generic type or method 'R<T>' // _ = new R<int>(1); Diagnostic(ErrorCode.ERR_RefConstraintNotSatisfied, "int").WithArguments("R<T>", "T", "int").WithLocation(9, 19), // (10,20): error CS0452: The type 'int' must be a reference type in order to use it as parameter 'T' in the generic type or method 'R2<T>' // _ = new R2<int>(2); Diagnostic(ErrorCode.ERR_RefConstraintNotSatisfied, "int").WithArguments("R2<T>", "T", "int").WithLocation(10, 20) ); } [Fact] public void CyclicBases4() { var text = @" record struct A<T> : B<A<T>> { } record struct B<T> : A<B<T>> { A<T> F() { return null; } } "; var comp = CreateCompilation(text); comp.GetDeclarationDiagnostics().Verify( // (3,22): error CS0527: Type 'A<B<T>>' in interface list is not an interface // record struct B<T> : A<B<T>> Diagnostic(ErrorCode.ERR_NonInterfaceInInterfaceList, "A<B<T>>").WithArguments("A<B<T>>").WithLocation(3, 22), // (2,22): error CS0527: Type 'B<A<T>>' in interface list is not an interface // record struct A<T> : B<A<T>> { } Diagnostic(ErrorCode.ERR_NonInterfaceInInterfaceList, "B<A<T>>").WithArguments("B<A<T>>").WithLocation(2, 22) ); } [Fact] public void PartialClassWithDifferentTupleNamesInImplementedInterfaces() { var source = @" public interface I<T> { } public partial record C1 : I<(int a, int b)> { } public partial record C1 : I<(int notA, int notB)> { } public partial record C2 : I<(int a, int b)> { } public partial record C2 : I<(int, int)> { } public partial record C3 : I<(int a, int b)> { } public partial record C3 : I<(int a, int b)> { } public partial record C4 : I<(int a, int b)> { } public partial record C4 : I<(int b, int a)> { } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics( // (3,23): error CS8140: 'I<(int notA, int notB)>' is already listed in the interface list on type 'C1' with different tuple element names, as 'I<(int a, int b)>'. // public partial record C1 : I<(int a, int b)> { } Diagnostic(ErrorCode.ERR_DuplicateInterfaceWithTupleNamesInBaseList, "C1").WithArguments("I<(int notA, int notB)>", "I<(int a, int b)>", "C1").WithLocation(3, 23), // (6,23): error CS8140: 'I<(int, int)>' is already listed in the interface list on type 'C2' with different tuple element names, as 'I<(int a, int b)>'. // public partial record C2 : I<(int a, int b)> { } Diagnostic(ErrorCode.ERR_DuplicateInterfaceWithTupleNamesInBaseList, "C2").WithArguments("I<(int, int)>", "I<(int a, int b)>", "C2").WithLocation(6, 23), // (12,23): error CS8140: 'I<(int b, int a)>' is already listed in the interface list on type 'C4' with different tuple element names, as 'I<(int a, int b)>'. // public partial record C4 : I<(int a, int b)> { } Diagnostic(ErrorCode.ERR_DuplicateInterfaceWithTupleNamesInBaseList, "C4").WithArguments("I<(int b, int a)>", "I<(int a, int b)>", "C4").WithLocation(12, 23) ); } [Fact] public void CS0267ERR_PartialMisplaced() { var test = @" partial public record struct C // CS0267 { } "; CreateCompilation(test).VerifyDiagnostics( // (2,1): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type. // partial public record struct C // CS0267 Diagnostic(ErrorCode.ERR_PartialMisplaced, "partial").WithLocation(2, 1) ); } [Fact] public void SealedStaticRecord() { var source = @" sealed static record struct R; "; CreateCompilation(source).VerifyDiagnostics( // (2,29): error CS0106: The modifier 'sealed' is not valid for this item // sealed static record struct R; Diagnostic(ErrorCode.ERR_BadMemberFlag, "R").WithArguments("sealed").WithLocation(2, 29), // (2,29): error CS0106: The modifier 'static' is not valid for this item // sealed static record struct R; Diagnostic(ErrorCode.ERR_BadMemberFlag, "R").WithArguments("static").WithLocation(2, 29) ); } [Fact] public void CS0513ERR_AbstractInConcreteClass02() { var text = @" record struct C { public abstract event System.Action E; public abstract int this[int x] { get; set; } } "; CreateCompilation(text).VerifyDiagnostics( // (5,25): error CS0106: The modifier 'abstract' is not valid for this item // public abstract int this[int x] { get; set; } Diagnostic(ErrorCode.ERR_BadMemberFlag, "this").WithArguments("abstract").WithLocation(5, 25), // (4,41): error CS0106: The modifier 'abstract' is not valid for this item // public abstract event System.Action E; Diagnostic(ErrorCode.ERR_BadMemberFlag, "E").WithArguments("abstract").WithLocation(4, 41) ); } [Fact] public void CS0574ERR_BadDestructorName() { var test = @" public record struct iii { ~iiii(){} } "; CreateCompilation(test).VerifyDiagnostics( // (4,6): error CS0574: Name of destructor must match name of type // ~iiii(){} Diagnostic(ErrorCode.ERR_BadDestructorName, "iiii").WithLocation(4, 6), // (4,6): error CS0575: Only class types can contain destructors // ~iiii(){} Diagnostic(ErrorCode.ERR_OnlyClassesCanContainDestructors, "iiii").WithArguments("iii.~iii()").WithLocation(4, 6) ); } [Fact] public void StaticRecordWithConstructorAndDestructor() { var text = @" static record struct R(int I) { public R() : this(0) { } ~R() { } } "; var comp = CreateCompilation(text); comp.VerifyDiagnostics( // (2,22): error CS0106: The modifier 'static' is not valid for this item // static record struct R(int I) Diagnostic(ErrorCode.ERR_BadMemberFlag, "R").WithArguments("static").WithLocation(2, 22), // (5,6): error CS0575: Only class types can contain destructors // ~R() { } Diagnostic(ErrorCode.ERR_OnlyClassesCanContainDestructors, "R").WithArguments("R.~R()").WithLocation(5, 6) ); } [Fact] public void RecordWithPartialMethodExplicitImplementation() { var source = @"record struct R { partial void M(); }"; CreateCompilation(source).VerifyDiagnostics( // (3,18): error CS0751: A partial method must be declared within a partial type // partial void M(); Diagnostic(ErrorCode.ERR_PartialMethodOnlyInPartialClass, "M").WithLocation(3, 18) ); } [Fact] public void RecordWithPartialMethodRequiringBody() { var source = @"partial record struct R { public partial int M(); }"; CreateCompilation(source).VerifyDiagnostics( // (3,24): error CS8795: Partial method 'R.M()' must have an implementation part because it has accessibility modifiers. // public partial int M(); Diagnostic(ErrorCode.ERR_PartialMethodWithAccessibilityModsMustHaveImplementation, "M").WithArguments("R.M()").WithLocation(3, 24) ); } [Fact] public void CanDeclareIteratorInRecord() { var source = @" using System.Collections.Generic; foreach(var i in new X(42).GetItems()) { System.Console.Write(i); } public record struct X(int a) { public IEnumerable<int> GetItems() { yield return a; yield return a + 1; } }"; var comp = CreateCompilation(source).VerifyDiagnostics(); CompileAndVerify(comp, expectedOutput: "4243"); } [Fact] public void ParameterlessConstructor() { var src = @" System.Console.Write(new C().Property); record struct C() { public int Property { get; set; } = 42; }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); CompileAndVerify(comp, expectedOutput: "42"); } [Fact] public void XmlDoc() { var src = @" /// <summary>Summary</summary> /// <param name=""I1"">Description for I1</param> public record struct C(int I1); namespace System.Runtime.CompilerServices { /// <summary>Ignored</summary> public static class IsExternalInit { } } "; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularWithDocumentationComments); comp.VerifyDiagnostics(); var cMember = comp.GetMember<NamedTypeSymbol>("C"); Assert.Equal( @"<member name=""T:C""> <summary>Summary</summary> <param name=""I1"">Description for I1</param> </member> ", cMember.GetDocumentationCommentXml()); var constructor = cMember.GetMembers(".ctor").OfType<SynthesizedRecordConstructor>().Single(); Assert.Equal( @"<member name=""M:C.#ctor(System.Int32)""> <summary>Summary</summary> <param name=""I1"">Description for I1</param> </member> ", constructor.GetDocumentationCommentXml()); Assert.Equal("", constructor.GetParameters()[0].GetDocumentationCommentXml()); var property = cMember.GetMembers("I1").Single(); Assert.Equal("", property.GetDocumentationCommentXml()); } [Fact] public void XmlDoc_Cref() { var src = @" /// <summary>Summary</summary> /// <param name=""I1"">Description for <see cref=""I1""/></param> public record struct C(int I1) { /// <summary>Summary</summary> /// <param name=""x"">Description for <see cref=""x""/></param> public void M(int x) { } } namespace System.Runtime.CompilerServices { /// <summary>Ignored</summary> public static class IsExternalInit { } } "; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularWithDocumentationComments); comp.VerifyDiagnostics( // (7,52): warning CS1574: XML comment has cref attribute 'x' that could not be resolved // /// <param name="x">Description for <see cref="x"/></param> Diagnostic(ErrorCode.WRN_BadXMLRef, "x").WithArguments("x").WithLocation(7, 52) ); var tree = comp.SyntaxTrees.Single(); var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); var cref = docComments.First().DescendantNodes().OfType<XmlCrefAttributeSyntax>().First().Cref; Assert.Equal("I1", cref.ToString()); var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); Assert.Equal(SymbolKind.Property, model.GetSymbolInfo(cref).Symbol!.Kind); } [Fact] public void Deconstruct_Simple() { var source = @"using System; record struct B(int X, int Y) { public static void Main() { M(new B(1, 2)); } static void M(B b) { switch (b) { case B(int x, int y): Console.Write(x); Console.Write(y); break; } } }"; var verifier = CompileAndVerify(source, expectedOutput: "12"); verifier.VerifyDiagnostics(); verifier.VerifyIL("B.Deconstruct", @" { // Code size 17 (0x11) .maxstack 2 IL_0000: ldarg.1 IL_0001: ldarg.0 IL_0002: call ""readonly int B.X.get"" IL_0007: stind.i4 IL_0008: ldarg.2 IL_0009: ldarg.0 IL_000a: call ""readonly int B.Y.get"" IL_000f: stind.i4 IL_0010: ret }"); var deconstruct = ((CSharpCompilation)verifier.Compilation).GetMember<MethodSymbol>("B.Deconstruct"); Assert.Equal(2, deconstruct.ParameterCount); Assert.Equal(RefKind.Out, deconstruct.Parameters[0].RefKind); Assert.Equal("X", deconstruct.Parameters[0].Name); Assert.Equal(RefKind.Out, deconstruct.Parameters[1].RefKind); Assert.Equal("Y", deconstruct.Parameters[1].Name); Assert.True(deconstruct.ReturnsVoid); Assert.False(deconstruct.IsVirtual); Assert.False(deconstruct.IsStatic); Assert.Equal(Accessibility.Public, deconstruct.DeclaredAccessibility); } [Fact] public void Deconstruct_PositionalAndNominalProperty() { var source = @"using System; record struct B(int X) { public int Y { get; init; } = 0; public static void Main() { M(new B(1)); } static void M(B b) { switch (b) { case B(int x): Console.Write(x); break; } } }"; var verifier = CompileAndVerify(source, expectedOutput: "1"); verifier.VerifyDiagnostics(); Assert.Equal( "readonly void B.Deconstruct(out System.Int32 X)", verifier.Compilation.GetMember("B.Deconstruct").ToTestDisplayString(includeNonNullable: false)); } [Fact] public void Deconstruct_Nested() { var source = @"using System; record struct B(int X, int Y); record struct C(B B, int Z) { public static void Main() { M(new C(new B(1, 2), 3)); } static void M(C c) { switch (c) { case C(B(int x, int y), int z): Console.Write(x); Console.Write(y); Console.Write(z); break; } } } "; var verifier = CompileAndVerify(source, expectedOutput: "123"); verifier.VerifyDiagnostics(); verifier.VerifyIL("B.Deconstruct", @" { // Code size 17 (0x11) .maxstack 2 IL_0000: ldarg.1 IL_0001: ldarg.0 IL_0002: call ""readonly int B.X.get"" IL_0007: stind.i4 IL_0008: ldarg.2 IL_0009: ldarg.0 IL_000a: call ""readonly int B.Y.get"" IL_000f: stind.i4 IL_0010: ret }"); verifier.VerifyIL("C.Deconstruct", @" { // Code size 21 (0x15) .maxstack 2 IL_0000: ldarg.1 IL_0001: ldarg.0 IL_0002: call ""readonly B C.B.get"" IL_0007: stobj ""B"" IL_000c: ldarg.2 IL_000d: ldarg.0 IL_000e: call ""readonly int C.Z.get"" IL_0013: stind.i4 IL_0014: ret }"); } [Fact] public void Deconstruct_PropertyCollision() { var source = @"using System; record struct B(int X, int Y) { public int X => 3; static void M(B b) { switch (b) { case B(int x, int y): Console.Write(x); Console.Write(y); break; } } static void Main() { M(new B(1, 2)); } } "; var verifier = CompileAndVerify(source, expectedOutput: "32"); verifier.VerifyDiagnostics( // (3,21): warning CS8907: Parameter 'X' is unread. Did you forget to use it to initialize the property with that name? // record struct B(int X, int Y) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "X").WithArguments("X").WithLocation(3, 21) ); Assert.Equal( "void B.Deconstruct(out System.Int32 X, out System.Int32 Y)", verifier.Compilation.GetMember("B.Deconstruct").ToTestDisplayString(includeNonNullable: false)); } [Fact] public void Deconstruct_MethodCollision_01() { var source = @" record struct B(int X, int Y) { public int X() => 3; static void M(B b) { switch (b) { case B(int x, int y): break; } } static void Main() { M(new B(1, 2)); } } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics( // (4,16): error CS0102: The type 'B' already contains a definition for 'X' // public int X() => 3; Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "X").WithArguments("B", "X").WithLocation(4, 16) ); Assert.Equal( "readonly void B.Deconstruct(out System.Int32 X, out System.Int32 Y)", comp.GetMember("B.Deconstruct").ToTestDisplayString(includeNonNullable: false)); } [Fact] public void Deconstruct_FieldCollision() { var source = @" using System; record struct C(int X) { int X = 0; static void M(C c) { switch (c) { case C(int x): Console.Write(x); break; } } static void Main() { M(new C(0)); } } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics( // (4,21): warning CS8907: Parameter 'X' is unread. Did you forget to use it to initialize the property with that name? // record struct C(int X) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "X").WithArguments("X").WithLocation(4, 21), // (6,9): warning CS0414: The field 'C.X' is assigned but its value is never used // int X = 0; Diagnostic(ErrorCode.WRN_UnreferencedFieldAssg, "X").WithArguments("C.X").WithLocation(6, 9)); Assert.Equal( "readonly void C.Deconstruct(out System.Int32 X)", comp.GetMember("C.Deconstruct").ToTestDisplayString(includeNonNullable: false)); } [Fact] public void Deconstruct_Empty() { var source = @" record struct C { static void M(C c) { switch (c) { case C(): break; } } static void Main() { M(new C()); } } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics( // (8,19): error CS1061: 'C' does not contain a definition for 'Deconstruct' and no accessible extension method 'Deconstruct' accepting a first argument of type 'C' could be found (are you missing a using directive or an assembly reference?) // case C(): Diagnostic(ErrorCode.ERR_NoSuchMemberOrExtension, "()").WithArguments("C", "Deconstruct").WithLocation(8, 19), // (8,19): error CS8129: No suitable 'Deconstruct' instance or extension method was found for type 'C', with 0 out parameters and a void return type. // case C(): Diagnostic(ErrorCode.ERR_MissingDeconstruct, "()").WithArguments("C", "0").WithLocation(8, 19)); Assert.Null(comp.GetMember("C.Deconstruct")); } [Fact] public void Deconstruct_Conversion_02() { var source = @" #nullable enable using System; record struct C(string? X, string Y) { public string X { get; init; } = null!; public string? Y { get; init; } = string.Empty; static void M(C c) { switch (c) { case C(var x, string y): Console.Write(x); Console.Write(y); break; } } static void Main() { M(new C(""a"", ""b"")); } } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics( // (5,25): warning CS8907: Parameter 'X' is unread. Did you forget to use it to initialize the property with that name? // record struct C(string? X, string Y) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "X").WithArguments("X").WithLocation(5, 25), // (5,35): warning CS8907: Parameter 'Y' is unread. Did you forget to use it to initialize the property with that name? // record struct C(string? X, string Y) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "Y").WithArguments("Y").WithLocation(5, 35) ); Assert.Equal( "readonly void C.Deconstruct(out System.String? X, out System.String Y)", comp.GetMember("C.Deconstruct").ToTestDisplayString(includeNonNullable: false)); } [Fact] public void Deconstruct_Empty_WithParameterList() { var source = @" record struct C() { static void M(C c) { switch (c) { case C(): break; } } static void Main() { M(new C()); } } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics( // (8,19): error CS1061: 'C' does not contain a definition for 'Deconstruct' and no accessible extension method 'Deconstruct' accepting a first argument of type 'C' could be found (are you missing a using directive or an assembly reference?) // case C(): Diagnostic(ErrorCode.ERR_NoSuchMemberOrExtension, "()").WithArguments("C", "Deconstruct").WithLocation(8, 19), // (8,19): error CS8129: No suitable 'Deconstruct' instance or extension method was found for type 'C', with 0 out parameters and a void return type. // case C(): Diagnostic(ErrorCode.ERR_MissingDeconstruct, "()").WithArguments("C", "0").WithLocation(8, 19)); AssertEx.Equal(new[] { "C..ctor()", "void C.M(C c)", "void C.Main()", "readonly System.String C.ToString()", "readonly System.Boolean C.PrintMembers(System.Text.StringBuilder builder)", "System.Boolean C.op_Inequality(C left, C right)", "System.Boolean C.op_Equality(C left, C right)", "readonly System.Int32 C.GetHashCode()", "readonly System.Boolean C.Equals(System.Object obj)", "readonly System.Boolean C.Equals(C other)" }, comp.GetMember<NamedTypeSymbol>("C").GetMembers().ToTestDisplayStrings()); } [Fact] public void Deconstruct_Empty_WithParameterList_UserDefined_01() { var source = @"using System; record struct C(int I) { public void Deconstruct() { } static void M(C c) { switch (c) { case C(): Console.Write(12); break; } } public static void Main() { M(new C(42)); } } "; var verifier = CompileAndVerify(source, expectedOutput: "12"); verifier.VerifyDiagnostics(); } [Fact] public void Deconstruct_GeneratedAsReadOnly() { var src = @" record struct A(int I, string S); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var method = comp.GetMember<SynthesizedRecordDeconstruct>("A.Deconstruct"); Assert.True(method.IsDeclaredReadOnly); } [Fact] public void Deconstruct_WihtNonReadOnlyGetter_GeneratedAsNonReadOnly() { var src = @" record struct A(int I, string S) { public int I { get => 0; } } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,21): warning CS8907: Parameter 'I' is unread. Did you forget to use it to initialize the property with that name? // record struct A(int I, string S) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "I").WithArguments("I").WithLocation(2, 21)); var method = comp.GetMember<SynthesizedRecordDeconstruct>("A.Deconstruct"); Assert.False(method.IsDeclaredReadOnly); } [Fact] public void Deconstruct_UserDefined() { var source = @"using System; record struct B(int X, int Y) { public void Deconstruct(out int X, out int Y) { X = this.X + 1; Y = this.Y + 2; } static void M(B b) { switch (b) { case B(int x, int y): Console.Write(x); Console.Write(y); break; } } public static void Main() { M(new B(0, 0)); } } "; var verifier = CompileAndVerify(source, expectedOutput: "12"); verifier.VerifyDiagnostics(); } [Fact] public void Deconstruct_UserDefined_DifferentSignature_02() { var source = @"using System; record struct B(int X) { public int Deconstruct(out int a) => throw null; static void M(B b) { switch (b) { case B(int x): Console.Write(x); break; } } public static void Main() { M(new B(1)); } } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics( // (5,16): error CS8874: Record member 'B.Deconstruct(out int)' must return 'void'. // public int Deconstruct(out int a) => throw null; Diagnostic(ErrorCode.ERR_SignatureMismatchInRecord, "Deconstruct").WithArguments("B.Deconstruct(out int)", "void").WithLocation(5, 16), // (11,19): error CS8129: No suitable 'Deconstruct' instance or extension method was found for type 'B', with 1 out parameters and a void return type. // case B(int x): Diagnostic(ErrorCode.ERR_MissingDeconstruct, "(int x)").WithArguments("B", "1").WithLocation(11, 19)); Assert.Equal("System.Int32 B.Deconstruct(out System.Int32 a)", comp.GetMember("B.Deconstruct").ToTestDisplayString(includeNonNullable: false)); } [Theory] [InlineData("")] [InlineData("private")] [InlineData("internal")] public void Deconstruct_UserDefined_Accessibility_07(string accessibility) { var source = $@" record struct A(int X) {{ { accessibility } void Deconstruct(out int a) => throw null; }} "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,11): error CS8873: Record member 'A.Deconstruct(out int)' must be public. // void Deconstruct(out int a) Diagnostic(ErrorCode.ERR_NonPublicAPIInRecord, "Deconstruct").WithArguments("A.Deconstruct(out int)").WithLocation(4, 11 + accessibility.Length) ); } [Fact] public void Deconstruct_UserDefined_Static_08() { var source = @" record struct A(int X) { public static void Deconstruct(out int a) => throw null; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,24): error CS8877: Record member 'A.Deconstruct(out int)' may not be static. // public static void Deconstruct(out int a) Diagnostic(ErrorCode.ERR_StaticAPIInRecord, "Deconstruct").WithArguments("A.Deconstruct(out int)").WithLocation(4, 24) ); } [Fact] public void OutVarInPositionalParameterDefaultValue() { var source = @" record struct A(int X = A.M(out int a) + a) { public static int M(out int a) => throw null; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (2,25): error CS1736: Default parameter value for 'X' must be a compile-time constant // record struct A(int X = A.M(out int a) + a) Diagnostic(ErrorCode.ERR_DefaultValueMustBeConstant, "A.M(out int a) + a").WithArguments("X").WithLocation(2, 25) ); } [Fact] public void FieldConsideredUnassignedIfInitializationViaProperty() { var source = @" record struct Pos(int X) { private int x; public int X { get { return x; } set { x = value; } } = X; } record struct Pos2(int X) { private int x = X; // value isn't validated by setter public int X { get { return x; } set { x = value; } } } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (2,15): error CS0171: Field 'Pos.x' must be fully assigned before control is returned to the caller // record struct Pos(int X) Diagnostic(ErrorCode.ERR_UnassignedThis, "Pos").WithArguments("Pos.x").WithLocation(2, 15), // (5,16): error CS8050: Only auto-implemented properties can have initializers. // public int X { get { return x; } set { x = value; } } = X; Diagnostic(ErrorCode.ERR_InitializerOnNonAutoProperty, "X").WithArguments("Pos.X").WithLocation(5, 16) ); } [Fact] public void IEquatableT_01() { var source = @"record struct A<T>; class Program { static void F<T>(System.IEquatable<T> t) { } static void M<T>() { F(new A<T>()); } }"; var comp = CreateCompilation(source); comp.VerifyDiagnostics( ); } [Fact] public void IEquatableT_02() { var source = @"using System; record struct A; record struct B<T>; class Program { static bool F<T>(IEquatable<T> t, T t2) { return t.Equals(t2); } static void Main() { Console.Write(F(new A(), new A())); Console.Write(F(new B<int>(), new B<int>())); } }"; var comp = CreateCompilation(new[] { source, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview, options: TestOptions.ReleaseExe); CompileAndVerify(comp, expectedOutput: "TrueTrue").VerifyDiagnostics(); } [Fact] public void IEquatableT_02_ImplicitImplementation() { var source = @"using System; record struct A { public bool Equals(A other) { System.Console.Write(""A.Equals(A) ""); return false; } } record struct B<T> { public bool Equals(B<T> other) { System.Console.Write(""B.Equals(B) ""); return true; } } class Program { static bool F<T>(IEquatable<T> t, T t2) { return t.Equals(t2); } static void Main() { Console.Write(F(new A(), new A())); Console.Write("" ""); Console.Write(F(new B<int>(), new B<int>())); } }"; var comp = CreateCompilation(new[] { source, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview, options: TestOptions.ReleaseExe); CompileAndVerify(comp, expectedOutput: "A.Equals(A) False B.Equals(B) True").VerifyDiagnostics( // (4,17): warning CS8851: 'A' defines 'Equals' but not 'GetHashCode' // public bool Equals(A other) Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("A").WithLocation(4, 17), // (12,17): warning CS8851: 'B' defines 'Equals' but not 'GetHashCode' // public bool Equals(B<T> other) Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("B").WithLocation(12, 17) ); } [Fact] public void IEquatableT_02_ExplicitImplementation() { var source = @"using System; record struct A { bool IEquatable<A>.Equals(A other) { System.Console.Write(""A.Equals(A) ""); return false; } } record struct B<T> { bool IEquatable<B<T>>.Equals(B<T> other) { System.Console.Write(""B.Equals(B) ""); return true; } } class Program { static bool F<T>(IEquatable<T> t, T t2) { return t.Equals(t2); } static void Main() { Console.Write(F(new A(), new A())); Console.Write("" ""); Console.Write(F(new B<int>(), new B<int>())); } }"; var comp = CreateCompilation(new[] { source, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview, options: TestOptions.ReleaseExe); CompileAndVerify(comp, expectedOutput: "A.Equals(A) False B.Equals(B) True").VerifyDiagnostics(); } [Fact] public void IEquatableT_03() { var source = @" record struct A<T> : System.IEquatable<A<T>>; "; var comp = CreateCompilation(source); comp.VerifyDiagnostics(); var type = comp.GetMember<NamedTypeSymbol>("A"); AssertEx.Equal(new[] { "System.IEquatable<A<T>>" }, type.InterfacesNoUseSiteDiagnostics().ToTestDisplayStrings()); AssertEx.Equal(new[] { "System.IEquatable<A<T>>" }, type.AllInterfacesNoUseSiteDiagnostics.ToTestDisplayStrings()); } [Fact] public void IEquatableT_MissingIEquatable() { var source = @" record struct A<T>; "; var comp = CreateCompilation(source); comp.MakeTypeMissing(WellKnownType.System_IEquatable_T); comp.VerifyEmitDiagnostics( // (2,15): error CS0518: Predefined type 'System.IEquatable`1' is not defined or imported // record struct A<T>; Diagnostic(ErrorCode.ERR_PredefinedTypeNotFound, "A").WithArguments("System.IEquatable`1").WithLocation(2, 15), // (2,15): error CS0518: Predefined type 'System.IEquatable`1' is not defined or imported // record struct A<T>; Diagnostic(ErrorCode.ERR_PredefinedTypeNotFound, "A").WithArguments("System.IEquatable`1").WithLocation(2, 15) ); var type = comp.GetMember<NamedTypeSymbol>("A"); AssertEx.Equal(new[] { "System.IEquatable<A<T>>[missing]" }, type.InterfacesNoUseSiteDiagnostics().ToTestDisplayStrings()); AssertEx.Equal(new[] { "System.IEquatable<A<T>>[missing]" }, type.AllInterfacesNoUseSiteDiagnostics.ToTestDisplayStrings()); } [Fact] public void RecordEquals_01() { var source = @" var a1 = new B(); var a2 = new B(); System.Console.WriteLine(a1.Equals(a2)); record struct B { public bool Equals(B other) { System.Console.WriteLine(""B.Equals(B)""); return false; } } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics( // (8,17): warning CS8851: 'B' defines 'Equals' but not 'GetHashCode' // public bool Equals(B other) Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("B").WithLocation(8, 17) ); CompileAndVerify(comp, expectedOutput: @" B.Equals(B) False "); } [Fact] public void RecordEquals_01_NoInParameters() { var source = @" var a1 = new B(); var a2 = new B(); System.Console.WriteLine(a1.Equals(in a2)); record struct B; "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,39): error CS1615: Argument 1 may not be passed with the 'in' keyword // System.Console.WriteLine(a1.Equals(in a2)); Diagnostic(ErrorCode.ERR_BadArgExtraRef, "a2").WithArguments("1", "in").WithLocation(4, 39) ); } [Theory] [InlineData("protected")] [InlineData("private protected")] [InlineData("internal protected")] public void RecordEquals_10(string accessibility) { var source = $@" record struct A {{ { accessibility } bool Equals(A x) => throw null; bool System.IEquatable<A>.Equals(A x) => throw null; }} "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,29): error CS0666: 'A.Equals(A)': new protected member declared in struct // internal protected bool Equals(A x) Diagnostic(ErrorCode.ERR_ProtectedInStruct, "Equals").WithArguments("A.Equals(A)").WithLocation(4, 11 + accessibility.Length), // (4,29): error CS8873: Record member 'A.Equals(A)' must be public. // internal protected bool Equals(A x) Diagnostic(ErrorCode.ERR_NonPublicAPIInRecord, "Equals").WithArguments("A.Equals(A)").WithLocation(4, 11 + accessibility.Length), // (4,29): warning CS8851: 'A' defines 'Equals' but not 'GetHashCode' // internal protected bool Equals(A x) Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("A").WithLocation(4, 11 + accessibility.Length) ); } [Theory] [InlineData("")] [InlineData("private")] [InlineData("internal")] public void RecordEquals_11(string accessibility) { var source = $@" record struct A {{ { accessibility } bool Equals(A x) => throw null; bool System.IEquatable<A>.Equals(A x) => throw null; }} "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,...): error CS8873: Record member 'A.Equals(A)' must be public. // { accessibility } bool Equals(A x) Diagnostic(ErrorCode.ERR_NonPublicAPIInRecord, "Equals").WithArguments("A.Equals(A)").WithLocation(4, 11 + accessibility.Length), // (4,11): warning CS8851: 'A' defines 'Equals' but not 'GetHashCode' // bool Equals(A x) Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("A").WithLocation(4, 11 + accessibility.Length) ); } [Fact] public void RecordEquals_12() { var source = @" A a1 = new A(); A a2 = new A(); System.Console.Write(a1.Equals(a2)); System.Console.Write(a1.Equals((object)a2)); record struct A { public bool Equals(B other) => throw null; } class B { } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "TrueTrue"); verifier.VerifyIL("A.Equals(A)", @" { // Code size 2 (0x2) .maxstack 1 IL_0000: ldc.i4.1 IL_0001: ret }"); verifier.VerifyIL("A.Equals(object)", @" { // Code size 23 (0x17) .maxstack 2 IL_0000: ldarg.1 IL_0001: isinst ""A"" IL_0006: brfalse.s IL_0015 IL_0008: ldarg.0 IL_0009: ldarg.1 IL_000a: unbox.any ""A"" IL_000f: call ""readonly bool A.Equals(A)"" IL_0014: ret IL_0015: ldc.i4.0 IL_0016: ret }"); verifier.VerifyIL("A.GetHashCode()", @" { // Code size 2 (0x2) .maxstack 1 IL_0000: ldc.i4.0 IL_0001: ret }"); var recordEquals = comp.GetMembers("A.Equals").OfType<SynthesizedRecordEquals>().Single(); Assert.Equal("readonly System.Boolean A.Equals(A other)", recordEquals.ToTestDisplayString()); Assert.Equal(Accessibility.Public, recordEquals.DeclaredAccessibility); Assert.False(recordEquals.IsAbstract); Assert.False(recordEquals.IsVirtual); Assert.False(recordEquals.IsOverride); Assert.False(recordEquals.IsSealed); Assert.True(recordEquals.IsImplicitlyDeclared); var objectEquals = comp.GetMembers("A.Equals").OfType<SynthesizedRecordObjEquals>().Single(); Assert.Equal("readonly System.Boolean A.Equals(System.Object obj)", objectEquals.ToTestDisplayString()); Assert.Equal(Accessibility.Public, objectEquals.DeclaredAccessibility); Assert.False(objectEquals.IsAbstract); Assert.False(objectEquals.IsVirtual); Assert.True(objectEquals.IsOverride); Assert.False(objectEquals.IsSealed); Assert.True(objectEquals.IsImplicitlyDeclared); MethodSymbol gethashCode = comp.GetMembers("A." + WellKnownMemberNames.ObjectGetHashCode).OfType<SynthesizedRecordGetHashCode>().Single(); Assert.Equal("readonly System.Int32 A.GetHashCode()", gethashCode.ToTestDisplayString()); Assert.Equal(Accessibility.Public, gethashCode.DeclaredAccessibility); Assert.False(gethashCode.IsStatic); Assert.False(gethashCode.IsAbstract); Assert.False(gethashCode.IsVirtual); Assert.True(gethashCode.IsOverride); Assert.False(gethashCode.IsSealed); Assert.True(gethashCode.IsImplicitlyDeclared); } [Fact] public void RecordEquals_13() { var source = @" record struct A { public int Equals(A other) => throw null; bool System.IEquatable<A>.Equals(A x) => throw null; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,16): error CS8874: Record member 'A.Equals(A)' must return 'bool'. // public int Equals(A other) Diagnostic(ErrorCode.ERR_SignatureMismatchInRecord, "Equals").WithArguments("A.Equals(A)", "bool").WithLocation(4, 16), // (4,16): warning CS8851: 'A' defines 'Equals' but not 'GetHashCode' // public int Equals(A other) Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("A").WithLocation(4, 16) ); } [Fact] public void RecordEquals_14() { var source = @" record struct A { public bool Equals(A other) => throw null; System.Boolean System.IEquatable<A>.Equals(A x) => throw null; } "; var comp = CreateCompilation(source); comp.MakeTypeMissing(SpecialType.System_Boolean); comp.VerifyEmitDiagnostics( // (2,1): error CS0518: Predefined type 'System.Boolean' is not defined or imported // record struct A Diagnostic(ErrorCode.ERR_PredefinedTypeNotFound, @"record struct A { public bool Equals(A other) => throw null; System.Boolean System.IEquatable<A>.Equals(A x) => throw null; }").WithArguments("System.Boolean").WithLocation(2, 1), // (2,1): error CS0518: Predefined type 'System.Boolean' is not defined or imported // record struct A Diagnostic(ErrorCode.ERR_PredefinedTypeNotFound, @"record struct A { public bool Equals(A other) => throw null; System.Boolean System.IEquatable<A>.Equals(A x) => throw null; }").WithArguments("System.Boolean").WithLocation(2, 1), // (2,15): error CS0518: Predefined type 'System.Boolean' is not defined or imported // record struct A Diagnostic(ErrorCode.ERR_PredefinedTypeNotFound, "A").WithArguments("System.Boolean").WithLocation(2, 15), // (2,15): error CS0518: Predefined type 'System.Boolean' is not defined or imported // record struct A Diagnostic(ErrorCode.ERR_PredefinedTypeNotFound, "A").WithArguments("System.Boolean").WithLocation(2, 15), // (2,15): error CS0518: Predefined type 'System.Boolean' is not defined or imported // record struct A Diagnostic(ErrorCode.ERR_PredefinedTypeNotFound, "A").WithArguments("System.Boolean").WithLocation(2, 15), // (2,15): error CS0518: Predefined type 'System.Boolean' is not defined or imported // record struct A Diagnostic(ErrorCode.ERR_PredefinedTypeNotFound, "A").WithArguments("System.Boolean").WithLocation(2, 15), // (4,12): error CS0518: Predefined type 'System.Boolean' is not defined or imported // public bool Equals(A other) Diagnostic(ErrorCode.ERR_PredefinedTypeNotFound, "bool").WithArguments("System.Boolean").WithLocation(4, 12), // (4,17): warning CS8851: 'A' defines 'Equals' but not 'GetHashCode' // public bool Equals(A other) Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("A").WithLocation(4, 17) ); } [Fact] public void RecordEquals_19() { var source = @" record struct A { public static bool Equals(A x) => throw null; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (2,15): error CS0736: 'A' does not implement interface member 'IEquatable<A>.Equals(A)'. 'A.Equals(A)' cannot implement an interface member because it is static. // record struct A Diagnostic(ErrorCode.ERR_CloseUnimplementedInterfaceMemberStatic, "A").WithArguments("A", "System.IEquatable<A>.Equals(A)", "A.Equals(A)").WithLocation(2, 15), // (4,24): error CS8877: Record member 'A.Equals(A)' may not be static. // public static bool Equals(A x) => throw null; Diagnostic(ErrorCode.ERR_StaticAPIInRecord, "Equals").WithArguments("A.Equals(A)").WithLocation(4, 24), // (4,24): warning CS8851: 'A' defines 'Equals' but not 'GetHashCode' // public static bool Equals(A x) => throw null; Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("A").WithLocation(4, 24) ); } [Fact] public void RecordEquals_RecordEqualsInValueType() { var src = @" public record struct A; namespace System { public class Object { public virtual bool Equals(object x) => throw null; public virtual int GetHashCode() => throw null; public virtual string ToString() => throw null; } public class Exception { } public class ValueType { public bool Equals(A x) => throw null; } public class Attribute { } public class String { } public struct Void { } public struct Boolean { } public struct Char { } public struct Int32 { } public interface IEquatable<T> { } } namespace System.Collections.Generic { public abstract class EqualityComparer<T> { public static EqualityComparer<T> Default => throw null; public abstract int GetHashCode(T t); } } namespace System.Text { public class StringBuilder { public StringBuilder Append(string s) => null; public StringBuilder Append(char c) => null; public StringBuilder Append(object o) => null; } } "; var comp = CreateEmptyCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics( // warning CS8021: No value for RuntimeMetadataVersion found. No assembly containing System.Object was found nor was a value for RuntimeMetadataVersion specified through options. Diagnostic(ErrorCode.WRN_NoRuntimeMetadataVersion).WithLocation(1, 1) ); var recordEquals = comp.GetMembers("A.Equals").OfType<SynthesizedRecordEquals>().Single(); Assert.Equal("readonly System.Boolean A.Equals(A other)", recordEquals.ToTestDisplayString()); } [Fact] public void RecordEquals_FourFields() { var source = @" A a1 = new A(1, ""hello""); System.Console.Write(a1.Equals(a1)); System.Console.Write(a1.Equals((object)a1)); System.Console.Write("" - ""); A a2 = new A(1, ""hello"") { fieldI = 100 }; System.Console.Write(a1.Equals(a2)); System.Console.Write(a1.Equals((object)a2)); System.Console.Write(a2.Equals(a1)); System.Console.Write(a2.Equals((object)a1)); System.Console.Write("" - ""); A a3 = new A(1, ""world""); System.Console.Write(a1.Equals(a3)); System.Console.Write(a1.Equals((object)a3)); System.Console.Write(a3.Equals(a1)); System.Console.Write(a3.Equals((object)a1)); record struct A(int I, string S) { public int fieldI = 42; public string fieldS = ""hello""; } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "TrueTrue - FalseFalseFalseFalse - FalseFalseFalseFalse"); verifier.VerifyIL("A.Equals(A)", @" { // Code size 97 (0x61) .maxstack 3 IL_0000: call ""System.Collections.Generic.EqualityComparer<int> System.Collections.Generic.EqualityComparer<int>.Default.get"" IL_0005: ldarg.0 IL_0006: ldfld ""int A.<I>k__BackingField"" IL_000b: ldarg.1 IL_000c: ldfld ""int A.<I>k__BackingField"" IL_0011: callvirt ""bool System.Collections.Generic.EqualityComparer<int>.Equals(int, int)"" IL_0016: brfalse.s IL_005f IL_0018: call ""System.Collections.Generic.EqualityComparer<string> System.Collections.Generic.EqualityComparer<string>.Default.get"" IL_001d: ldarg.0 IL_001e: ldfld ""string A.<S>k__BackingField"" IL_0023: ldarg.1 IL_0024: ldfld ""string A.<S>k__BackingField"" IL_0029: callvirt ""bool System.Collections.Generic.EqualityComparer<string>.Equals(string, string)"" IL_002e: brfalse.s IL_005f IL_0030: call ""System.Collections.Generic.EqualityComparer<int> System.Collections.Generic.EqualityComparer<int>.Default.get"" IL_0035: ldarg.0 IL_0036: ldfld ""int A.fieldI"" IL_003b: ldarg.1 IL_003c: ldfld ""int A.fieldI"" IL_0041: callvirt ""bool System.Collections.Generic.EqualityComparer<int>.Equals(int, int)"" IL_0046: brfalse.s IL_005f IL_0048: call ""System.Collections.Generic.EqualityComparer<string> System.Collections.Generic.EqualityComparer<string>.Default.get"" IL_004d: ldarg.0 IL_004e: ldfld ""string A.fieldS"" IL_0053: ldarg.1 IL_0054: ldfld ""string A.fieldS"" IL_0059: callvirt ""bool System.Collections.Generic.EqualityComparer<string>.Equals(string, string)"" IL_005e: ret IL_005f: ldc.i4.0 IL_0060: ret }"); verifier.VerifyIL("A.Equals(object)", @" { // Code size 23 (0x17) .maxstack 2 IL_0000: ldarg.1 IL_0001: isinst ""A"" IL_0006: brfalse.s IL_0015 IL_0008: ldarg.0 IL_0009: ldarg.1 IL_000a: unbox.any ""A"" IL_000f: call ""readonly bool A.Equals(A)"" IL_0014: ret IL_0015: ldc.i4.0 IL_0016: ret }"); verifier.VerifyIL("A.GetHashCode()", @" { // Code size 86 (0x56) .maxstack 3 IL_0000: call ""System.Collections.Generic.EqualityComparer<int> System.Collections.Generic.EqualityComparer<int>.Default.get"" IL_0005: ldarg.0 IL_0006: ldfld ""int A.<I>k__BackingField"" IL_000b: callvirt ""int System.Collections.Generic.EqualityComparer<int>.GetHashCode(int)"" IL_0010: ldc.i4 0xa5555529 IL_0015: mul IL_0016: call ""System.Collections.Generic.EqualityComparer<string> System.Collections.Generic.EqualityComparer<string>.Default.get"" IL_001b: ldarg.0 IL_001c: ldfld ""string A.<S>k__BackingField"" IL_0021: callvirt ""int System.Collections.Generic.EqualityComparer<string>.GetHashCode(string)"" IL_0026: add IL_0027: ldc.i4 0xa5555529 IL_002c: mul IL_002d: call ""System.Collections.Generic.EqualityComparer<int> System.Collections.Generic.EqualityComparer<int>.Default.get"" IL_0032: ldarg.0 IL_0033: ldfld ""int A.fieldI"" IL_0038: callvirt ""int System.Collections.Generic.EqualityComparer<int>.GetHashCode(int)"" IL_003d: add IL_003e: ldc.i4 0xa5555529 IL_0043: mul IL_0044: call ""System.Collections.Generic.EqualityComparer<string> System.Collections.Generic.EqualityComparer<string>.Default.get"" IL_0049: ldarg.0 IL_004a: ldfld ""string A.fieldS"" IL_004f: callvirt ""int System.Collections.Generic.EqualityComparer<string>.GetHashCode(string)"" IL_0054: add IL_0055: ret }"); } [Fact] public void RecordEquals_StaticField() { var source = @" record struct A { public static int field = 42; } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp); verifier.VerifyIL("A.Equals(A)", @" { // Code size 2 (0x2) .maxstack 1 IL_0000: ldc.i4.1 IL_0001: ret }"); verifier.VerifyIL("A.GetHashCode()", @" { // Code size 2 (0x2) .maxstack 1 IL_0000: ldc.i4.0 IL_0001: ret }"); } [Fact] public void RecordEquals_GeneratedAsReadOnly() { var src = @" record struct A(int I, string S); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var recordEquals = comp.GetMembers("A.Equals").OfType<SynthesizedRecordEquals>().Single(); Assert.True(recordEquals.IsDeclaredReadOnly); } [Fact] public void ObjectEquals_06() { var source = @" record struct A { public static new bool Equals(object obj) => throw null; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,28): error CS0111: Type 'A' already defines a member called 'Equals' with the same parameter types // public static new bool Equals(object obj) => throw null; Diagnostic(ErrorCode.ERR_MemberAlreadyExists, "Equals").WithArguments("Equals", "A").WithLocation(4, 28) ); } [Fact] public void ObjectEquals_UserDefined() { var source = @" record struct A { public override bool Equals(object obj) => throw null; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,26): error CS0111: Type 'A' already defines a member called 'Equals' with the same parameter types // public override bool Equals(object obj) => throw null; Diagnostic(ErrorCode.ERR_MemberAlreadyExists, "Equals").WithArguments("Equals", "A").WithLocation(4, 26) ); } [Fact] public void ObjectEquals_GeneratedAsReadOnly() { var src = @" record struct A(int I, string S); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var objectEquals = comp.GetMembers("A.Equals").OfType<SynthesizedRecordObjEquals>().Single(); Assert.True(objectEquals.IsDeclaredReadOnly); } [Fact] public void GetHashCode_UserDefined() { var source = @" System.Console.Write(new A().GetHashCode()); record struct A { public override int GetHashCode() => 42; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics(); CompileAndVerify(comp, expectedOutput: "42"); } [Fact] public void GetHashCode_GetHashCodeInValueType() { var src = @" public record struct A; namespace System { public class Object { public virtual bool Equals(object x) => throw null; public virtual string ToString() => throw null; } public class Exception { } public class ValueType { public virtual int GetHashCode() => throw null; } public class Attribute { } public class String { } public struct Void { } public struct Boolean { } public struct Char { } public struct Int32 { } public interface IEquatable<T> { } } namespace System.Collections.Generic { public abstract class EqualityComparer<T> { public static EqualityComparer<T> Default => throw null; public abstract int GetHashCode(T t); } } namespace System.Text { public class StringBuilder { public StringBuilder Append(string s) => null; public StringBuilder Append(char c) => null; public StringBuilder Append(object o) => null; } } "; var comp = CreateEmptyCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics( // warning CS8021: No value for RuntimeMetadataVersion found. No assembly containing System.Object was found nor was a value for RuntimeMetadataVersion specified through options. Diagnostic(ErrorCode.WRN_NoRuntimeMetadataVersion).WithLocation(1, 1), // (2,22): error CS8869: 'A.GetHashCode()' does not override expected method from 'object'. // public record struct A; Diagnostic(ErrorCode.ERR_DoesNotOverrideMethodFromObject, "A").WithArguments("A.GetHashCode()").WithLocation(2, 22) ); } [Fact] public void GetHashCode_MissingEqualityComparer_EmptyRecord() { var src = @" public record struct A; "; var comp = CreateCompilation(src); comp.MakeTypeMissing(WellKnownType.System_Collections_Generic_EqualityComparer_T); comp.VerifyEmitDiagnostics(); } [Fact] public void GetHashCode_MissingEqualityComparer_NonEmptyRecord() { var src = @" public record struct A(int I); "; var comp = CreateCompilation(src); comp.MakeTypeMissing(WellKnownType.System_Collections_Generic_EqualityComparer_T); comp.VerifyEmitDiagnostics( // (2,1): error CS0656: Missing compiler required member 'System.Collections.Generic.EqualityComparer`1.GetHashCode' // public record struct A(int I); Diagnostic(ErrorCode.ERR_MissingPredefinedMember, "public record struct A(int I);").WithArguments("System.Collections.Generic.EqualityComparer`1", "GetHashCode").WithLocation(2, 1), // (2,1): error CS0656: Missing compiler required member 'System.Collections.Generic.EqualityComparer`1.get_Default' // public record struct A(int I); Diagnostic(ErrorCode.ERR_MissingPredefinedMember, "public record struct A(int I);").WithArguments("System.Collections.Generic.EqualityComparer`1", "get_Default").WithLocation(2, 1) ); } [Fact] public void GetHashCode_GeneratedAsReadOnly() { var src = @" record struct A(int I, string S); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var method = comp.GetMember<SynthesizedRecordGetHashCode>("A.GetHashCode"); Assert.True(method.IsDeclaredReadOnly); } [Fact] public void GetHashCodeIsDefinedButEqualsIsNot() { var src = @" public record struct C { public object Data; public override int GetHashCode() { return 0; } }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); } [Fact] public void EqualsIsDefinedButGetHashCodeIsNot() { var src = @" public record struct C { public object Data; public bool Equals(C c) { return false; } }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (5,17): warning CS8851: 'C' defines 'Equals' but not 'GetHashCode' // public bool Equals(C c) { return false; } Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("C").WithLocation(5, 17)); } [Fact] public void EqualityOperators_01() { var source = @" record struct A(int X) { public bool Equals(ref A other) => throw null; static void Main() { Test(default, default); Test(default, new A(0)); Test(new A(1), new A(1)); Test(new A(2), new A(3)); var a = new A(11); Test(a, a); } static void Test(A a1, A a2) { System.Console.WriteLine(""{0} {1} {2} {3}"", a1 == a2, a2 == a1, a1 != a2, a2 != a1); } } "; var verifier = CompileAndVerify(source, expectedOutput: @" True True False False True True False False True True False False False False True True True True False False ").VerifyDiagnostics(); var comp = (CSharpCompilation)verifier.Compilation; MethodSymbol op = comp.GetMembers("A." + WellKnownMemberNames.EqualityOperatorName).OfType<SynthesizedRecordEqualityOperator>().Single(); Assert.Equal("System.Boolean A.op_Equality(A left, A right)", op.ToTestDisplayString()); Assert.Equal(Accessibility.Public, op.DeclaredAccessibility); Assert.True(op.IsStatic); Assert.False(op.IsAbstract); Assert.False(op.IsVirtual); Assert.False(op.IsOverride); Assert.False(op.IsSealed); Assert.True(op.IsImplicitlyDeclared); op = comp.GetMembers("A." + WellKnownMemberNames.InequalityOperatorName).OfType<SynthesizedRecordInequalityOperator>().Single(); Assert.Equal("System.Boolean A.op_Inequality(A left, A right)", op.ToTestDisplayString()); Assert.Equal(Accessibility.Public, op.DeclaredAccessibility); Assert.True(op.IsStatic); Assert.False(op.IsAbstract); Assert.False(op.IsVirtual); Assert.False(op.IsOverride); Assert.False(op.IsSealed); Assert.True(op.IsImplicitlyDeclared); verifier.VerifyIL("bool A.op_Equality(A, A)", @" { // Code size 9 (0x9) .maxstack 2 IL_0000: ldarga.s V_0 IL_0002: ldarg.1 IL_0003: call ""readonly bool A.Equals(A)"" IL_0008: ret } "); verifier.VerifyIL("bool A.op_Inequality(A, A)", @" { // Code size 11 (0xb) .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call ""bool A.op_Equality(A, A)"" IL_0007: ldc.i4.0 IL_0008: ceq IL_000a: ret } "); } [Fact] public void EqualityOperators_03() { var source = @" record struct A { public static bool operator==(A r1, A r2) => throw null; public static bool operator==(A r1, string r2) => throw null; public static bool operator!=(A r1, string r2) => throw null; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,32): error CS0111: Type 'A' already defines a member called 'op_Equality' with the same parameter types // public static bool operator==(A r1, A r2) Diagnostic(ErrorCode.ERR_MemberAlreadyExists, "==").WithArguments("op_Equality", "A").WithLocation(4, 32) ); } [Fact] public void EqualityOperators_04() { var source = @" record struct A { public static bool operator!=(A r1, A r2) => throw null; public static bool operator!=(string r1, A r2) => throw null; public static bool operator==(string r1, A r2) => throw null; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,32): error CS0111: Type 'A' already defines a member called 'op_Inequality' with the same parameter types // public static bool operator!=(A r1, A r2) Diagnostic(ErrorCode.ERR_MemberAlreadyExists, "!=").WithArguments("op_Inequality", "A").WithLocation(4, 32) ); } [Fact] public void EqualityOperators_05() { var source = @" record struct A { public static bool op_Equality(A r1, A r2) => throw null; public static bool op_Equality(string r1, A r2) => throw null; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,24): error CS0111: Type 'A' already defines a member called 'op_Equality' with the same parameter types // public static bool op_Equality(A r1, A r2) Diagnostic(ErrorCode.ERR_MemberAlreadyExists, "op_Equality").WithArguments("op_Equality", "A").WithLocation(4, 24) ); } [Fact] public void EqualityOperators_06() { var source = @" record struct A { public static bool op_Inequality(A r1, A r2) => throw null; public static bool op_Inequality(A r1, string r2) => throw null; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,24): error CS0111: Type 'A' already defines a member called 'op_Inequality' with the same parameter types // public static bool op_Inequality(A r1, A r2) Diagnostic(ErrorCode.ERR_MemberAlreadyExists, "op_Inequality").WithArguments("op_Inequality", "A").WithLocation(4, 24) ); } [Fact] public void EqualityOperators_07() { var source = @" record struct A { public static bool Equals(A other) => throw null; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (2,15): error CS0736: 'A' does not implement interface member 'IEquatable<A>.Equals(A)'. 'A.Equals(A)' cannot implement an interface member because it is static. // record struct A Diagnostic(ErrorCode.ERR_CloseUnimplementedInterfaceMemberStatic, "A").WithArguments("A", "System.IEquatable<A>.Equals(A)", "A.Equals(A)").WithLocation(2, 15), // (4,24): error CS8877: Record member 'A.Equals(A)' may not be static. // public static bool Equals(A other) Diagnostic(ErrorCode.ERR_StaticAPIInRecord, "Equals").WithArguments("A.Equals(A)").WithLocation(4, 24), // (4,24): warning CS8851: 'A' defines 'Equals' but not 'GetHashCode' // public static bool Equals(A other) Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("A").WithLocation(4, 24) ); } [Theory] [CombinatorialData] public void EqualityOperators_09(bool useImageReference) { var source1 = @" public record struct A(int X); "; var comp1 = CreateCompilation(source1); var source2 = @" class Program { static void Main() { Test(default, default); Test(default, new A(0)); Test(new A(1), new A(1)); Test(new A(2), new A(3)); } static void Test(A a1, A a2) { System.Console.WriteLine(""{0} {1} {2} {3}"", a1 == a2, a2 == a1, a1 != a2, a2 != a1); } } "; CompileAndVerify(source2, references: new[] { useImageReference ? comp1.EmitToImageReference() : comp1.ToMetadataReference() }, expectedOutput: @" True True False False True True False False True True False False False False True True ").VerifyDiagnostics(); } [Fact] public void GetSimpleNonTypeMembers_DirectApiCheck() { var src = @" public record struct RecordB(); "; var comp = CreateCompilation(src); var b = comp.GlobalNamespace.GetTypeMember("RecordB"); AssertEx.SetEqual(new[] { "System.Boolean RecordB.op_Equality(RecordB left, RecordB right)" }, b.GetSimpleNonTypeMembers("op_Equality").ToTestDisplayStrings()); } [Fact] public void ToString_NestedRecord() { var src = @" var c1 = new Outer.C1(42); System.Console.Write(c1.ToString()); public class Outer { public record struct C1(int I1); } "; var compDebug = CreateCompilation(new[] { src, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview, options: TestOptions.DebugExe); var compRelease = CreateCompilation(new[] { src, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview, options: TestOptions.ReleaseExe); CompileAndVerify(compDebug, expectedOutput: "C1 { I1 = 42 }"); compDebug.VerifyEmitDiagnostics(); CompileAndVerify(compRelease, expectedOutput: "C1 { I1 = 42 }"); compRelease.VerifyEmitDiagnostics(); } [Fact] public void ToString_TopLevelRecord_Empty() { var src = @" var c1 = new C1(); System.Console.Write(c1.ToString()); record struct C1; "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(); var v = CompileAndVerify(comp, expectedOutput: "C1 { }"); var print = comp.GetMember<MethodSymbol>("C1." + WellKnownMemberNames.PrintMembersMethodName); Assert.Equal(Accessibility.Private, print.DeclaredAccessibility); Assert.False(print.IsOverride); Assert.False(print.IsVirtual); Assert.False(print.IsAbstract); Assert.False(print.IsSealed); Assert.True(print.IsImplicitlyDeclared); var toString = comp.GetMember<MethodSymbol>("C1." + WellKnownMemberNames.ObjectToString); Assert.Equal(Accessibility.Public, toString.DeclaredAccessibility); Assert.True(toString.IsOverride); Assert.False(toString.IsVirtual); Assert.False(toString.IsAbstract); Assert.False(toString.IsSealed); Assert.True(toString.IsImplicitlyDeclared); v.VerifyIL("C1." + WellKnownMemberNames.PrintMembersMethodName, @" { // Code size 2 (0x2) .maxstack 1 IL_0000: ldc.i4.0 IL_0001: ret } "); v.VerifyIL("C1." + WellKnownMemberNames.ObjectToString, @" { // Code size 64 (0x40) .maxstack 2 .locals init (System.Text.StringBuilder V_0) IL_0000: newobj ""System.Text.StringBuilder..ctor()"" IL_0005: stloc.0 IL_0006: ldloc.0 IL_0007: ldstr ""C1"" IL_000c: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_0011: pop IL_0012: ldloc.0 IL_0013: ldstr "" { "" IL_0018: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_001d: pop IL_001e: ldarg.0 IL_001f: ldloc.0 IL_0020: call ""readonly bool C1.PrintMembers(System.Text.StringBuilder)"" IL_0025: brfalse.s IL_0030 IL_0027: ldloc.0 IL_0028: ldc.i4.s 32 IL_002a: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(char)"" IL_002f: pop IL_0030: ldloc.0 IL_0031: ldc.i4.s 125 IL_0033: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(char)"" IL_0038: pop IL_0039: ldloc.0 IL_003a: callvirt ""string object.ToString()"" IL_003f: ret } "); } [Fact] public void ToString_TopLevelRecord_MissingStringBuilder() { var src = @" record struct C1; "; var comp = CreateCompilation(src); comp.MakeTypeMissing(WellKnownType.System_Text_StringBuilder); comp.VerifyEmitDiagnostics( // (2,1): error CS0518: Predefined type 'System.Text.StringBuilder' is not defined or imported // record struct C1; Diagnostic(ErrorCode.ERR_PredefinedTypeNotFound, "record struct C1;").WithArguments("System.Text.StringBuilder").WithLocation(2, 1), // (2,1): error CS0656: Missing compiler required member 'System.Text.StringBuilder..ctor' // record struct C1; Diagnostic(ErrorCode.ERR_MissingPredefinedMember, "record struct C1;").WithArguments("System.Text.StringBuilder", ".ctor").WithLocation(2, 1), // (2,15): error CS0518: Predefined type 'System.Text.StringBuilder' is not defined or imported // record struct C1; Diagnostic(ErrorCode.ERR_PredefinedTypeNotFound, "C1").WithArguments("System.Text.StringBuilder").WithLocation(2, 15) ); } [Fact] public void ToString_TopLevelRecord_MissingStringBuilderCtor() { var src = @" record struct C1; "; var comp = CreateCompilation(src); comp.MakeMemberMissing(WellKnownMember.System_Text_StringBuilder__ctor); comp.VerifyEmitDiagnostics( // (2,1): error CS0656: Missing compiler required member 'System.Text.StringBuilder..ctor' // record struct C1; Diagnostic(ErrorCode.ERR_MissingPredefinedMember, "record struct C1;").WithArguments("System.Text.StringBuilder", ".ctor").WithLocation(2, 1) ); } [Fact] public void ToString_TopLevelRecord_MissingStringBuilderAppendString() { var src = @" record struct C1; "; var comp = CreateCompilation(src); comp.MakeMemberMissing(WellKnownMember.System_Text_StringBuilder__AppendString); comp.VerifyEmitDiagnostics( // (2,1): error CS0656: Missing compiler required member 'System.Text.StringBuilder.Append' // record struct C1; Diagnostic(ErrorCode.ERR_MissingPredefinedMember, "record struct C1;").WithArguments("System.Text.StringBuilder", "Append").WithLocation(2, 1) ); } [Fact] public void ToString_TopLevelRecord_OneProperty_MissingStringBuilderAppendString() { var src = @" record struct C1(int P); "; var comp = CreateCompilation(src); comp.MakeMemberMissing(WellKnownMember.System_Text_StringBuilder__AppendString); comp.VerifyEmitDiagnostics( // (2,1): error CS0656: Missing compiler required member 'System.Text.StringBuilder.Append' // record struct C1(int P); Diagnostic(ErrorCode.ERR_MissingPredefinedMember, "record struct C1(int P);").WithArguments("System.Text.StringBuilder", "Append").WithLocation(2, 1), // (2,1): error CS0656: Missing compiler required member 'System.Text.StringBuilder.Append' // record struct C1(int P); Diagnostic(ErrorCode.ERR_MissingPredefinedMember, "record struct C1(int P);").WithArguments("System.Text.StringBuilder", "Append").WithLocation(2, 1) ); } [Fact] public void ToString_RecordWithIndexer() { var src = @" var c1 = new C1(42); System.Console.Write(c1.ToString()); record struct C1(int I1) { private int field = 44; public int this[int i] => 0; public int PropertyWithoutGetter { set { } } public int P2 { get => 43; } public event System.Action a = null; private int field1 = 100; internal int field2 = 100; private int Property1 { get; set; } = 100; internal int Property2 { get; set; } = 100; } "; var comp = CreateCompilation(src); CompileAndVerify(comp, expectedOutput: "C1 { I1 = 42, P2 = 43 }"); comp.VerifyEmitDiagnostics( // (7,17): warning CS0414: The field 'C1.field' is assigned but its value is never used // private int field = 44; Diagnostic(ErrorCode.WRN_UnreferencedFieldAssg, "field").WithArguments("C1.field").WithLocation(7, 17), // (11,32): warning CS0414: The field 'C1.a' is assigned but its value is never used // public event System.Action a = null; Diagnostic(ErrorCode.WRN_UnreferencedFieldAssg, "a").WithArguments("C1.a").WithLocation(11, 32), // (13,17): warning CS0414: The field 'C1.field1' is assigned but its value is never used // private int field1 = 100; Diagnostic(ErrorCode.WRN_UnreferencedFieldAssg, "field1").WithArguments("C1.field1").WithLocation(13, 17) ); } [Fact] public void ToString_PrivateGetter() { var src = @" var c1 = new C1(); System.Console.Write(c1.ToString()); record struct C1 { public int P1 { private get => 43; set => throw null; } } "; var comp = CreateCompilation(src); CompileAndVerify(comp, expectedOutput: "C1 { P1 = 43 }"); comp.VerifyEmitDiagnostics(); } [Fact] public void ToString_TopLevelRecord_OneField_ValueType() { var src = @" var c1 = new C1() { field = 42 }; System.Console.Write(c1.ToString()); record struct C1 { public int field; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(); var v = CompileAndVerify(comp, expectedOutput: "C1 { field = 42 }"); var print = comp.GetMember<MethodSymbol>("C1." + WellKnownMemberNames.PrintMembersMethodName); Assert.Equal(Accessibility.Private, print.DeclaredAccessibility); Assert.False(print.IsOverride); Assert.False(print.IsVirtual); Assert.False(print.IsAbstract); Assert.False(print.IsSealed); Assert.True(print.IsImplicitlyDeclared); var toString = comp.GetMember<MethodSymbol>("C1." + WellKnownMemberNames.ObjectToString); Assert.Equal(Accessibility.Public, toString.DeclaredAccessibility); Assert.True(toString.IsOverride); Assert.False(toString.IsVirtual); Assert.False(toString.IsAbstract); Assert.False(toString.IsSealed); Assert.True(toString.IsImplicitlyDeclared); v.VerifyIL("C1." + WellKnownMemberNames.PrintMembersMethodName, @" { // Code size 38 (0x26) .maxstack 2 IL_0000: ldarg.1 IL_0001: ldstr ""field = "" IL_0006: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_000b: pop IL_000c: ldarg.1 IL_000d: ldarg.0 IL_000e: ldflda ""int C1.field"" IL_0013: constrained. ""int"" IL_0019: callvirt ""string object.ToString()"" IL_001e: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_0023: pop IL_0024: ldc.i4.1 IL_0025: ret } "); } [Fact] public void ToString_TopLevelRecord_OneField_ConstrainedValueType() { var src = @" var c1 = new C1<int>() { field = 42 }; System.Console.Write(c1.ToString()); record struct C1<T> where T : struct { public T field; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(); var v = CompileAndVerify(comp, expectedOutput: "C1 { field = 42 }"); v.VerifyIL("C1<T>." + WellKnownMemberNames.PrintMembersMethodName, @" { // Code size 41 (0x29) .maxstack 2 .locals init (T V_0) IL_0000: ldarg.1 IL_0001: ldstr ""field = "" IL_0006: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_000b: pop IL_000c: ldarg.1 IL_000d: ldarg.0 IL_000e: ldfld ""T C1<T>.field"" IL_0013: stloc.0 IL_0014: ldloca.s V_0 IL_0016: constrained. ""T"" IL_001c: callvirt ""string object.ToString()"" IL_0021: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_0026: pop IL_0027: ldc.i4.1 IL_0028: ret } "); } [Fact] public void ToString_TopLevelRecord_OneField_ReferenceType() { var src = @" var c1 = new C1() { field = ""hello"" }; System.Console.Write(c1.ToString()); record struct C1 { public string field; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(); var v = CompileAndVerify(comp, expectedOutput: "C1 { field = hello }"); v.VerifyIL("C1." + WellKnownMemberNames.PrintMembersMethodName, @" { // Code size 27 (0x1b) .maxstack 2 IL_0000: ldarg.1 IL_0001: ldstr ""field = "" IL_0006: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_000b: pop IL_000c: ldarg.1 IL_000d: ldarg.0 IL_000e: ldfld ""string C1.field"" IL_0013: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(object)"" IL_0018: pop IL_0019: ldc.i4.1 IL_001a: ret } "); } [Fact] public void ToString_TopLevelRecord_TwoFields_ReferenceType() { var src = @" var c1 = new C1(42) { field1 = ""hi"", field2 = null }; System.Console.Write(c1.ToString()); record struct C1(int I) { public string field1 = null; public string field2 = null; private string field3 = null; internal string field4 = null; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (10,20): warning CS0414: The field 'C1.field3' is assigned but its value is never used // private string field3 = null; Diagnostic(ErrorCode.WRN_UnreferencedFieldAssg, "field3").WithArguments("C1.field3").WithLocation(10, 20) ); var v = CompileAndVerify(comp, expectedOutput: "C1 { I = 42, field1 = hi, field2 = }"); v.VerifyIL("C1." + WellKnownMemberNames.PrintMembersMethodName, @" { // Code size 91 (0x5b) .maxstack 2 .locals init (int V_0) IL_0000: ldarg.1 IL_0001: ldstr ""I = "" IL_0006: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_000b: pop IL_000c: ldarg.1 IL_000d: ldarg.0 IL_000e: call ""readonly int C1.I.get"" IL_0013: stloc.0 IL_0014: ldloca.s V_0 IL_0016: constrained. ""int"" IL_001c: callvirt ""string object.ToString()"" IL_0021: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_0026: pop IL_0027: ldarg.1 IL_0028: ldstr "", field1 = "" IL_002d: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_0032: pop IL_0033: ldarg.1 IL_0034: ldarg.0 IL_0035: ldfld ""string C1.field1"" IL_003a: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(object)"" IL_003f: pop IL_0040: ldarg.1 IL_0041: ldstr "", field2 = "" IL_0046: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_004b: pop IL_004c: ldarg.1 IL_004d: ldarg.0 IL_004e: ldfld ""string C1.field2"" IL_0053: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(object)"" IL_0058: pop IL_0059: ldc.i4.1 IL_005a: ret } "); } [Fact] public void ToString_TopLevelRecord_Readonly() { var src = @" var c1 = new C1(42); System.Console.Write(c1.ToString()); readonly record struct C1(int I); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var v = CompileAndVerify(comp, expectedOutput: "C1 { I = 42 }", verify: Verification.Skipped /* init-only */); v.VerifyIL("C1." + WellKnownMemberNames.PrintMembersMethodName, @" { // Code size 41 (0x29) .maxstack 2 .locals init (int V_0) IL_0000: ldarg.1 IL_0001: ldstr ""I = "" IL_0006: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_000b: pop IL_000c: ldarg.1 IL_000d: ldarg.0 IL_000e: call ""int C1.I.get"" IL_0013: stloc.0 IL_0014: ldloca.s V_0 IL_0016: constrained. ""int"" IL_001c: callvirt ""string object.ToString()"" IL_0021: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_0026: pop IL_0027: ldc.i4.1 IL_0028: ret } "); v.VerifyIL("C1." + WellKnownMemberNames.ObjectToString, @" { // Code size 64 (0x40) .maxstack 2 .locals init (System.Text.StringBuilder V_0) IL_0000: newobj ""System.Text.StringBuilder..ctor()"" IL_0005: stloc.0 IL_0006: ldloc.0 IL_0007: ldstr ""C1"" IL_000c: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_0011: pop IL_0012: ldloc.0 IL_0013: ldstr "" { "" IL_0018: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_001d: pop IL_001e: ldarg.0 IL_001f: ldloc.0 IL_0020: call ""bool C1.PrintMembers(System.Text.StringBuilder)"" IL_0025: brfalse.s IL_0030 IL_0027: ldloc.0 IL_0028: ldc.i4.s 32 IL_002a: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(char)"" IL_002f: pop IL_0030: ldloc.0 IL_0031: ldc.i4.s 125 IL_0033: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(char)"" IL_0038: pop IL_0039: ldloc.0 IL_003a: callvirt ""string object.ToString()"" IL_003f: ret } "); } [Fact] public void ToString_TopLevelRecord_UserDefinedToString() { var src = @" var c1 = new C1(); System.Console.Write(c1.ToString()); record struct C1 { public override string ToString() => ""RAN""; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(); CompileAndVerify(comp, expectedOutput: "RAN"); var print = comp.GetMember<MethodSymbol>("C1." + WellKnownMemberNames.PrintMembersMethodName); Assert.Equal("readonly System.Boolean C1." + WellKnownMemberNames.PrintMembersMethodName + "(System.Text.StringBuilder builder)", print.ToTestDisplayString()); } [Fact] public void ToString_TopLevelRecord_UserDefinedToString_New() { var src = @" record struct C1 { public new string ToString() => throw null; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (4,23): error CS8869: 'C1.ToString()' does not override expected method from 'object'. // public new string ToString() => throw null; Diagnostic(ErrorCode.ERR_DoesNotOverrideMethodFromObject, "ToString").WithArguments("C1.ToString()").WithLocation(4, 23) ); } [Fact] public void ToString_TopLevelRecord_UserDefinedToString_Sealed() { var src = @" record struct C1 { public sealed override string ToString() => throw null; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (4,35): error CS0106: The modifier 'sealed' is not valid for this item // public sealed override string ToString() => throw null; Diagnostic(ErrorCode.ERR_BadMemberFlag, "ToString").WithArguments("sealed").WithLocation(4, 35) ); } [Fact] public void ToString_UserDefinedPrintMembers_WithNullableStringBuilder() { var src = @" #nullable enable record struct C1 { private bool PrintMembers(System.Text.StringBuilder? builder) => throw null!; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(); } [Fact] public void ToString_UserDefinedPrintMembers_ErrorReturnType() { var src = @" record struct C1 { private Error PrintMembers(System.Text.StringBuilder builder) => throw null; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (4,13): error CS0246: The type or namespace name 'Error' could not be found (are you missing a using directive or an assembly reference?) // private Error PrintMembers(System.Text.StringBuilder builder) => throw null; Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "Error").WithArguments("Error").WithLocation(4, 13) ); } [Fact] public void ToString_UserDefinedPrintMembers_WrongReturnType() { var src = @" record struct C1 { private int PrintMembers(System.Text.StringBuilder builder) => throw null; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (4,17): error CS8874: Record member 'C1.PrintMembers(StringBuilder)' must return 'bool'. // private int PrintMembers(System.Text.StringBuilder builder) => throw null; Diagnostic(ErrorCode.ERR_SignatureMismatchInRecord, "PrintMembers").WithArguments("C1.PrintMembers(System.Text.StringBuilder)", "bool").WithLocation(4, 17) ); } [Fact] public void ToString_UserDefinedPrintMembers() { var src = @" var c1 = new C1(); System.Console.Write(c1.ToString()); System.Console.Write("" - ""); c1.M(); record struct C1 { private bool PrintMembers(System.Text.StringBuilder builder) { builder.Append(""RAN""); return true; } public void M() { var builder = new System.Text.StringBuilder(); if (PrintMembers(builder)) { System.Console.Write(builder.ToString()); } } } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(); CompileAndVerify(comp, expectedOutput: "C1 { RAN } - RAN"); } [Fact] public void ToString_CallingSynthesizedPrintMembers() { var src = @" var c1 = new C1(1, 2, 3); System.Console.Write(c1.ToString()); System.Console.Write("" - ""); c1.M(); record struct C1(int I, int I2, int I3) { public void M() { var builder = new System.Text.StringBuilder(); if (PrintMembers(builder)) { System.Console.Write(builder.ToString()); } } } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(); CompileAndVerify(comp, expectedOutput: "C1 { I = 1, I2 = 2, I3 = 3 } - I = 1, I2 = 2, I3 = 3"); } [Fact] public void ToString_UserDefinedPrintMembers_WrongAccessibility() { var src = @" var c = new C1(); System.Console.Write(c.ToString()); record struct C1 { internal bool PrintMembers(System.Text.StringBuilder builder) => throw null; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (7,19): error CS8879: Record member 'C1.PrintMembers(StringBuilder)' must be private. // internal bool PrintMembers(System.Text.StringBuilder builder) => throw null; Diagnostic(ErrorCode.ERR_NonPrivateAPIInRecord, "PrintMembers").WithArguments("C1.PrintMembers(System.Text.StringBuilder)").WithLocation(7, 19) ); } [Fact] public void ToString_UserDefinedPrintMembers_Static() { var src = @" record struct C1 { static private bool PrintMembers(System.Text.StringBuilder builder) => throw null; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (4,25): error CS8877: Record member 'C1.PrintMembers(StringBuilder)' may not be static. // static private bool PrintMembers(System.Text.StringBuilder builder) => throw null; Diagnostic(ErrorCode.ERR_StaticAPIInRecord, "PrintMembers").WithArguments("C1.PrintMembers(System.Text.StringBuilder)").WithLocation(4, 25) ); } [Fact] public void ToString_GeneratedAsReadOnly() { var src = @" record struct A(int I, string S); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var method = comp.GetMember<SynthesizedRecordToString>("A.ToString"); Assert.True(method.IsDeclaredReadOnly); } [Fact] public void ToString_WihtNonReadOnlyGetter_GeneratedAsNonReadOnly() { var src = @" record struct A(int I, string S) { public double T => 0.1; } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var method = comp.GetMember<SynthesizedRecordToString>("A.ToString"); Assert.False(method.IsDeclaredReadOnly); } [Fact] public void AmbigCtor_WithPropertyInitializer() { // Scenario causes ambiguous ctor for record class, but not record struct var src = @" record struct R(R X) { public R X { get; init; } = X; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (4,14): error CS0523: Struct member 'R.X' of type 'R' causes a cycle in the struct layout // public R X { get; init; } = X; Diagnostic(ErrorCode.ERR_StructLayoutCycle, "X").WithArguments("R.X", "R").WithLocation(4, 14) ); var tree = comp.SyntaxTrees[0]; var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); var parameterSyntax = tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().Single(); var parameter = model.GetDeclaredSymbol(parameterSyntax)!; Assert.Equal("R X", parameter.ToTestDisplayString()); Assert.Equal(SymbolKind.Parameter, parameter.Kind); Assert.Equal("R..ctor(R X)", parameter.ContainingSymbol.ToTestDisplayString()); var initializerSyntax = tree.GetRoot().DescendantNodes().OfType<EqualsValueClauseSyntax>().Single(); var initializer = model.GetSymbolInfo(initializerSyntax.Value).Symbol!; Assert.Equal("R X", initializer.ToTestDisplayString()); Assert.Equal(SymbolKind.Parameter, initializer.Kind); Assert.Equal("R..ctor(R X)", initializer.ContainingSymbol.ToTestDisplayString()); var src2 = @" record struct R(R X); "; var comp2 = CreateCompilation(src2); comp2.VerifyEmitDiagnostics( // (2,19): error CS0523: Struct member 'R.X' of type 'R' causes a cycle in the struct layout // record struct R(R X); Diagnostic(ErrorCode.ERR_StructLayoutCycle, "X").WithArguments("R.X", "R").WithLocation(2, 19) ); } [Fact] public void GetDeclaredSymbolOnAnOutLocalInPropertyInitializer() { var src = @" record struct R(int I) { public int I { get; init; } = M(out int i); static int M(out int i) => throw null; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (2,21): warning CS8907: Parameter 'I' is unread. Did you forget to use it to initialize the property with that name? // record struct R(int I) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "I").WithArguments("I").WithLocation(2, 21) ); var tree = comp.SyntaxTrees[0]; var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); var outVarSyntax = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Single(); var outVar = model.GetDeclaredSymbol(outVarSyntax)!; Assert.Equal("System.Int32 i", outVar.ToTestDisplayString()); Assert.Equal(SymbolKind.Local, outVar.Kind); Assert.Equal("System.Int32 R.<I>k__BackingField", outVar.ContainingSymbol.ToTestDisplayString()); } [Fact] public void AnalyzerActions_01() { // Test RegisterSyntaxNodeAction var text1 = @" record struct A([Attr1]int X = 0) : I1 { private int M() => 3; A(string S) : this(4) => throw null; } interface I1 {} class Attr1 : System.Attribute {} "; var analyzer = new AnalyzerActions_01_Analyzer(); var comp = CreateCompilation(text1); comp.GetAnalyzerDiagnostics(new[] { analyzer }, null).Verify(); Assert.Equal(1, analyzer.FireCount0); Assert.Equal(1, analyzer.FireCountRecordStructDeclarationA); Assert.Equal(1, analyzer.FireCountRecordStructDeclarationACtor); Assert.Equal(1, analyzer.FireCount3); Assert.Equal(1, analyzer.FireCountSimpleBaseTypeI1onA); Assert.Equal(1, analyzer.FireCount5); Assert.Equal(1, analyzer.FireCountParameterListAPrimaryCtor); Assert.Equal(1, analyzer.FireCount7); Assert.Equal(1, analyzer.FireCountConstructorDeclaration); Assert.Equal(1, analyzer.FireCountStringParameterList); Assert.Equal(1, analyzer.FireCountThisConstructorInitializer); Assert.Equal(1, analyzer.FireCount11); Assert.Equal(1, analyzer.FireCount12); } private class AnalyzerActions_01_Analyzer : DiagnosticAnalyzer { public int FireCount0; public int FireCountRecordStructDeclarationA; public int FireCountRecordStructDeclarationACtor; public int FireCount3; public int FireCountSimpleBaseTypeI1onA; public int FireCount5; public int FireCountParameterListAPrimaryCtor; public int FireCount7; public int FireCountConstructorDeclaration; public int FireCountStringParameterList; public int FireCountThisConstructorInitializer; public int FireCount11; public int FireCount12; private static readonly DiagnosticDescriptor Descriptor = new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Descriptor); public override void Initialize(AnalysisContext context) { context.RegisterSyntaxNodeAction(Handle1, SyntaxKind.NumericLiteralExpression); context.RegisterSyntaxNodeAction(Handle2, SyntaxKind.EqualsValueClause); context.RegisterSyntaxNodeAction(Fail, SyntaxKind.BaseConstructorInitializer); context.RegisterSyntaxNodeAction(Handle3, SyntaxKind.ThisConstructorInitializer); context.RegisterSyntaxNodeAction(Handle4, SyntaxKind.ConstructorDeclaration); context.RegisterSyntaxNodeAction(Fail, SyntaxKind.PrimaryConstructorBaseType); context.RegisterSyntaxNodeAction(Handle6, SyntaxKind.RecordStructDeclaration); context.RegisterSyntaxNodeAction(Handle7, SyntaxKind.IdentifierName); context.RegisterSyntaxNodeAction(Handle8, SyntaxKind.SimpleBaseType); context.RegisterSyntaxNodeAction(Handle9, SyntaxKind.ParameterList); context.RegisterSyntaxNodeAction(Handle10, SyntaxKind.ArgumentList); } protected void Handle1(SyntaxNodeAnalysisContext context) { var literal = (LiteralExpressionSyntax)context.Node; switch (literal.ToString()) { case "0": Interlocked.Increment(ref FireCount0); Assert.Equal("A..ctor([System.Int32 X = 0])", context.ContainingSymbol.ToTestDisplayString()); break; case "3": Interlocked.Increment(ref FireCount7); Assert.Equal("System.Int32 A.M()", context.ContainingSymbol.ToTestDisplayString()); break; case "4": Interlocked.Increment(ref FireCount12); Assert.Equal("A..ctor(System.String S)", context.ContainingSymbol.ToTestDisplayString()); break; default: Assert.True(false); break; } Assert.Same(literal.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); } protected void Handle2(SyntaxNodeAnalysisContext context) { var equalsValue = (EqualsValueClauseSyntax)context.Node; switch (equalsValue.ToString()) { case "= 0": Interlocked.Increment(ref FireCount3); Assert.Equal("A..ctor([System.Int32 X = 0])", context.ContainingSymbol.ToTestDisplayString()); break; default: Assert.True(false); break; } Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); } protected void Handle3(SyntaxNodeAnalysisContext context) { var initializer = (ConstructorInitializerSyntax)context.Node; switch (initializer.ToString()) { case ": this(4)": Interlocked.Increment(ref FireCountThisConstructorInitializer); Assert.Equal("A..ctor(System.String S)", context.ContainingSymbol.ToTestDisplayString()); break; default: Assert.True(false); break; } Assert.Same(initializer.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); } protected void Handle4(SyntaxNodeAnalysisContext context) { Interlocked.Increment(ref FireCountConstructorDeclaration); Assert.Equal("A..ctor(System.String S)", context.ContainingSymbol.ToTestDisplayString()); } protected void Fail(SyntaxNodeAnalysisContext context) { Assert.True(false); } protected void Handle6(SyntaxNodeAnalysisContext context) { var record = (RecordDeclarationSyntax)context.Node; Assert.Equal(SyntaxKind.RecordStructDeclaration, record.Kind()); switch (context.ContainingSymbol.ToTestDisplayString()) { case "A": Interlocked.Increment(ref FireCountRecordStructDeclarationA); break; case "A..ctor([System.Int32 X = 0])": Interlocked.Increment(ref FireCountRecordStructDeclarationACtor); break; default: Assert.True(false); break; } Assert.Same(record.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); } protected void Handle7(SyntaxNodeAnalysisContext context) { var identifier = (IdentifierNameSyntax)context.Node; switch (identifier.Identifier.ValueText) { case "Attr1": Interlocked.Increment(ref FireCount5); Assert.Equal("A..ctor([System.Int32 X = 0])", context.ContainingSymbol.ToTestDisplayString()); break; } } protected void Handle8(SyntaxNodeAnalysisContext context) { var baseType = (SimpleBaseTypeSyntax)context.Node; switch (baseType.ToString()) { case "I1": switch (context.ContainingSymbol.ToTestDisplayString()) { case "A": Interlocked.Increment(ref FireCountSimpleBaseTypeI1onA); break; default: Assert.True(false); break; } break; case "System.Attribute": break; default: Assert.True(false); break; } } protected void Handle9(SyntaxNodeAnalysisContext context) { var parameterList = (ParameterListSyntax)context.Node; switch (parameterList.ToString()) { case "([Attr1]int X = 0)": Interlocked.Increment(ref FireCountParameterListAPrimaryCtor); Assert.Equal("A..ctor([System.Int32 X = 0])", context.ContainingSymbol.ToTestDisplayString()); break; case "(string S)": Interlocked.Increment(ref FireCountStringParameterList); Assert.Equal("A..ctor(System.String S)", context.ContainingSymbol.ToTestDisplayString()); break; case "()": break; default: Assert.True(false); break; } } protected void Handle10(SyntaxNodeAnalysisContext context) { var argumentList = (ArgumentListSyntax)context.Node; switch (argumentList.ToString()) { case "(4)": Interlocked.Increment(ref FireCount11); Assert.Equal("A..ctor(System.String S)", context.ContainingSymbol.ToTestDisplayString()); break; default: Assert.True(false); break; } } } [Fact] public void AnalyzerActions_02() { // Test RegisterSymbolAction var text1 = @" record struct A(int X = 0) {} record struct C { C(int Z = 4) {} } "; var analyzer = new AnalyzerActions_02_Analyzer(); var comp = CreateCompilation(text1); comp.GetAnalyzerDiagnostics(new[] { analyzer }, null).Verify(); Assert.Equal(1, analyzer.FireCount1); Assert.Equal(1, analyzer.FireCount2); Assert.Equal(1, analyzer.FireCount3); Assert.Equal(1, analyzer.FireCount4); Assert.Equal(1, analyzer.FireCount5); Assert.Equal(1, analyzer.FireCount6); Assert.Equal(1, analyzer.FireCount7); } private class AnalyzerActions_02_Analyzer : DiagnosticAnalyzer { public int FireCount1; public int FireCount2; public int FireCount3; public int FireCount4; public int FireCount5; public int FireCount6; public int FireCount7; private static readonly DiagnosticDescriptor Descriptor = new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Descriptor); public override void Initialize(AnalysisContext context) { context.RegisterSymbolAction(Handle, SymbolKind.Method); context.RegisterSymbolAction(Handle, SymbolKind.Property); context.RegisterSymbolAction(Handle, SymbolKind.Parameter); context.RegisterSymbolAction(Handle, SymbolKind.NamedType); } private void Handle(SymbolAnalysisContext context) { switch (context.Symbol.ToTestDisplayString()) { case "A..ctor([System.Int32 X = 0])": Interlocked.Increment(ref FireCount1); break; case "System.Int32 A.X { get; set; }": Interlocked.Increment(ref FireCount2); break; case "[System.Int32 X = 0]": Interlocked.Increment(ref FireCount3); break; case "C..ctor([System.Int32 Z = 4])": Interlocked.Increment(ref FireCount4); break; case "[System.Int32 Z = 4]": Interlocked.Increment(ref FireCount5); break; case "A": Interlocked.Increment(ref FireCount6); break; case "C": Interlocked.Increment(ref FireCount7); break; case "System.Runtime.CompilerServices.IsExternalInit": break; default: Assert.True(false); break; } } } [Fact] public void AnalyzerActions_03() { // Test RegisterSymbolStartAction var text1 = @" readonly record struct A(int X = 0) {} readonly record struct C { C(int Z = 4) {} } "; var analyzer = new AnalyzerActions_03_Analyzer(); var comp = CreateCompilation(text1); comp.GetAnalyzerDiagnostics(new[] { analyzer }, null).Verify(); Assert.Equal(1, analyzer.FireCount1); Assert.Equal(1, analyzer.FireCount2); Assert.Equal(0, analyzer.FireCount3); Assert.Equal(1, analyzer.FireCount4); Assert.Equal(0, analyzer.FireCount5); Assert.Equal(1, analyzer.FireCount6); Assert.Equal(1, analyzer.FireCount7); Assert.Equal(1, analyzer.FireCount8); Assert.Equal(1, analyzer.FireCount9); Assert.Equal(1, analyzer.FireCount10); Assert.Equal(1, analyzer.FireCount11); Assert.Equal(1, analyzer.FireCount12); } private class AnalyzerActions_03_Analyzer : DiagnosticAnalyzer { public int FireCount1; public int FireCount2; public int FireCount3; public int FireCount4; public int FireCount5; public int FireCount6; public int FireCount7; public int FireCount8; public int FireCount9; public int FireCount10; public int FireCount11; public int FireCount12; private static readonly DiagnosticDescriptor Descriptor = new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Descriptor); public override void Initialize(AnalysisContext context) { context.RegisterSymbolStartAction(Handle1, SymbolKind.Method); context.RegisterSymbolStartAction(Handle1, SymbolKind.Property); context.RegisterSymbolStartAction(Handle1, SymbolKind.Parameter); context.RegisterSymbolStartAction(Handle1, SymbolKind.NamedType); } private void Handle1(SymbolStartAnalysisContext context) { switch (context.Symbol.ToTestDisplayString()) { case "A..ctor([System.Int32 X = 0])": Interlocked.Increment(ref FireCount1); context.RegisterSymbolEndAction(Handle2); break; case "System.Int32 A.X { get; init; }": Interlocked.Increment(ref FireCount2); context.RegisterSymbolEndAction(Handle3); break; case "[System.Int32 X = 0]": Interlocked.Increment(ref FireCount3); break; case "C..ctor([System.Int32 Z = 4])": Interlocked.Increment(ref FireCount4); context.RegisterSymbolEndAction(Handle4); break; case "[System.Int32 Z = 4]": Interlocked.Increment(ref FireCount5); break; case "A": Interlocked.Increment(ref FireCount9); Assert.Equal(0, FireCount1); Assert.Equal(0, FireCount2); Assert.Equal(0, FireCount6); Assert.Equal(0, FireCount7); context.RegisterSymbolEndAction(Handle5); break; case "C": Interlocked.Increment(ref FireCount10); Assert.Equal(0, FireCount4); Assert.Equal(0, FireCount8); context.RegisterSymbolEndAction(Handle6); break; case "System.Runtime.CompilerServices.IsExternalInit": break; default: Assert.True(false); break; } } private void Handle2(SymbolAnalysisContext context) { Assert.Equal("A..ctor([System.Int32 X = 0])", context.Symbol.ToTestDisplayString()); Interlocked.Increment(ref FireCount6); } private void Handle3(SymbolAnalysisContext context) { Assert.Equal("System.Int32 A.X { get; init; }", context.Symbol.ToTestDisplayString()); Interlocked.Increment(ref FireCount7); } private void Handle4(SymbolAnalysisContext context) { Assert.Equal("C..ctor([System.Int32 Z = 4])", context.Symbol.ToTestDisplayString()); Interlocked.Increment(ref FireCount8); } private void Handle5(SymbolAnalysisContext context) { Assert.Equal("A", context.Symbol.ToTestDisplayString()); Interlocked.Increment(ref FireCount11); Assert.Equal(1, FireCount1); Assert.Equal(1, FireCount2); Assert.Equal(1, FireCount6); Assert.Equal(1, FireCount7); } private void Handle6(SymbolAnalysisContext context) { Assert.Equal("C", context.Symbol.ToTestDisplayString()); Interlocked.Increment(ref FireCount12); Assert.Equal(1, FireCount4); Assert.Equal(1, FireCount8); } } [Fact] public void AnalyzerActions_04() { // Test RegisterOperationAction var text1 = @" record struct A([Attr1(100)]int X = 0) : I1 {} interface I1 {} "; var analyzer = new AnalyzerActions_04_Analyzer(); var comp = CreateCompilation(text1); comp.GetAnalyzerDiagnostics(new[] { analyzer }, null).Verify(); Assert.Equal(0, analyzer.FireCount1); Assert.Equal(1, analyzer.FireCount6); Assert.Equal(1, analyzer.FireCount7); Assert.Equal(1, analyzer.FireCount14); } private class AnalyzerActions_04_Analyzer : DiagnosticAnalyzer { public int FireCount1; public int FireCount6; public int FireCount7; public int FireCount14; private static readonly DiagnosticDescriptor Descriptor = new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Descriptor); public override void Initialize(AnalysisContext context) { context.RegisterOperationAction(HandleConstructorBody, OperationKind.ConstructorBody); context.RegisterOperationAction(HandleInvocation, OperationKind.Invocation); context.RegisterOperationAction(HandleLiteral, OperationKind.Literal); context.RegisterOperationAction(HandleParameterInitializer, OperationKind.ParameterInitializer); context.RegisterOperationAction(Fail, OperationKind.PropertyInitializer); context.RegisterOperationAction(Fail, OperationKind.FieldInitializer); } protected void HandleConstructorBody(OperationAnalysisContext context) { switch (context.ContainingSymbol.ToTestDisplayString()) { case "A..ctor([System.Int32 X = 0])": Interlocked.Increment(ref FireCount1); Assert.Equal(SyntaxKind.RecordDeclaration, context.Operation.Syntax.Kind()); VerifyOperationTree((CSharpCompilation)context.Compilation, context.Operation, @""); break; default: Assert.True(false); break; } } protected void HandleInvocation(OperationAnalysisContext context) { Assert.True(false); } protected void HandleLiteral(OperationAnalysisContext context) { switch (context.Operation.Syntax.ToString()) { case "100": Assert.Equal("A..ctor([System.Int32 X = 0])", context.ContainingSymbol.ToTestDisplayString()); Interlocked.Increment(ref FireCount6); break; case "0": Assert.Equal("A..ctor([System.Int32 X = 0])", context.ContainingSymbol.ToTestDisplayString()); Interlocked.Increment(ref FireCount7); break; default: Assert.True(false); break; } } protected void HandleParameterInitializer(OperationAnalysisContext context) { switch (context.Operation.Syntax.ToString()) { case "= 0": Assert.Equal("A..ctor([System.Int32 X = 0])", context.ContainingSymbol.ToTestDisplayString()); Interlocked.Increment(ref FireCount14); break; default: Assert.True(false); break; } } protected void Fail(OperationAnalysisContext context) { Assert.True(false); } } [Fact] public void AnalyzerActions_05() { // Test RegisterOperationBlockAction var text1 = @" record struct A([Attr1(100)]int X = 0) : I1 {} interface I1 {} "; var analyzer = new AnalyzerActions_05_Analyzer(); var comp = CreateCompilation(text1); comp.GetAnalyzerDiagnostics(new[] { analyzer }, null).Verify(); Assert.Equal(1, analyzer.FireCount1); } private class AnalyzerActions_05_Analyzer : DiagnosticAnalyzer { public int FireCount1; private static readonly DiagnosticDescriptor Descriptor = new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Descriptor); public override void Initialize(AnalysisContext context) { context.RegisterOperationBlockAction(Handle); } private void Handle(OperationBlockAnalysisContext context) { switch (context.OwningSymbol.ToTestDisplayString()) { case "A..ctor([System.Int32 X = 0])": Interlocked.Increment(ref FireCount1); Assert.Equal(2, context.OperationBlocks.Length); Assert.Equal(OperationKind.ParameterInitializer, context.OperationBlocks[0].Kind); Assert.Equal("= 0", context.OperationBlocks[0].Syntax.ToString()); Assert.Equal(OperationKind.None, context.OperationBlocks[1].Kind); Assert.Equal("Attr1(100)", context.OperationBlocks[1].Syntax.ToString()); break; default: Assert.True(false); break; } } } [Fact] public void AnalyzerActions_07() { // Test RegisterCodeBlockAction var text1 = @" record struct A([Attr1(100)]int X = 0) : I1 { int M() => 3; } interface I1 {} "; var analyzer = new AnalyzerActions_07_Analyzer(); var comp = CreateCompilation(text1); comp.GetAnalyzerDiagnostics(new[] { analyzer }, null).Verify(); Assert.Equal(1, analyzer.FireCount1); Assert.Equal(1, analyzer.FireCount4); } private class AnalyzerActions_07_Analyzer : DiagnosticAnalyzer { public int FireCount1; public int FireCount4; private static readonly DiagnosticDescriptor Descriptor = new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Descriptor); public override void Initialize(AnalysisContext context) { context.RegisterCodeBlockAction(Handle); } private void Handle(CodeBlockAnalysisContext context) { switch (context.OwningSymbol.ToTestDisplayString()) { case "A..ctor([System.Int32 X = 0])": switch (context.CodeBlock) { case RecordDeclarationSyntax { Identifier: { ValueText: "A" } }: Interlocked.Increment(ref FireCount1); break; default: Assert.True(false); break; } break; case "System.Int32 A.M()": switch (context.CodeBlock) { case MethodDeclarationSyntax { Identifier: { ValueText: "M" } }: Interlocked.Increment(ref FireCount4); break; default: Assert.True(false); break; } break; default: Assert.True(false); break; } } } [Fact] public void AnalyzerActions_08() { // Test RegisterCodeBlockStartAction var text1 = @" record struct A([Attr1]int X = 0) : I1 { private int M() => 3; A(string S) : this(4) => throw null; } interface I1 {} "; var analyzer = new AnalyzerActions_08_Analyzer(); var comp = CreateCompilation(text1); comp.GetAnalyzerDiagnostics(new[] { analyzer }, null).Verify(); Assert.Equal(1, analyzer.FireCount100); Assert.Equal(1, analyzer.FireCount400); Assert.Equal(1, analyzer.FireCount500); Assert.Equal(1, analyzer.FireCount0); Assert.Equal(0, analyzer.FireCountRecordStructDeclarationA); Assert.Equal(0, analyzer.FireCountRecordStructDeclarationACtor); Assert.Equal(1, analyzer.FireCount3); Assert.Equal(0, analyzer.FireCountSimpleBaseTypeI1onA); Assert.Equal(1, analyzer.FireCount5); Assert.Equal(0, analyzer.FireCountParameterListAPrimaryCtor); Assert.Equal(1, analyzer.FireCount7); Assert.Equal(0, analyzer.FireCountConstructorDeclaration); Assert.Equal(0, analyzer.FireCountStringParameterList); Assert.Equal(1, analyzer.FireCountThisConstructorInitializer); Assert.Equal(1, analyzer.FireCount11); Assert.Equal(1, analyzer.FireCount12); Assert.Equal(1, analyzer.FireCount1000); Assert.Equal(1, analyzer.FireCount4000); Assert.Equal(1, analyzer.FireCount5000); } private class AnalyzerActions_08_Analyzer : AnalyzerActions_01_Analyzer { public int FireCount100; public int FireCount400; public int FireCount500; public int FireCount1000; public int FireCount4000; public int FireCount5000; private static readonly DiagnosticDescriptor Descriptor = new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Descriptor); public override void Initialize(AnalysisContext context) { context.RegisterCodeBlockStartAction<SyntaxKind>(Handle); } private void Handle(CodeBlockStartAnalysisContext<SyntaxKind> context) { switch (context.OwningSymbol.ToTestDisplayString()) { case "A..ctor([System.Int32 X = 0])": switch (context.CodeBlock) { case RecordDeclarationSyntax { Identifier: { ValueText: "A" } }: Interlocked.Increment(ref FireCount100); break; default: Assert.True(false); break; } break; case "System.Int32 A.M()": switch (context.CodeBlock) { case MethodDeclarationSyntax { Identifier: { ValueText: "M" } }: Interlocked.Increment(ref FireCount400); break; default: Assert.True(false); break; } break; case "A..ctor(System.String S)": switch (context.CodeBlock) { case ConstructorDeclarationSyntax { Identifier: { ValueText: "A" } }: Interlocked.Increment(ref FireCount500); break; default: Assert.True(false); break; } break; default: Assert.True(false); break; } context.RegisterSyntaxNodeAction(Handle1, SyntaxKind.NumericLiteralExpression); context.RegisterSyntaxNodeAction(Handle2, SyntaxKind.EqualsValueClause); context.RegisterSyntaxNodeAction(Fail, SyntaxKind.BaseConstructorInitializer); context.RegisterSyntaxNodeAction(Handle3, SyntaxKind.ThisConstructorInitializer); context.RegisterSyntaxNodeAction(Handle4, SyntaxKind.ConstructorDeclaration); context.RegisterSyntaxNodeAction(Fail, SyntaxKind.PrimaryConstructorBaseType); context.RegisterSyntaxNodeAction(Handle6, SyntaxKind.RecordStructDeclaration); context.RegisterSyntaxNodeAction(Handle7, SyntaxKind.IdentifierName); context.RegisterSyntaxNodeAction(Handle8, SyntaxKind.SimpleBaseType); context.RegisterSyntaxNodeAction(Handle9, SyntaxKind.ParameterList); context.RegisterSyntaxNodeAction(Handle10, SyntaxKind.ArgumentList); context.RegisterCodeBlockEndAction(Handle11); } private void Handle11(CodeBlockAnalysisContext context) { switch (context.OwningSymbol.ToTestDisplayString()) { case "A..ctor([System.Int32 X = 0])": switch (context.CodeBlock) { case RecordDeclarationSyntax { Identifier: { ValueText: "A" } }: Interlocked.Increment(ref FireCount1000); break; default: Assert.True(false); break; } break; case "System.Int32 A.M()": switch (context.CodeBlock) { case MethodDeclarationSyntax { Identifier: { ValueText: "M" } }: Interlocked.Increment(ref FireCount4000); break; default: Assert.True(false); break; } break; case "A..ctor(System.String S)": switch (context.CodeBlock) { case ConstructorDeclarationSyntax { Identifier: { ValueText: "A" } }: Interlocked.Increment(ref FireCount5000); break; default: Assert.True(false); break; } break; default: Assert.True(false); break; } } } [Fact] public void AnalyzerActions_09() { var text1 = @" record A([Attr1(100)]int X = 0) : I1 {} record B([Attr2(200)]int Y = 1) : A(2), I1 { int M() => 3; } record C : A, I1 { C([Attr3(300)]int Z = 4) : base(5) {} } interface I1 {} "; var analyzer = new AnalyzerActions_09_Analyzer(); var comp = CreateCompilation(text1); comp.GetAnalyzerDiagnostics(new[] { analyzer }, null).Verify(); Assert.Equal(1, analyzer.FireCount1); Assert.Equal(1, analyzer.FireCount2); Assert.Equal(1, analyzer.FireCount3); Assert.Equal(1, analyzer.FireCount4); Assert.Equal(1, analyzer.FireCount5); Assert.Equal(1, analyzer.FireCount6); Assert.Equal(1, analyzer.FireCount7); Assert.Equal(1, analyzer.FireCount8); Assert.Equal(1, analyzer.FireCount9); } private class AnalyzerActions_09_Analyzer : DiagnosticAnalyzer { public int FireCount1; public int FireCount2; public int FireCount3; public int FireCount4; public int FireCount5; public int FireCount6; public int FireCount7; public int FireCount8; public int FireCount9; private static readonly DiagnosticDescriptor Descriptor = new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Descriptor); public override void Initialize(AnalysisContext context) { context.RegisterSymbolAction(Handle1, SymbolKind.Method); context.RegisterSymbolAction(Handle2, SymbolKind.Property); context.RegisterSymbolAction(Handle3, SymbolKind.Parameter); } private void Handle1(SymbolAnalysisContext context) { switch (context.Symbol.ToTestDisplayString()) { case "A..ctor([System.Int32 X = 0])": Interlocked.Increment(ref FireCount1); break; case "B..ctor([System.Int32 Y = 1])": Interlocked.Increment(ref FireCount2); break; case "C..ctor([System.Int32 Z = 4])": Interlocked.Increment(ref FireCount3); break; case "System.Int32 B.M()": Interlocked.Increment(ref FireCount4); break; default: Assert.True(false); break; } } private void Handle2(SymbolAnalysisContext context) { switch (context.Symbol.ToTestDisplayString()) { case "System.Int32 A.X { get; init; }": Interlocked.Increment(ref FireCount5); break; case "System.Int32 B.Y { get; init; }": Interlocked.Increment(ref FireCount6); break; default: Assert.True(false); break; } } private void Handle3(SymbolAnalysisContext context) { switch (context.Symbol.ToTestDisplayString()) { case "[System.Int32 X = 0]": Interlocked.Increment(ref FireCount7); break; case "[System.Int32 Y = 1]": Interlocked.Increment(ref FireCount8); break; case "[System.Int32 Z = 4]": Interlocked.Increment(ref FireCount9); break; default: Assert.True(false); break; } } } [Fact] public void WithExprOnStruct_LangVersion() { var src = @" var b = new B() { X = 1 }; var b2 = b.M(); System.Console.Write(b2.X); System.Console.Write("" ""); System.Console.Write(b.X); public struct B { public int X { get; set; } public B M() /*<bind>*/{ return this with { X = 42 }; }/*</bind>*/ }"; var comp = CreateCompilation(src, parseOptions: TestOptions.Regular9); comp.VerifyEmitDiagnostics( // (13,16): error CS8773: Feature 'with on structs' is not available in C# 9.0. Please use language version 10.0 or greater. // return this with { X = 42 }; Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "this with { X = 42 }").WithArguments("with on structs", "10.0").WithLocation(13, 16) ); comp = CreateCompilation(src); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "42 1"); verifier.VerifyIL("B.M", @" { // Code size 18 (0x12) .maxstack 2 .locals init (B V_0) IL_0000: ldarg.0 IL_0001: ldobj ""B"" IL_0006: stloc.0 IL_0007: ldloca.s V_0 IL_0009: ldc.i4.s 42 IL_000b: call ""void B.X.set"" IL_0010: ldloc.0 IL_0011: ret }"); var tree = comp.SyntaxTrees.First(); var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); var with = tree.GetRoot().DescendantNodes().OfType<WithExpressionSyntax>().Single(); var type = model.GetTypeInfo(with); Assert.Equal("B", type.Type.ToTestDisplayString()); var operation = model.GetOperation(with); VerifyOperationTree(comp, operation, @" IWithOperation (OperationKind.With, Type: B) (Syntax: 'this with { X = 42 }') Operand: IInstanceReferenceOperation (ReferenceKind: ContainingTypeInstance) (OperationKind.InstanceReference, Type: B) (Syntax: 'this') CloneMethod: null Initializer: IObjectOrCollectionInitializerOperation (OperationKind.ObjectOrCollectionInitializer, Type: B) (Syntax: '{ X = 42 }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32) (Syntax: 'X = 42') Left: IPropertyReferenceOperation: System.Int32 B.X { get; set; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'X') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: B, IsImplicit) (Syntax: 'X') Right: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 42) (Syntax: '42') "); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} .locals {R1} { CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (2) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'this') Value: IInstanceReferenceOperation (ReferenceKind: ContainingTypeInstance) (OperationKind.InstanceReference, Type: B) (Syntax: 'this') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32) (Syntax: 'X = 42') Left: IPropertyReferenceOperation: System.Int32 B.X { get; set; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'X') Instance Receiver: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'this') Right: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 42) (Syntax: '42') Next (Return) Block[B2] IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'this') Leaving: {R1} } Block[B2] - Exit Predecessors: [B1] Statements (0) "; var expectedDiagnostics = DiagnosticDescription.None; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExprOnStruct_ControlFlow_DuplicateInitialization() { var src = @" public struct B { public int X { get; set; } public B M() /*<bind>*/{ return this with { X = 42, X = 43 }; }/*</bind>*/ }"; var expectedDiagnostics = new[] { // (8,36): error CS1912: Duplicate initialization of member 'X' // return this with { X = 42, X = 43 }; Diagnostic(ErrorCode.ERR_MemberAlreadyInitialized, "X").WithArguments("X").WithLocation(8, 36) }; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(expectedDiagnostics); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} .locals {R1} { CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (3) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'this') Value: IInstanceReferenceOperation (ReferenceKind: ContainingTypeInstance) (OperationKind.InstanceReference, Type: B) (Syntax: 'this') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32) (Syntax: 'X = 42') Left: IPropertyReferenceOperation: System.Int32 B.X { get; set; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'X') Instance Receiver: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'this') Right: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 42) (Syntax: '42') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsInvalid) (Syntax: 'X = 43') Left: IPropertyReferenceOperation: System.Int32 B.X { get; set; } (OperationKind.PropertyReference, Type: System.Int32, IsInvalid) (Syntax: 'X') Instance Receiver: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'this') Right: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 43) (Syntax: '43') Next (Return) Block[B2] IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'this') Leaving: {R1} } Block[B2] - Exit Predecessors: [B1] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExprOnStruct_ControlFlow_NestedInitializer() { var src = @" public struct C { public int Y { get; set; } } public struct B { public C X { get; set; } public B M() /*<bind>*/{ return this with { X = { Y = 1 } }; }/*</bind>*/ }"; var expectedDiagnostics = new[] { // (12,32): error CS1525: Invalid expression term '{' // return this with { X = { Y = 1 } }; Diagnostic(ErrorCode.ERR_InvalidExprTerm, "{").WithArguments("{").WithLocation(12, 32), // (12,32): error CS1513: } expected // return this with { X = { Y = 1 } }; Diagnostic(ErrorCode.ERR_RbraceExpected, "{").WithLocation(12, 32), // (12,32): error CS1002: ; expected // return this with { X = { Y = 1 } }; Diagnostic(ErrorCode.ERR_SemicolonExpected, "{").WithLocation(12, 32), // (12,34): error CS0103: The name 'Y' does not exist in the current context // return this with { X = { Y = 1 } }; Diagnostic(ErrorCode.ERR_NameNotInContext, "Y").WithArguments("Y").WithLocation(12, 34), // (12,34): warning CS0162: Unreachable code detected // return this with { X = { Y = 1 } }; Diagnostic(ErrorCode.WRN_UnreachableCode, "Y").WithLocation(12, 34), // (12,40): error CS1002: ; expected // return this with { X = { Y = 1 } }; Diagnostic(ErrorCode.ERR_SemicolonExpected, "}").WithLocation(12, 40), // (12,43): error CS1597: Semicolon after method or accessor block is not valid // return this with { X = { Y = 1 } }; Diagnostic(ErrorCode.ERR_UnexpectedSemicolon, ";").WithLocation(12, 43), // (14,1): error CS1022: Type or namespace definition, or end-of-file expected // } Diagnostic(ErrorCode.ERR_EOFExpected, "}").WithLocation(14, 1) }; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(expectedDiagnostics); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} .locals {R1} { CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (2) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'this') Value: IInstanceReferenceOperation (ReferenceKind: ContainingTypeInstance) (OperationKind.InstanceReference, Type: B) (Syntax: 'this') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: C, IsInvalid) (Syntax: 'X = ') Left: IPropertyReferenceOperation: C B.X { get; set; } (OperationKind.PropertyReference, Type: C) (Syntax: 'X') Instance Receiver: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'this') Right: IInvalidOperation (OperationKind.Invalid, Type: null, IsInvalid) (Syntax: '') Children(0) Next (Return) Block[B3] IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'this') Leaving: {R1} } Block[B2] - Block [UnReachable] Predecessors (0) Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null, IsInvalid) (Syntax: 'Y = 1 ') Expression: ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: ?, IsInvalid) (Syntax: 'Y = 1') Left: IInvalidOperation (OperationKind.Invalid, Type: ?, IsInvalid) (Syntax: 'Y') Children(0) Right: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 1) (Syntax: '1') Next (Regular) Block[B3] Block[B3] - Exit Predecessors: [B1] [B2] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExprOnStruct_ControlFlow_NonAssignmentExpression() { var src = @" public struct B { public int X { get; set; } public B M(int i, int j) /*<bind>*/{ return this with { i, j++, M2(), X = 2}; }/*</bind>*/ static int M2() => 0; }"; var expectedDiagnostics = new[] { // (8,28): error CS0747: Invalid initializer member declarator // return this with { i, j++, M2(), X = 2}; Diagnostic(ErrorCode.ERR_InvalidInitializerElementInitializer, "i").WithLocation(8, 28), // (8,31): error CS0747: Invalid initializer member declarator // return this with { i, j++, M2(), X = 2}; Diagnostic(ErrorCode.ERR_InvalidInitializerElementInitializer, "j++").WithLocation(8, 31), // (8,36): error CS0747: Invalid initializer member declarator // return this with { i, j++, M2(), X = 2}; Diagnostic(ErrorCode.ERR_InvalidInitializerElementInitializer, "M2()").WithLocation(8, 36) }; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(expectedDiagnostics); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} .locals {R1} { CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (5) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'this') Value: IInstanceReferenceOperation (ReferenceKind: ContainingTypeInstance) (OperationKind.InstanceReference, Type: B) (Syntax: 'this') IInvalidOperation (OperationKind.Invalid, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'i') Children(1): IParameterReferenceOperation: i (OperationKind.ParameterReference, Type: System.Int32, IsInvalid) (Syntax: 'i') IInvalidOperation (OperationKind.Invalid, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'j++') Children(1): IIncrementOrDecrementOperation (Postfix) (OperationKind.Increment, Type: System.Int32, IsInvalid) (Syntax: 'j++') Target: IParameterReferenceOperation: j (OperationKind.ParameterReference, Type: System.Int32, IsInvalid) (Syntax: 'j') IInvalidOperation (OperationKind.Invalid, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'M2()') Children(1): IInvocationOperation (System.Int32 B.M2()) (OperationKind.Invocation, Type: System.Int32, IsInvalid) (Syntax: 'M2()') Instance Receiver: null Arguments(0) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32) (Syntax: 'X = 2') Left: IPropertyReferenceOperation: System.Int32 B.X { get; set; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'X') Instance Receiver: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'this') Right: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 2) (Syntax: '2') Next (Return) Block[B2] IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'this') Leaving: {R1} } Block[B2] - Exit Predecessors: [B1] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void ObjectCreationInitializer_ControlFlow_WithCoalescingExpressionForValue() { var src = @" public struct B { public string X; public void M(string hello) /*<bind>*/{ var x = new B() { X = Identity((string)null) ?? Identity(hello) }; }/*</bind>*/ T Identity<T>(T t) => t; }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} .locals {R1} { Locals: [B x] CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (1) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'new B() { X ... ty(hello) }') Value: IObjectCreationOperation (Constructor: B..ctor()) (OperationKind.ObjectCreation, Type: B) (Syntax: 'new B() { X ... ty(hello) }') Arguments(0) Initializer: null Next (Regular) Block[B2] Entering: {R2} {R3} .locals {R2} { CaptureIds: [2] .locals {R3} { CaptureIds: [1] Block[B2] - Block Predecessors: [B1] Statements (1) IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity((string)null)') Value: IInvocationOperation ( System.String B.Identity<System.String>(System.String t)) (OperationKind.Invocation, Type: System.String) (Syntax: 'Identity((string)null)') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ContainingTypeInstance) (OperationKind.InstanceReference, Type: B, IsImplicit) (Syntax: 'Identity') Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '(string)null') IConversionOperation (TryCast: False, Unchecked) (OperationKind.Conversion, Type: System.String, Constant: null) (Syntax: '(string)null') Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) (ImplicitReference) Operand: ILiteralOperation (OperationKind.Literal, Type: null, Constant: null) (Syntax: 'null') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Jump if True (Regular) to Block[B4] IIsNullOperation (OperationKind.IsNull, Type: System.Boolean, IsImplicit) (Syntax: 'Identity((string)null)') Operand: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.String, IsImplicit) (Syntax: 'Identity((string)null)') Leaving: {R3} Next (Regular) Block[B3] Block[B3] - Block Predecessors: [B2] Statements (1) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity((string)null)') Value: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.String, IsImplicit) (Syntax: 'Identity((string)null)') Next (Regular) Block[B5] Leaving: {R3} } Block[B4] - Block Predecessors: [B2] Statements (1) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(hello)') Value: IInvocationOperation ( System.String B.Identity<System.String>(System.String t)) (OperationKind.Invocation, Type: System.String) (Syntax: 'Identity(hello)') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ContainingTypeInstance) (OperationKind.InstanceReference, Type: B, IsImplicit) (Syntax: 'Identity') Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'hello') IParameterReferenceOperation: hello (OperationKind.ParameterReference, Type: System.String) (Syntax: 'hello') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B5] Block[B5] - Block Predecessors: [B3] [B4] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.String) (Syntax: 'X = Identit ... tity(hello)') Left: IFieldReferenceOperation: System.String B.X (OperationKind.FieldReference, Type: System.String) (Syntax: 'X') Instance Receiver: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'new B() { X ... ty(hello) }') Right: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: System.String, IsImplicit) (Syntax: 'Identity((s ... tity(hello)') Next (Regular) Block[B6] Leaving: {R2} } Block[B6] - Block Predecessors: [B5] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: B, IsImplicit) (Syntax: 'x = new B() ... ty(hello) }') Left: ILocalReferenceOperation: x (IsDeclaration: True) (OperationKind.LocalReference, Type: B, IsImplicit) (Syntax: 'x = new B() ... ty(hello) }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'new B() { X ... ty(hello) }') Next (Regular) Block[B7] Leaving: {R1} } Block[B7] - Exit Predecessors: [B6] Statements (0) "; var expectedDiagnostics = DiagnosticDescription.None; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics); } [Fact] public void WithExprOnStruct_ControlFlow_WithCoalescingExpressionForValue() { var src = @" var b = new B() { X = string.Empty }; var b2 = b.M(""hello""); System.Console.Write(b2.X); public struct B { public string X; public B M(string hello) /*<bind>*/{ return Identity(this) with { X = Identity((string)null) ?? Identity(hello) }; }/*</bind>*/ T Identity<T>(T t) => t; }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); CompileAndVerify(comp, expectedOutput: "hello"); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} .locals {R1} { CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (1) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(this)') Value: IInvocationOperation ( B B.Identity<B>(B t)) (OperationKind.Invocation, Type: B) (Syntax: 'Identity(this)') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ContainingTypeInstance) (OperationKind.InstanceReference, Type: B, IsImplicit) (Syntax: 'Identity') Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'this') IInstanceReferenceOperation (ReferenceKind: ContainingTypeInstance) (OperationKind.InstanceReference, Type: B) (Syntax: 'this') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B2] Entering: {R2} {R3} .locals {R2} { CaptureIds: [2] .locals {R3} { CaptureIds: [1] Block[B2] - Block Predecessors: [B1] Statements (1) IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity((string)null)') Value: IInvocationOperation ( System.String B.Identity<System.String>(System.String t)) (OperationKind.Invocation, Type: System.String) (Syntax: 'Identity((string)null)') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ContainingTypeInstance) (OperationKind.InstanceReference, Type: B, IsImplicit) (Syntax: 'Identity') Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '(string)null') IConversionOperation (TryCast: False, Unchecked) (OperationKind.Conversion, Type: System.String, Constant: null) (Syntax: '(string)null') Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) (ImplicitReference) Operand: ILiteralOperation (OperationKind.Literal, Type: null, Constant: null) (Syntax: 'null') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Jump if True (Regular) to Block[B4] IIsNullOperation (OperationKind.IsNull, Type: System.Boolean, IsImplicit) (Syntax: 'Identity((string)null)') Operand: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.String, IsImplicit) (Syntax: 'Identity((string)null)') Leaving: {R3} Next (Regular) Block[B3] Block[B3] - Block Predecessors: [B2] Statements (1) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity((string)null)') Value: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.String, IsImplicit) (Syntax: 'Identity((string)null)') Next (Regular) Block[B5] Leaving: {R3} } Block[B4] - Block Predecessors: [B2] Statements (1) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(hello)') Value: IInvocationOperation ( System.String B.Identity<System.String>(System.String t)) (OperationKind.Invocation, Type: System.String) (Syntax: 'Identity(hello)') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ContainingTypeInstance) (OperationKind.InstanceReference, Type: B, IsImplicit) (Syntax: 'Identity') Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'hello') IParameterReferenceOperation: hello (OperationKind.ParameterReference, Type: System.String) (Syntax: 'hello') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B5] Block[B5] - Block Predecessors: [B3] [B4] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.String) (Syntax: 'X = Identit ... tity(hello)') Left: IFieldReferenceOperation: System.String B.X (OperationKind.FieldReference, Type: System.String) (Syntax: 'X') Instance Receiver: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'Identity(this)') Right: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: System.String, IsImplicit) (Syntax: 'Identity((s ... tity(hello)') Next (Regular) Block[B6] Leaving: {R2} } Block[B6] - Block Predecessors: [B5] Statements (0) Next (Return) Block[B7] IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'Identity(this)') Leaving: {R1} } Block[B7] - Exit Predecessors: [B6] Statements (0) "; var expectedDiagnostics = DiagnosticDescription.None; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExprOnStruct_OnParameter() { var src = @" var b = new B() { X = 1 }; var b2 = B.M(b); System.Console.Write(b2.X); public struct B { public int X { get; set; } public static B M(B b) { return b with { X = 42 }; } }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "42"); verifier.VerifyIL("B.M", @" { // Code size 13 (0xd) .maxstack 2 .locals init (B V_0) IL_0000: ldarg.0 IL_0001: stloc.0 IL_0002: ldloca.s V_0 IL_0004: ldc.i4.s 42 IL_0006: call ""void B.X.set"" IL_000b: ldloc.0 IL_000c: ret }"); } [Fact] public void WithExprOnStruct_OnThis() { var src = @" record struct C { public int X { get; set; } C(string ignored) { _ = this with { X = 42 }; // 1 this = default; } } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (8,13): error CS0188: The 'this' object cannot be used before all of its fields have been assigned // _ = this with { X = 42 }; // 1 Diagnostic(ErrorCode.ERR_UseDefViolationThis, "this").WithArguments("this").WithLocation(8, 13) ); } [Fact] public void WithExprOnStruct_OnTStructParameter() { var src = @" var b = new B() { X = 1 }; var b2 = B.M(b); System.Console.Write(b2.X); public interface I { int X { get; set; } } public struct B : I { public int X { get; set; } public static T M<T>(T b) where T : struct, I { return b with { X = 42 }; } }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "42"); verifier.VerifyIL("B.M<T>(T)", @" { // Code size 19 (0x13) .maxstack 2 .locals init (T V_0) IL_0000: ldarg.0 IL_0001: stloc.0 IL_0002: ldloca.s V_0 IL_0004: ldc.i4.s 42 IL_0006: constrained. ""T"" IL_000c: callvirt ""void I.X.set"" IL_0011: ldloc.0 IL_0012: ret }"); var tree = comp.SyntaxTrees.First(); var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); var with = tree.GetRoot().DescendantNodes().OfType<WithExpressionSyntax>().Single(); var type = model.GetTypeInfo(with); Assert.Equal("T", type.Type.ToTestDisplayString()); } [Fact] public void WithExprOnStruct_OnRecordStructParameter() { var src = @" var b = new B(1); var b2 = B.M(b); System.Console.Write(b2.X); public record struct B(int X) { public static B M(B b) { return b with { X = 42 }; } }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "42"); verifier.VerifyIL("B.M", @" { // Code size 13 (0xd) .maxstack 2 .locals init (B V_0) IL_0000: ldarg.0 IL_0001: stloc.0 IL_0002: ldloca.s V_0 IL_0004: ldc.i4.s 42 IL_0006: call ""void B.X.set"" IL_000b: ldloc.0 IL_000c: ret }"); } [Fact] public void WithExprOnStruct_OnRecordStructParameter_Readonly() { var src = @" var b = new B(1, 2); var b2 = B.M(b); System.Console.Write(b2.X); System.Console.Write(b2.Y); public readonly record struct B(int X, int Y) { public static B M(B b) { return b with { X = 42, Y = 43 }; } }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "4243", verify: Verification.Skipped /* init-only */); verifier.VerifyIL("B.M", @" { // Code size 22 (0x16) .maxstack 2 .locals init (B V_0) IL_0000: ldarg.0 IL_0001: stloc.0 IL_0002: ldloca.s V_0 IL_0004: ldc.i4.s 42 IL_0006: call ""void B.X.init"" IL_000b: ldloca.s V_0 IL_000d: ldc.i4.s 43 IL_000f: call ""void B.Y.init"" IL_0014: ldloc.0 IL_0015: ret }"); } [Fact] public void WithExprOnStruct_OnTuple() { var src = @" class C { static void Main() { var b = (1, 2); var b2 = M(b); System.Console.Write(b2.Item1); System.Console.Write(b2.Item2); } static (int, int) M((int, int) b) { return b with { Item1 = 42, Item2 = 43 }; } }"; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview, options: TestOptions.ReleaseExe); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "4243"); verifier.VerifyIL("C.M", @" { // Code size 22 (0x16) .maxstack 2 .locals init (System.ValueTuple<int, int> V_0) IL_0000: ldarg.0 IL_0001: stloc.0 IL_0002: ldloca.s V_0 IL_0004: ldc.i4.s 42 IL_0006: stfld ""int System.ValueTuple<int, int>.Item1"" IL_000b: ldloca.s V_0 IL_000d: ldc.i4.s 43 IL_000f: stfld ""int System.ValueTuple<int, int>.Item2"" IL_0014: ldloc.0 IL_0015: ret }"); } [Fact] public void WithExprOnStruct_OnTuple_WithNames() { var src = @" var b = (1, 2); var b2 = M(b); System.Console.Write(b2.Item1); System.Console.Write(b2.Item2); static (int, int) M((int X, int Y) b) { return b with { X = 42, Y = 43 }; }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "4243"); verifier.VerifyIL("Program.<<Main>$>g__M|0_0(System.ValueTuple<int, int>)", @" { // Code size 22 (0x16) .maxstack 2 .locals init (System.ValueTuple<int, int> V_0) IL_0000: ldarg.0 IL_0001: stloc.0 IL_0002: ldloca.s V_0 IL_0004: ldc.i4.s 42 IL_0006: stfld ""int System.ValueTuple<int, int>.Item1"" IL_000b: ldloca.s V_0 IL_000d: ldc.i4.s 43 IL_000f: stfld ""int System.ValueTuple<int, int>.Item2"" IL_0014: ldloc.0 IL_0015: ret }"); } [Fact] public void WithExprOnStruct_OnTuple_LongTuple() { var src = @" var b = (1, 2, 3, 4, 5, 6, 7, 8); var b2 = M(b); System.Console.Write(b2.Item7); System.Console.Write(b2.Item8); static (int, int, int, int, int, int, int, int) M((int, int, int, int, int, int, int, int) b) { return b with { Item7 = 42, Item8 = 43 }; }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "4243"); verifier.VerifyIL("Program.<<Main>$>g__M|0_0(System.ValueTuple<int, int, int, int, int, int, int, System.ValueTuple<int>>)", @" { // Code size 27 (0x1b) .maxstack 2 .locals init (System.ValueTuple<int, int, int, int, int, int, int, System.ValueTuple<int>> V_0) IL_0000: ldarg.0 IL_0001: stloc.0 IL_0002: ldloca.s V_0 IL_0004: ldc.i4.s 42 IL_0006: stfld ""int System.ValueTuple<int, int, int, int, int, int, int, System.ValueTuple<int>>.Item7"" IL_000b: ldloca.s V_0 IL_000d: ldflda ""System.ValueTuple<int> System.ValueTuple<int, int, int, int, int, int, int, System.ValueTuple<int>>.Rest"" IL_0012: ldc.i4.s 43 IL_0014: stfld ""int System.ValueTuple<int>.Item1"" IL_0019: ldloc.0 IL_001a: ret }"); } [Fact] public void WithExprOnStruct_OnReadonlyField() { var src = @" var b = new B { X = 1 }; // 1 public struct B { public readonly int X; public B M() { return this with { X = 42 }; // 2 } public static B M2(B b) { return b with { X = 42 }; // 3 } public B(int i) { this = default; _ = this with { X = 42 }; // 4 } }"; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (2,17): error CS0191: A readonly field cannot be assigned to (except in a constructor or init-only setter of the type in which the field is defined or a variable initializer) // var b = new B { X = 1 }; // 1 Diagnostic(ErrorCode.ERR_AssgReadonly, "X").WithLocation(2, 17), // (9,28): error CS0191: A readonly field cannot be assigned to (except in a constructor or init-only setter of the type in which the field is defined or a variable initializer) // return this with { X = 42 }; // 2 Diagnostic(ErrorCode.ERR_AssgReadonly, "X").WithLocation(9, 28), // (13,25): error CS0191: A readonly field cannot be assigned to (except in a constructor or init-only setter of the type in which the field is defined or a variable initializer) // return b with { X = 42 }; // 3 Diagnostic(ErrorCode.ERR_AssgReadonly, "X").WithLocation(13, 25), // (18,25): error CS0191: A readonly field cannot be assigned to (except in a constructor or init-only setter of the type in which the field is defined or a variable initializer) // _ = this with { X = 42 }; // 4 Diagnostic(ErrorCode.ERR_AssgReadonly, "X").WithLocation(18, 25) ); } [Fact] public void WithExprOnStruct_OnEnum() { var src = @" public enum E { } class C { static E M(E e) { return e with { }; } }"; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(); } [Fact] public void WithExprOnStruct_OnPointer() { var src = @" unsafe class C { static int* M(int* i) { return i with { }; } }"; var comp = CreateCompilation(src, options: TestOptions.UnsafeReleaseDll, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics( // (6,16): error CS8858: The receiver type 'int*' is not a valid record type and is not a struct type. // return i with { }; Diagnostic(ErrorCode.ERR_CannotClone, "i").WithArguments("int*").WithLocation(6, 16) ); } [Fact] public void WithExprOnStruct_OnInterface() { var src = @" public interface I { int X { get; set; } } class C { static I M(I i) { return i with { X = 42 }; } }"; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (10,16): error CS8858: The receiver type 'I' is not a valid record type and is not a value type. // return i with { X = 42 }; Diagnostic(ErrorCode.ERR_CannotClone, "i").WithArguments("I").WithLocation(10, 16) ); } [Fact] public void WithExprOnStruct_OnRefStruct() { // Similar to test RefLikeObjInitializers but with `with` expressions var text = @" using System; class Program { static S2 Test1() { S1 outer = default; S1 inner = stackalloc int[1]; // error return new S2() with { Field1 = outer, Field2 = inner }; } static S2 Test2() { S1 outer = default; S1 inner = stackalloc int[1]; S2 result; // error result = new S2() with { Field1 = inner, Field2 = outer }; return result; } static S2 Test3() { S1 outer = default; S1 inner = stackalloc int[1]; return new S2() with { Field1 = outer, Field2 = outer }; } public ref struct S1 { public static implicit operator S1(Span<int> o) => default; } public ref struct S2 { public S1 Field1; public S1 Field2; } } "; CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.RegularPreview).VerifyDiagnostics( // (12,48): error CS8352: Cannot use local 'inner' in this context because it may expose referenced variables outside of their declaration scope // return new S2() with { Field1 = outer, Field2 = inner }; Diagnostic(ErrorCode.ERR_EscapeLocal, "Field2 = inner").WithArguments("inner").WithLocation(12, 48), // (23,34): error CS8352: Cannot use local 'inner' in this context because it may expose referenced variables outside of their declaration scope // result = new S2() with { Field1 = inner, Field2 = outer }; Diagnostic(ErrorCode.ERR_EscapeLocal, "Field1 = inner").WithArguments("inner").WithLocation(23, 34) ); } [Fact] public void WithExprOnStruct_OnRefStruct_ReceiverMayWrap() { // Similar to test LocalWithNoInitializerEscape but wrapping method is used as receiver for `with` expression var text = @" using System; class Program { static void Main() { S1 sp; Span<int> local = stackalloc int[1]; sp = MayWrap(ref local) with { }; // 1, 2 } static S1 MayWrap(ref Span<int> arg) { return default; } ref struct S1 { public ref int this[int i] => throw null; } } "; CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.RegularPreview).VerifyDiagnostics( // (9,26): error CS8352: Cannot use local 'local' in this context because it may expose referenced variables outside of their declaration scope // sp = MayWrap(ref local) with { }; // 1, 2 Diagnostic(ErrorCode.ERR_EscapeLocal, "local").WithArguments("local").WithLocation(9, 26), // (9,14): error CS8347: Cannot use a result of 'Program.MayWrap(ref Span<int>)' in this context because it may expose variables referenced by parameter 'arg' outside of their declaration scope // sp = MayWrap(ref local) with { }; // 1, 2 Diagnostic(ErrorCode.ERR_EscapeCall, "MayWrap(ref local)").WithArguments("Program.MayWrap(ref System.Span<int>)", "arg").WithLocation(9, 14) ); } [Fact] public void WithExprOnStruct_OnRefStruct_ReceiverMayWrap_02() { var text = @" using System; class Program { static void Main() { Span<int> local = stackalloc int[1]; S1 sp = MayWrap(ref local) with { }; } static S1 MayWrap(ref Span<int> arg) { return default; } ref struct S1 { public ref int this[int i] => throw null; } } "; CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.RegularPreview).VerifyDiagnostics(); } [Fact] public void WithExpr_NullableAnalysis_01() { var src = @" #nullable enable record struct B(int X) { static void M(B b) { string? s = null; _ = b with { X = M(out s) }; s.ToString(); } static int M(out string s) { s = ""a""; return 42; } }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); } [Fact] public void WithExpr_NullableAnalysis_02() { var src = @" #nullable enable record struct B(string X) { static void M(B b, string? s) { b.X.ToString(); _ = b with { X = s }; // 1 b.X.ToString(); // 2 } }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (8,26): warning CS8601: Possible null reference assignment. // _ = b with { X = s }; // 1 Diagnostic(ErrorCode.WRN_NullReferenceAssignment, "s").WithLocation(8, 26)); } [Fact] public void WithExpr_NullableAnalysis_03() { var src = @" #nullable enable record struct B(string? X) { static void M1(B b, string s, bool flag) { if (flag) { b.X.ToString(); } // 1 _ = b with { X = s }; if (flag) { b.X.ToString(); } // 2 } static void M2(B b, string s, bool flag) { if (flag) { b.X.ToString(); } // 3 b = b with { X = s }; if (flag) { b.X.ToString(); } } }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (7,21): warning CS8602: Dereference of a possibly null reference. // if (flag) { b.X.ToString(); } // 1 Diagnostic(ErrorCode.WRN_NullReferenceReceiver, "b.X").WithLocation(7, 21), // (9,21): warning CS8602: Dereference of a possibly null reference. // if (flag) { b.X.ToString(); } // 2 Diagnostic(ErrorCode.WRN_NullReferenceReceiver, "b.X").WithLocation(9, 21), // (14,21): warning CS8602: Dereference of a possibly null reference. // if (flag) { b.X.ToString(); } // 3 Diagnostic(ErrorCode.WRN_NullReferenceReceiver, "b.X").WithLocation(14, 21)); } [Fact, WorkItem(44763, "https://github.com/dotnet/roslyn/issues/44763")] public void WithExpr_NullableAnalysis_05() { var src = @" #nullable enable record struct B(string? X, string? Y) { static void M1(bool flag) { B b = new B(""hello"", null); if (flag) { b.X.ToString(); // shouldn't warn b.Y.ToString(); // 1 } b = b with { Y = ""world"" }; b.X.ToString(); // shouldn't warn b.Y.ToString(); } }"; // records should propagate the nullability of the // constructor arguments to the corresponding properties. // https://github.com/dotnet/roslyn/issues/44763 var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (10,13): warning CS8602: Dereference of a possibly null reference. // b.X.ToString(); // shouldn't warn Diagnostic(ErrorCode.WRN_NullReferenceReceiver, "b.X").WithLocation(10, 13), // (11,13): warning CS8602: Dereference of a possibly null reference. // b.Y.ToString(); // 1 Diagnostic(ErrorCode.WRN_NullReferenceReceiver, "b.Y").WithLocation(11, 13), // (15,9): warning CS8602: Dereference of a possibly null reference. // b.X.ToString(); // shouldn't warn Diagnostic(ErrorCode.WRN_NullReferenceReceiver, "b.X").WithLocation(15, 9)); } [Fact] public void WithExpr_NullableAnalysis_06() { var src = @" #nullable enable struct B { public string? X { get; init; } public string? Y { get; init; } static void M1(bool flag) { B b = new B { X = ""hello"", Y = null }; if (flag) { b.X.ToString(); b.Y.ToString(); // 1 } b = b with { Y = ""world"" }; b.X.ToString(); b.Y.ToString(); } }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (14,13): warning CS8602: Dereference of a possibly null reference. // b.Y.ToString(); // 1 Diagnostic(ErrorCode.WRN_NullReferenceReceiver, "b.Y").WithLocation(14, 13) ); } [Fact] public void WithExprAssignToRef1() { var src = @" using System; record struct C(int Y) { private readonly int[] _a = new[] { 0 }; public ref int X => ref _a[0]; public static void Main() { var c = new C(0) { X = 5 }; Console.WriteLine(c.X); c = c with { X = 1 }; Console.WriteLine(c.X); } }"; var verifier = CompileAndVerify(src, expectedOutput: @" 5 1").VerifyDiagnostics(); verifier.VerifyIL("C.Main", @" { // Code size 59 (0x3b) .maxstack 2 .locals init (C V_0, //c C V_1) IL_0000: ldloca.s V_1 IL_0002: ldc.i4.0 IL_0003: call ""C..ctor(int)"" IL_0008: ldloca.s V_1 IL_000a: call ""ref int C.X.get"" IL_000f: ldc.i4.5 IL_0010: stind.i4 IL_0011: ldloc.1 IL_0012: stloc.0 IL_0013: ldloca.s V_0 IL_0015: call ""ref int C.X.get"" IL_001a: ldind.i4 IL_001b: call ""void System.Console.WriteLine(int)"" IL_0020: ldloc.0 IL_0021: stloc.1 IL_0022: ldloca.s V_1 IL_0024: call ""ref int C.X.get"" IL_0029: ldc.i4.1 IL_002a: stind.i4 IL_002b: ldloc.1 IL_002c: stloc.0 IL_002d: ldloca.s V_0 IL_002f: call ""ref int C.X.get"" IL_0034: ldind.i4 IL_0035: call ""void System.Console.WriteLine(int)"" IL_003a: ret }"); } [Fact] public void WithExpressionSameLHS() { var comp = CreateCompilation(@" record struct C(int X) { public static void Main() { var c = new C(0); c = c with { X = 1, X = 2}; } }"); comp.VerifyDiagnostics( // (7,29): error CS1912: Duplicate initialization of member 'X' // c = c with { X = 1, X = 2}; Diagnostic(ErrorCode.ERR_MemberAlreadyInitialized, "X").WithArguments("X").WithLocation(7, 29) ); } [Fact] public void WithExpr_AnonymousType_ChangeAllProperties() { var src = @" C.M(); public class C { public static void M() /*<bind>*/{ var a = new { A = 10, B = 20 }; var b = Identity(a) with { A = Identity(30), B = Identity(40) }; System.Console.Write(b); }/*</bind>*/ static T Identity<T>(T t) { System.Console.Write($""Identity({t}) ""); return t; } }"; var comp = CreateCompilation(src, parseOptions: TestOptions.Regular9); comp.VerifyEmitDiagnostics( // (9,17): error CS8773: Feature 'with on anonymous types' is not available in C# 9.0. Please use language version 10.0 or greater. // var b = Identity(a) with { A = Identity(30), B = Identity(40) }; Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "Identity(a) with { A = Identity(30), B = Identity(40) }").WithArguments("with on anonymous types", "10.0").WithLocation(9, 17) ); comp = CreateCompilation(src, parseOptions: TestOptions.Regular10); comp.VerifyEmitDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "Identity({ A = 10, B = 20 }) Identity(30) Identity(40) { A = 30, B = 40 }"); verifier.VerifyIL("C.M", @" { // Code size 42 (0x2a) .maxstack 2 .locals init (int V_0) IL_0000: ldc.i4.s 10 IL_0002: ldc.i4.s 20 IL_0004: newobj ""<>f__AnonymousType0<int, int>..ctor(int, int)"" IL_0009: call ""<anonymous type: int A, int B> C.Identity<<anonymous type: int A, int B>>(<anonymous type: int A, int B>)"" IL_000e: pop IL_000f: ldc.i4.s 30 IL_0011: call ""int C.Identity<int>(int)"" IL_0016: ldc.i4.s 40 IL_0018: call ""int C.Identity<int>(int)"" IL_001d: stloc.0 IL_001e: ldloc.0 IL_001f: newobj ""<>f__AnonymousType0<int, int>..ctor(int, int)"" IL_0024: call ""void System.Console.Write(object)"" IL_0029: ret } "); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A, System.Int32 B> a] [<anonymous type: System.Int32 A, System.Int32 B> b] .locals {R2} { CaptureIds: [0] [1] Block[B1] - Block Predecessors: [B0] Statements (3) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '20') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20) (Syntax: '20') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'new { A = 10, B = 20 }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 20) (Syntax: 'B = 20') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'B') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 20, IsImplicit) (Syntax: '20') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} } .locals {R3} { CaptureIds: [2] [3] Block[B2] - Block Predecessors: [B1] Statements (4) IInvocationOperation (<anonymous type: System.Int32 A, System.Int32 B> C.Identity<<anonymous type: System.Int32 A, System.Int32 B>>(<anonymous type: System.Int32 A, System.Int32 B> t)) (OperationKind.Invocation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'Identity(a)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'a') ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'a') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(30)') Value: IInvocationOperation (System.Int32 C.Identity<System.Int32>(System.Int32 t)) (OperationKind.Invocation, Type: System.Int32) (Syntax: 'Identity(30)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '30') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 30) (Syntax: '30') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 3 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(40)') Value: IInvocationOperation (System.Int32 C.Identity<System.Int32>(System.Int32 t)) (OperationKind.Invocation, Type: System.Int32) (Syntax: 'Identity(40)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '40') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 40) (Syntax: '40') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = Identit ... ntity(40) }') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = Identit ... ntity(40) }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'Identity(a) ... ntity(40) }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(40) }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(40) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a) ... ntity(40) }') Right: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a)') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(40) }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(40) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a) ... ntity(40) }') Right: IFlowCaptureReferenceOperation: 3 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a)') Next (Regular) Block[B3] Leaving: {R3} } Block[B3] - Block Predecessors: [B2] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'System.Console.Write(b);') Expression: IInvocationOperation (void System.Console.Write(System.Object value)) (OperationKind.Invocation, Type: System.Void) (Syntax: 'System.Console.Write(b)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument, Type: null) (Syntax: 'b') IConversionOperation (TryCast: False, Unchecked) (OperationKind.Conversion, Type: System.Object, IsImplicit) (Syntax: 'b') Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) (ImplicitReference) Operand: ILocalReferenceOperation: b (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'b') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B4] Leaving: {R1} } Block[B4] - Exit Predecessors: [B3] Statements (0) "; var expectedDiagnostics = DiagnosticDescription.None; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_ChangeAllProperties_ReverseOrder() { var src = @" C.M(); public class C { public static void M() /*<bind>*/{ var a = new { A = 10, B = 20 }; var b = Identity(a) with { B = Identity(40), A = Identity(30) }; System.Console.Write(b); }/*</bind>*/ static T Identity<T>(T t) { System.Console.Write($""Identity({t}) ""); return t; } }"; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "Identity({ A = 10, B = 20 }) Identity(40) Identity(30) { A = 30, B = 40 }"); verifier.VerifyIL("C.M", @" { // Code size 42 (0x2a) .maxstack 2 .locals init (int V_0) IL_0000: ldc.i4.s 10 IL_0002: ldc.i4.s 20 IL_0004: newobj ""<>f__AnonymousType0<int, int>..ctor(int, int)"" IL_0009: call ""<anonymous type: int A, int B> C.Identity<<anonymous type: int A, int B>>(<anonymous type: int A, int B>)"" IL_000e: pop IL_000f: ldc.i4.s 40 IL_0011: call ""int C.Identity<int>(int)"" IL_0016: stloc.0 IL_0017: ldc.i4.s 30 IL_0019: call ""int C.Identity<int>(int)"" IL_001e: ldloc.0 IL_001f: newobj ""<>f__AnonymousType0<int, int>..ctor(int, int)"" IL_0024: call ""void System.Console.Write(object)"" IL_0029: ret } "); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A, System.Int32 B> a] [<anonymous type: System.Int32 A, System.Int32 B> b] .locals {R2} { CaptureIds: [0] [1] Block[B1] - Block Predecessors: [B0] Statements (3) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '20') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20) (Syntax: '20') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'new { A = 10, B = 20 }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 20) (Syntax: 'B = 20') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'B') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 20, IsImplicit) (Syntax: '20') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} } .locals {R3} { CaptureIds: [2] [3] Block[B2] - Block Predecessors: [B1] Statements (4) IInvocationOperation (<anonymous type: System.Int32 A, System.Int32 B> C.Identity<<anonymous type: System.Int32 A, System.Int32 B>>(<anonymous type: System.Int32 A, System.Int32 B> t)) (OperationKind.Invocation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'Identity(a)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'a') ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'a') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(40)') Value: IInvocationOperation (System.Int32 C.Identity<System.Int32>(System.Int32 t)) (OperationKind.Invocation, Type: System.Int32) (Syntax: 'Identity(40)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '40') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 40) (Syntax: '40') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 3 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(30)') Value: IInvocationOperation (System.Int32 C.Identity<System.Int32>(System.Int32 t)) (OperationKind.Invocation, Type: System.Int32) (Syntax: 'Identity(30)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '30') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 30) (Syntax: '30') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = Identit ... ntity(30) }') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = Identit ... ntity(30) }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'Identity(a) ... ntity(30) }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Right: IFlowCaptureReferenceOperation: 3 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a)') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Right: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a)') Next (Regular) Block[B3] Leaving: {R3} } Block[B3] - Block Predecessors: [B2] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'System.Console.Write(b);') Expression: IInvocationOperation (void System.Console.Write(System.Object value)) (OperationKind.Invocation, Type: System.Void) (Syntax: 'System.Console.Write(b)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument, Type: null) (Syntax: 'b') IConversionOperation (TryCast: False, Unchecked) (OperationKind.Conversion, Type: System.Object, IsImplicit) (Syntax: 'b') Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) (ImplicitReference) Operand: ILocalReferenceOperation: b (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'b') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B4] Leaving: {R1} } Block[B4] - Exit Predecessors: [B3] Statements (0) "; var expectedDiagnostics = DiagnosticDescription.None; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_ChangeNoProperty() { var src = @" C.M(); public class C { public static void M() /*<bind>*/{ var a = new { A = 10, B = 20 }; var b = M2(a) with { }; System.Console.Write(b); }/*</bind>*/ static T M2<T>(T t) { System.Console.Write(""M2 ""); return t; } }"; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "M2 { A = 10, B = 20 }"); verifier.VerifyIL("C.M", @" { // Code size 38 (0x26) .maxstack 2 .locals init (<>f__AnonymousType0<int, int> V_0) IL_0000: ldc.i4.s 10 IL_0002: ldc.i4.s 20 IL_0004: newobj ""<>f__AnonymousType0<int, int>..ctor(int, int)"" IL_0009: call ""<anonymous type: int A, int B> C.M2<<anonymous type: int A, int B>>(<anonymous type: int A, int B>)"" IL_000e: stloc.0 IL_000f: ldloc.0 IL_0010: callvirt ""int <>f__AnonymousType0<int, int>.A.get"" IL_0015: ldloc.0 IL_0016: callvirt ""int <>f__AnonymousType0<int, int>.B.get"" IL_001b: newobj ""<>f__AnonymousType0<int, int>..ctor(int, int)"" IL_0020: call ""void System.Console.Write(object)"" IL_0025: ret } "); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A, System.Int32 B> a] [<anonymous type: System.Int32 A, System.Int32 B> b] .locals {R2} { CaptureIds: [0] [1] Block[B1] - Block Predecessors: [B0] Statements (3) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '20') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20) (Syntax: '20') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'new { A = 10, B = 20 }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 20) (Syntax: 'B = 20') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'B') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 20, IsImplicit) (Syntax: '20') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} {R4} } .locals {R3} { CaptureIds: [3] [4] .locals {R4} { CaptureIds: [2] Block[B2] - Block Predecessors: [B1] Statements (3) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'M2(a)') Value: IInvocationOperation (<anonymous type: System.Int32 A, System.Int32 B> C.M2<<anonymous type: System.Int32 A, System.Int32 B>>(<anonymous type: System.Int32 A, System.Int32 B> t)) (OperationKind.Invocation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'M2(a)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'a') ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'a') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 3 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'M2(a) with { }') Value: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'M2(a) with { }') Instance Receiver: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'M2(a)') IFlowCaptureOperation: 4 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'M2(a) with { }') Value: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'M2(a) with { }') Instance Receiver: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'M2(a)') Next (Regular) Block[B3] Leaving: {R4} } Block[B3] - Block Predecessors: [B2] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = M2(a) with { }') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = M2(a) with { }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'M2(a) with { }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'M2(a) with { }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'M2(a) with { }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'M2(a) with { }') Right: IFlowCaptureReferenceOperation: 3 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'M2(a)') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'M2(a) with { }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'M2(a) with { }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'M2(a) with { }') Right: IFlowCaptureReferenceOperation: 4 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'M2(a)') Next (Regular) Block[B4] Leaving: {R3} } Block[B4] - Block Predecessors: [B3] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'System.Console.Write(b);') Expression: IInvocationOperation (void System.Console.Write(System.Object value)) (OperationKind.Invocation, Type: System.Void) (Syntax: 'System.Console.Write(b)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument, Type: null) (Syntax: 'b') IConversionOperation (TryCast: False, Unchecked) (OperationKind.Conversion, Type: System.Object, IsImplicit) (Syntax: 'b') Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) (ImplicitReference) Operand: ILocalReferenceOperation: b (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'b') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B5] Leaving: {R1} } Block[B5] - Exit Predecessors: [B4] Statements (0) "; var expectedDiagnostics = DiagnosticDescription.None; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_ChangeOneProperty() { var src = @" C.M(); public class C { public static void M() /*<bind>*/{ var a = new { A = 10, B = 20 }; var b = a with { B = Identity(30) }; System.Console.Write(b); }/*</bind>*/ static T Identity<T>(T t) => t; }"; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "{ A = 10, B = 30 }"); verifier.VerifyIL("C.M", @" { // Code size 34 (0x22) .maxstack 2 .locals init (int V_0) IL_0000: ldc.i4.s 10 IL_0002: ldc.i4.s 20 IL_0004: newobj ""<>f__AnonymousType0<int, int>..ctor(int, int)"" IL_0009: ldc.i4.s 30 IL_000b: call ""int C.Identity<int>(int)"" IL_0010: stloc.0 IL_0011: callvirt ""int <>f__AnonymousType0<int, int>.A.get"" IL_0016: ldloc.0 IL_0017: newobj ""<>f__AnonymousType0<int, int>..ctor(int, int)"" IL_001c: call ""void System.Console.Write(object)"" IL_0021: ret } "); var tree = comp.SyntaxTrees.Single(); var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); var withExpr = tree.GetRoot().DescendantNodes().OfType<WithExpressionSyntax>().Single(); var operation = model.GetOperation(withExpr); VerifyOperationTree(comp, operation, @" IWithOperation (OperationKind.With, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'a with { B ... ntity(30) }') Operand: ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'a') CloneMethod: null Initializer: IObjectOrCollectionInitializerOperation (OperationKind.ObjectOrCollectionInitializer, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: '{ B = Identity(30) }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32) (Syntax: 'B = Identity(30)') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'B') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'B') Right: IInvocationOperation (System.Int32 C.Identity<System.Int32>(System.Int32 t)) (OperationKind.Invocation, Type: System.Int32) (Syntax: 'Identity(30)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '30') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 30) (Syntax: '30') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) "); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A, System.Int32 B> a] [<anonymous type: System.Int32 A, System.Int32 B> b] .locals {R2} { CaptureIds: [0] [1] Block[B1] - Block Predecessors: [B0] Statements (3) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '20') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20) (Syntax: '20') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'new { A = 10, B = 20 }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 20) (Syntax: 'B = 20') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'B') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 20, IsImplicit) (Syntax: '20') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} {R4} } .locals {R3} { CaptureIds: [3] [4] .locals {R4} { CaptureIds: [2] Block[B2] - Block Predecessors: [B1] Statements (3) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'a') Value: ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'a') IFlowCaptureOperation: 3 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(30)') Value: IInvocationOperation (System.Int32 C.Identity<System.Int32>(System.Int32 t)) (OperationKind.Invocation, Type: System.Int32) (Syntax: 'Identity(30)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '30') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 30) (Syntax: '30') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 4 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'a with { B ... ntity(30) }') Value: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'a with { B ... ntity(30) }') Instance Receiver: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a') Next (Regular) Block[B3] Leaving: {R4} } Block[B3] - Block Predecessors: [B2] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = a with ... ntity(30) }') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = a with ... ntity(30) }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'a with { B ... ntity(30) }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'a with { B ... ntity(30) }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'a with { B ... ntity(30) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a with { B ... ntity(30) }') Right: IFlowCaptureReferenceOperation: 4 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'a with { B ... ntity(30) }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'a with { B ... ntity(30) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a with { B ... ntity(30) }') Right: IFlowCaptureReferenceOperation: 3 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a') Next (Regular) Block[B4] Leaving: {R3} } Block[B4] - Block Predecessors: [B3] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'System.Console.Write(b);') Expression: IInvocationOperation (void System.Console.Write(System.Object value)) (OperationKind.Invocation, Type: System.Void) (Syntax: 'System.Console.Write(b)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument, Type: null) (Syntax: 'b') IConversionOperation (TryCast: False, Unchecked) (OperationKind.Conversion, Type: System.Object, IsImplicit) (Syntax: 'b') Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) (ImplicitReference) Operand: ILocalReferenceOperation: b (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'b') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B5] Leaving: {R1} } Block[B5] - Exit Predecessors: [B4] Statements (0) "; var expectedDiagnostics = DiagnosticDescription.None; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_ChangeOneProperty_WithMethodCallForTarget() { var src = @" C.M(); public class C { public static void M() /*<bind>*/{ var a = new { A = 10, B = 20 }; var b = Identity(a) with { B = 30 }; System.Console.Write(b); }/*</bind>*/ static T Identity<T>(T t) => t; }"; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "{ A = 10, B = 30 }"); verifier.VerifyIL("C.M", @" { // Code size 34 (0x22) .maxstack 2 .locals init (int V_0) IL_0000: ldc.i4.s 10 IL_0002: ldc.i4.s 20 IL_0004: newobj ""<>f__AnonymousType0<int, int>..ctor(int, int)"" IL_0009: call ""<anonymous type: int A, int B> C.Identity<<anonymous type: int A, int B>>(<anonymous type: int A, int B>)"" IL_000e: ldc.i4.s 30 IL_0010: stloc.0 IL_0011: callvirt ""int <>f__AnonymousType0<int, int>.A.get"" IL_0016: ldloc.0 IL_0017: newobj ""<>f__AnonymousType0<int, int>..ctor(int, int)"" IL_001c: call ""void System.Console.Write(object)"" IL_0021: ret } "); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A, System.Int32 B> a] [<anonymous type: System.Int32 A, System.Int32 B> b] .locals {R2} { CaptureIds: [0] [1] Block[B1] - Block Predecessors: [B0] Statements (3) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '20') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20) (Syntax: '20') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'new { A = 10, B = 20 }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 20) (Syntax: 'B = 20') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'B') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 20, IsImplicit) (Syntax: '20') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} {R4} } .locals {R3} { CaptureIds: [3] [4] .locals {R4} { CaptureIds: [2] Block[B2] - Block Predecessors: [B1] Statements (3) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(a)') Value: IInvocationOperation (<anonymous type: System.Int32 A, System.Int32 B> C.Identity<<anonymous type: System.Int32 A, System.Int32 B>>(<anonymous type: System.Int32 A, System.Int32 B> t)) (OperationKind.Invocation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'Identity(a)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'a') ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'a') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 3 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '30') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 30) (Syntax: '30') IFlowCaptureOperation: 4 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(a) ... { B = 30 }') Value: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... { B = 30 }') Instance Receiver: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a)') Next (Regular) Block[B3] Leaving: {R4} } Block[B3] - Block Predecessors: [B2] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = Identit ... { B = 30 }') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = Identit ... { B = 30 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'Identity(a) ... { B = 30 }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... { B = 30 }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... { B = 30 }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a) ... { B = 30 }') Right: IFlowCaptureReferenceOperation: 4 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a)') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... { B = 30 }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... { B = 30 }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a) ... { B = 30 }') Right: IFlowCaptureReferenceOperation: 3 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a)') Next (Regular) Block[B4] Leaving: {R3} } Block[B4] - Block Predecessors: [B3] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'System.Console.Write(b);') Expression: IInvocationOperation (void System.Console.Write(System.Object value)) (OperationKind.Invocation, Type: System.Void) (Syntax: 'System.Console.Write(b)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument, Type: null) (Syntax: 'b') IConversionOperation (TryCast: False, Unchecked) (OperationKind.Conversion, Type: System.Object, IsImplicit) (Syntax: 'b') Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) (ImplicitReference) Operand: ILocalReferenceOperation: b (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'b') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B5] Leaving: {R1} } Block[B5] - Exit Predecessors: [B4] Statements (0) "; var expectedDiagnostics = DiagnosticDescription.None; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_ChangeOneProperty_WithCoalescingExpressionForTarget() { var src = @" C.M(); public class C { public static void M() /*<bind>*/{ var a = new { A = 10, B = 20 }; var b = (Identity(a) ?? Identity2(a)) with { B = 30 }; System.Console.Write(b); }/*</bind>*/ static T Identity<T>(T t) => t; static T Identity2<T>(T t) => t; }"; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics(); CompileAndVerify(comp, expectedOutput: "{ A = 10, B = 30 }"); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A, System.Int32 B> a] [<anonymous type: System.Int32 A, System.Int32 B> b] .locals {R2} { CaptureIds: [0] [1] Block[B1] - Block Predecessors: [B0] Statements (3) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '20') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20) (Syntax: '20') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'new { A = 10, B = 20 }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 20) (Syntax: 'B = 20') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'B') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 20, IsImplicit) (Syntax: '20') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} {R4} {R5} } .locals {R3} { CaptureIds: [4] [5] .locals {R4} { CaptureIds: [2] .locals {R5} { CaptureIds: [3] Block[B2] - Block Predecessors: [B1] Statements (1) IFlowCaptureOperation: 3 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(a)') Value: IInvocationOperation (<anonymous type: System.Int32 A, System.Int32 B> C.Identity<<anonymous type: System.Int32 A, System.Int32 B>>(<anonymous type: System.Int32 A, System.Int32 B> t)) (OperationKind.Invocation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'Identity(a)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'a') ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'a') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Jump if True (Regular) to Block[B4] IIsNullOperation (OperationKind.IsNull, Type: System.Boolean, IsImplicit) (Syntax: 'Identity(a)') Operand: IFlowCaptureReferenceOperation: 3 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a)') Leaving: {R5} Next (Regular) Block[B3] Block[B3] - Block Predecessors: [B2] Statements (1) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(a)') Value: IFlowCaptureReferenceOperation: 3 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a)') Next (Regular) Block[B5] Leaving: {R5} } Block[B4] - Block Predecessors: [B2] Statements (1) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity2(a)') Value: IInvocationOperation (<anonymous type: System.Int32 A, System.Int32 B> C.Identity2<<anonymous type: System.Int32 A, System.Int32 B>>(<anonymous type: System.Int32 A, System.Int32 B> t)) (OperationKind.Invocation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'Identity2(a)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'a') ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'a') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B5] Block[B5] - Block Predecessors: [B3] [B4] Statements (2) IFlowCaptureOperation: 4 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '30') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 30) (Syntax: '30') IFlowCaptureOperation: 5 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '(Identity(a ... { B = 30 }') Value: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: '(Identity(a ... { B = 30 }') Instance Receiver: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a) ... dentity2(a)') Next (Regular) Block[B6] Leaving: {R4} } Block[B6] - Block Predecessors: [B5] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = (Identi ... { B = 30 }') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = (Identi ... { B = 30 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: '(Identity(a ... { B = 30 }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: '(Identity(a ... { B = 30 }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: '(Identity(a ... { B = 30 }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: '(Identity(a ... { B = 30 }') Right: IFlowCaptureReferenceOperation: 5 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a) ... dentity2(a)') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: '(Identity(a ... { B = 30 }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: '(Identity(a ... { B = 30 }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: '(Identity(a ... { B = 30 }') Right: IFlowCaptureReferenceOperation: 4 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a) ... dentity2(a)') Next (Regular) Block[B7] Leaving: {R3} } Block[B7] - Block Predecessors: [B6] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'System.Console.Write(b);') Expression: IInvocationOperation (void System.Console.Write(System.Object value)) (OperationKind.Invocation, Type: System.Void) (Syntax: 'System.Console.Write(b)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument, Type: null) (Syntax: 'b') IConversionOperation (TryCast: False, Unchecked) (OperationKind.Conversion, Type: System.Object, IsImplicit) (Syntax: 'b') Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) (ImplicitReference) Operand: ILocalReferenceOperation: b (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'b') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B8] Leaving: {R1} } Block[B8] - Exit Predecessors: [B7] Statements (0) "; var expectedDiagnostics = DiagnosticDescription.None; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_ChangeOneProperty_WithCoalescingExpressionForValue() { var src = @" C.M(""hello"", ""world""); public class C { public static void M(string hello, string world) /*<bind>*/{ var x = new { A = hello, B = string.Empty }; var y = x with { B = Identity(null) ?? Identity2(world) }; System.Console.Write(y); }/*</bind>*/ static string Identity(string t) => t; static string Identity2(string t) => t; }"; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics(); CompileAndVerify(comp, expectedOutput: "{ A = hello, B = world }"); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.String A, System.String B> x] [<anonymous type: System.String A, System.String B> y] .locals {R2} { CaptureIds: [0] [1] Block[B1] - Block Predecessors: [B0] Statements (3) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'hello') Value: IParameterReferenceOperation: hello (OperationKind.ParameterReference, Type: System.String) (Syntax: 'hello') IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'string.Empty') Value: IFieldReferenceOperation: System.String System.String.Empty (Static) (OperationKind.FieldReference, Type: System.String) (Syntax: 'string.Empty') Instance Receiver: null ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.String A, System.String B>, IsImplicit) (Syntax: 'x = new { A ... ing.Empty }') Left: ILocalReferenceOperation: x (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.String A, System.String B>, IsImplicit) (Syntax: 'x = new { A ... ing.Empty }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.String A, System.String B>) (Syntax: 'new { A = h ... ing.Empty }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.String) (Syntax: 'A = hello') Left: IPropertyReferenceOperation: System.String <anonymous type: System.String A, System.String B>.A { get; } (OperationKind.PropertyReference, Type: System.String) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.String A, System.String B>, IsImplicit) (Syntax: 'new { A = h ... ing.Empty }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.String, IsImplicit) (Syntax: 'hello') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.String) (Syntax: 'B = string.Empty') Left: IPropertyReferenceOperation: System.String <anonymous type: System.String A, System.String B>.B { get; } (OperationKind.PropertyReference, Type: System.String) (Syntax: 'B') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.String A, System.String B>, IsImplicit) (Syntax: 'new { A = h ... ing.Empty }') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.String, IsImplicit) (Syntax: 'string.Empty') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} {R4} } .locals {R3} { CaptureIds: [3] [5] .locals {R4} { CaptureIds: [2] Block[B2] - Block Predecessors: [B1] Statements (1) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'x') Value: ILocalReferenceOperation: x (OperationKind.LocalReference, Type: <anonymous type: System.String A, System.String B>) (Syntax: 'x') Next (Regular) Block[B3] Entering: {R5} .locals {R5} { CaptureIds: [4] Block[B3] - Block Predecessors: [B2] Statements (1) IFlowCaptureOperation: 4 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(null)') Value: IInvocationOperation (System.String C.Identity(System.String t)) (OperationKind.Invocation, Type: System.String) (Syntax: 'Identity(null)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'null') IConversionOperation (TryCast: False, Unchecked) (OperationKind.Conversion, Type: System.String, Constant: null, IsImplicit) (Syntax: 'null') Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) (ImplicitReference) Operand: ILiteralOperation (OperationKind.Literal, Type: null, Constant: null) (Syntax: 'null') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Jump if True (Regular) to Block[B5] IIsNullOperation (OperationKind.IsNull, Type: System.Boolean, IsImplicit) (Syntax: 'Identity(null)') Operand: IFlowCaptureReferenceOperation: 4 (OperationKind.FlowCaptureReference, Type: System.String, IsImplicit) (Syntax: 'Identity(null)') Leaving: {R5} Next (Regular) Block[B4] Block[B4] - Block Predecessors: [B3] Statements (1) IFlowCaptureOperation: 3 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(null)') Value: IFlowCaptureReferenceOperation: 4 (OperationKind.FlowCaptureReference, Type: System.String, IsImplicit) (Syntax: 'Identity(null)') Next (Regular) Block[B6] Leaving: {R5} } Block[B5] - Block Predecessors: [B3] Statements (1) IFlowCaptureOperation: 3 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity2(world)') Value: IInvocationOperation (System.String C.Identity2(System.String t)) (OperationKind.Invocation, Type: System.String) (Syntax: 'Identity2(world)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'world') IParameterReferenceOperation: world (OperationKind.ParameterReference, Type: System.String) (Syntax: 'world') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B6] Block[B6] - Block Predecessors: [B4] [B5] Statements (1) IFlowCaptureOperation: 5 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'x with { B ... y2(world) }') Value: IPropertyReferenceOperation: System.String <anonymous type: System.String A, System.String B>.A { get; } (OperationKind.PropertyReference, Type: System.String, IsImplicit) (Syntax: 'x with { B ... y2(world) }') Instance Receiver: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.String A, System.String B>, IsImplicit) (Syntax: 'x') Next (Regular) Block[B7] Leaving: {R4} } Block[B7] - Block Predecessors: [B6] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.String A, System.String B>, IsImplicit) (Syntax: 'y = x with ... y2(world) }') Left: ILocalReferenceOperation: y (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.String A, System.String B>, IsImplicit) (Syntax: 'y = x with ... y2(world) }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.String A, System.String B>) (Syntax: 'x with { B ... y2(world) }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.String, IsImplicit) (Syntax: 'x with { B ... y2(world) }') Left: IPropertyReferenceOperation: System.String <anonymous type: System.String A, System.String B>.A { get; } (OperationKind.PropertyReference, Type: System.String, IsImplicit) (Syntax: 'x with { B ... y2(world) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.String A, System.String B>, IsImplicit) (Syntax: 'x with { B ... y2(world) }') Right: IFlowCaptureReferenceOperation: 5 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.String A, System.String B>, IsImplicit) (Syntax: 'x') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.String, IsImplicit) (Syntax: 'x with { B ... y2(world) }') Left: IPropertyReferenceOperation: System.String <anonymous type: System.String A, System.String B>.B { get; } (OperationKind.PropertyReference, Type: System.String, IsImplicit) (Syntax: 'x with { B ... y2(world) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.String A, System.String B>, IsImplicit) (Syntax: 'x with { B ... y2(world) }') Right: IFlowCaptureReferenceOperation: 3 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.String A, System.String B>, IsImplicit) (Syntax: 'x') Next (Regular) Block[B8] Leaving: {R3} } Block[B8] - Block Predecessors: [B7] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'System.Console.Write(y);') Expression: IInvocationOperation (void System.Console.Write(System.Object value)) (OperationKind.Invocation, Type: System.Void) (Syntax: 'System.Console.Write(y)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument, Type: null) (Syntax: 'y') IConversionOperation (TryCast: False, Unchecked) (OperationKind.Conversion, Type: System.Object, IsImplicit) (Syntax: 'y') Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) (ImplicitReference) Operand: ILocalReferenceOperation: y (OperationKind.LocalReference, Type: <anonymous type: System.String A, System.String B>) (Syntax: 'y') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B9] Leaving: {R1} } Block[B9] - Exit Predecessors: [B8] Statements (0) "; var expectedDiagnostics = DiagnosticDescription.None; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_ErrorMember() { var src = @" public class C { public static void M() /*<bind>*/{ var a = new { A = 10 }; var b = a with { Error = Identity(20) }; }/*</bind>*/ static T Identity<T>(T t) => t; }"; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); var expectedDiagnostics = new[] { // (7,26): error CS0117: '<anonymous type: int A>' does not contain a definition for 'Error' // var b = a with { Error = Identity(20) }; Diagnostic(ErrorCode.ERR_NoSuchMember, "Error").WithArguments("<anonymous type: int A>", "Error").WithLocation(7, 26) }; comp.VerifyEmitDiagnostics(expectedDiagnostics); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A> a] [<anonymous type: System.Int32 A> b] .locals {R2} { CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (2) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a = new { A = 10 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a = new { A = 10 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A>) (Syntax: 'new { A = 10 }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'new { A = 10 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} {R4} } .locals {R3} { CaptureIds: [2] .locals {R4} { CaptureIds: [1] Block[B2] - Block Predecessors: [B1] Statements (3) IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'a') Value: ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>) (Syntax: 'a') IInvocationOperation (System.Int32 C.Identity<System.Int32>(System.Int32 t)) (OperationKind.Invocation, Type: System.Int32) (Syntax: 'Identity(20)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '20') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20) (Syntax: '20') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsInvalid, IsImplicit) (Syntax: 'a with { Er ... ntity(20) }') Value: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'a with { Er ... ntity(20) }') Instance Receiver: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a') Next (Regular) Block[B3] Leaving: {R4} } Block[B3] - Block Predecessors: [B2] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'b = a with ... ntity(20) }') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'b = a with ... ntity(20) }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A>, IsInvalid) (Syntax: 'a with { Er ... ntity(20) }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'a with { Er ... ntity(20) }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'a with { Er ... ntity(20) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'a with { Er ... ntity(20) }') Right: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a') Next (Regular) Block[B4] Leaving: {R3} {R1} } } Block[B4] - Exit Predecessors: [B3] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_ToString() { var src = @" public class C { public static void M() /*<bind>*/{ var a = new { A = 10 }; var b = a with { ToString = Identity(20) }; }/*</bind>*/ static T Identity<T>(T t) => t; }"; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); var expectedDiagnostics = new[] { // (7,26): error CS1913: Member 'ToString' cannot be initialized. It is not a field or property. // var b = a with { ToString = Identity(20) }; Diagnostic(ErrorCode.ERR_MemberCannotBeInitialized, "ToString").WithArguments("ToString").WithLocation(7, 26) }; comp.VerifyEmitDiagnostics(expectedDiagnostics); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A> a] [<anonymous type: System.Int32 A> b] .locals {R2} { CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (2) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a = new { A = 10 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a = new { A = 10 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A>) (Syntax: 'new { A = 10 }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'new { A = 10 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} {R4} } .locals {R3} { CaptureIds: [2] .locals {R4} { CaptureIds: [1] Block[B2] - Block Predecessors: [B1] Statements (3) IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'a') Value: ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>) (Syntax: 'a') IInvocationOperation (System.Int32 C.Identity<System.Int32>(System.Int32 t)) (OperationKind.Invocation, Type: System.Int32) (Syntax: 'Identity(20)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '20') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20) (Syntax: '20') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsInvalid, IsImplicit) (Syntax: 'a with { To ... ntity(20) }') Value: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'a with { To ... ntity(20) }') Instance Receiver: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a') Next (Regular) Block[B3] Leaving: {R4} } Block[B3] - Block Predecessors: [B2] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'b = a with ... ntity(20) }') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'b = a with ... ntity(20) }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A>, IsInvalid) (Syntax: 'a with { To ... ntity(20) }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'a with { To ... ntity(20) }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'a with { To ... ntity(20) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'a with { To ... ntity(20) }') Right: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a') Next (Regular) Block[B4] Leaving: {R3} {R1} } } Block[B4] - Exit Predecessors: [B3] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_NestedInitializer() { var src = @" C.M(); public class C { public static void M() /*<bind>*/{ var nested = new { A = 10 }; var a = new { Nested = nested }; var b = a with { Nested = { A = 20 } }; System.Console.Write(b); }/*</bind>*/ }"; var expectedDiagnostics = new[] { // (10,35): error CS1525: Invalid expression term '{' // var b = a with { Nested = { A = 20 } }; Diagnostic(ErrorCode.ERR_InvalidExprTerm, "{").WithArguments("{").WithLocation(10, 35), // (10,35): error CS1513: } expected // var b = a with { Nested = { A = 20 } }; Diagnostic(ErrorCode.ERR_RbraceExpected, "{").WithLocation(10, 35), // (10,35): error CS1002: ; expected // var b = a with { Nested = { A = 20 } }; Diagnostic(ErrorCode.ERR_SemicolonExpected, "{").WithLocation(10, 35), // (10,37): error CS0103: The name 'A' does not exist in the current context // var b = a with { Nested = { A = 20 } }; Diagnostic(ErrorCode.ERR_NameNotInContext, "A").WithArguments("A").WithLocation(10, 37), // (10,44): error CS1002: ; expected // var b = a with { Nested = { A = 20 } }; Diagnostic(ErrorCode.ERR_SemicolonExpected, "}").WithLocation(10, 44), // (10,47): error CS1597: Semicolon after method or accessor block is not valid // var b = a with { Nested = { A = 20 } }; Diagnostic(ErrorCode.ERR_UnexpectedSemicolon, ";").WithLocation(10, 47), // (11,29): error CS1519: Invalid token '(' in class, record, struct, or interface member declaration // System.Console.Write(b); Diagnostic(ErrorCode.ERR_InvalidMemberDecl, "(").WithArguments("(").WithLocation(11, 29), // (11,31): error CS8124: Tuple must contain at least two elements. // System.Console.Write(b); Diagnostic(ErrorCode.ERR_TupleTooFewElements, ")").WithLocation(11, 31), // (11,32): error CS1519: Invalid token ';' in class, record, struct, or interface member declaration // System.Console.Write(b); Diagnostic(ErrorCode.ERR_InvalidMemberDecl, ";").WithArguments(";").WithLocation(11, 32), // (13,1): error CS1022: Type or namespace definition, or end-of-file expected // } Diagnostic(ErrorCode.ERR_EOFExpected, "}").WithLocation(13, 1) }; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics(expectedDiagnostics); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A> nested] [<anonymous type: <anonymous type: System.Int32 A> Nested> a] [<anonymous type: <anonymous type: System.Int32 A> Nested> b] .locals {R2} { CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (2) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'nested = new { A = 10 }') Left: ILocalReferenceOperation: nested (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'nested = new { A = 10 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A>) (Syntax: 'new { A = 10 }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'new { A = 10 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} } .locals {R3} { CaptureIds: [1] Block[B2] - Block Predecessors: [B1] Statements (2) IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'nested') Value: ILocalReferenceOperation: nested (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>) (Syntax: 'nested') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: <anonymous type: System.Int32 A> Nested>, IsImplicit) (Syntax: 'a = new { N ... = nested }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: <anonymous type: System.Int32 A> Nested>, IsImplicit) (Syntax: 'a = new { N ... = nested }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: <anonymous type: System.Int32 A> Nested>) (Syntax: 'new { Nested = nested }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>) (Syntax: 'Nested = nested') Left: IPropertyReferenceOperation: <anonymous type: System.Int32 A> <anonymous type: <anonymous type: System.Int32 A> Nested>.Nested { get; } (OperationKind.PropertyReference, Type: <anonymous type: System.Int32 A>) (Syntax: 'Nested') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: <anonymous type: System.Int32 A> Nested>, IsImplicit) (Syntax: 'new { Nested = nested }') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'nested') Next (Regular) Block[B3] Leaving: {R3} Entering: {R4} } .locals {R4} { CaptureIds: [2] Block[B3] - Block Predecessors: [B2] Statements (3) ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: <anonymous type: System.Int32 A> Nested>) (Syntax: 'a') IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsInvalid, IsImplicit) (Syntax: '') Value: IInvalidOperation (OperationKind.Invalid, Type: null, IsInvalid) (Syntax: '') Children(0) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: <anonymous type: System.Int32 A> Nested>, IsInvalid, IsImplicit) (Syntax: 'b = a with { Nested = ') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: <anonymous type: System.Int32 A> Nested>, IsInvalid, IsImplicit) (Syntax: 'b = a with { Nested = ') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: <anonymous type: System.Int32 A> Nested>, IsInvalid) (Syntax: 'a with { Nested = ') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'a with { Nested = ') Left: IPropertyReferenceOperation: <anonymous type: System.Int32 A> <anonymous type: <anonymous type: System.Int32 A> Nested>.Nested { get; } (OperationKind.PropertyReference, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'a with { Nested = ') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: <anonymous type: System.Int32 A> Nested>, IsInvalid, IsImplicit) (Syntax: 'a with { Nested = ') Right: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: <anonymous type: System.Int32 A> Nested>, IsImplicit) (Syntax: 'a') Next (Regular) Block[B4] Leaving: {R4} } Block[B4] - Block Predecessors: [B3] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null, IsInvalid) (Syntax: 'A = 20 ') Expression: ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: ?, IsInvalid) (Syntax: 'A = 20') Left: IInvalidOperation (OperationKind.Invalid, Type: ?, IsInvalid) (Syntax: 'A') Children(0) Right: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20) (Syntax: '20') Next (Regular) Block[B5] Leaving: {R1} } Block[B5] - Exit Predecessors: [B4] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_NonAssignmentExpression() { var src = @" public class C { public static void M(int i, int j) /*<bind>*/{ var a = new { A = 10 }; var b = a with { i, j++, M2(), A = 20 }; }/*</bind>*/ static int M2() => 0; }"; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); var expectedDiagnostics = new[] { // (7,26): error CS0747: Invalid initializer member declarator // var b = a with { i, j++, M2(), A = 20 }; Diagnostic(ErrorCode.ERR_InvalidInitializerElementInitializer, "i").WithLocation(7, 26), // (7,29): error CS0747: Invalid initializer member declarator // var b = a with { i, j++, M2(), A = 20 }; Diagnostic(ErrorCode.ERR_InvalidInitializerElementInitializer, "j++").WithLocation(7, 29), // (7,34): error CS0747: Invalid initializer member declarator // var b = a with { i, j++, M2(), A = 20 }; Diagnostic(ErrorCode.ERR_InvalidInitializerElementInitializer, "M2()").WithLocation(7, 34) }; comp.VerifyEmitDiagnostics(expectedDiagnostics); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A> a] [<anonymous type: System.Int32 A> b] .locals {R2} { CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (2) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a = new { A = 10 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a = new { A = 10 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A>) (Syntax: 'new { A = 10 }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'new { A = 10 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} } .locals {R3} { CaptureIds: [1] Block[B2] - Block Predecessors: [B1] Statements (6) ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>) (Syntax: 'a') IInvalidOperation (OperationKind.Invalid, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'i') Children(1): IParameterReferenceOperation: i (OperationKind.ParameterReference, Type: System.Int32, IsInvalid) (Syntax: 'i') IInvalidOperation (OperationKind.Invalid, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'j++') Children(1): IIncrementOrDecrementOperation (Postfix) (OperationKind.Increment, Type: System.Int32, IsInvalid) (Syntax: 'j++') Target: IParameterReferenceOperation: j (OperationKind.ParameterReference, Type: System.Int32, IsInvalid) (Syntax: 'j') IInvalidOperation (OperationKind.Invalid, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'M2()') Children(1): IInvocationOperation (System.Int32 C.M2()) (OperationKind.Invocation, Type: System.Int32, IsInvalid) (Syntax: 'M2()') Instance Receiver: null Arguments(0) IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '20') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20) (Syntax: '20') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'b = a with ... ), A = 20 }') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'b = a with ... ), A = 20 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A>, IsInvalid) (Syntax: 'a with { i, ... ), A = 20 }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'a with { i, ... ), A = 20 }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'a with { i, ... ), A = 20 }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'a with { i, ... ), A = 20 }') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a') Next (Regular) Block[B3] Leaving: {R3} {R1} } } Block[B3] - Exit Predecessors: [B2] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_IndexerAccess() { var src = @" public class C { public static void M() /*<bind>*/{ var a = new { A = 10 }; var b = a with { [0] = 20 }; }/*</bind>*/ }"; var expectedDiagnostics = new[] { // (7,26): error CS1513: } expected // var b = a with { [0] = 20 }; Diagnostic(ErrorCode.ERR_RbraceExpected, "[").WithLocation(7, 26), // (7,26): error CS1002: ; expected // var b = a with { [0] = 20 }; Diagnostic(ErrorCode.ERR_SemicolonExpected, "[").WithLocation(7, 26), // (7,26): error CS7014: Attributes are not valid in this context. // var b = a with { [0] = 20 }; Diagnostic(ErrorCode.ERR_AttributesNotAllowed, "[").WithLocation(7, 26), // (7,27): error CS1001: Identifier expected // var b = a with { [0] = 20 }; Diagnostic(ErrorCode.ERR_IdentifierExpected, "0").WithLocation(7, 27), // (7,27): error CS1003: Syntax error, ']' expected // var b = a with { [0] = 20 }; Diagnostic(ErrorCode.ERR_SyntaxError, "0").WithArguments("]", "").WithLocation(7, 27), // (7,28): error CS1002: ; expected // var b = a with { [0] = 20 }; Diagnostic(ErrorCode.ERR_SemicolonExpected, "]").WithLocation(7, 28), // (7,28): error CS1513: } expected // var b = a with { [0] = 20 }; Diagnostic(ErrorCode.ERR_RbraceExpected, "]").WithLocation(7, 28), // (7,30): error CS1525: Invalid expression term '=' // var b = a with { [0] = 20 }; Diagnostic(ErrorCode.ERR_InvalidExprTerm, "=").WithArguments("=").WithLocation(7, 30), // (7,35): error CS1002: ; expected // var b = a with { [0] = 20 }; Diagnostic(ErrorCode.ERR_SemicolonExpected, "}").WithLocation(7, 35), // (7,36): error CS1597: Semicolon after method or accessor block is not valid // var b = a with { [0] = 20 }; Diagnostic(ErrorCode.ERR_UnexpectedSemicolon, ";").WithLocation(7, 36), // (9,1): error CS1022: Type or namespace definition, or end-of-file expected // } Diagnostic(ErrorCode.ERR_EOFExpected, "}").WithLocation(9, 1) }; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics(expectedDiagnostics); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A> a] [<anonymous type: System.Int32 A> b] .locals {R2} { CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (2) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a = new { A = 10 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a = new { A = 10 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A>) (Syntax: 'new { A = 10 }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'new { A = 10 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} {R4} } .locals {R3} { CaptureIds: [2] .locals {R4} { CaptureIds: [1] Block[B2] - Block Predecessors: [B1] Statements (2) IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'a') Value: ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>) (Syntax: 'a') IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsInvalid, IsImplicit) (Syntax: 'a with { ') Value: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'a with { ') Instance Receiver: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a') Next (Regular) Block[B3] Leaving: {R4} } Block[B3] - Block Predecessors: [B2] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'b = a with { ') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'b = a with { ') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A>, IsInvalid) (Syntax: 'a with { ') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'a with { ') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'a with { ') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'a with { ') Right: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a') Next (Regular) Block[B4] Leaving: {R3} } Block[B4] - Block Predecessors: [B3] Statements (2) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null, IsInvalid) (Syntax: '[0') Expression: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 0, IsInvalid) (Syntax: '0') IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null, IsInvalid) (Syntax: '= 20 ') Expression: ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: ?, IsInvalid) (Syntax: '= 20') Left: IInvalidOperation (OperationKind.Invalid, Type: null, IsInvalid) (Syntax: '') Children(0) Right: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20) (Syntax: '20') Next (Regular) Block[B5] Leaving: {R1} } Block[B5] - Exit Predecessors: [B4] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_CannotSet() { var src = @" public class C { public static void M() { var a = new { A = 10 }; a.A = 20; var b = new { B = a }; b.B.A = 30; } }"; var comp = CreateCompilation(src, parseOptions: TestOptions.Regular9); comp.VerifyEmitDiagnostics( // (7,9): error CS0200: Property or indexer '<anonymous type: int A>.A' cannot be assigned to -- it is read only // a.A = 20; Diagnostic(ErrorCode.ERR_AssgReadonlyProp, "a.A").WithArguments("<anonymous type: int A>.A").WithLocation(7, 9), // (10,9): error CS0200: Property or indexer '<anonymous type: int A>.A' cannot be assigned to -- it is read only // b.B.A = 30; Diagnostic(ErrorCode.ERR_AssgReadonlyProp, "b.B.A").WithArguments("<anonymous type: int A>.A").WithLocation(10, 9) ); } [Fact] public void WithExpr_AnonymousType_DuplicateMemberInDeclaration() { var src = @" public class C { public static void M() /*<bind>*/{ var a = new { A = 10, A = 20 }; var b = Identity(a) with { A = Identity(30) }; System.Console.Write(b); }/*</bind>*/ static T Identity<T>(T t) => t; }"; var expectedDiagnostics = new[] { // (6,31): error CS0833: An anonymous type cannot have multiple properties with the same name // var a = new { A = 10, A = 20 }; Diagnostic(ErrorCode.ERR_AnonymousTypeDuplicatePropertyName, "A = 20").WithLocation(6, 31) }; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics(expectedDiagnostics); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A, System.Int32 $1> a] [<anonymous type: System.Int32 A, System.Int32 $1> b] .locals {R2} { CaptureIds: [0] [1] Block[B1] - Block Predecessors: [B0] Statements (3) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsInvalid, IsImplicit) (Syntax: '20') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20, IsInvalid) (Syntax: '20') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsInvalid, IsImplicit) (Syntax: 'a = new { A ... 0, A = 20 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsInvalid, IsImplicit) (Syntax: 'a = new { A ... 0, A = 20 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsInvalid) (Syntax: 'new { A = 10, A = 20 }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 $1>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsInvalid, IsImplicit) (Syntax: 'new { A = 10, A = 20 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 20, IsInvalid) (Syntax: 'A = 20') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 $1>.$1 { get; } (OperationKind.PropertyReference, Type: System.Int32, IsInvalid) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsInvalid, IsImplicit) (Syntax: 'new { A = 10, A = 20 }') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 20, IsInvalid, IsImplicit) (Syntax: '20') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} {R4} } .locals {R3} { CaptureIds: [3] [4] .locals {R4} { CaptureIds: [2] Block[B2] - Block Predecessors: [B1] Statements (3) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(a)') Value: IInvocationOperation (<anonymous type: System.Int32 A, System.Int32 $1> C.Identity<<anonymous type: System.Int32 A, System.Int32 $1>>(<anonymous type: System.Int32 A, System.Int32 $1> t)) (OperationKind.Invocation, Type: <anonymous type: System.Int32 A, System.Int32 $1>) (Syntax: 'Identity(a)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'a') ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 $1>) (Syntax: 'a') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 3 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(30)') Value: IInvocationOperation (System.Int32 C.Identity<System.Int32>(System.Int32 t)) (OperationKind.Invocation, Type: System.Int32) (Syntax: 'Identity(30)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '30') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 30) (Syntax: '30') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 4 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Value: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 $1>.$1 { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Instance Receiver: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsImplicit) (Syntax: 'Identity(a)') Next (Regular) Block[B3] Leaving: {R4} } Block[B3] - Block Predecessors: [B2] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsImplicit) (Syntax: 'b = Identit ... ntity(30) }') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsImplicit) (Syntax: 'b = Identit ... ntity(30) }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 $1>) (Syntax: 'Identity(a) ... ntity(30) }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 $1>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Right: IFlowCaptureReferenceOperation: 3 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsImplicit) (Syntax: 'Identity(a)') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 $1>.$1 { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Right: IFlowCaptureReferenceOperation: 4 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsImplicit) (Syntax: 'Identity(a)') Next (Regular) Block[B4] Leaving: {R3} } Block[B4] - Block Predecessors: [B3] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'System.Console.Write(b);') Expression: IInvocationOperation (void System.Console.Write(System.Object value)) (OperationKind.Invocation, Type: System.Void) (Syntax: 'System.Console.Write(b)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument, Type: null) (Syntax: 'b') IConversionOperation (TryCast: False, Unchecked) (OperationKind.Conversion, Type: System.Object, IsImplicit) (Syntax: 'b') Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) (ImplicitReference) Operand: ILocalReferenceOperation: b (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 $1>) (Syntax: 'b') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B5] Leaving: {R1} } Block[B5] - Exit Predecessors: [B4] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_DuplicateInitialization() { var src = @" public class C { public static void M() /*<bind>*/{ var a = new { A = 10 }; var b = Identity(a) with { A = Identity(30), A = Identity(40) }; }/*</bind>*/ static T Identity<T>(T t) => t; }"; var expectedDiagnostics = new[] { // (7,54): error CS1912: Duplicate initialization of member 'A' // var b = Identity(a) with { A = Identity(30), A = Identity(40) }; Diagnostic(ErrorCode.ERR_MemberAlreadyInitialized, "A").WithArguments("A").WithLocation(7, 54) }; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics(expectedDiagnostics); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A> a] [<anonymous type: System.Int32 A> b] .locals {R2} { CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (2) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a = new { A = 10 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a = new { A = 10 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A>) (Syntax: 'new { A = 10 }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'new { A = 10 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} } .locals {R3} { CaptureIds: [1] Block[B2] - Block Predecessors: [B1] Statements (4) IInvocationOperation (<anonymous type: System.Int32 A> C.Identity<<anonymous type: System.Int32 A>>(<anonymous type: System.Int32 A> t)) (OperationKind.Invocation, Type: <anonymous type: System.Int32 A>) (Syntax: 'Identity(a)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'a') ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>) (Syntax: 'a') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(30)') Value: IInvocationOperation (System.Int32 C.Identity<System.Int32>(System.Int32 t)) (OperationKind.Invocation, Type: System.Int32) (Syntax: 'Identity(30)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '30') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 30) (Syntax: '30') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IInvocationOperation (System.Int32 C.Identity<System.Int32>(System.Int32 t)) (OperationKind.Invocation, Type: System.Int32) (Syntax: 'Identity(40)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '40') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 40) (Syntax: '40') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'b = Identit ... ntity(40) }') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'b = Identit ... ntity(40) }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A>, IsInvalid) (Syntax: 'Identity(a) ... ntity(40) }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'Identity(a) ... ntity(40) }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'Identity(a) ... ntity(40) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'Identity(a) ... ntity(40) }') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'Identity(a)') Next (Regular) Block[B3] Leaving: {R3} {R1} } } Block[B3] - Exit Predecessors: [B2] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact, WorkItem(53849, "https://github.com/dotnet/roslyn/issues/53849")] public void WithExpr_AnonymousType_ValueIsLoweredToo() { var src = @" var x = new { Property = 42 }; var adjusted = x with { Property = x.Property + 2 }; System.Console.WriteLine(adjusted); "; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); var verifier = CompileAndVerify(comp, expectedOutput: "{ Property = 44 }"); verifier.VerifyDiagnostics(); } [Fact, WorkItem(53849, "https://github.com/dotnet/roslyn/issues/53849")] public void WithExpr_AnonymousType_ValueIsLoweredToo_NestedWith() { var src = @" var x = new { Property = 42 }; var container = new { Item = x }; var adjusted = container with { Item = x with { Property = x.Property + 2 } }; System.Console.WriteLine(adjusted); "; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); var verifier = CompileAndVerify(comp, expectedOutput: "{ Item = { Property = 44 } }"); verifier.VerifyDiagnostics(); } [Fact] public void AttributesOnPrimaryConstructorParameters_01() { string source = @" [System.AttributeUsage(System.AttributeTargets.Field, AllowMultiple = true) ] public class A : System.Attribute { } [System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple = true) ] public class B : System.Attribute { } [System.AttributeUsage(System.AttributeTargets.Parameter, AllowMultiple = true) ] public class C : System.Attribute { } [System.AttributeUsage(System.AttributeTargets.Parameter, AllowMultiple = true) ] public class D : System.Attribute { } public readonly record struct Test( [field: A] [property: B] [param: C] [D] int P1) { } "; Action<ModuleSymbol> symbolValidator = moduleSymbol => { var @class = moduleSymbol.GlobalNamespace.GetMember<NamedTypeSymbol>("Test"); var prop1 = @class.GetMember<PropertySymbol>("P1"); AssertEx.SetEqual(new[] { "B" }, getAttributeStrings(prop1)); var field1 = @class.GetMember<FieldSymbol>("<P1>k__BackingField"); AssertEx.SetEqual(new[] { "A" }, getAttributeStrings(field1)); var param1 = @class.GetMembers(".ctor").OfType<MethodSymbol>().Where(m => m.Parameters.AsSingleton()?.Name == "P1").Single().Parameters[0]; AssertEx.SetEqual(new[] { "C", "D" }, getAttributeStrings(param1)); }; var comp = CompileAndVerify(new[] { source, IsExternalInitTypeDefinition }, sourceSymbolValidator: symbolValidator, symbolValidator: symbolValidator, parseOptions: TestOptions.RegularPreview, // init-only is unverifiable verify: Verification.Skipped, options: TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All)); comp.VerifyDiagnostics(); IEnumerable<string> getAttributeStrings(Symbol symbol) { return GetAttributeStrings(symbol.GetAttributes().Where(a => a.AttributeClass!.Name is "A" or "B" or "C" or "D")); } } [Fact] public void FieldAsPositionalMember() { var source = @" var a = new A(42); System.Console.Write(a.X); System.Console.Write("" - ""); a.Deconstruct(out int x); System.Console.Write(x); record struct A(int X) { public int X = X; } "; var comp = CreateCompilation(source, parseOptions: TestOptions.Regular9); comp.VerifyEmitDiagnostics( // (8,8): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct A(int X) Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(8, 8), // (8,17): error CS8773: Feature 'positional fields in records' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct A(int X) Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "int X").WithArguments("positional fields in records", "10.0").WithLocation(8, 17) ); comp = CreateCompilation(source, parseOptions: TestOptions.Regular10); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "42 - 42"); verifier.VerifyIL("A.Deconstruct", @" { // Code size 9 (0x9) .maxstack 2 IL_0000: ldarg.1 IL_0001: ldarg.0 IL_0002: ldfld ""int A.X"" IL_0007: stind.i4 IL_0008: ret } "); } [Fact] public void FieldAsPositionalMember_Readonly() { var source = @" readonly record struct A(int X) { public int X = X; // 1 } readonly record struct B(int X) { public readonly int X = X; } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics( // (4,16): error CS8340: Instance fields of readonly structs must be readonly. // public int X = X; // 1 Diagnostic(ErrorCode.ERR_FieldsInRoStruct, "X").WithLocation(4, 16) ); } [Fact] public void FieldAsPositionalMember_Fixed() { var src = @" unsafe record struct C(int[] P) { public fixed int P[2]; public int[] X = P; }"; var comp = CreateCompilation(src, options: TestOptions.UnsafeReleaseDll, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics( // (2,30): error CS8866: Record member 'C.P' must be a readable instance property or field of type 'int[]' to match positional parameter 'P'. // unsafe record struct C(int[] P) Diagnostic(ErrorCode.ERR_BadRecordMemberForPositionalParameter, "P").WithArguments("C.P", "int[]", "P").WithLocation(2, 30), // (4,22): error CS8908: The type 'int*' may not be used for a field of a record. // public fixed int P[2]; Diagnostic(ErrorCode.ERR_BadFieldTypeInRecord, "P").WithArguments("int*").WithLocation(4, 22) ); } [Fact] public void FieldAsPositionalMember_WrongType() { var source = @" record struct A(int X) { public string X = null; public int Y = X; } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics( // (2,21): error CS8866: Record member 'A.X' must be a readable instance property or field of type 'int' to match positional parameter 'X'. // record struct A(int X) Diagnostic(ErrorCode.ERR_BadRecordMemberForPositionalParameter, "X").WithArguments("A.X", "int", "X").WithLocation(2, 21) ); } [Fact] public void FieldAsPositionalMember_DuplicateFields() { var source = @" record struct A(int X) { public int X = 0; public int X = 0; public int Y = X; } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics( // (5,16): error CS0102: The type 'A' already contains a definition for 'X' // public int X = 0; Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "X").WithArguments("A", "X").WithLocation(5, 16) ); } [Fact] public void SyntaxFactory_TypeDeclaration() { var expected = @"record struct Point { }"; AssertEx.AssertEqualToleratingWhitespaceDifferences(expected, SyntaxFactory.TypeDeclaration(SyntaxKind.RecordStructDeclaration, "Point").NormalizeWhitespace().ToString()); } [Fact] public void InterfaceWithParameters() { var src = @" public interface I { } record struct R(int X) : I() { } record struct R2(int X) : I(X) { } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (6,27): error CS8861: Unexpected argument list. // record struct R(int X) : I() Diagnostic(ErrorCode.ERR_UnexpectedArgumentList, "()").WithLocation(6, 27), // (10,28): error CS8861: Unexpected argument list. // record struct R2(int X) : I(X) Diagnostic(ErrorCode.ERR_UnexpectedArgumentList, "(X)").WithLocation(10, 28) ); } [Fact] public void InterfaceWithParameters_NoPrimaryConstructor() { var src = @" public interface I { } record struct R : I() { } record struct R2 : I(0) { } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (6,20): error CS8861: Unexpected argument list. // record struct R : I() Diagnostic(ErrorCode.ERR_UnexpectedArgumentList, "()").WithLocation(6, 20), // (10,21): error CS8861: Unexpected argument list. // record struct R2 : I(0) Diagnostic(ErrorCode.ERR_UnexpectedArgumentList, "(0)").WithLocation(10, 21) ); } [Fact] public void InterfaceWithParameters_Struct() { var src = @" public interface I { } struct C : I() { } struct C2 : I(0) { } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (6,13): error CS8861: Unexpected argument list. // struct C : I() Diagnostic(ErrorCode.ERR_UnexpectedArgumentList, "()").WithLocation(6, 13), // (10,14): error CS8861: Unexpected argument list. // struct C2 : I(0) Diagnostic(ErrorCode.ERR_UnexpectedArgumentList, "(0)").WithLocation(10, 14) ); } [Fact] public void BaseArguments_Speculation() { var src = @" record struct R1(int X) : Error1(0, 1) { } record struct R2(int X) : Error2() { } record struct R3(int X) : Error3 { } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,27): error CS0246: The type or namespace name 'Error1' could not be found (are you missing a using directive or an assembly reference?) // record struct R1(int X) : Error1(0, 1) Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "Error1").WithArguments("Error1").WithLocation(2, 27), // (2,33): error CS8861: Unexpected argument list. // record struct R1(int X) : Error1(0, 1) Diagnostic(ErrorCode.ERR_UnexpectedArgumentList, "(0, 1)").WithLocation(2, 33), // (5,27): error CS0246: The type or namespace name 'Error2' could not be found (are you missing a using directive or an assembly reference?) // record struct R2(int X) : Error2() Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "Error2").WithArguments("Error2").WithLocation(5, 27), // (5,33): error CS8861: Unexpected argument list. // record struct R2(int X) : Error2() Diagnostic(ErrorCode.ERR_UnexpectedArgumentList, "()").WithLocation(5, 33), // (8,27): error CS0246: The type or namespace name 'Error3' could not be found (are you missing a using directive or an assembly reference?) // record struct R3(int X) : Error3 Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "Error3").WithArguments("Error3").WithLocation(8, 27) ); var tree = comp.SyntaxTrees.First(); var model = comp.GetSemanticModel(tree); var baseWithargs = tree.GetRoot().DescendantNodes().OfType<PrimaryConstructorBaseTypeSyntax>().First(); Assert.Equal("Error1(0, 1)", baseWithargs.ToString()); var speculativeBase = baseWithargs.WithArgumentList(baseWithargs.ArgumentList.WithArguments(baseWithargs.ArgumentList.Arguments.RemoveAt(1))); Assert.Equal("Error1(0)", speculativeBase.ToString()); Assert.False(model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBase, out _)); var baseWithoutargs = tree.GetRoot().DescendantNodes().OfType<PrimaryConstructorBaseTypeSyntax>().Skip(1).First(); Assert.Equal("Error2()", baseWithoutargs.ToString()); Assert.False(model.TryGetSpeculativeSemanticModel(baseWithoutargs.ArgumentList.OpenParenToken.SpanStart, speculativeBase, out _)); var baseWithoutParens = tree.GetRoot().DescendantNodes().OfType<SimpleBaseTypeSyntax>().Single(); Assert.Equal("Error3", baseWithoutParens.ToString()); Assert.False(model.TryGetSpeculativeSemanticModel(baseWithoutParens.SpanStart + 2, speculativeBase, out _)); } [Fact, WorkItem(54413, "https://github.com/dotnet/roslyn/issues/54413")] public void ValueTypeCopyConstructorLike_NoThisInitializer() { var src = @" record struct Value(string Text) { private Value(int X) { } // 1 private Value(Value original) { } // 2 } record class Boxed(string Text) { private Boxed(int X) { } // 3 private Boxed(Boxed original) { } // 4 } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (4,13): error CS8862: A constructor declared in a record with parameter list must have 'this' constructor initializer. // private Value(int X) { } // 1 Diagnostic(ErrorCode.ERR_UnexpectedOrMissingConstructorInitializerInRecord, "Value").WithLocation(4, 13), // (5,13): error CS8862: A constructor declared in a record with parameter list must have 'this' constructor initializer. // private Value(Value original) { } // 2 Diagnostic(ErrorCode.ERR_UnexpectedOrMissingConstructorInitializerInRecord, "Value").WithLocation(5, 13), // (10,13): error CS8862: A constructor declared in a record with parameter list must have 'this' constructor initializer. // private Boxed(int X) { } // 3 Diagnostic(ErrorCode.ERR_UnexpectedOrMissingConstructorInitializerInRecord, "Boxed").WithLocation(10, 13), // (11,13): error CS8878: A copy constructor 'Boxed.Boxed(Boxed)' must be public or protected because the record is not sealed. // private Boxed(Boxed original) { } // 4 Diagnostic(ErrorCode.ERR_CopyConstructorWrongAccessibility, "Boxed").WithArguments("Boxed.Boxed(Boxed)").WithLocation(11, 13) ); } [Fact] public void ValueTypeCopyConstructorLike() { var src = @" System.Console.Write(new Value(new Value(0))); record struct Value(int I) { public Value(Value original) : this(42) { } } "; var comp = CreateCompilation(src); CompileAndVerify(comp, expectedOutput: "Value { I = 42 }"); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using System.Threading; using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE; using Microsoft.CodeAnalysis.CSharp.Symbols.Retargeting; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Test.Utilities; using Roslyn.Test.Utilities; using Roslyn.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.CSharp.UnitTests.Semantics { [CompilerTrait(CompilerFeature.RecordStructs)] public class RecordStructTests : CompilingTestBase { private static CSharpCompilation CreateCompilation(CSharpTestSource source) => CSharpTestBase.CreateCompilation(new[] { source, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview); private CompilationVerifier CompileAndVerify( CSharpTestSource src, string? expectedOutput = null, IEnumerable<MetadataReference>? references = null) => base.CompileAndVerify( new[] { src, IsExternalInitTypeDefinition }, expectedOutput: expectedOutput, parseOptions: TestOptions.RegularPreview, references: references, // init-only is unverifiable verify: Verification.Skipped); [Fact] public void StructRecord1() { var src = @" record struct Point(int X, int Y);"; var verifier = CompileAndVerify(src).VerifyDiagnostics(); verifier.VerifyIL("Point.Equals(object)", @" { // Code size 23 (0x17) .maxstack 2 IL_0000: ldarg.1 IL_0001: isinst ""Point"" IL_0006: brfalse.s IL_0015 IL_0008: ldarg.0 IL_0009: ldarg.1 IL_000a: unbox.any ""Point"" IL_000f: call ""readonly bool Point.Equals(Point)"" IL_0014: ret IL_0015: ldc.i4.0 IL_0016: ret }"); verifier.VerifyIL("Point.Equals(Point)", @" { // Code size 49 (0x31) .maxstack 3 IL_0000: call ""System.Collections.Generic.EqualityComparer<int> System.Collections.Generic.EqualityComparer<int>.Default.get"" IL_0005: ldarg.0 IL_0006: ldfld ""int Point.<X>k__BackingField"" IL_000b: ldarg.1 IL_000c: ldfld ""int Point.<X>k__BackingField"" IL_0011: callvirt ""bool System.Collections.Generic.EqualityComparer<int>.Equals(int, int)"" IL_0016: brfalse.s IL_002f IL_0018: call ""System.Collections.Generic.EqualityComparer<int> System.Collections.Generic.EqualityComparer<int>.Default.get"" IL_001d: ldarg.0 IL_001e: ldfld ""int Point.<Y>k__BackingField"" IL_0023: ldarg.1 IL_0024: ldfld ""int Point.<Y>k__BackingField"" IL_0029: callvirt ""bool System.Collections.Generic.EqualityComparer<int>.Equals(int, int)"" IL_002e: ret IL_002f: ldc.i4.0 IL_0030: ret }"); } [Fact] public void StructRecord2() { var src = @" using System; record struct S(int X, int Y) { public static void Main() { var s1 = new S(0, 1); var s2 = new S(0, 1); Console.WriteLine(s1.X); Console.WriteLine(s1.Y); Console.WriteLine(s1.Equals(s2)); Console.WriteLine(s1.Equals(new S(1, 0))); } }"; var verifier = CompileAndVerify(src, expectedOutput: @"0 1 True False").VerifyDiagnostics(); } [Fact] public void StructRecord3() { var src = @" using System; record struct S(int X, int Y) { public bool Equals(S s) => false; public static void Main() { var s1 = new S(0, 1); Console.WriteLine(s1.Equals(s1)); } }"; var verifier = CompileAndVerify(src, expectedOutput: @"False") .VerifyDiagnostics( // (5,17): warning CS8851: 'S' defines 'Equals' but not 'GetHashCode' // public bool Equals(S s) => false; Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("S").WithLocation(5, 17)); verifier.VerifyIL("S.Main", @" { // Code size 23 (0x17) .maxstack 3 .locals init (S V_0) //s1 IL_0000: ldloca.s V_0 IL_0002: ldc.i4.0 IL_0003: ldc.i4.1 IL_0004: call ""S..ctor(int, int)"" IL_0009: ldloca.s V_0 IL_000b: ldloc.0 IL_000c: call ""bool S.Equals(S)"" IL_0011: call ""void System.Console.WriteLine(bool)"" IL_0016: ret }"); } [Fact] public void StructRecord5() { var src = @" using System; record struct S(int X, int Y) { public bool Equals(S s) { Console.Write(""s""); return true; } public static void Main() { var s1 = new S(0, 1); s1.Equals((object)s1); s1.Equals(s1); } }"; CompileAndVerify(src, expectedOutput: @"ss") .VerifyDiagnostics( // (5,17): warning CS8851: 'S' defines 'Equals' but not 'GetHashCode' // public bool Equals(S s) Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("S").WithLocation(5, 17)); } [Fact] public void StructRecordDefaultCtor() { const string src = @" public record struct S(int X);"; const string src2 = @" class C { public S M() => new S(); }"; var comp = CreateCompilation(src + src2); comp.VerifyDiagnostics(); comp = CreateCompilation(src); var comp2 = CreateCompilation(src2, references: new[] { comp.EmitToImageReference() }); comp2.VerifyDiagnostics(); } [Fact] public void Equality_01() { var source = @"using static System.Console; record struct S; class Program { static void Main() { var x = new S(); var y = new S(); WriteLine(x.Equals(y)); WriteLine(((object)x).Equals(y)); } }"; var comp = CreateCompilation(source, parseOptions: TestOptions.RegularPreview, options: TestOptions.ReleaseExe); var verifier = CompileAndVerify(comp, expectedOutput: @"True True").VerifyDiagnostics(); verifier.VerifyIL("S.Equals(S)", @" { // Code size 2 (0x2) .maxstack 1 IL_0000: ldc.i4.1 IL_0001: ret }"); verifier.VerifyIL("S.Equals(object)", @" { // Code size 23 (0x17) .maxstack 2 IL_0000: ldarg.1 IL_0001: isinst ""S"" IL_0006: brfalse.s IL_0015 IL_0008: ldarg.0 IL_0009: ldarg.1 IL_000a: unbox.any ""S"" IL_000f: call ""readonly bool S.Equals(S)"" IL_0014: ret IL_0015: ldc.i4.0 IL_0016: ret }"); } [Fact] public void RecordStructLanguageVersion() { var src1 = @" struct Point(int x, int y); "; var src2 = @" record struct Point { } "; var src3 = @" record struct Point(int x, int y); "; var comp = CreateCompilation(new[] { src1, IsExternalInitTypeDefinition }, parseOptions: TestOptions.Regular9, options: TestOptions.ReleaseDll); comp.VerifyDiagnostics( // (2,13): error CS1514: { expected // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_LbraceExpected, "(").WithLocation(2, 13), // (2,13): error CS1513: } expected // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_RbraceExpected, "(").WithLocation(2, 13), // (2,13): error CS8803: Top-level statements must precede namespace and type declarations. // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "(int x, int y);").WithLocation(2, 13), // (2,13): error CS8805: Program using top-level statements must be an executable. // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_SimpleProgramNotAnExecutable, "(int x, int y);").WithLocation(2, 13), // (2,13): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_IllegalStatement, "(int x, int y)").WithLocation(2, 13), // (2,14): error CS8185: A declaration is not allowed in this context. // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_DeclarationExpressionNotPermitted, "int x").WithLocation(2, 14), // (2,14): error CS0165: Use of unassigned local variable 'x' // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_UseDefViolation, "int x").WithArguments("x").WithLocation(2, 14), // (2,21): error CS8185: A declaration is not allowed in this context. // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_DeclarationExpressionNotPermitted, "int y").WithLocation(2, 21), // (2,21): error CS0165: Use of unassigned local variable 'y' // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_UseDefViolation, "int y").WithArguments("y").WithLocation(2, 21) ); comp = CreateCompilation(new[] { src2, IsExternalInitTypeDefinition }, parseOptions: TestOptions.Regular9, options: TestOptions.ReleaseDll); comp.VerifyDiagnostics( // (2,8): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct Point { } Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(2, 8) ); comp = CreateCompilation(new[] { src3, IsExternalInitTypeDefinition }, parseOptions: TestOptions.Regular9, options: TestOptions.ReleaseDll); comp.VerifyDiagnostics( // (2,8): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct Point { } Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(2, 8) ); comp = CreateCompilation(new[] { src1, IsExternalInitTypeDefinition }, parseOptions: TestOptions.Regular10, options: TestOptions.ReleaseDll); comp.VerifyDiagnostics( // (2,13): error CS1514: { expected // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_LbraceExpected, "(").WithLocation(2, 13), // (2,13): error CS1513: } expected // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_RbraceExpected, "(").WithLocation(2, 13), // (2,13): error CS8803: Top-level statements must precede namespace and type declarations. // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "(int x, int y);").WithLocation(2, 13), // (2,13): error CS8805: Program using top-level statements must be an executable. // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_SimpleProgramNotAnExecutable, "(int x, int y);").WithLocation(2, 13), // (2,13): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_IllegalStatement, "(int x, int y)").WithLocation(2, 13), // (2,14): error CS8185: A declaration is not allowed in this context. // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_DeclarationExpressionNotPermitted, "int x").WithLocation(2, 14), // (2,14): error CS0165: Use of unassigned local variable 'x' // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_UseDefViolation, "int x").WithArguments("x").WithLocation(2, 14), // (2,21): error CS8185: A declaration is not allowed in this context. // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_DeclarationExpressionNotPermitted, "int y").WithLocation(2, 21), // (2,21): error CS0165: Use of unassigned local variable 'y' // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_UseDefViolation, "int y").WithArguments("y").WithLocation(2, 21) ); comp = CreateCompilation(new[] { src2, IsExternalInitTypeDefinition }, parseOptions: TestOptions.Regular10, options: TestOptions.ReleaseDll); comp.VerifyDiagnostics(); comp = CreateCompilation(new[] { src3, IsExternalInitTypeDefinition }, parseOptions: TestOptions.Regular10, options: TestOptions.ReleaseDll); comp.VerifyDiagnostics(); } [Fact] public void RecordStructLanguageVersion_Nested() { var src1 = @" class C { struct Point(int x, int y); } "; var src2 = @" class D { record struct Point { } } "; var src3 = @" struct E { record struct Point(int x, int y); } "; var src4 = @" namespace NS { record struct Point { } } "; var comp = CreateCompilation(src1, parseOptions: TestOptions.Regular9); comp.VerifyDiagnostics( // (4,17): error CS1514: { expected // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_LbraceExpected, "(").WithLocation(4, 17), // (4,17): error CS1513: } expected // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_RbraceExpected, "(").WithLocation(4, 17), // (4,31): error CS1519: Invalid token ';' in class, record, struct, or interface member declaration // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_InvalidMemberDecl, ";").WithArguments(";").WithLocation(4, 31), // (4,31): error CS1519: Invalid token ';' in class, record, struct, or interface member declaration // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_InvalidMemberDecl, ";").WithArguments(";").WithLocation(4, 31) ); comp = CreateCompilation(new[] { src2, IsExternalInitTypeDefinition }, parseOptions: TestOptions.Regular9); comp.VerifyDiagnostics( // (4,12): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct Point { } Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(4, 12) ); comp = CreateCompilation(new[] { src3, IsExternalInitTypeDefinition }, parseOptions: TestOptions.Regular9); comp.VerifyDiagnostics( // (4,12): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct Point(int x, int y); Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(4, 12) ); comp = CreateCompilation(src4, parseOptions: TestOptions.Regular9); comp.VerifyDiagnostics( // (4,12): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct Point { } Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(4, 12) ); comp = CreateCompilation(src1); comp.VerifyDiagnostics( // (4,17): error CS1514: { expected // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_LbraceExpected, "(").WithLocation(4, 17), // (4,17): error CS1513: } expected // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_RbraceExpected, "(").WithLocation(4, 17), // (4,31): error CS1519: Invalid token ';' in class, record, struct, or interface member declaration // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_InvalidMemberDecl, ";").WithArguments(";").WithLocation(4, 31), // (4,31): error CS1519: Invalid token ';' in class, record, struct, or interface member declaration // struct Point(int x, int y); Diagnostic(ErrorCode.ERR_InvalidMemberDecl, ";").WithArguments(";").WithLocation(4, 31) ); comp = CreateCompilation(src2); comp.VerifyDiagnostics(); comp = CreateCompilation(src3); comp.VerifyDiagnostics(); comp = CreateCompilation(src4); comp.VerifyDiagnostics(); } [Fact] public void TypeDeclaration_IsStruct() { var src = @" record struct Point(int x, int y); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); CompileAndVerify(comp, symbolValidator: validateModule, sourceSymbolValidator: validateModule); Assert.True(SyntaxFacts.IsTypeDeclaration(SyntaxKind.RecordStructDeclaration)); static void validateModule(ModuleSymbol module) { var isSourceSymbol = module is SourceModuleSymbol; var point = module.GlobalNamespace.GetTypeMember("Point"); Assert.True(point.IsValueType); Assert.False(point.IsReferenceType); Assert.False(point.IsRecord); Assert.Equal(TypeKind.Struct, point.TypeKind); Assert.Equal(SpecialType.System_ValueType, point.BaseTypeNoUseSiteDiagnostics.SpecialType); Assert.Equal("Point", point.ToTestDisplayString()); if (isSourceSymbol) { Assert.True(point is SourceNamedTypeSymbol); Assert.True(point.IsRecordStruct); Assert.True(point.GetPublicSymbol().IsRecord); Assert.Equal("record struct Point", point.ToDisplayString(SymbolDisplayFormat.TestFormat.AddKindOptions(SymbolDisplayKindOptions.IncludeTypeKeyword))); } else { Assert.True(point is PENamedTypeSymbol); Assert.False(point.IsRecordStruct); Assert.False(point.GetPublicSymbol().IsRecord); Assert.Equal("struct Point", point.ToDisplayString(SymbolDisplayFormat.TestFormat.AddKindOptions(SymbolDisplayKindOptions.IncludeTypeKeyword))); } } } [Fact] public void TypeDeclaration_IsStruct_InConstraints() { var src = @" record struct Point(int x, int y); class C<T> where T : struct { void M(C<Point> c) { } } class C2<T> where T : new() { void M(C2<Point> c) { } } class C3<T> where T : class { void M(C3<Point> c) { } // 1 } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (16,22): error CS0452: The type 'Point' must be a reference type in order to use it as parameter 'T' in the generic type or method 'C3<T>' // void M(C3<Point> c) { } // 1 Diagnostic(ErrorCode.ERR_RefConstraintNotSatisfied, "c").WithArguments("C3<T>", "T", "Point").WithLocation(16, 22) ); } [Fact] public void TypeDeclaration_IsStruct_Unmanaged() { var src = @" record struct Point(int x, int y); record struct Point2(string x, string y); class C<T> where T : unmanaged { void M(C<Point> c) { } void M2(C<Point2> c) { } // 1 } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (8,23): error CS8377: The type 'Point2' must be a non-nullable value type, along with all fields at any level of nesting, in order to use it as parameter 'T' in the generic type or method 'C<T>' // void M2(C<Point2> c) { } // 1 Diagnostic(ErrorCode.ERR_UnmanagedConstraintNotSatisfied, "c").WithArguments("C<T>", "T", "Point2").WithLocation(8, 23) ); } [Fact] public void IsRecord_Generic() { var src = @" record struct Point<T>(T x, T y); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); CompileAndVerify(comp, symbolValidator: validateModule, sourceSymbolValidator: validateModule); static void validateModule(ModuleSymbol module) { var isSourceSymbol = module is SourceModuleSymbol; var point = module.GlobalNamespace.GetTypeMember("Point"); Assert.True(point.IsValueType); Assert.False(point.IsReferenceType); Assert.False(point.IsRecord); Assert.Equal(TypeKind.Struct, point.TypeKind); Assert.Equal(SpecialType.System_ValueType, point.BaseTypeNoUseSiteDiagnostics.SpecialType); Assert.True(SyntaxFacts.IsTypeDeclaration(SyntaxKind.RecordStructDeclaration)); if (isSourceSymbol) { Assert.True(point is SourceNamedTypeSymbol); Assert.True(point.IsRecordStruct); Assert.True(point.GetPublicSymbol().IsRecord); } else { Assert.True(point is PENamedTypeSymbol); Assert.False(point.IsRecordStruct); Assert.False(point.GetPublicSymbol().IsRecord); } } } [Fact] public void IsRecord_Retargeting() { var src = @" public record struct Point(int x, int y); "; var comp = CreateCompilation(src, targetFramework: TargetFramework.Mscorlib40); var comp2 = CreateCompilation("", targetFramework: TargetFramework.Mscorlib46, references: new[] { comp.ToMetadataReference() }); var point = comp2.GlobalNamespace.GetTypeMember("Point"); Assert.Equal("Point", point.ToTestDisplayString()); Assert.IsType<RetargetingNamedTypeSymbol>(point); Assert.True(point.IsRecordStruct); Assert.True(point.GetPublicSymbol().IsRecord); } [Fact] public void IsRecord_AnonymousType() { var src = @" class C { void M() { var x = new { X = 1 }; } } "; var comp = CreateCompilation(src); var tree = comp.SyntaxTrees.First(); var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); var creation = tree.GetRoot().DescendantNodes().OfType<AnonymousObjectCreationExpressionSyntax>().Single(); var type = model.GetTypeInfo(creation).Type!; Assert.Equal("<anonymous type: System.Int32 X>", type.ToTestDisplayString()); Assert.IsType<AnonymousTypeManager.AnonymousTypePublicSymbol>(((Symbols.PublicModel.NonErrorNamedTypeSymbol)type).UnderlyingNamedTypeSymbol); Assert.False(type.IsRecord); } [Fact] public void IsRecord_ErrorType() { var src = @" class C { Error M() => throw null; } "; var comp = CreateCompilation(src); var tree = comp.SyntaxTrees.First(); var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); var method = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(); var type = model.GetDeclaredSymbol(method)!.ReturnType; Assert.Equal("Error", type.ToTestDisplayString()); Assert.IsType<ExtendedErrorTypeSymbol>(((Symbols.PublicModel.ErrorTypeSymbol)type).UnderlyingNamedTypeSymbol); Assert.False(type.IsRecord); } [Fact] public void IsRecord_Pointer() { var src = @" class C { int* M() => throw null; } "; var comp = CreateCompilation(src, options: TestOptions.UnsafeReleaseDll); var tree = comp.SyntaxTrees.First(); var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); var method = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(); var type = model.GetDeclaredSymbol(method)!.ReturnType; Assert.Equal("System.Int32*", type.ToTestDisplayString()); Assert.IsType<PointerTypeSymbol>(((Symbols.PublicModel.PointerTypeSymbol)type).UnderlyingTypeSymbol); Assert.False(type.IsRecord); } [Fact] public void IsRecord_Dynamic() { var src = @" class C { void M(dynamic d) { } } "; var comp = CreateCompilation(src); var tree = comp.SyntaxTrees.First(); var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); var method = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(); var type = model.GetDeclaredSymbol(method)!.GetParameterType(0); Assert.Equal("dynamic", type.ToTestDisplayString()); Assert.IsType<DynamicTypeSymbol>(((Symbols.PublicModel.DynamicTypeSymbol)type).UnderlyingTypeSymbol); Assert.False(type.IsRecord); } [Fact] public void TypeDeclaration_MayNotHaveBaseType() { var src = @" record struct Point(int x, int y) : object; record struct Point2(int x, int y) : System.ValueType; "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,37): error CS0527: Type 'object' in interface list is not an interface // record struct Point(int x, int y) : object; Diagnostic(ErrorCode.ERR_NonInterfaceInInterfaceList, "object").WithArguments("object").WithLocation(2, 37), // (3,38): error CS0527: Type 'ValueType' in interface list is not an interface // record struct Point2(int x, int y) : System.ValueType; Diagnostic(ErrorCode.ERR_NonInterfaceInInterfaceList, "System.ValueType").WithArguments("System.ValueType").WithLocation(3, 38) ); } [Fact] public void TypeDeclaration_MayNotHaveTypeConstraintsWithoutTypeParameters() { var src = @" record struct Point(int x, int y) where T : struct; "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,35): error CS0080: Constraints are not allowed on non-generic declarations // record struct Point(int x, int y) where T : struct; Diagnostic(ErrorCode.ERR_ConstraintOnlyAllowedOnGenericDecl, "where").WithLocation(2, 35) ); } [Fact] public void TypeDeclaration_AllowedModifiers() { var src = @" readonly partial record struct S1; public record struct S2; internal record struct S3; public class Base { public int S6; } public class C : Base { private protected record struct S4; protected internal record struct S5; new record struct S6; } unsafe record struct S7; "; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview, options: TestOptions.UnsafeDebugDll); comp.VerifyDiagnostics(); Assert.Equal(Accessibility.Internal, comp.GlobalNamespace.GetTypeMember("S1").DeclaredAccessibility); Assert.Equal(Accessibility.Public, comp.GlobalNamespace.GetTypeMember("S2").DeclaredAccessibility); Assert.Equal(Accessibility.Internal, comp.GlobalNamespace.GetTypeMember("S3").DeclaredAccessibility); Assert.Equal(Accessibility.ProtectedAndInternal, comp.GlobalNamespace.GetTypeMember("C").GetTypeMember("S4").DeclaredAccessibility); Assert.Equal(Accessibility.ProtectedOrInternal, comp.GlobalNamespace.GetTypeMember("C").GetTypeMember("S5").DeclaredAccessibility); } [Fact] public void TypeDeclaration_DisallowedModifiers() { var src = @" abstract record struct S1; volatile record struct S2; extern record struct S3; virtual record struct S4; override record struct S5; async record struct S6; ref record struct S7; unsafe record struct S8; static record struct S9; sealed record struct S10; "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,24): error CS0106: The modifier 'abstract' is not valid for this item // abstract record struct S1; Diagnostic(ErrorCode.ERR_BadMemberFlag, "S1").WithArguments("abstract").WithLocation(2, 24), // (3,24): error CS0106: The modifier 'volatile' is not valid for this item // volatile record struct S2; Diagnostic(ErrorCode.ERR_BadMemberFlag, "S2").WithArguments("volatile").WithLocation(3, 24), // (4,22): error CS0106: The modifier 'extern' is not valid for this item // extern record struct S3; Diagnostic(ErrorCode.ERR_BadMemberFlag, "S3").WithArguments("extern").WithLocation(4, 22), // (5,23): error CS0106: The modifier 'virtual' is not valid for this item // virtual record struct S4; Diagnostic(ErrorCode.ERR_BadMemberFlag, "S4").WithArguments("virtual").WithLocation(5, 23), // (6,24): error CS0106: The modifier 'override' is not valid for this item // override record struct S5; Diagnostic(ErrorCode.ERR_BadMemberFlag, "S5").WithArguments("override").WithLocation(6, 24), // (7,21): error CS0106: The modifier 'async' is not valid for this item // async record struct S6; Diagnostic(ErrorCode.ERR_BadMemberFlag, "S6").WithArguments("async").WithLocation(7, 21), // (8,19): error CS0106: The modifier 'ref' is not valid for this item // ref record struct S7; Diagnostic(ErrorCode.ERR_BadMemberFlag, "S7").WithArguments("ref").WithLocation(8, 19), // (9,22): error CS0227: Unsafe code may only appear if compiling with /unsafe // unsafe record struct S8; Diagnostic(ErrorCode.ERR_IllegalUnsafe, "S8").WithLocation(9, 22), // (10,22): error CS0106: The modifier 'static' is not valid for this item // static record struct S9; Diagnostic(ErrorCode.ERR_BadMemberFlag, "S9").WithArguments("static").WithLocation(10, 22), // (11,22): error CS0106: The modifier 'sealed' is not valid for this item // sealed record struct S10; Diagnostic(ErrorCode.ERR_BadMemberFlag, "S10").WithArguments("sealed").WithLocation(11, 22) ); } [Fact] public void TypeDeclaration_DuplicatesModifiers() { var src = @" public public record struct S2; "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,8): error CS1004: Duplicate 'public' modifier // public public record struct S2; Diagnostic(ErrorCode.ERR_DuplicateModifier, "public").WithArguments("public").WithLocation(2, 8) ); } [Fact] public void TypeDeclaration_BeforeTopLevelStatement() { var src = @" record struct S; System.Console.WriteLine(); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (3,1): error CS8803: Top-level statements must precede namespace and type declarations. // System.Console.WriteLine(); Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "System.Console.WriteLine();").WithLocation(3, 1) ); } [Fact] public void TypeDeclaration_WithTypeParameters() { var src = @" S<string> local = default; local.ToString(); record struct S<T>; "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); Assert.Equal(new[] { "T" }, comp.GlobalNamespace.GetTypeMember("S").TypeParameters.ToTestDisplayStrings()); } [Fact] public void TypeDeclaration_AllowedModifiersForMembers() { var src = @" record struct S { protected int Property { get; set; } // 1 internal protected string field; // 2, 3 abstract void M(); // 4 virtual void M2() { } // 5 }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (4,19): error CS0666: 'S.Property': new protected member declared in struct // protected int Property { get; set; } // 1 Diagnostic(ErrorCode.ERR_ProtectedInStruct, "Property").WithArguments("S.Property").WithLocation(4, 19), // (5,31): error CS0666: 'S.field': new protected member declared in struct // internal protected string field; // 2, 3 Diagnostic(ErrorCode.ERR_ProtectedInStruct, "field").WithArguments("S.field").WithLocation(5, 31), // (5,31): warning CS0649: Field 'S.field' is never assigned to, and will always have its default value null // internal protected string field; // 2, 3 Diagnostic(ErrorCode.WRN_UnassignedInternalField, "field").WithArguments("S.field", "null").WithLocation(5, 31), // (6,19): error CS0621: 'S.M()': virtual or abstract members cannot be private // abstract void M(); // 4 Diagnostic(ErrorCode.ERR_VirtualPrivate, "M").WithArguments("S.M()").WithLocation(6, 19), // (7,18): error CS0621: 'S.M2()': virtual or abstract members cannot be private // virtual void M2() { } // 5 Diagnostic(ErrorCode.ERR_VirtualPrivate, "M2").WithArguments("S.M2()").WithLocation(7, 18) ); } [Fact] public void TypeDeclaration_ImplementInterface() { var src = @" I i = (I)default(S); System.Console.Write(i.M(""four"")); I i2 = (I)default(S2); System.Console.Write(i2.M(""four"")); interface I { int M(string s); } public record struct S : I { public int M(string s) => s.Length; } public record struct S2 : I { int I.M(string s) => s.Length + 1; } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); CompileAndVerify(comp, expectedOutput: "45"); AssertEx.Equal(new[] { "System.Int32 S.M(System.String s)", "readonly System.String S.ToString()", "readonly System.Boolean S.PrintMembers(System.Text.StringBuilder builder)", "System.Boolean S.op_Inequality(S left, S right)", "System.Boolean S.op_Equality(S left, S right)", "readonly System.Int32 S.GetHashCode()", "readonly System.Boolean S.Equals(System.Object obj)", "readonly System.Boolean S.Equals(S other)", "S..ctor()" }, comp.GetMember<NamedTypeSymbol>("S").GetMembers().ToTestDisplayStrings()); } [Fact] public void TypeDeclaration_SatisfiesStructConstraint() { var src = @" S s = default; System.Console.Write(M(s)); static int M<T>(T t) where T : struct, I => t.Property; public interface I { int Property { get; } } public record struct S : I { public int Property => 42; } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); CompileAndVerify(comp, expectedOutput: "42"); } [Fact] public void TypeDeclaration_AccessingThis() { var src = @" S s = new S(); System.Console.Write(s.M()); public record struct S { public int Property => 42; public int M() => this.Property; } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "42"); verifier.VerifyIL("S.M", @" { // Code size 7 (0x7) .maxstack 1 IL_0000: ldarg.0 IL_0001: call ""int S.Property.get"" IL_0006: ret } "); } [Fact] public void TypeDeclaration_NoBaseInitializer() { var src = @" public record struct S { public S(int i) : base() { } } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (4,12): error CS0522: 'S': structs cannot call base class constructors // public S(int i) : base() { } Diagnostic(ErrorCode.ERR_StructWithBaseConstructorCall, "S").WithArguments("S").WithLocation(4, 12) ); } [Fact] public void TypeDeclaration_ParameterlessConstructor_01() { var src = @"record struct S0(); record struct S1; record struct S2 { public S2() { } }"; var comp = CreateCompilation(src, parseOptions: TestOptions.Regular9); comp.VerifyDiagnostics( // (1,8): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct S0(); Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(1, 8), // (2,8): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct S1; Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(2, 8), // (3,8): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct S2 Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(3, 8), // (5,12): error CS8773: Feature 'parameterless struct constructors' is not available in C# 9.0. Please use language version 10.0 or greater. // public S2() { } Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "S2").WithArguments("parameterless struct constructors", "10.0").WithLocation(5, 12)); var verifier = CompileAndVerify(src); verifier.VerifyIL("S0..ctor()", @"{ // Code size 1 (0x1) .maxstack 0 IL_0000: ret }"); verifier.VerifyMissing("S1..ctor()"); verifier.VerifyIL("S2..ctor()", @"{ // Code size 1 (0x1) .maxstack 0 IL_0000: ret }"); } [Fact] public void TypeDeclaration_ParameterlessConstructor_02() { var src = @"record struct S1 { S1() { } } record struct S2 { internal S2() { } }"; var comp = CreateCompilation(src, parseOptions: TestOptions.Regular9); comp.VerifyDiagnostics( // (1,8): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct S1 Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(1, 8), // (3,5): error CS8773: Feature 'parameterless struct constructors' is not available in C# 9.0. Please use language version 10.0 or greater. // S1() { } Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "S1").WithArguments("parameterless struct constructors", "10.0").WithLocation(3, 5), // (3,5): error CS8938: The parameterless struct constructor must be 'public'. // S1() { } Diagnostic(ErrorCode.ERR_NonPublicParameterlessStructConstructor, "S1").WithLocation(3, 5), // (5,8): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct S2 Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(5, 8), // (7,14): error CS8773: Feature 'parameterless struct constructors' is not available in C# 9.0. Please use language version 10.0 or greater. // internal S2() { } Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "S2").WithArguments("parameterless struct constructors", "10.0").WithLocation(7, 14), // (7,14): error CS8938: The parameterless struct constructor must be 'public'. // internal S2() { } Diagnostic(ErrorCode.ERR_NonPublicParameterlessStructConstructor, "S2").WithLocation(7, 14)); comp = CreateCompilation(src); comp.VerifyDiagnostics( // (3,5): error CS8918: The parameterless struct constructor must be 'public'. // S1() { } Diagnostic(ErrorCode.ERR_NonPublicParameterlessStructConstructor, "S1").WithLocation(3, 5), // (7,14): error CS8918: The parameterless struct constructor must be 'public'. // internal S2() { } Diagnostic(ErrorCode.ERR_NonPublicParameterlessStructConstructor, "S2").WithLocation(7, 14)); } [Fact] public void TypeDeclaration_ParameterlessConstructor_OtherConstructors() { var src = @" record struct S1 { public S1() { } S1(object o) { } // ok because no record parameter list } record struct S2 { S2(object o) { } } record struct S3() { S3(object o) { } // 1 } record struct S4() { S4(object o) : this() { } } record struct S5(object o) { public S5() { } // 2 } record struct S6(object o) { public S6() : this(null) { } } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (13,5): error CS8862: A constructor declared in a record with parameter list must have 'this' constructor initializer. // S3(object o) { } // 1 Diagnostic(ErrorCode.ERR_UnexpectedOrMissingConstructorInitializerInRecord, "S3").WithLocation(13, 5), // (21,12): error CS8862: A constructor declared in a record with parameter list must have 'this' constructor initializer. // public S5() { } // 2 Diagnostic(ErrorCode.ERR_UnexpectedOrMissingConstructorInitializerInRecord, "S5").WithLocation(21, 12) ); } [Fact] public void TypeDeclaration_ParameterlessConstructor_Initializers() { var src = @" var s1 = new S1(); var s2 = new S2(null); var s2b = new S2(); var s3 = new S3(); var s4 = new S4(new object()); var s5 = new S5(); var s6 = new S6(""s6.other""); System.Console.Write((s1.field, s2.field, s2b.field is null, s3.field, s4.field, s5.field, s6.field, s6.other)); record struct S1 { public string field = ""s1""; public S1() { } } record struct S2 { public string field = ""s2""; public S2(object o) { } } record struct S3() { public string field = ""s3""; } record struct S4 { public string field = ""s4""; public S4(object o) : this() { } } record struct S5() { public string field = ""s5""; public S5(object o) : this() { } } record struct S6(string other) { public string field = ""s6.field""; public S6() : this(""ignored"") { } } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); CompileAndVerify(comp, expectedOutput: "(s1, s2, True, s3, s4, s5, s6.field, s6.other)"); } [Fact] public void TypeDeclaration_InstanceInitializers() { var src = @" public record struct S { public int field = 42; public int Property { get; set; } = 43; } "; var comp = CreateCompilation(src, parseOptions: TestOptions.Regular9); comp.VerifyDiagnostics( // (2,15): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // public record struct S Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(2, 15), // (4,16): error CS8773: Feature 'struct field initializers' is not available in C# 9.0. Please use language version 10.0 or greater. // public int field = 42; Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "field").WithArguments("struct field initializers", "10.0").WithLocation(4, 16), // (5,16): error CS8773: Feature 'struct field initializers' is not available in C# 9.0. Please use language version 10.0 or greater. // public int Property { get; set; } = 43; Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "Property").WithArguments("struct field initializers", "10.0").WithLocation(5, 16)); comp = CreateCompilation(src); comp.VerifyDiagnostics(); } [Fact] public void TypeDeclaration_NoDestructor() { var src = @" public record struct S { ~S() { } } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (4,6): error CS0575: Only class types can contain destructors // ~S() { } Diagnostic(ErrorCode.ERR_OnlyClassesCanContainDestructors, "S").WithArguments("S.~S()").WithLocation(4, 6) ); } [Fact] public void TypeDeclaration_DifferentPartials() { var src = @" partial record struct S1; partial struct S1 { } partial struct S2 { } partial record struct S2; partial record struct S3; partial record S3 { } partial record struct S4; partial record class S4 { } partial record struct S5; partial class S5 { } partial record struct S6; partial interface S6 { } partial record class C1; partial struct C1 { } partial record class C2; partial record struct C2 { } partial record class C3 { } partial record C3; partial record class C4; partial class C4 { } partial record class C5; partial interface C5 { } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (3,16): error CS0261: Partial declarations of 'S1' must be all classes, all record classes, all structs, all record structs, or all interfaces // partial struct S1 { } Diagnostic(ErrorCode.ERR_PartialTypeKindConflict, "S1").WithArguments("S1").WithLocation(3, 16), // (6,23): error CS0261: Partial declarations of 'S2' must be all classes, all record classes, all structs, all record structs, or all interfaces // partial record struct S2; Diagnostic(ErrorCode.ERR_PartialTypeKindConflict, "S2").WithArguments("S2").WithLocation(6, 23), // (9,16): error CS0261: Partial declarations of 'S3' must be all classes, all record classes, all structs, all record structs, or all interfaces // partial record S3 { } Diagnostic(ErrorCode.ERR_PartialTypeKindConflict, "S3").WithArguments("S3").WithLocation(9, 16), // (12,22): error CS0261: Partial declarations of 'S4' must be all classes, all record classes, all structs, all record structs, or all interfaces // partial record class S4 { } Diagnostic(ErrorCode.ERR_PartialTypeKindConflict, "S4").WithArguments("S4").WithLocation(12, 22), // (15,15): error CS0261: Partial declarations of 'S5' must be all classes, all record classes, all structs, all record structs, or all interfaces // partial class S5 { } Diagnostic(ErrorCode.ERR_PartialTypeKindConflict, "S5").WithArguments("S5").WithLocation(15, 15), // (18,19): error CS0261: Partial declarations of 'S6' must be all classes, all record classes, all structs, all record structs, or all interfaces // partial interface S6 { } Diagnostic(ErrorCode.ERR_PartialTypeKindConflict, "S6").WithArguments("S6").WithLocation(18, 19), // (21,16): error CS0261: Partial declarations of 'C1' must be all classes, all record classes, all structs, all record structs, or all interfaces // partial struct C1 { } Diagnostic(ErrorCode.ERR_PartialTypeKindConflict, "C1").WithArguments("C1").WithLocation(21, 16), // (24,23): error CS0261: Partial declarations of 'C2' must be all classes, all record classes, all structs, all record structs, or all interfaces // partial record struct C2 { } Diagnostic(ErrorCode.ERR_PartialTypeKindConflict, "C2").WithArguments("C2").WithLocation(24, 23), // (30,15): error CS0261: Partial declarations of 'C4' must be all classes, all record classes, all structs, all record structs, or all interfaces // partial class C4 { } Diagnostic(ErrorCode.ERR_PartialTypeKindConflict, "C4").WithArguments("C4").WithLocation(30, 15), // (33,19): error CS0261: Partial declarations of 'C5' must be all classes, all record classes, all structs, all record structs, or all interfaces // partial interface C5 { } Diagnostic(ErrorCode.ERR_PartialTypeKindConflict, "C5").WithArguments("C5").WithLocation(33, 19) ); } [Fact] public void PartialRecord_OnlyOnePartialHasParameterList() { var src = @" partial record struct S(int i); partial record struct S(int i); partial record struct S2(int i); partial record struct S2(); partial record struct S3(); partial record struct S3(); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (3,24): error CS8863: Only a single record partial declaration may have a parameter list // partial record struct S(int i); Diagnostic(ErrorCode.ERR_MultipleRecordParameterLists, "(int i)").WithLocation(3, 24), // (6,25): error CS8863: Only a single record partial declaration may have a parameter list // partial record struct S2(); Diagnostic(ErrorCode.ERR_MultipleRecordParameterLists, "()").WithLocation(6, 25), // (9,25): error CS8863: Only a single record partial declaration may have a parameter list // partial record struct S3(); Diagnostic(ErrorCode.ERR_MultipleRecordParameterLists, "()").WithLocation(9, 25) ); } [Fact] public void PartialRecord_ParametersInScopeOfBothParts() { var src = @" var c = new C(2); System.Console.Write((c.P1, c.P2)); public partial record struct C(int X) { public int P1 { get; set; } = X; } public partial record struct C { public int P2 { get; set; } = X; } "; var comp = CreateCompilation(src); CompileAndVerify(comp, expectedOutput: "(2, 2)", verify: Verification.Skipped /* init-only */) .VerifyDiagnostics( // (5,30): warning CS0282: There is no defined ordering between fields in multiple declarations of partial struct 'C'. To specify an ordering, all instance fields must be in the same declaration. // public partial record struct C(int X) Diagnostic(ErrorCode.WRN_SequentialOnPartialClass, "C").WithArguments("C").WithLocation(5, 30) ); } [Fact] public void PartialRecord_DuplicateMemberNames() { var src = @" public partial record struct C(int X) { public void M(int i) { } } public partial record struct C { public void M(string s) { } } "; var comp = CreateCompilation(src); var expectedMemberNames = new string[] { ".ctor", "<X>k__BackingField", "get_X", "set_X", "X", "M", "M", "ToString", "PrintMembers", "op_Inequality", "op_Equality", "GetHashCode", "Equals", "Equals", "Deconstruct", ".ctor", }; AssertEx.Equal(expectedMemberNames, comp.GetMember<NamedTypeSymbol>("C").GetPublicSymbol().MemberNames); } [Fact] public void RecordInsideGenericType() { var src = @" var c = new C<int>.Nested(2); System.Console.Write(c.T); public class C<T> { public record struct Nested(T T); } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); CompileAndVerify(comp, expectedOutput: "2"); } [Fact] public void PositionalMemberModifiers_RefOrOut() { var src = @" record struct R(ref int P1, out int P2); "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (2,15): error CS0177: The out parameter 'P2' must be assigned to before control leaves the current method // record struct R(ref int P1, out int P2); Diagnostic(ErrorCode.ERR_ParamUnassigned, "R").WithArguments("P2").WithLocation(2, 15), // (2,17): error CS0631: ref and out are not valid in this context // record struct R(ref int P1, out int P2); Diagnostic(ErrorCode.ERR_IllegalRefParam, "ref").WithLocation(2, 17), // (2,29): error CS0631: ref and out are not valid in this context // record struct R(ref int P1, out int P2); Diagnostic(ErrorCode.ERR_IllegalRefParam, "out").WithLocation(2, 29) ); } [Fact, WorkItem(45008, "https://github.com/dotnet/roslyn/issues/45008")] public void PositionalMemberModifiers_This() { var src = @" record struct R(this int i); "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (2,17): error CS0027: Keyword 'this' is not available in the current context // record struct R(this int i); Diagnostic(ErrorCode.ERR_ThisInBadContext, "this").WithLocation(2, 17) ); } [Fact, WorkItem(45591, "https://github.com/dotnet/roslyn/issues/45591")] public void Clone_DisallowedInSource() { var src = @" record struct C1(string Clone); // 1 record struct C2 { string Clone; // 2 } record struct C3 { string Clone { get; set; } // 3 } record struct C5 { void Clone() { } // 4 void Clone(int i) { } // 5 } record struct C6 { class Clone { } // 6 } record struct C7 { delegate void Clone(); // 7 } record struct C8 { event System.Action Clone; // 8 } record struct Clone { Clone(int i) => throw null; } record struct C9 : System.ICloneable { object System.ICloneable.Clone() => throw null; } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,25): error CS8859: Members named 'Clone' are disallowed in records. // record struct C1(string Clone); // 1 Diagnostic(ErrorCode.ERR_CloneDisallowedInRecord, "Clone").WithLocation(2, 25), // (5,12): error CS8859: Members named 'Clone' are disallowed in records. // string Clone; // 2 Diagnostic(ErrorCode.ERR_CloneDisallowedInRecord, "Clone").WithLocation(5, 12), // (5,12): warning CS0169: The field 'C2.Clone' is never used // string Clone; // 2 Diagnostic(ErrorCode.WRN_UnreferencedField, "Clone").WithArguments("C2.Clone").WithLocation(5, 12), // (9,12): error CS8859: Members named 'Clone' are disallowed in records. // string Clone { get; set; } // 3 Diagnostic(ErrorCode.ERR_CloneDisallowedInRecord, "Clone").WithLocation(9, 12), // (13,10): error CS8859: Members named 'Clone' are disallowed in records. // void Clone() { } // 4 Diagnostic(ErrorCode.ERR_CloneDisallowedInRecord, "Clone").WithLocation(13, 10), // (14,10): error CS8859: Members named 'Clone' are disallowed in records. // void Clone(int i) { } // 5 Diagnostic(ErrorCode.ERR_CloneDisallowedInRecord, "Clone").WithLocation(14, 10), // (18,11): error CS8859: Members named 'Clone' are disallowed in records. // class Clone { } // 6 Diagnostic(ErrorCode.ERR_CloneDisallowedInRecord, "Clone").WithLocation(18, 11), // (22,19): error CS8859: Members named 'Clone' are disallowed in records. // delegate void Clone(); // 7 Diagnostic(ErrorCode.ERR_CloneDisallowedInRecord, "Clone").WithLocation(22, 19), // (26,25): error CS8859: Members named 'Clone' are disallowed in records. // event System.Action Clone; // 8 Diagnostic(ErrorCode.ERR_CloneDisallowedInRecord, "Clone").WithLocation(26, 25), // (26,25): warning CS0067: The event 'C8.Clone' is never used // event System.Action Clone; // 8 Diagnostic(ErrorCode.WRN_UnreferencedEvent, "Clone").WithArguments("C8.Clone").WithLocation(26, 25) ); } [ConditionalFact(typeof(DesktopOnly), Reason = ConditionalSkipReason.RestrictedTypesNeedDesktop)] [WorkItem(48115, "https://github.com/dotnet/roslyn/issues/48115")] public void RestrictedTypesAndPointerTypes() { var src = @" class C<T> { } static class C2 { } ref struct RefLike{} unsafe record struct C( // 1 int* P1, // 2 int*[] P2, // 3 C<int*[]> P3, delegate*<int, int> P4, // 4 void P5, // 5 C2 P6, // 6, 7 System.ArgIterator P7, // 8 System.TypedReference P8, // 9 RefLike P9); // 10 "; var comp = CreateCompilation(new[] { src, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview, options: TestOptions.UnsafeDebugDll); comp.VerifyEmitDiagnostics( // (6,22): error CS0721: 'C2': static types cannot be used as parameters // unsafe record struct C( // 1 Diagnostic(ErrorCode.ERR_ParameterIsStaticClass, "C").WithArguments("C2").WithLocation(6, 22), // (7,10): error CS8908: The type 'int*' may not be used for a field of a record. // int* P1, // 2 Diagnostic(ErrorCode.ERR_BadFieldTypeInRecord, "P1").WithArguments("int*").WithLocation(7, 10), // (8,12): error CS8908: The type 'int*[]' may not be used for a field of a record. // int*[] P2, // 3 Diagnostic(ErrorCode.ERR_BadFieldTypeInRecord, "P2").WithArguments("int*[]").WithLocation(8, 12), // (10,25): error CS8908: The type 'delegate*<int, int>' may not be used for a field of a record. // delegate*<int, int> P4, // 4 Diagnostic(ErrorCode.ERR_BadFieldTypeInRecord, "P4").WithArguments("delegate*<int, int>").WithLocation(10, 25), // (11,5): error CS1536: Invalid parameter type 'void' // void P5, // 5 Diagnostic(ErrorCode.ERR_NoVoidParameter, "void").WithLocation(11, 5), // (12,8): error CS0722: 'C2': static types cannot be used as return types // C2 P6, // 6, 7 Diagnostic(ErrorCode.ERR_ReturnTypeIsStaticClass, "P6").WithArguments("C2").WithLocation(12, 8), // (12,8): error CS0721: 'C2': static types cannot be used as parameters // C2 P6, // 6, 7 Diagnostic(ErrorCode.ERR_ParameterIsStaticClass, "P6").WithArguments("C2").WithLocation(12, 8), // (13,5): error CS0610: Field or property cannot be of type 'ArgIterator' // System.ArgIterator P7, // 8 Diagnostic(ErrorCode.ERR_FieldCantBeRefAny, "System.ArgIterator").WithArguments("System.ArgIterator").WithLocation(13, 5), // (14,5): error CS0610: Field or property cannot be of type 'TypedReference' // System.TypedReference P8, // 9 Diagnostic(ErrorCode.ERR_FieldCantBeRefAny, "System.TypedReference").WithArguments("System.TypedReference").WithLocation(14, 5), // (15,5): error CS8345: Field or auto-implemented property cannot be of type 'RefLike' unless it is an instance member of a ref struct. // RefLike P9); // 10 Diagnostic(ErrorCode.ERR_FieldAutoPropCantBeByRefLike, "RefLike").WithArguments("RefLike").WithLocation(15, 5) ); } [ConditionalFact(typeof(DesktopOnly), Reason = ConditionalSkipReason.RestrictedTypesNeedDesktop)] [WorkItem(48115, "https://github.com/dotnet/roslyn/issues/48115")] public void RestrictedTypesAndPointerTypes_NominalMembers() { var src = @" public class C<T> { } public static class C2 { } public ref struct RefLike{} public unsafe record struct C { public int* f1; // 1 public int*[] f2; // 2 public C<int*[]> f3; public delegate*<int, int> f4; // 3 public void f5; // 4 public C2 f6; // 5 public System.ArgIterator f7; // 6 public System.TypedReference f8; // 7 public RefLike f9; // 8 } "; var comp = CreateCompilation(new[] { src, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview, options: TestOptions.UnsafeDebugDll); comp.VerifyEmitDiagnostics( // (8,17): error CS8908: The type 'int*' may not be used for a field of a record. // public int* f1; // 1 Diagnostic(ErrorCode.ERR_BadFieldTypeInRecord, "f1").WithArguments("int*").WithLocation(8, 17), // (9,19): error CS8908: The type 'int*[]' may not be used for a field of a record. // public int*[] f2; // 2 Diagnostic(ErrorCode.ERR_BadFieldTypeInRecord, "f2").WithArguments("int*[]").WithLocation(9, 19), // (11,32): error CS8908: The type 'delegate*<int, int>' may not be used for a field of a record. // public delegate*<int, int> f4; // 3 Diagnostic(ErrorCode.ERR_BadFieldTypeInRecord, "f4").WithArguments("delegate*<int, int>").WithLocation(11, 32), // (12,12): error CS0670: Field cannot have void type // public void f5; // 4 Diagnostic(ErrorCode.ERR_FieldCantHaveVoidType, "void").WithLocation(12, 12), // (13,15): error CS0723: Cannot declare a variable of static type 'C2' // public C2 f6; // 5 Diagnostic(ErrorCode.ERR_VarDeclIsStaticClass, "f6").WithArguments("C2").WithLocation(13, 15), // (14,12): error CS0610: Field or property cannot be of type 'ArgIterator' // public System.ArgIterator f7; // 6 Diagnostic(ErrorCode.ERR_FieldCantBeRefAny, "System.ArgIterator").WithArguments("System.ArgIterator").WithLocation(14, 12), // (15,12): error CS0610: Field or property cannot be of type 'TypedReference' // public System.TypedReference f8; // 7 Diagnostic(ErrorCode.ERR_FieldCantBeRefAny, "System.TypedReference").WithArguments("System.TypedReference").WithLocation(15, 12), // (16,12): error CS8345: Field or auto-implemented property cannot be of type 'RefLike' unless it is an instance member of a ref struct. // public RefLike f9; // 8 Diagnostic(ErrorCode.ERR_FieldAutoPropCantBeByRefLike, "RefLike").WithArguments("RefLike").WithLocation(16, 12) ); } [ConditionalFact(typeof(DesktopOnly), Reason = ConditionalSkipReason.RestrictedTypesNeedDesktop)] [WorkItem(48115, "https://github.com/dotnet/roslyn/issues/48115")] public void RestrictedTypesAndPointerTypes_NominalMembers_AutoProperties() { var src = @" public class C<T> { } public static class C2 { } public ref struct RefLike{} public unsafe record struct C { public int* f1 { get; set; } // 1 public int*[] f2 { get; set; } // 2 public C<int*[]> f3 { get; set; } public delegate*<int, int> f4 { get; set; } // 3 public void f5 { get; set; } // 4 public C2 f6 { get; set; } // 5, 6 public System.ArgIterator f7 { get; set; } // 6 public System.TypedReference f8 { get; set; } // 7 public RefLike f9 { get; set; } // 8 } "; var comp = CreateCompilation(new[] { src, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview, options: TestOptions.UnsafeDebugDll); comp.VerifyEmitDiagnostics( // (8,17): error CS8908: The type 'int*' may not be used for a field of a record. // public int* f1 { get; set; } // 1 Diagnostic(ErrorCode.ERR_BadFieldTypeInRecord, "f1").WithArguments("int*").WithLocation(8, 17), // (9,19): error CS8908: The type 'int*[]' may not be used for a field of a record. // public int*[] f2 { get; set; } // 2 Diagnostic(ErrorCode.ERR_BadFieldTypeInRecord, "f2").WithArguments("int*[]").WithLocation(9, 19), // (11,32): error CS8908: The type 'delegate*<int, int>' may not be used for a field of a record. // public delegate*<int, int> f4 { get; set; } // 3 Diagnostic(ErrorCode.ERR_BadFieldTypeInRecord, "f4").WithArguments("delegate*<int, int>").WithLocation(11, 32), // (12,17): error CS0547: 'C.f5': property or indexer cannot have void type // public void f5 { get; set; } // 4 Diagnostic(ErrorCode.ERR_PropertyCantHaveVoidType, "f5").WithArguments("C.f5").WithLocation(12, 17), // (13,20): error CS0722: 'C2': static types cannot be used as return types // public C2 f6 { get; set; } // 5, 6 Diagnostic(ErrorCode.ERR_ReturnTypeIsStaticClass, "get").WithArguments("C2").WithLocation(13, 20), // (13,25): error CS0721: 'C2': static types cannot be used as parameters // public C2 f6 { get; set; } // 5, 6 Diagnostic(ErrorCode.ERR_ParameterIsStaticClass, "set").WithArguments("C2").WithLocation(13, 25), // (14,12): error CS0610: Field or property cannot be of type 'ArgIterator' // public System.ArgIterator f7 { get; set; } // 6 Diagnostic(ErrorCode.ERR_FieldCantBeRefAny, "System.ArgIterator").WithArguments("System.ArgIterator").WithLocation(14, 12), // (15,12): error CS0610: Field or property cannot be of type 'TypedReference' // public System.TypedReference f8 { get; set; } // 7 Diagnostic(ErrorCode.ERR_FieldCantBeRefAny, "System.TypedReference").WithArguments("System.TypedReference").WithLocation(15, 12), // (16,12): error CS8345: Field or auto-implemented property cannot be of type 'RefLike' unless it is an instance member of a ref struct. // public RefLike f9 { get; set; } // 8 Diagnostic(ErrorCode.ERR_FieldAutoPropCantBeByRefLike, "RefLike").WithArguments("RefLike").WithLocation(16, 12) ); } [Fact] [WorkItem(48115, "https://github.com/dotnet/roslyn/issues/48115")] public void RestrictedTypesAndPointerTypes_PointerTypeAllowedForParameterAndProperty() { var src = @" class C<T> { } unsafe record struct C(int* P1, int*[] P2, C<int*[]> P3) { int* P1 { get { System.Console.Write(""P1 ""); return null; } init { } } int*[] P2 { get { System.Console.Write(""P2 ""); return null; } init { } } C<int*[]> P3 { get { System.Console.Write(""P3 ""); return null; } init { } } public unsafe static void Main() { var x = new C(null, null, null); var (x1, x2, x3) = x; System.Console.Write(""RAN""); } } "; var comp = CreateCompilation(new[] { src, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview, options: TestOptions.UnsafeDebugExe); comp.VerifyEmitDiagnostics( // (4,29): warning CS8907: Parameter 'P1' is unread. Did you forget to use it to initialize the property with that name? // unsafe record struct C(int* P1, int*[] P2, C<int*[]> P3) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "P1").WithArguments("P1").WithLocation(4, 29), // (4,40): warning CS8907: Parameter 'P2' is unread. Did you forget to use it to initialize the property with that name? // unsafe record struct C(int* P1, int*[] P2, C<int*[]> P3) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "P2").WithArguments("P2").WithLocation(4, 40), // (4,54): warning CS8907: Parameter 'P3' is unread. Did you forget to use it to initialize the property with that name? // unsafe record struct C(int* P1, int*[] P2, C<int*[]> P3) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "P3").WithArguments("P3").WithLocation(4, 54) ); CompileAndVerify(comp, expectedOutput: "P1 P2 P3 RAN", verify: Verification.Skipped /* pointers */); } [ConditionalFact(typeof(DesktopOnly), Reason = ConditionalSkipReason.RestrictedTypesNeedDesktop)] [WorkItem(48115, "https://github.com/dotnet/roslyn/issues/48115")] public void RestrictedTypesAndPointerTypes_StaticFields() { var src = @" public class C<T> { } public static class C2 { } public ref struct RefLike{} public unsafe record C { public static int* f1; public static int*[] f2; public static C<int*[]> f3; public static delegate*<int, int> f4; public static C2 f6; // 1 public static System.ArgIterator f7; // 2 public static System.TypedReference f8; // 3 public static RefLike f9; // 4 } "; var comp = CreateCompilation(new[] { src, IsExternalInitTypeDefinition }, options: TestOptions.UnsafeDebugDll); comp.VerifyEmitDiagnostics( // (12,22): error CS0723: Cannot declare a variable of static type 'C2' // public static C2 f6; // 1 Diagnostic(ErrorCode.ERR_VarDeclIsStaticClass, "f6").WithArguments("C2").WithLocation(12, 22), // (13,19): error CS0610: Field or property cannot be of type 'ArgIterator' // public static System.ArgIterator f7; // 2 Diagnostic(ErrorCode.ERR_FieldCantBeRefAny, "System.ArgIterator").WithArguments("System.ArgIterator").WithLocation(13, 19), // (14,19): error CS0610: Field or property cannot be of type 'TypedReference' // public static System.TypedReference f8; // 3 Diagnostic(ErrorCode.ERR_FieldCantBeRefAny, "System.TypedReference").WithArguments("System.TypedReference").WithLocation(14, 19), // (15,19): error CS8345: Field or auto-implemented property cannot be of type 'RefLike' unless it is an instance member of a ref struct. // public static RefLike f9; // 4 Diagnostic(ErrorCode.ERR_FieldAutoPropCantBeByRefLike, "RefLike").WithArguments("RefLike").WithLocation(15, 19) ); } [Fact] public void RecordProperties_01() { var src = @" using System; record struct C(int X, int Y) { int Z = 345; public static void Main() { var c = new C(1, 2); Console.Write(c.X); Console.Write(c.Y); Console.Write(c.Z); } }"; var verifier = CompileAndVerify(src, expectedOutput: @"12345").VerifyDiagnostics(); verifier.VerifyIL("C..ctor(int, int)", @" { // Code size 26 (0x1a) .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: stfld ""int C.<X>k__BackingField"" IL_0007: ldarg.0 IL_0008: ldarg.2 IL_0009: stfld ""int C.<Y>k__BackingField"" IL_000e: ldarg.0 IL_000f: ldc.i4 0x159 IL_0014: stfld ""int C.Z"" IL_0019: ret } "); var c = verifier.Compilation.GlobalNamespace.GetTypeMember("C"); Assert.False(c.IsReadOnly); var x = (IPropertySymbol)c.GetMember("X"); Assert.Equal("readonly System.Int32 C.X.get", x.GetMethod.ToTestDisplayString()); Assert.Equal("void C.X.set", x.SetMethod.ToTestDisplayString()); Assert.False(x.SetMethod!.IsInitOnly); var xBackingField = (IFieldSymbol)c.GetMember("<X>k__BackingField"); Assert.Equal("System.Int32 C.<X>k__BackingField", xBackingField.ToTestDisplayString()); Assert.False(xBackingField.IsReadOnly); } [Fact] public void RecordProperties_01_EmptyParameterList() { var src = @" using System; record struct C() { int Z = 345; public static void Main() { var c = new C(); Console.Write(c.Z); } }"; CreateCompilation(src).VerifyEmitDiagnostics(); } [Fact] public void RecordProperties_01_Readonly() { var src = @" using System; readonly record struct C(int X, int Y) { readonly int Z = 345; public static void Main() { var c = new C(1, 2); Console.Write(c.X); Console.Write(c.Y); Console.Write(c.Z); } }"; var verifier = CompileAndVerify(src, expectedOutput: @"12345").VerifyDiagnostics(); var c = verifier.Compilation.GlobalNamespace.GetTypeMember("C"); Assert.True(c.IsReadOnly); var x = (IPropertySymbol)c.GetMember("X"); Assert.Equal("System.Int32 C.X.get", x.GetMethod.ToTestDisplayString()); Assert.Equal("void modreq(System.Runtime.CompilerServices.IsExternalInit) C.X.init", x.SetMethod.ToTestDisplayString()); Assert.True(x.SetMethod!.IsInitOnly); var xBackingField = (IFieldSymbol)c.GetMember("<X>k__BackingField"); Assert.Equal("System.Int32 C.<X>k__BackingField", xBackingField.ToTestDisplayString()); Assert.True(xBackingField.IsReadOnly); } [Fact] public void RecordProperties_01_ReadonlyMismatch() { var src = @" readonly record struct C(int X) { public int X { get; set; } = X; // 1 } record struct C2(int X) { public int X { get; init; } = X; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (4,16): error CS8341: Auto-implemented instance properties in readonly structs must be readonly. // public int X { get; set; } = X; // 1 Diagnostic(ErrorCode.ERR_AutoPropsInRoStruct, "X").WithLocation(4, 16) ); } [Fact] public void RecordProperties_02() { var src = @" using System; record struct C(int X, int Y) { public C(int a, int b) { } public static void Main() { var c = new C(1, 2); Console.WriteLine(c.X); Console.WriteLine(c.Y); } private int X1 = X; }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (5,12): error CS0111: Type 'C' already defines a member called 'C' with the same parameter types // public C(int a, int b) Diagnostic(ErrorCode.ERR_MemberAlreadyExists, "C").WithArguments("C", "C").WithLocation(5, 12), // (5,12): error CS8862: A constructor declared in a record with parameter list must have 'this' constructor initializer. // public C(int a, int b) Diagnostic(ErrorCode.ERR_UnexpectedOrMissingConstructorInitializerInRecord, "C").WithLocation(5, 12), // (11,21): error CS0121: The call is ambiguous between the following methods or properties: 'C.C(int, int)' and 'C.C(int, int)' // var c = new C(1, 2); Diagnostic(ErrorCode.ERR_AmbigCall, "C").WithArguments("C.C(int, int)", "C.C(int, int)").WithLocation(11, 21) ); } [Fact] public void RecordProperties_03() { var src = @" using System; record struct C(int X, int Y) { public int X { get; } public static void Main() { var c = new C(1, 2); Console.WriteLine(c.X); Console.WriteLine(c.Y); } }"; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (3,15): error CS0843: Auto-implemented property 'C.X' must be fully assigned before control is returned to the caller. // record struct C(int X, int Y) Diagnostic(ErrorCode.ERR_UnassignedThisAutoProperty, "C").WithArguments("C.X").WithLocation(3, 15), // (3,21): warning CS8907: Parameter 'X' is unread. Did you forget to use it to initialize the property with that name? // record struct C(int X, int Y) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "X").WithArguments("X").WithLocation(3, 21) ); } [Fact] public void RecordProperties_03_InitializedWithY() { var src = @" using System; record struct C(int X, int Y) { public int X { get; } = Y; public static void Main() { var c = new C(1, 2); Console.Write(c.X); Console.Write(c.Y); } }"; CompileAndVerify(src, expectedOutput: "22") .VerifyDiagnostics( // (3,21): warning CS8907: Parameter 'X' is unread. Did you forget to use it to initialize the property with that name? // record struct C(int X, int Y) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "X").WithArguments("X").WithLocation(3, 21) ); } [Fact] public void RecordProperties_04() { var src = @" using System; record struct C(int X, int Y) { public int X { get; } = 3; public static void Main() { var c = new C(1, 2); Console.Write(c.X); Console.Write(c.Y); } }"; CompileAndVerify(src, expectedOutput: "32") .VerifyDiagnostics( // (3,21): warning CS8907: Parameter 'X' is unread. Did you forget to use it to initialize the property with that name? // record struct C(int X, int Y) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "X").WithArguments("X").WithLocation(3, 21) ); } [Fact] public void RecordProperties_05() { var src = @" record struct C(int X, int X) { }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,28): error CS0100: The parameter name 'X' is a duplicate // record struct C(int X, int X) Diagnostic(ErrorCode.ERR_DuplicateParamName, "X").WithArguments("X").WithLocation(2, 28), // (2,28): error CS0102: The type 'C' already contains a definition for 'X' // record struct C(int X, int X) Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "X").WithArguments("C", "X").WithLocation(2, 28) ); var expectedMembers = new[] { "System.Int32 C.X { get; set; }", "System.Int32 C.X { get; set; }" }; AssertEx.Equal(expectedMembers, comp.GetMember<NamedTypeSymbol>("C").GetMembers().OfType<PropertySymbol>().ToTestDisplayStrings()); var expectedMemberNames = new[] { ".ctor", "<X>k__BackingField", "get_X", "set_X", "X", "<X>k__BackingField", "get_X", "set_X", "X", "ToString", "PrintMembers", "op_Inequality", "op_Equality", "GetHashCode", "Equals", "Equals", "Deconstruct", ".ctor" }; AssertEx.Equal(expectedMemberNames, comp.GetMember<NamedTypeSymbol>("C").GetPublicSymbol().MemberNames); } [Fact] public void RecordProperties_06() { var src = @" record struct C(int X, int Y) { public void get_X() { } public void set_X() { } int get_Y(int value) => value; int set_Y(int value) => value; }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,21): error CS0082: Type 'C' already reserves a member called 'get_X' with the same parameter types // record struct C(int X, int Y) Diagnostic(ErrorCode.ERR_MemberReserved, "X").WithArguments("get_X", "C").WithLocation(2, 21), // (2,28): error CS0082: Type 'C' already reserves a member called 'set_Y' with the same parameter types // record struct C(int X, int Y) Diagnostic(ErrorCode.ERR_MemberReserved, "Y").WithArguments("set_Y", "C").WithLocation(2, 28) ); var actualMembers = comp.GetMember<NamedTypeSymbol>("C").GetMembers().ToTestDisplayStrings(); var expectedMembers = new[] { "C..ctor(System.Int32 X, System.Int32 Y)", "System.Int32 C.<X>k__BackingField", "readonly System.Int32 C.X.get", "void C.X.set", "System.Int32 C.X { get; set; }", "System.Int32 C.<Y>k__BackingField", "readonly System.Int32 C.Y.get", "void C.Y.set", "System.Int32 C.Y { get; set; }", "void C.get_X()", "void C.set_X()", "System.Int32 C.get_Y(System.Int32 value)", "System.Int32 C.set_Y(System.Int32 value)", "readonly System.String C.ToString()", "readonly System.Boolean C.PrintMembers(System.Text.StringBuilder builder)", "System.Boolean C.op_Inequality(C left, C right)", "System.Boolean C.op_Equality(C left, C right)", "readonly System.Int32 C.GetHashCode()", "readonly System.Boolean C.Equals(System.Object obj)", "readonly System.Boolean C.Equals(C other)", "readonly void C.Deconstruct(out System.Int32 X, out System.Int32 Y)", "C..ctor()", }; AssertEx.Equal(expectedMembers, actualMembers); } [Fact] public void RecordProperties_07() { var comp = CreateCompilation(@" record struct C1(object P, object get_P); record struct C2(object get_P, object P);"); comp.VerifyDiagnostics( // (2,25): error CS0102: The type 'C1' already contains a definition for 'get_P' // record struct C1(object P, object get_P); Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "P").WithArguments("C1", "get_P").WithLocation(2, 25), // (3,39): error CS0102: The type 'C2' already contains a definition for 'get_P' // record struct C2(object get_P, object P); Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "P").WithArguments("C2", "get_P").WithLocation(3, 39) ); } [Fact] public void RecordProperties_08() { var comp = CreateCompilation(@" record struct C1(object O1) { public object O1 { get; } = O1; public object O2 { get; } = O1; }"); comp.VerifyDiagnostics(); } [Fact] public void RecordProperties_09() { var src = @" record struct C(object P1, object P2, object P3, object P4) { class P1 { } object P2 = 2; int P3(object o) => 3; int P4<T>(T t) => 4; }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,24): error CS0102: The type 'C' already contains a definition for 'P1' // record struct C(object P1, object P2, object P3, object P4) Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "P1").WithArguments("C", "P1").WithLocation(2, 24), // (2,35): warning CS8907: Parameter 'P2' is unread. Did you forget to use it to initialize the property with that name? // record struct C(object P1, object P2, object P3, object P4) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "P2").WithArguments("P2").WithLocation(2, 35), // (6,9): error CS0102: The type 'C' already contains a definition for 'P3' // int P3(object o) => 3; Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "P3").WithArguments("C", "P3").WithLocation(6, 9), // (7,9): error CS0102: The type 'C' already contains a definition for 'P4' // int P4<T>(T t) => 4; Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "P4").WithArguments("C", "P4").WithLocation(7, 9) ); } [Fact] public void RecordProperties_10() { var src = @" record struct C(object P) { const int P = 4; }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,24): error CS8866: Record member 'C.P' must be a readable instance property or field of type 'object' to match positional parameter 'P'. // record struct C(object P) Diagnostic(ErrorCode.ERR_BadRecordMemberForPositionalParameter, "P").WithArguments("C.P", "object", "P").WithLocation(2, 24), // (2,24): warning CS8907: Parameter 'P' is unread. Did you forget to use it to initialize the property with that name? // record struct C(object P) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "P").WithArguments("P").WithLocation(2, 24) ); } [Fact] public void RecordProperties_11_UnreadPositionalParameter() { var comp = CreateCompilation(@" record struct C1(object O1, object O2, object O3) // 1, 2 { public object O1 { get; init; } public object O2 { get; init; } = M(O2); public object O3 { get; init; } = M(O3 = null); private static object M(object o) => o; } "); comp.VerifyDiagnostics( // (2,15): error CS0843: Auto-implemented property 'C1.O1' must be fully assigned before control is returned to the caller. // record struct C1(object O1, object O2, object O3) // 1, 2 Diagnostic(ErrorCode.ERR_UnassignedThisAutoProperty, "C1").WithArguments("C1.O1").WithLocation(2, 15), // (2,25): warning CS8907: Parameter 'O1' is unread. Did you forget to use it to initialize the property with that name? // record struct C1(object O1, object O2, object O3) // 1, 2 Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "O1").WithArguments("O1").WithLocation(2, 25), // (2,47): warning CS8907: Parameter 'O3' is unread. Did you forget to use it to initialize the property with that name? // record struct C1(object O1, object O2, object O3) // 1, 2 Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "O3").WithArguments("O3").WithLocation(2, 47) ); } [Fact] public void RecordProperties_11_UnreadPositionalParameter_InRefOut() { var comp = CreateCompilation(@" record struct C1(object O1, object O2, object O3) // 1 { public object O1 { get; init; } = MIn(in O1); public object O2 { get; init; } = MRef(ref O2); public object O3 { get; init; } = MOut(out O3); static object MIn(in object o) => o; static object MRef(ref object o) => o; static object MOut(out object o) => throw null; } "); comp.VerifyDiagnostics( // (2,47): warning CS8907: Parameter 'O3' is unread. Did you forget to use it to initialize the property with that name? // record struct C1(object O1, object O2, object O3) // 1 Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "O3").WithArguments("O3").WithLocation(2, 47) ); } [Fact] public void RecordProperties_SelfContainedStruct() { var comp = CreateCompilation(@" record struct C(C c); "); comp.VerifyDiagnostics( // (2,19): error CS0523: Struct member 'C.c' of type 'C' causes a cycle in the struct layout // record struct C(C c); Diagnostic(ErrorCode.ERR_StructLayoutCycle, "c").WithArguments("C.c", "C").WithLocation(2, 19) ); } [Fact] public void RecordProperties_PropertyInValueType() { var corlib_cs = @" namespace System { public class Object { public virtual bool Equals(object x) => throw null; public virtual int GetHashCode() => throw null; public virtual string ToString() => throw null; } public class Exception { } public class ValueType { public bool X { get; set; } } public class Attribute { } public class String { } public struct Void { } public struct Boolean { } public struct Char { } public struct Int32 { } public interface IEquatable<T> { } } namespace System.Collections.Generic { public abstract class EqualityComparer<T> { public static EqualityComparer<T> Default => throw null; public abstract int GetHashCode(T t); } } namespace System.Text { public class StringBuilder { public StringBuilder Append(string s) => null; public StringBuilder Append(char c) => null; public StringBuilder Append(object o) => null; } } "; var corlibRef = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); { var src = @" record struct C(bool X) { bool M() { return X; } } "; var comp = CreateEmptyCompilation(src, parseOptions: TestOptions.RegularPreview, references: new[] { corlibRef }); comp.VerifyEmitDiagnostics( // (2,22): warning CS8907: Parameter 'X' is unread. Did you forget to use it to initialize the property with that name? // record struct C(bool X) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "X").WithArguments("X").WithLocation(2, 22) ); Assert.Null(comp.GlobalNamespace.GetTypeMember("C").GetMember("X")); var tree = comp.SyntaxTrees.Single(); var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); var x = tree.GetRoot().DescendantNodes().OfType<ReturnStatementSyntax>().Single().Expression; Assert.Equal("System.Boolean System.ValueType.X { get; set; }", model.GetSymbolInfo(x!).Symbol.ToTestDisplayString()); } { var src = @" readonly record struct C(bool X) { bool M() { return X; } } "; var comp = CreateEmptyCompilation(src, parseOptions: TestOptions.RegularPreview, references: new[] { corlibRef }); comp.VerifyEmitDiagnostics( // (2,31): warning CS8907: Parameter 'X' is unread. Did you forget to use it to initialize the property with that name? // readonly record struct C(bool X) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "X").WithArguments("X").WithLocation(2, 31) ); Assert.Null(comp.GlobalNamespace.GetTypeMember("C").GetMember("X")); var tree = comp.SyntaxTrees.Single(); var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); var x = tree.GetRoot().DescendantNodes().OfType<ReturnStatementSyntax>().Single().Expression; Assert.Equal("System.Boolean System.ValueType.X { get; set; }", model.GetSymbolInfo(x!).Symbol.ToTestDisplayString()); } } [Fact] public void RecordProperties_PropertyInValueType_Static() { var corlib_cs = @" namespace System { public class Object { public virtual bool Equals(object x) => throw null; public virtual int GetHashCode() => throw null; public virtual string ToString() => throw null; } public class Exception { } public class ValueType { public static bool X { get; set; } } public class Attribute { } public class String { } public struct Void { } public struct Boolean { } public struct Char { } public struct Int32 { } public interface IEquatable<T> { } } namespace System.Collections.Generic { public abstract class EqualityComparer<T> { public static EqualityComparer<T> Default => throw null; public abstract int GetHashCode(T t); } } namespace System.Text { public class StringBuilder { public StringBuilder Append(string s) => null; public StringBuilder Append(char c) => null; public StringBuilder Append(object o) => null; } } "; var corlibRef = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); var src = @" record struct C(bool X) { bool M() { return X; } } "; var comp = CreateEmptyCompilation(src, parseOptions: TestOptions.RegularPreview, references: new[] { corlibRef }); comp.VerifyEmitDiagnostics( // (2,22): error CS8866: Record member 'System.ValueType.X' must be a readable instance property or field of type 'bool' to match positional parameter 'X'. // record struct C(bool X) Diagnostic(ErrorCode.ERR_BadRecordMemberForPositionalParameter, "X").WithArguments("System.ValueType.X", "bool", "X").WithLocation(2, 22), // (2,22): warning CS8907: Parameter 'X' is unread. Did you forget to use it to initialize the property with that name? // record struct C(bool X) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "X").WithArguments("X").WithLocation(2, 22) ); } [Fact] public void StaticCtor() { var src = @" record R(int x) { static void Main() { } static R() { System.Console.Write(""static ctor""); } } "; var comp = CreateCompilation(new[] { src, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview, options: TestOptions.DebugExe); comp.VerifyEmitDiagnostics(); CompileAndVerify(comp, expectedOutput: "static ctor", verify: Verification.Skipped /* init-only */); } [Fact] public void StaticCtor_ParameterlessPrimaryCtor() { var src = @" record struct R(int I) { static R() { } } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(); } [Fact] public void StaticCtor_CopyCtor() { var src = @" record struct R(int I) { static R(R r) { } } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (4,12): error CS0132: 'R.R(R)': a static constructor must be parameterless // static R(R r) { } Diagnostic(ErrorCode.ERR_StaticConstParam, "R").WithArguments("R.R(R)").WithLocation(4, 12) ); } [Fact] public void InterfaceImplementation_NotReadonly() { var source = @" I r = new R(42); r.P2 = 43; r.P3 = 44; System.Console.Write((r.P1, r.P2, r.P3)); interface I { int P1 { get; set; } int P2 { get; set; } int P3 { get; set; } } record struct R(int P1) : I { public int P2 { get; set; } = 0; int I.P3 { get; set; } = 0; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics(); CompileAndVerify(comp, expectedOutput: "(42, 43, 44)"); } [Fact] public void InterfaceImplementation_NotReadonly_InitOnlyInterface() { var source = @" interface I { int P1 { get; init; } } record struct R(int P1) : I; "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (6,27): error CS8854: 'R' does not implement interface member 'I.P1.init'. 'R.P1.set' cannot implement 'I.P1.init'. // record struct R(int P1) : I; Diagnostic(ErrorCode.ERR_CloseUnimplementedInterfaceMemberWrongInitOnly, "I").WithArguments("R", "I.P1.init", "R.P1.set").WithLocation(6, 27) ); } [Fact] public void InterfaceImplementation_Readonly() { var source = @" I r = new R(42) { P2 = 43 }; System.Console.Write((r.P1, r.P2)); interface I { int P1 { get; init; } int P2 { get; init; } } readonly record struct R(int P1) : I { public int P2 { get; init; } = 0; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics(); CompileAndVerify(comp, expectedOutput: "(42, 43)", verify: Verification.Skipped /* init-only */); } [Fact] public void InterfaceImplementation_Readonly_SetInterface() { var source = @" interface I { int P1 { get; set; } } readonly record struct R(int P1) : I; "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (6,36): error CS8854: 'R' does not implement interface member 'I.P1.set'. 'R.P1.init' cannot implement 'I.P1.set'. // readonly record struct R(int P1) : I; Diagnostic(ErrorCode.ERR_CloseUnimplementedInterfaceMemberWrongInitOnly, "I").WithArguments("R", "I.P1.set", "R.P1.init").WithLocation(6, 36) ); } [Fact] public void InterfaceImplementation_Readonly_PrivateImplementation() { var source = @" I r = new R(42) { P2 = 43, P3 = 44 }; System.Console.Write((r.P1, r.P2, r.P3)); interface I { int P1 { get; init; } int P2 { get; init; } int P3 { get; init; } } readonly record struct R(int P1) : I { public int P2 { get; init; } = 0; int I.P3 { get; init; } = 0; // not practically initializable } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (2,28): error CS0117: 'R' does not contain a definition for 'P3' // I r = new R(42) { P2 = 43, P3 = 44 }; Diagnostic(ErrorCode.ERR_NoSuchMember, "P3").WithArguments("R", "P3").WithLocation(2, 28) ); } [Fact] public void Initializers_01() { var src = @" using System; record struct C(int X) { int Z = X + 1; public static void Main() { var c = new C(1); Console.WriteLine(c.Z); } }"; var verifier = CompileAndVerify(src, expectedOutput: @"2").VerifyDiagnostics(); var comp = CreateCompilation(src); var tree = comp.SyntaxTrees.First(); var model = comp.GetSemanticModel(tree); var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); Assert.Equal("= X + 1", x.Parent!.Parent!.ToString()); var symbol = model.GetSymbolInfo(x).Symbol; Assert.Equal(SymbolKind.Parameter, symbol!.Kind); Assert.Equal("System.Int32 X", symbol.ToTestDisplayString()); Assert.Equal("C..ctor(System.Int32 X)", symbol.ContainingSymbol.ToTestDisplayString()); Assert.Equal("System.Int32 C.Z", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); Assert.Contains("X", model.LookupNames(x.SpanStart)); var recordDeclaration = tree.GetRoot().DescendantNodes().OfType<RecordDeclarationSyntax>().Single(); Assert.Equal("C", recordDeclaration.Identifier.ValueText); Assert.Null(model.GetOperation(recordDeclaration)); } [Fact] public void Initializers_02() { var src = @" record struct C(int X) { static int Z = X + 1; }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (4,20): error CS0236: A field initializer cannot reference the non-static field, method, or property 'C.X' // static int Z = X + 1; Diagnostic(ErrorCode.ERR_FieldInitRefNonstatic, "X").WithArguments("C.X").WithLocation(4, 20) ); var tree = comp.SyntaxTrees.First(); var model = comp.GetSemanticModel(tree); var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); Assert.Equal("= X + 1", x.Parent!.Parent!.ToString()); var symbol = model.GetSymbolInfo(x).Symbol; Assert.Equal(SymbolKind.Property, symbol!.Kind); Assert.Equal("System.Int32 C.X { get; set; }", symbol.ToTestDisplayString()); Assert.Equal("C", symbol.ContainingSymbol.ToTestDisplayString()); Assert.Equal("System.Int32 C.Z", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); Assert.Contains("X", model.LookupNames(x.SpanStart)); } [Fact] public void Initializers_03() { var src = @" record struct C(int X) { const int Z = X + 1; }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (4,19): error CS0236: A field initializer cannot reference the non-static field, method, or property 'C.X' // const int Z = X + 1; Diagnostic(ErrorCode.ERR_FieldInitRefNonstatic, "X").WithArguments("C.X").WithLocation(4, 19) ); var tree = comp.SyntaxTrees.First(); var model = comp.GetSemanticModel(tree); var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); Assert.Equal("= X + 1", x.Parent!.Parent!.ToString()); var symbol = model.GetSymbolInfo(x).Symbol; Assert.Equal(SymbolKind.Property, symbol!.Kind); Assert.Equal("System.Int32 C.X { get; set; }", symbol.ToTestDisplayString()); Assert.Equal("C", symbol.ContainingSymbol.ToTestDisplayString()); Assert.Equal("System.Int32 C.Z", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); Assert.Contains("X", model.LookupNames(x.SpanStart)); } [Fact] public void Initializers_04() { var src = @" using System; record struct C(int X) { Func<int> Z = () => X + 1; public static void Main() { var c = new C(1); Console.WriteLine(c.Z()); } }"; var verifier = CompileAndVerify(src, expectedOutput: @"2").VerifyDiagnostics(); var comp = CreateCompilation(src); var tree = comp.SyntaxTrees.First(); var model = comp.GetSemanticModel(tree); var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); Assert.Equal("() => X + 1", x.Parent!.Parent!.ToString()); var symbol = model.GetSymbolInfo(x).Symbol; Assert.Equal(SymbolKind.Parameter, symbol!.Kind); Assert.Equal("System.Int32 X", symbol.ToTestDisplayString()); Assert.Equal("C..ctor(System.Int32 X)", symbol.ContainingSymbol.ToTestDisplayString()); Assert.Equal("lambda expression", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); Assert.Contains("X", model.LookupNames(x.SpanStart)); } [Fact] public void SynthesizedRecordPointerProperty() { var src = @" record struct R(int P1, int* P2, delegate*<int> P3);"; var comp = CreateCompilation(src); var p = comp.GlobalNamespace.GetTypeMember("R").GetMember<SourcePropertySymbolBase>("P1"); Assert.False(p.HasPointerType); p = comp.GlobalNamespace.GetTypeMember("R").GetMember<SourcePropertySymbolBase>("P2"); Assert.True(p.HasPointerType); p = comp.GlobalNamespace.GetTypeMember("R").GetMember<SourcePropertySymbolBase>("P3"); Assert.True(p.HasPointerType); } [Fact] public void PositionalMemberModifiers_In() { var src = @" var r = new R(42); int i = 43; var r2 = new R(in i); System.Console.Write((r.P1, r2.P1)); record struct R(in int P1); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "(42, 43)"); var actualMembers = comp.GetMember<NamedTypeSymbol>("R").Constructors.ToTestDisplayStrings(); var expectedMembers = new[] { "R..ctor(in System.Int32 P1)", "R..ctor()" }; AssertEx.Equal(expectedMembers, actualMembers); } [Fact] public void PositionalMemberModifiers_Params() { var src = @" var r = new R(42, 43); var r2 = new R(new[] { 44, 45 }); System.Console.Write((r.Array[0], r.Array[1], r2.Array[0], r2.Array[1])); record struct R(params int[] Array); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); CompileAndVerify(comp, expectedOutput: "(42, 43, 44, 45)"); var actualMembers = comp.GetMember<NamedTypeSymbol>("R").Constructors.ToTestDisplayStrings(); var expectedMembers = new[] { "R..ctor(params System.Int32[] Array)", "R..ctor()" }; AssertEx.Equal(expectedMembers, actualMembers); } [Fact] public void PositionalMemberDefaultValue() { var src = @" var r = new R(); // This uses the parameterless constructor System.Console.Write(r.P); record struct R(int P = 42); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); CompileAndVerify(comp, expectedOutput: "0"); } [Fact] public void PositionalMemberDefaultValue_PassingOneArgument() { var src = @" var r = new R(41); System.Console.Write(r.O); System.Console.Write("" ""); System.Console.Write(r.P); record struct R(int O, int P = 42); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); CompileAndVerify(comp, expectedOutput: "41 42"); } [Fact] public void PositionalMemberDefaultValue_AndPropertyWithInitializer() { var src = @" var r = new R(0); System.Console.Write(r.P); record struct R(int O, int P = 1) { public int P { get; init; } = 42; } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (5,28): warning CS8907: Parameter 'P' is unread. Did you forget to use it to initialize the property with that name? // record struct R(int O, int P = 1) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "P").WithArguments("P").WithLocation(5, 28) ); var verifier = CompileAndVerify(comp, expectedOutput: "42", verify: Verification.Skipped /* init-only */); verifier.VerifyIL("R..ctor(int, int)", @" { // Code size 16 (0x10) .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: stfld ""int R.<O>k__BackingField"" IL_0007: ldarg.0 IL_0008: ldc.i4.s 42 IL_000a: stfld ""int R.<P>k__BackingField"" IL_000f: ret }"); } [Fact] public void PositionalMemberDefaultValue_AndPropertyWithoutInitializer() { var src = @" record struct R(int P = 42) { public int P { get; init; } public static void Main() { var r = new R(); System.Console.Write(r.P); } } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,15): error CS0843: Auto-implemented property 'R.P' must be fully assigned before control is returned to the caller. // record struct R(int P = 42) Diagnostic(ErrorCode.ERR_UnassignedThisAutoProperty, "R").WithArguments("R.P").WithLocation(2, 15), // (2,21): warning CS8907: Parameter 'P' is unread. Did you forget to use it to initialize the property with that name? // record struct R(int P = 42) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "P").WithArguments("P").WithLocation(2, 21) ); } [Fact] public void PositionalMemberDefaultValue_AndPropertyWithInitializer_CopyingParameter() { var src = @" var r = new R(0); System.Console.Write(r.P); record struct R(int O, int P = 42) { public int P { get; init; } = P; } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "42", verify: Verification.Skipped /* init-only */); verifier.VerifyIL("R..ctor(int, int)", @" { // Code size 15 (0xf) .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: stfld ""int R.<O>k__BackingField"" IL_0007: ldarg.0 IL_0008: ldarg.2 IL_0009: stfld ""int R.<P>k__BackingField"" IL_000e: ret }"); } [Fact] public void RecordWithConstraints_NullableWarning() { var src = @" #nullable enable var r = new R<string?>(""R""); var r2 = new R2<string?>(""R2""); System.Console.Write((r.P, r2.P)); record struct R<T>(T P) where T : class; record struct R2<T>(T P) where T : class { } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (3,15): warning CS8634: The type 'string?' cannot be used as type parameter 'T' in the generic type or method 'R<T>'. Nullability of type argument 'string?' doesn't match 'class' constraint. // var r = new R<string?>("R"); Diagnostic(ErrorCode.WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint, "string?").WithArguments("R<T>", "T", "string?").WithLocation(3, 15), // (4,17): warning CS8634: The type 'string?' cannot be used as type parameter 'T' in the generic type or method 'R2<T>'. Nullability of type argument 'string?' doesn't match 'class' constraint. // var r2 = new R2<string?>("R2"); Diagnostic(ErrorCode.WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint, "string?").WithArguments("R2<T>", "T", "string?").WithLocation(4, 17) ); CompileAndVerify(comp, expectedOutput: "(R, R2)"); } [Fact] public void RecordWithConstraints_ConstraintError() { var src = @" record struct R<T>(T P) where T : class; record struct R2<T>(T P) where T : class { } public class C { public static void Main() { _ = new R<int>(1); _ = new R2<int>(2); } }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (9,19): error CS0452: The type 'int' must be a reference type in order to use it as parameter 'T' in the generic type or method 'R<T>' // _ = new R<int>(1); Diagnostic(ErrorCode.ERR_RefConstraintNotSatisfied, "int").WithArguments("R<T>", "T", "int").WithLocation(9, 19), // (10,20): error CS0452: The type 'int' must be a reference type in order to use it as parameter 'T' in the generic type or method 'R2<T>' // _ = new R2<int>(2); Diagnostic(ErrorCode.ERR_RefConstraintNotSatisfied, "int").WithArguments("R2<T>", "T", "int").WithLocation(10, 20) ); } [Fact] public void CyclicBases4() { var text = @" record struct A<T> : B<A<T>> { } record struct B<T> : A<B<T>> { A<T> F() { return null; } } "; var comp = CreateCompilation(text); comp.GetDeclarationDiagnostics().Verify( // (3,22): error CS0527: Type 'A<B<T>>' in interface list is not an interface // record struct B<T> : A<B<T>> Diagnostic(ErrorCode.ERR_NonInterfaceInInterfaceList, "A<B<T>>").WithArguments("A<B<T>>").WithLocation(3, 22), // (2,22): error CS0527: Type 'B<A<T>>' in interface list is not an interface // record struct A<T> : B<A<T>> { } Diagnostic(ErrorCode.ERR_NonInterfaceInInterfaceList, "B<A<T>>").WithArguments("B<A<T>>").WithLocation(2, 22) ); } [Fact] public void PartialClassWithDifferentTupleNamesInImplementedInterfaces() { var source = @" public interface I<T> { } public partial record C1 : I<(int a, int b)> { } public partial record C1 : I<(int notA, int notB)> { } public partial record C2 : I<(int a, int b)> { } public partial record C2 : I<(int, int)> { } public partial record C3 : I<(int a, int b)> { } public partial record C3 : I<(int a, int b)> { } public partial record C4 : I<(int a, int b)> { } public partial record C4 : I<(int b, int a)> { } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics( // (3,23): error CS8140: 'I<(int notA, int notB)>' is already listed in the interface list on type 'C1' with different tuple element names, as 'I<(int a, int b)>'. // public partial record C1 : I<(int a, int b)> { } Diagnostic(ErrorCode.ERR_DuplicateInterfaceWithTupleNamesInBaseList, "C1").WithArguments("I<(int notA, int notB)>", "I<(int a, int b)>", "C1").WithLocation(3, 23), // (6,23): error CS8140: 'I<(int, int)>' is already listed in the interface list on type 'C2' with different tuple element names, as 'I<(int a, int b)>'. // public partial record C2 : I<(int a, int b)> { } Diagnostic(ErrorCode.ERR_DuplicateInterfaceWithTupleNamesInBaseList, "C2").WithArguments("I<(int, int)>", "I<(int a, int b)>", "C2").WithLocation(6, 23), // (12,23): error CS8140: 'I<(int b, int a)>' is already listed in the interface list on type 'C4' with different tuple element names, as 'I<(int a, int b)>'. // public partial record C4 : I<(int a, int b)> { } Diagnostic(ErrorCode.ERR_DuplicateInterfaceWithTupleNamesInBaseList, "C4").WithArguments("I<(int b, int a)>", "I<(int a, int b)>", "C4").WithLocation(12, 23) ); } [Fact] public void CS0267ERR_PartialMisplaced() { var test = @" partial public record struct C // CS0267 { } "; CreateCompilation(test).VerifyDiagnostics( // (2,1): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type. // partial public record struct C // CS0267 Diagnostic(ErrorCode.ERR_PartialMisplaced, "partial").WithLocation(2, 1) ); } [Fact] public void SealedStaticRecord() { var source = @" sealed static record struct R; "; CreateCompilation(source).VerifyDiagnostics( // (2,29): error CS0106: The modifier 'sealed' is not valid for this item // sealed static record struct R; Diagnostic(ErrorCode.ERR_BadMemberFlag, "R").WithArguments("sealed").WithLocation(2, 29), // (2,29): error CS0106: The modifier 'static' is not valid for this item // sealed static record struct R; Diagnostic(ErrorCode.ERR_BadMemberFlag, "R").WithArguments("static").WithLocation(2, 29) ); } [Fact] public void CS0513ERR_AbstractInConcreteClass02() { var text = @" record struct C { public abstract event System.Action E; public abstract int this[int x] { get; set; } } "; CreateCompilation(text).VerifyDiagnostics( // (5,25): error CS0106: The modifier 'abstract' is not valid for this item // public abstract int this[int x] { get; set; } Diagnostic(ErrorCode.ERR_BadMemberFlag, "this").WithArguments("abstract").WithLocation(5, 25), // (4,41): error CS0106: The modifier 'abstract' is not valid for this item // public abstract event System.Action E; Diagnostic(ErrorCode.ERR_BadMemberFlag, "E").WithArguments("abstract").WithLocation(4, 41) ); } [Fact] public void CS0574ERR_BadDestructorName() { var test = @" public record struct iii { ~iiii(){} } "; CreateCompilation(test).VerifyDiagnostics( // (4,6): error CS0574: Name of destructor must match name of type // ~iiii(){} Diagnostic(ErrorCode.ERR_BadDestructorName, "iiii").WithLocation(4, 6), // (4,6): error CS0575: Only class types can contain destructors // ~iiii(){} Diagnostic(ErrorCode.ERR_OnlyClassesCanContainDestructors, "iiii").WithArguments("iii.~iii()").WithLocation(4, 6) ); } [Fact] public void StaticRecordWithConstructorAndDestructor() { var text = @" static record struct R(int I) { public R() : this(0) { } ~R() { } } "; var comp = CreateCompilation(text); comp.VerifyDiagnostics( // (2,22): error CS0106: The modifier 'static' is not valid for this item // static record struct R(int I) Diagnostic(ErrorCode.ERR_BadMemberFlag, "R").WithArguments("static").WithLocation(2, 22), // (5,6): error CS0575: Only class types can contain destructors // ~R() { } Diagnostic(ErrorCode.ERR_OnlyClassesCanContainDestructors, "R").WithArguments("R.~R()").WithLocation(5, 6) ); } [Fact] public void RecordWithPartialMethodExplicitImplementation() { var source = @"record struct R { partial void M(); }"; CreateCompilation(source).VerifyDiagnostics( // (3,18): error CS0751: A partial method must be declared within a partial type // partial void M(); Diagnostic(ErrorCode.ERR_PartialMethodOnlyInPartialClass, "M").WithLocation(3, 18) ); } [Fact] public void RecordWithPartialMethodRequiringBody() { var source = @"partial record struct R { public partial int M(); }"; CreateCompilation(source).VerifyDiagnostics( // (3,24): error CS8795: Partial method 'R.M()' must have an implementation part because it has accessibility modifiers. // public partial int M(); Diagnostic(ErrorCode.ERR_PartialMethodWithAccessibilityModsMustHaveImplementation, "M").WithArguments("R.M()").WithLocation(3, 24) ); } [Fact] public void CanDeclareIteratorInRecord() { var source = @" using System.Collections.Generic; foreach(var i in new X(42).GetItems()) { System.Console.Write(i); } public record struct X(int a) { public IEnumerable<int> GetItems() { yield return a; yield return a + 1; } }"; var comp = CreateCompilation(source).VerifyDiagnostics(); CompileAndVerify(comp, expectedOutput: "4243"); } [Fact] public void ParameterlessConstructor() { var src = @" System.Console.Write(new C().Property); record struct C() { public int Property { get; set; } = 42; }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); CompileAndVerify(comp, expectedOutput: "42"); } [Fact] public void XmlDoc() { var src = @" /// <summary>Summary</summary> /// <param name=""I1"">Description for I1</param> public record struct C(int I1); namespace System.Runtime.CompilerServices { /// <summary>Ignored</summary> public static class IsExternalInit { } } "; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularWithDocumentationComments); comp.VerifyDiagnostics(); var cMember = comp.GetMember<NamedTypeSymbol>("C"); Assert.Equal( @"<member name=""T:C""> <summary>Summary</summary> <param name=""I1"">Description for I1</param> </member> ", cMember.GetDocumentationCommentXml()); var constructor = cMember.GetMembers(".ctor").OfType<SynthesizedRecordConstructor>().Single(); Assert.Equal( @"<member name=""M:C.#ctor(System.Int32)""> <summary>Summary</summary> <param name=""I1"">Description for I1</param> </member> ", constructor.GetDocumentationCommentXml()); Assert.Equal("", constructor.GetParameters()[0].GetDocumentationCommentXml()); var property = cMember.GetMembers("I1").Single(); Assert.Equal("", property.GetDocumentationCommentXml()); } [Fact] public void XmlDoc_Cref() { var src = @" /// <summary>Summary</summary> /// <param name=""I1"">Description for <see cref=""I1""/></param> public record struct C(int I1) { /// <summary>Summary</summary> /// <param name=""x"">Description for <see cref=""x""/></param> public void M(int x) { } } namespace System.Runtime.CompilerServices { /// <summary>Ignored</summary> public static class IsExternalInit { } } "; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularWithDocumentationComments); comp.VerifyDiagnostics( // (7,52): warning CS1574: XML comment has cref attribute 'x' that could not be resolved // /// <param name="x">Description for <see cref="x"/></param> Diagnostic(ErrorCode.WRN_BadXMLRef, "x").WithArguments("x").WithLocation(7, 52) ); var tree = comp.SyntaxTrees.Single(); var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); var cref = docComments.First().DescendantNodes().OfType<XmlCrefAttributeSyntax>().First().Cref; Assert.Equal("I1", cref.ToString()); var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); Assert.Equal(SymbolKind.Property, model.GetSymbolInfo(cref).Symbol!.Kind); } [Fact] public void Deconstruct_Simple() { var source = @"using System; record struct B(int X, int Y) { public static void Main() { M(new B(1, 2)); } static void M(B b) { switch (b) { case B(int x, int y): Console.Write(x); Console.Write(y); break; } } }"; var verifier = CompileAndVerify(source, expectedOutput: "12"); verifier.VerifyDiagnostics(); verifier.VerifyIL("B.Deconstruct", @" { // Code size 17 (0x11) .maxstack 2 IL_0000: ldarg.1 IL_0001: ldarg.0 IL_0002: call ""readonly int B.X.get"" IL_0007: stind.i4 IL_0008: ldarg.2 IL_0009: ldarg.0 IL_000a: call ""readonly int B.Y.get"" IL_000f: stind.i4 IL_0010: ret }"); var deconstruct = ((CSharpCompilation)verifier.Compilation).GetMember<MethodSymbol>("B.Deconstruct"); Assert.Equal(2, deconstruct.ParameterCount); Assert.Equal(RefKind.Out, deconstruct.Parameters[0].RefKind); Assert.Equal("X", deconstruct.Parameters[0].Name); Assert.Equal(RefKind.Out, deconstruct.Parameters[1].RefKind); Assert.Equal("Y", deconstruct.Parameters[1].Name); Assert.True(deconstruct.ReturnsVoid); Assert.False(deconstruct.IsVirtual); Assert.False(deconstruct.IsStatic); Assert.Equal(Accessibility.Public, deconstruct.DeclaredAccessibility); } [Fact] public void Deconstruct_PositionalAndNominalProperty() { var source = @"using System; record struct B(int X) { public int Y { get; init; } = 0; public static void Main() { M(new B(1)); } static void M(B b) { switch (b) { case B(int x): Console.Write(x); break; } } }"; var verifier = CompileAndVerify(source, expectedOutput: "1"); verifier.VerifyDiagnostics(); Assert.Equal( "readonly void B.Deconstruct(out System.Int32 X)", verifier.Compilation.GetMember("B.Deconstruct").ToTestDisplayString(includeNonNullable: false)); } [Fact] public void Deconstruct_Nested() { var source = @"using System; record struct B(int X, int Y); record struct C(B B, int Z) { public static void Main() { M(new C(new B(1, 2), 3)); } static void M(C c) { switch (c) { case C(B(int x, int y), int z): Console.Write(x); Console.Write(y); Console.Write(z); break; } } } "; var verifier = CompileAndVerify(source, expectedOutput: "123"); verifier.VerifyDiagnostics(); verifier.VerifyIL("B.Deconstruct", @" { // Code size 17 (0x11) .maxstack 2 IL_0000: ldarg.1 IL_0001: ldarg.0 IL_0002: call ""readonly int B.X.get"" IL_0007: stind.i4 IL_0008: ldarg.2 IL_0009: ldarg.0 IL_000a: call ""readonly int B.Y.get"" IL_000f: stind.i4 IL_0010: ret }"); verifier.VerifyIL("C.Deconstruct", @" { // Code size 21 (0x15) .maxstack 2 IL_0000: ldarg.1 IL_0001: ldarg.0 IL_0002: call ""readonly B C.B.get"" IL_0007: stobj ""B"" IL_000c: ldarg.2 IL_000d: ldarg.0 IL_000e: call ""readonly int C.Z.get"" IL_0013: stind.i4 IL_0014: ret }"); } [Fact] public void Deconstruct_PropertyCollision() { var source = @"using System; record struct B(int X, int Y) { public int X => 3; static void M(B b) { switch (b) { case B(int x, int y): Console.Write(x); Console.Write(y); break; } } static void Main() { M(new B(1, 2)); } } "; var verifier = CompileAndVerify(source, expectedOutput: "32"); verifier.VerifyDiagnostics( // (3,21): warning CS8907: Parameter 'X' is unread. Did you forget to use it to initialize the property with that name? // record struct B(int X, int Y) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "X").WithArguments("X").WithLocation(3, 21) ); Assert.Equal( "void B.Deconstruct(out System.Int32 X, out System.Int32 Y)", verifier.Compilation.GetMember("B.Deconstruct").ToTestDisplayString(includeNonNullable: false)); } [Fact] public void Deconstruct_MethodCollision_01() { var source = @" record struct B(int X, int Y) { public int X() => 3; static void M(B b) { switch (b) { case B(int x, int y): break; } } static void Main() { M(new B(1, 2)); } } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics( // (4,16): error CS0102: The type 'B' already contains a definition for 'X' // public int X() => 3; Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "X").WithArguments("B", "X").WithLocation(4, 16) ); Assert.Equal( "readonly void B.Deconstruct(out System.Int32 X, out System.Int32 Y)", comp.GetMember("B.Deconstruct").ToTestDisplayString(includeNonNullable: false)); } [Fact] public void Deconstruct_FieldCollision() { var source = @" using System; record struct C(int X) { int X = 0; static void M(C c) { switch (c) { case C(int x): Console.Write(x); break; } } static void Main() { M(new C(0)); } } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics( // (4,21): warning CS8907: Parameter 'X' is unread. Did you forget to use it to initialize the property with that name? // record struct C(int X) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "X").WithArguments("X").WithLocation(4, 21), // (6,9): warning CS0414: The field 'C.X' is assigned but its value is never used // int X = 0; Diagnostic(ErrorCode.WRN_UnreferencedFieldAssg, "X").WithArguments("C.X").WithLocation(6, 9)); Assert.Equal( "readonly void C.Deconstruct(out System.Int32 X)", comp.GetMember("C.Deconstruct").ToTestDisplayString(includeNonNullable: false)); } [Fact] public void Deconstruct_Empty() { var source = @" record struct C { static void M(C c) { switch (c) { case C(): break; } } static void Main() { M(new C()); } } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics( // (8,19): error CS1061: 'C' does not contain a definition for 'Deconstruct' and no accessible extension method 'Deconstruct' accepting a first argument of type 'C' could be found (are you missing a using directive or an assembly reference?) // case C(): Diagnostic(ErrorCode.ERR_NoSuchMemberOrExtension, "()").WithArguments("C", "Deconstruct").WithLocation(8, 19), // (8,19): error CS8129: No suitable 'Deconstruct' instance or extension method was found for type 'C', with 0 out parameters and a void return type. // case C(): Diagnostic(ErrorCode.ERR_MissingDeconstruct, "()").WithArguments("C", "0").WithLocation(8, 19)); Assert.Null(comp.GetMember("C.Deconstruct")); } [Fact] public void Deconstruct_Conversion_02() { var source = @" #nullable enable using System; record struct C(string? X, string Y) { public string X { get; init; } = null!; public string? Y { get; init; } = string.Empty; static void M(C c) { switch (c) { case C(var x, string y): Console.Write(x); Console.Write(y); break; } } static void Main() { M(new C(""a"", ""b"")); } } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics( // (5,25): warning CS8907: Parameter 'X' is unread. Did you forget to use it to initialize the property with that name? // record struct C(string? X, string Y) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "X").WithArguments("X").WithLocation(5, 25), // (5,35): warning CS8907: Parameter 'Y' is unread. Did you forget to use it to initialize the property with that name? // record struct C(string? X, string Y) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "Y").WithArguments("Y").WithLocation(5, 35) ); Assert.Equal( "readonly void C.Deconstruct(out System.String? X, out System.String Y)", comp.GetMember("C.Deconstruct").ToTestDisplayString(includeNonNullable: false)); } [Fact] public void Deconstruct_Empty_WithParameterList() { var source = @" record struct C() { static void M(C c) { switch (c) { case C(): break; } } static void Main() { M(new C()); } } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics( // (8,19): error CS1061: 'C' does not contain a definition for 'Deconstruct' and no accessible extension method 'Deconstruct' accepting a first argument of type 'C' could be found (are you missing a using directive or an assembly reference?) // case C(): Diagnostic(ErrorCode.ERR_NoSuchMemberOrExtension, "()").WithArguments("C", "Deconstruct").WithLocation(8, 19), // (8,19): error CS8129: No suitable 'Deconstruct' instance or extension method was found for type 'C', with 0 out parameters and a void return type. // case C(): Diagnostic(ErrorCode.ERR_MissingDeconstruct, "()").WithArguments("C", "0").WithLocation(8, 19)); AssertEx.Equal(new[] { "C..ctor()", "void C.M(C c)", "void C.Main()", "readonly System.String C.ToString()", "readonly System.Boolean C.PrintMembers(System.Text.StringBuilder builder)", "System.Boolean C.op_Inequality(C left, C right)", "System.Boolean C.op_Equality(C left, C right)", "readonly System.Int32 C.GetHashCode()", "readonly System.Boolean C.Equals(System.Object obj)", "readonly System.Boolean C.Equals(C other)" }, comp.GetMember<NamedTypeSymbol>("C").GetMembers().ToTestDisplayStrings()); } [Fact] public void Deconstruct_Empty_WithParameterList_UserDefined_01() { var source = @"using System; record struct C(int I) { public void Deconstruct() { } static void M(C c) { switch (c) { case C(): Console.Write(12); break; } } public static void Main() { M(new C(42)); } } "; var verifier = CompileAndVerify(source, expectedOutput: "12"); verifier.VerifyDiagnostics(); } [Fact] public void Deconstruct_GeneratedAsReadOnly() { var src = @" record struct A(int I, string S); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var method = comp.GetMember<SynthesizedRecordDeconstruct>("A.Deconstruct"); Assert.True(method.IsDeclaredReadOnly); } [Fact] public void Deconstruct_WihtNonReadOnlyGetter_GeneratedAsNonReadOnly() { var src = @" record struct A(int I, string S) { public int I { get => 0; } } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,21): warning CS8907: Parameter 'I' is unread. Did you forget to use it to initialize the property with that name? // record struct A(int I, string S) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "I").WithArguments("I").WithLocation(2, 21)); var method = comp.GetMember<SynthesizedRecordDeconstruct>("A.Deconstruct"); Assert.False(method.IsDeclaredReadOnly); } [Fact] public void Deconstruct_UserDefined() { var source = @"using System; record struct B(int X, int Y) { public void Deconstruct(out int X, out int Y) { X = this.X + 1; Y = this.Y + 2; } static void M(B b) { switch (b) { case B(int x, int y): Console.Write(x); Console.Write(y); break; } } public static void Main() { M(new B(0, 0)); } } "; var verifier = CompileAndVerify(source, expectedOutput: "12"); verifier.VerifyDiagnostics(); } [Fact] public void Deconstruct_UserDefined_DifferentSignature_02() { var source = @"using System; record struct B(int X) { public int Deconstruct(out int a) => throw null; static void M(B b) { switch (b) { case B(int x): Console.Write(x); break; } } public static void Main() { M(new B(1)); } } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics( // (5,16): error CS8874: Record member 'B.Deconstruct(out int)' must return 'void'. // public int Deconstruct(out int a) => throw null; Diagnostic(ErrorCode.ERR_SignatureMismatchInRecord, "Deconstruct").WithArguments("B.Deconstruct(out int)", "void").WithLocation(5, 16), // (11,19): error CS8129: No suitable 'Deconstruct' instance or extension method was found for type 'B', with 1 out parameters and a void return type. // case B(int x): Diagnostic(ErrorCode.ERR_MissingDeconstruct, "(int x)").WithArguments("B", "1").WithLocation(11, 19)); Assert.Equal("System.Int32 B.Deconstruct(out System.Int32 a)", comp.GetMember("B.Deconstruct").ToTestDisplayString(includeNonNullable: false)); } [Theory] [InlineData("")] [InlineData("private")] [InlineData("internal")] public void Deconstruct_UserDefined_Accessibility_07(string accessibility) { var source = $@" record struct A(int X) {{ { accessibility } void Deconstruct(out int a) => throw null; }} "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,11): error CS8873: Record member 'A.Deconstruct(out int)' must be public. // void Deconstruct(out int a) Diagnostic(ErrorCode.ERR_NonPublicAPIInRecord, "Deconstruct").WithArguments("A.Deconstruct(out int)").WithLocation(4, 11 + accessibility.Length) ); } [Fact] public void Deconstruct_UserDefined_Static_08() { var source = @" record struct A(int X) { public static void Deconstruct(out int a) => throw null; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,24): error CS8877: Record member 'A.Deconstruct(out int)' may not be static. // public static void Deconstruct(out int a) Diagnostic(ErrorCode.ERR_StaticAPIInRecord, "Deconstruct").WithArguments("A.Deconstruct(out int)").WithLocation(4, 24) ); } [Fact] public void OutVarInPositionalParameterDefaultValue() { var source = @" record struct A(int X = A.M(out int a) + a) { public static int M(out int a) => throw null; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (2,25): error CS1736: Default parameter value for 'X' must be a compile-time constant // record struct A(int X = A.M(out int a) + a) Diagnostic(ErrorCode.ERR_DefaultValueMustBeConstant, "A.M(out int a) + a").WithArguments("X").WithLocation(2, 25) ); } [Fact] public void FieldConsideredUnassignedIfInitializationViaProperty() { var source = @" record struct Pos(int X) { private int x; public int X { get { return x; } set { x = value; } } = X; } record struct Pos2(int X) { private int x = X; // value isn't validated by setter public int X { get { return x; } set { x = value; } } } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (2,15): error CS0171: Field 'Pos.x' must be fully assigned before control is returned to the caller // record struct Pos(int X) Diagnostic(ErrorCode.ERR_UnassignedThis, "Pos").WithArguments("Pos.x").WithLocation(2, 15), // (5,16): error CS8050: Only auto-implemented properties can have initializers. // public int X { get { return x; } set { x = value; } } = X; Diagnostic(ErrorCode.ERR_InitializerOnNonAutoProperty, "X").WithArguments("Pos.X").WithLocation(5, 16) ); } [Fact] public void IEquatableT_01() { var source = @"record struct A<T>; class Program { static void F<T>(System.IEquatable<T> t) { } static void M<T>() { F(new A<T>()); } }"; var comp = CreateCompilation(source); comp.VerifyDiagnostics( ); } [Fact] public void IEquatableT_02() { var source = @"using System; record struct A; record struct B<T>; class Program { static bool F<T>(IEquatable<T> t, T t2) { return t.Equals(t2); } static void Main() { Console.Write(F(new A(), new A())); Console.Write(F(new B<int>(), new B<int>())); } }"; var comp = CreateCompilation(new[] { source, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview, options: TestOptions.ReleaseExe); CompileAndVerify(comp, expectedOutput: "TrueTrue").VerifyDiagnostics(); } [Fact] public void IEquatableT_02_ImplicitImplementation() { var source = @"using System; record struct A { public bool Equals(A other) { System.Console.Write(""A.Equals(A) ""); return false; } } record struct B<T> { public bool Equals(B<T> other) { System.Console.Write(""B.Equals(B) ""); return true; } } class Program { static bool F<T>(IEquatable<T> t, T t2) { return t.Equals(t2); } static void Main() { Console.Write(F(new A(), new A())); Console.Write("" ""); Console.Write(F(new B<int>(), new B<int>())); } }"; var comp = CreateCompilation(new[] { source, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview, options: TestOptions.ReleaseExe); CompileAndVerify(comp, expectedOutput: "A.Equals(A) False B.Equals(B) True").VerifyDiagnostics( // (4,17): warning CS8851: 'A' defines 'Equals' but not 'GetHashCode' // public bool Equals(A other) Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("A").WithLocation(4, 17), // (12,17): warning CS8851: 'B' defines 'Equals' but not 'GetHashCode' // public bool Equals(B<T> other) Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("B").WithLocation(12, 17) ); } [Fact] public void IEquatableT_02_ExplicitImplementation() { var source = @"using System; record struct A { bool IEquatable<A>.Equals(A other) { System.Console.Write(""A.Equals(A) ""); return false; } } record struct B<T> { bool IEquatable<B<T>>.Equals(B<T> other) { System.Console.Write(""B.Equals(B) ""); return true; } } class Program { static bool F<T>(IEquatable<T> t, T t2) { return t.Equals(t2); } static void Main() { Console.Write(F(new A(), new A())); Console.Write("" ""); Console.Write(F(new B<int>(), new B<int>())); } }"; var comp = CreateCompilation(new[] { source, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview, options: TestOptions.ReleaseExe); CompileAndVerify(comp, expectedOutput: "A.Equals(A) False B.Equals(B) True").VerifyDiagnostics(); } [Fact] public void IEquatableT_03() { var source = @" record struct A<T> : System.IEquatable<A<T>>; "; var comp = CreateCompilation(source); comp.VerifyDiagnostics(); var type = comp.GetMember<NamedTypeSymbol>("A"); AssertEx.Equal(new[] { "System.IEquatable<A<T>>" }, type.InterfacesNoUseSiteDiagnostics().ToTestDisplayStrings()); AssertEx.Equal(new[] { "System.IEquatable<A<T>>" }, type.AllInterfacesNoUseSiteDiagnostics.ToTestDisplayStrings()); } [Fact] public void IEquatableT_MissingIEquatable() { var source = @" record struct A<T>; "; var comp = CreateCompilation(source); comp.MakeTypeMissing(WellKnownType.System_IEquatable_T); comp.VerifyEmitDiagnostics( // (2,15): error CS0518: Predefined type 'System.IEquatable`1' is not defined or imported // record struct A<T>; Diagnostic(ErrorCode.ERR_PredefinedTypeNotFound, "A").WithArguments("System.IEquatable`1").WithLocation(2, 15), // (2,15): error CS0518: Predefined type 'System.IEquatable`1' is not defined or imported // record struct A<T>; Diagnostic(ErrorCode.ERR_PredefinedTypeNotFound, "A").WithArguments("System.IEquatable`1").WithLocation(2, 15) ); var type = comp.GetMember<NamedTypeSymbol>("A"); AssertEx.Equal(new[] { "System.IEquatable<A<T>>[missing]" }, type.InterfacesNoUseSiteDiagnostics().ToTestDisplayStrings()); AssertEx.Equal(new[] { "System.IEquatable<A<T>>[missing]" }, type.AllInterfacesNoUseSiteDiagnostics.ToTestDisplayStrings()); } [Fact] public void RecordEquals_01() { var source = @" var a1 = new B(); var a2 = new B(); System.Console.WriteLine(a1.Equals(a2)); record struct B { public bool Equals(B other) { System.Console.WriteLine(""B.Equals(B)""); return false; } } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics( // (8,17): warning CS8851: 'B' defines 'Equals' but not 'GetHashCode' // public bool Equals(B other) Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("B").WithLocation(8, 17) ); CompileAndVerify(comp, expectedOutput: @" B.Equals(B) False "); } [Fact] public void RecordEquals_01_NoInParameters() { var source = @" var a1 = new B(); var a2 = new B(); System.Console.WriteLine(a1.Equals(in a2)); record struct B; "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,39): error CS1615: Argument 1 may not be passed with the 'in' keyword // System.Console.WriteLine(a1.Equals(in a2)); Diagnostic(ErrorCode.ERR_BadArgExtraRef, "a2").WithArguments("1", "in").WithLocation(4, 39) ); } [Theory] [InlineData("protected")] [InlineData("private protected")] [InlineData("internal protected")] public void RecordEquals_10(string accessibility) { var source = $@" record struct A {{ { accessibility } bool Equals(A x) => throw null; bool System.IEquatable<A>.Equals(A x) => throw null; }} "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,29): error CS0666: 'A.Equals(A)': new protected member declared in struct // internal protected bool Equals(A x) Diagnostic(ErrorCode.ERR_ProtectedInStruct, "Equals").WithArguments("A.Equals(A)").WithLocation(4, 11 + accessibility.Length), // (4,29): error CS8873: Record member 'A.Equals(A)' must be public. // internal protected bool Equals(A x) Diagnostic(ErrorCode.ERR_NonPublicAPIInRecord, "Equals").WithArguments("A.Equals(A)").WithLocation(4, 11 + accessibility.Length), // (4,29): warning CS8851: 'A' defines 'Equals' but not 'GetHashCode' // internal protected bool Equals(A x) Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("A").WithLocation(4, 11 + accessibility.Length) ); } [Theory] [InlineData("")] [InlineData("private")] [InlineData("internal")] public void RecordEquals_11(string accessibility) { var source = $@" record struct A {{ { accessibility } bool Equals(A x) => throw null; bool System.IEquatable<A>.Equals(A x) => throw null; }} "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,...): error CS8873: Record member 'A.Equals(A)' must be public. // { accessibility } bool Equals(A x) Diagnostic(ErrorCode.ERR_NonPublicAPIInRecord, "Equals").WithArguments("A.Equals(A)").WithLocation(4, 11 + accessibility.Length), // (4,11): warning CS8851: 'A' defines 'Equals' but not 'GetHashCode' // bool Equals(A x) Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("A").WithLocation(4, 11 + accessibility.Length) ); } [Fact] public void RecordEquals_12() { var source = @" A a1 = new A(); A a2 = new A(); System.Console.Write(a1.Equals(a2)); System.Console.Write(a1.Equals((object)a2)); record struct A { public bool Equals(B other) => throw null; } class B { } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "TrueTrue"); verifier.VerifyIL("A.Equals(A)", @" { // Code size 2 (0x2) .maxstack 1 IL_0000: ldc.i4.1 IL_0001: ret }"); verifier.VerifyIL("A.Equals(object)", @" { // Code size 23 (0x17) .maxstack 2 IL_0000: ldarg.1 IL_0001: isinst ""A"" IL_0006: brfalse.s IL_0015 IL_0008: ldarg.0 IL_0009: ldarg.1 IL_000a: unbox.any ""A"" IL_000f: call ""readonly bool A.Equals(A)"" IL_0014: ret IL_0015: ldc.i4.0 IL_0016: ret }"); verifier.VerifyIL("A.GetHashCode()", @" { // Code size 2 (0x2) .maxstack 1 IL_0000: ldc.i4.0 IL_0001: ret }"); var recordEquals = comp.GetMembers("A.Equals").OfType<SynthesizedRecordEquals>().Single(); Assert.Equal("readonly System.Boolean A.Equals(A other)", recordEquals.ToTestDisplayString()); Assert.Equal(Accessibility.Public, recordEquals.DeclaredAccessibility); Assert.False(recordEquals.IsAbstract); Assert.False(recordEquals.IsVirtual); Assert.False(recordEquals.IsOverride); Assert.False(recordEquals.IsSealed); Assert.True(recordEquals.IsImplicitlyDeclared); var objectEquals = comp.GetMembers("A.Equals").OfType<SynthesizedRecordObjEquals>().Single(); Assert.Equal("readonly System.Boolean A.Equals(System.Object obj)", objectEquals.ToTestDisplayString()); Assert.Equal(Accessibility.Public, objectEquals.DeclaredAccessibility); Assert.False(objectEquals.IsAbstract); Assert.False(objectEquals.IsVirtual); Assert.True(objectEquals.IsOverride); Assert.False(objectEquals.IsSealed); Assert.True(objectEquals.IsImplicitlyDeclared); MethodSymbol gethashCode = comp.GetMembers("A." + WellKnownMemberNames.ObjectGetHashCode).OfType<SynthesizedRecordGetHashCode>().Single(); Assert.Equal("readonly System.Int32 A.GetHashCode()", gethashCode.ToTestDisplayString()); Assert.Equal(Accessibility.Public, gethashCode.DeclaredAccessibility); Assert.False(gethashCode.IsStatic); Assert.False(gethashCode.IsAbstract); Assert.False(gethashCode.IsVirtual); Assert.True(gethashCode.IsOverride); Assert.False(gethashCode.IsSealed); Assert.True(gethashCode.IsImplicitlyDeclared); } [Fact] public void RecordEquals_13() { var source = @" record struct A { public int Equals(A other) => throw null; bool System.IEquatable<A>.Equals(A x) => throw null; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,16): error CS8874: Record member 'A.Equals(A)' must return 'bool'. // public int Equals(A other) Diagnostic(ErrorCode.ERR_SignatureMismatchInRecord, "Equals").WithArguments("A.Equals(A)", "bool").WithLocation(4, 16), // (4,16): warning CS8851: 'A' defines 'Equals' but not 'GetHashCode' // public int Equals(A other) Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("A").WithLocation(4, 16) ); } [Fact] public void RecordEquals_14() { var source = @" record struct A { public bool Equals(A other) => throw null; System.Boolean System.IEquatable<A>.Equals(A x) => throw null; } "; var comp = CreateCompilation(source); comp.MakeTypeMissing(SpecialType.System_Boolean); comp.VerifyEmitDiagnostics( // (2,1): error CS0518: Predefined type 'System.Boolean' is not defined or imported // record struct A Diagnostic(ErrorCode.ERR_PredefinedTypeNotFound, @"record struct A { public bool Equals(A other) => throw null; System.Boolean System.IEquatable<A>.Equals(A x) => throw null; }").WithArguments("System.Boolean").WithLocation(2, 1), // (2,1): error CS0518: Predefined type 'System.Boolean' is not defined or imported // record struct A Diagnostic(ErrorCode.ERR_PredefinedTypeNotFound, @"record struct A { public bool Equals(A other) => throw null; System.Boolean System.IEquatable<A>.Equals(A x) => throw null; }").WithArguments("System.Boolean").WithLocation(2, 1), // (2,15): error CS0518: Predefined type 'System.Boolean' is not defined or imported // record struct A Diagnostic(ErrorCode.ERR_PredefinedTypeNotFound, "A").WithArguments("System.Boolean").WithLocation(2, 15), // (2,15): error CS0518: Predefined type 'System.Boolean' is not defined or imported // record struct A Diagnostic(ErrorCode.ERR_PredefinedTypeNotFound, "A").WithArguments("System.Boolean").WithLocation(2, 15), // (2,15): error CS0518: Predefined type 'System.Boolean' is not defined or imported // record struct A Diagnostic(ErrorCode.ERR_PredefinedTypeNotFound, "A").WithArguments("System.Boolean").WithLocation(2, 15), // (2,15): error CS0518: Predefined type 'System.Boolean' is not defined or imported // record struct A Diagnostic(ErrorCode.ERR_PredefinedTypeNotFound, "A").WithArguments("System.Boolean").WithLocation(2, 15), // (4,12): error CS0518: Predefined type 'System.Boolean' is not defined or imported // public bool Equals(A other) Diagnostic(ErrorCode.ERR_PredefinedTypeNotFound, "bool").WithArguments("System.Boolean").WithLocation(4, 12), // (4,17): warning CS8851: 'A' defines 'Equals' but not 'GetHashCode' // public bool Equals(A other) Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("A").WithLocation(4, 17) ); } [Fact] public void RecordEquals_19() { var source = @" record struct A { public static bool Equals(A x) => throw null; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (2,15): error CS0736: 'A' does not implement interface member 'IEquatable<A>.Equals(A)'. 'A.Equals(A)' cannot implement an interface member because it is static. // record struct A Diagnostic(ErrorCode.ERR_CloseUnimplementedInterfaceMemberStatic, "A").WithArguments("A", "System.IEquatable<A>.Equals(A)", "A.Equals(A)").WithLocation(2, 15), // (4,24): error CS8877: Record member 'A.Equals(A)' may not be static. // public static bool Equals(A x) => throw null; Diagnostic(ErrorCode.ERR_StaticAPIInRecord, "Equals").WithArguments("A.Equals(A)").WithLocation(4, 24), // (4,24): warning CS8851: 'A' defines 'Equals' but not 'GetHashCode' // public static bool Equals(A x) => throw null; Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("A").WithLocation(4, 24) ); } [Fact] public void RecordEquals_RecordEqualsInValueType() { var src = @" public record struct A; namespace System { public class Object { public virtual bool Equals(object x) => throw null; public virtual int GetHashCode() => throw null; public virtual string ToString() => throw null; } public class Exception { } public class ValueType { public bool Equals(A x) => throw null; } public class Attribute { } public class String { } public struct Void { } public struct Boolean { } public struct Char { } public struct Int32 { } public interface IEquatable<T> { } } namespace System.Collections.Generic { public abstract class EqualityComparer<T> { public static EqualityComparer<T> Default => throw null; public abstract int GetHashCode(T t); } } namespace System.Text { public class StringBuilder { public StringBuilder Append(string s) => null; public StringBuilder Append(char c) => null; public StringBuilder Append(object o) => null; } } "; var comp = CreateEmptyCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics( // warning CS8021: No value for RuntimeMetadataVersion found. No assembly containing System.Object was found nor was a value for RuntimeMetadataVersion specified through options. Diagnostic(ErrorCode.WRN_NoRuntimeMetadataVersion).WithLocation(1, 1) ); var recordEquals = comp.GetMembers("A.Equals").OfType<SynthesizedRecordEquals>().Single(); Assert.Equal("readonly System.Boolean A.Equals(A other)", recordEquals.ToTestDisplayString()); } [Fact] public void RecordEquals_FourFields() { var source = @" A a1 = new A(1, ""hello""); System.Console.Write(a1.Equals(a1)); System.Console.Write(a1.Equals((object)a1)); System.Console.Write("" - ""); A a2 = new A(1, ""hello"") { fieldI = 100 }; System.Console.Write(a1.Equals(a2)); System.Console.Write(a1.Equals((object)a2)); System.Console.Write(a2.Equals(a1)); System.Console.Write(a2.Equals((object)a1)); System.Console.Write("" - ""); A a3 = new A(1, ""world""); System.Console.Write(a1.Equals(a3)); System.Console.Write(a1.Equals((object)a3)); System.Console.Write(a3.Equals(a1)); System.Console.Write(a3.Equals((object)a1)); record struct A(int I, string S) { public int fieldI = 42; public string fieldS = ""hello""; } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "TrueTrue - FalseFalseFalseFalse - FalseFalseFalseFalse"); verifier.VerifyIL("A.Equals(A)", @" { // Code size 97 (0x61) .maxstack 3 IL_0000: call ""System.Collections.Generic.EqualityComparer<int> System.Collections.Generic.EqualityComparer<int>.Default.get"" IL_0005: ldarg.0 IL_0006: ldfld ""int A.<I>k__BackingField"" IL_000b: ldarg.1 IL_000c: ldfld ""int A.<I>k__BackingField"" IL_0011: callvirt ""bool System.Collections.Generic.EqualityComparer<int>.Equals(int, int)"" IL_0016: brfalse.s IL_005f IL_0018: call ""System.Collections.Generic.EqualityComparer<string> System.Collections.Generic.EqualityComparer<string>.Default.get"" IL_001d: ldarg.0 IL_001e: ldfld ""string A.<S>k__BackingField"" IL_0023: ldarg.1 IL_0024: ldfld ""string A.<S>k__BackingField"" IL_0029: callvirt ""bool System.Collections.Generic.EqualityComparer<string>.Equals(string, string)"" IL_002e: brfalse.s IL_005f IL_0030: call ""System.Collections.Generic.EqualityComparer<int> System.Collections.Generic.EqualityComparer<int>.Default.get"" IL_0035: ldarg.0 IL_0036: ldfld ""int A.fieldI"" IL_003b: ldarg.1 IL_003c: ldfld ""int A.fieldI"" IL_0041: callvirt ""bool System.Collections.Generic.EqualityComparer<int>.Equals(int, int)"" IL_0046: brfalse.s IL_005f IL_0048: call ""System.Collections.Generic.EqualityComparer<string> System.Collections.Generic.EqualityComparer<string>.Default.get"" IL_004d: ldarg.0 IL_004e: ldfld ""string A.fieldS"" IL_0053: ldarg.1 IL_0054: ldfld ""string A.fieldS"" IL_0059: callvirt ""bool System.Collections.Generic.EqualityComparer<string>.Equals(string, string)"" IL_005e: ret IL_005f: ldc.i4.0 IL_0060: ret }"); verifier.VerifyIL("A.Equals(object)", @" { // Code size 23 (0x17) .maxstack 2 IL_0000: ldarg.1 IL_0001: isinst ""A"" IL_0006: brfalse.s IL_0015 IL_0008: ldarg.0 IL_0009: ldarg.1 IL_000a: unbox.any ""A"" IL_000f: call ""readonly bool A.Equals(A)"" IL_0014: ret IL_0015: ldc.i4.0 IL_0016: ret }"); verifier.VerifyIL("A.GetHashCode()", @" { // Code size 86 (0x56) .maxstack 3 IL_0000: call ""System.Collections.Generic.EqualityComparer<int> System.Collections.Generic.EqualityComparer<int>.Default.get"" IL_0005: ldarg.0 IL_0006: ldfld ""int A.<I>k__BackingField"" IL_000b: callvirt ""int System.Collections.Generic.EqualityComparer<int>.GetHashCode(int)"" IL_0010: ldc.i4 0xa5555529 IL_0015: mul IL_0016: call ""System.Collections.Generic.EqualityComparer<string> System.Collections.Generic.EqualityComparer<string>.Default.get"" IL_001b: ldarg.0 IL_001c: ldfld ""string A.<S>k__BackingField"" IL_0021: callvirt ""int System.Collections.Generic.EqualityComparer<string>.GetHashCode(string)"" IL_0026: add IL_0027: ldc.i4 0xa5555529 IL_002c: mul IL_002d: call ""System.Collections.Generic.EqualityComparer<int> System.Collections.Generic.EqualityComparer<int>.Default.get"" IL_0032: ldarg.0 IL_0033: ldfld ""int A.fieldI"" IL_0038: callvirt ""int System.Collections.Generic.EqualityComparer<int>.GetHashCode(int)"" IL_003d: add IL_003e: ldc.i4 0xa5555529 IL_0043: mul IL_0044: call ""System.Collections.Generic.EqualityComparer<string> System.Collections.Generic.EqualityComparer<string>.Default.get"" IL_0049: ldarg.0 IL_004a: ldfld ""string A.fieldS"" IL_004f: callvirt ""int System.Collections.Generic.EqualityComparer<string>.GetHashCode(string)"" IL_0054: add IL_0055: ret }"); } [Fact] public void RecordEquals_StaticField() { var source = @" record struct A { public static int field = 42; } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp); verifier.VerifyIL("A.Equals(A)", @" { // Code size 2 (0x2) .maxstack 1 IL_0000: ldc.i4.1 IL_0001: ret }"); verifier.VerifyIL("A.GetHashCode()", @" { // Code size 2 (0x2) .maxstack 1 IL_0000: ldc.i4.0 IL_0001: ret }"); } [Fact] public void RecordEquals_GeneratedAsReadOnly() { var src = @" record struct A(int I, string S); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var recordEquals = comp.GetMembers("A.Equals").OfType<SynthesizedRecordEquals>().Single(); Assert.True(recordEquals.IsDeclaredReadOnly); } [Fact] public void ObjectEquals_06() { var source = @" record struct A { public static new bool Equals(object obj) => throw null; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,28): error CS0111: Type 'A' already defines a member called 'Equals' with the same parameter types // public static new bool Equals(object obj) => throw null; Diagnostic(ErrorCode.ERR_MemberAlreadyExists, "Equals").WithArguments("Equals", "A").WithLocation(4, 28) ); } [Fact] public void ObjectEquals_UserDefined() { var source = @" record struct A { public override bool Equals(object obj) => throw null; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,26): error CS0111: Type 'A' already defines a member called 'Equals' with the same parameter types // public override bool Equals(object obj) => throw null; Diagnostic(ErrorCode.ERR_MemberAlreadyExists, "Equals").WithArguments("Equals", "A").WithLocation(4, 26) ); } [Fact] public void ObjectEquals_GeneratedAsReadOnly() { var src = @" record struct A(int I, string S); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var objectEquals = comp.GetMembers("A.Equals").OfType<SynthesizedRecordObjEquals>().Single(); Assert.True(objectEquals.IsDeclaredReadOnly); } [Fact] public void GetHashCode_UserDefined() { var source = @" System.Console.Write(new A().GetHashCode()); record struct A { public override int GetHashCode() => 42; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics(); CompileAndVerify(comp, expectedOutput: "42"); } [Fact] public void GetHashCode_GetHashCodeInValueType() { var src = @" public record struct A; namespace System { public class Object { public virtual bool Equals(object x) => throw null; public virtual string ToString() => throw null; } public class Exception { } public class ValueType { public virtual int GetHashCode() => throw null; } public class Attribute { } public class String { } public struct Void { } public struct Boolean { } public struct Char { } public struct Int32 { } public interface IEquatable<T> { } } namespace System.Collections.Generic { public abstract class EqualityComparer<T> { public static EqualityComparer<T> Default => throw null; public abstract int GetHashCode(T t); } } namespace System.Text { public class StringBuilder { public StringBuilder Append(string s) => null; public StringBuilder Append(char c) => null; public StringBuilder Append(object o) => null; } } "; var comp = CreateEmptyCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics( // warning CS8021: No value for RuntimeMetadataVersion found. No assembly containing System.Object was found nor was a value for RuntimeMetadataVersion specified through options. Diagnostic(ErrorCode.WRN_NoRuntimeMetadataVersion).WithLocation(1, 1), // (2,22): error CS8869: 'A.GetHashCode()' does not override expected method from 'object'. // public record struct A; Diagnostic(ErrorCode.ERR_DoesNotOverrideMethodFromObject, "A").WithArguments("A.GetHashCode()").WithLocation(2, 22) ); } [Fact] public void GetHashCode_MissingEqualityComparer_EmptyRecord() { var src = @" public record struct A; "; var comp = CreateCompilation(src); comp.MakeTypeMissing(WellKnownType.System_Collections_Generic_EqualityComparer_T); comp.VerifyEmitDiagnostics(); } [Fact] public void GetHashCode_MissingEqualityComparer_NonEmptyRecord() { var src = @" public record struct A(int I); "; var comp = CreateCompilation(src); comp.MakeTypeMissing(WellKnownType.System_Collections_Generic_EqualityComparer_T); comp.VerifyEmitDiagnostics( // (2,1): error CS0656: Missing compiler required member 'System.Collections.Generic.EqualityComparer`1.GetHashCode' // public record struct A(int I); Diagnostic(ErrorCode.ERR_MissingPredefinedMember, "public record struct A(int I);").WithArguments("System.Collections.Generic.EqualityComparer`1", "GetHashCode").WithLocation(2, 1), // (2,1): error CS0656: Missing compiler required member 'System.Collections.Generic.EqualityComparer`1.get_Default' // public record struct A(int I); Diagnostic(ErrorCode.ERR_MissingPredefinedMember, "public record struct A(int I);").WithArguments("System.Collections.Generic.EqualityComparer`1", "get_Default").WithLocation(2, 1) ); } [Fact] public void GetHashCode_GeneratedAsReadOnly() { var src = @" record struct A(int I, string S); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var method = comp.GetMember<SynthesizedRecordGetHashCode>("A.GetHashCode"); Assert.True(method.IsDeclaredReadOnly); } [Fact] public void GetHashCodeIsDefinedButEqualsIsNot() { var src = @" public record struct C { public object Data; public override int GetHashCode() { return 0; } }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); } [Fact] public void EqualsIsDefinedButGetHashCodeIsNot() { var src = @" public record struct C { public object Data; public bool Equals(C c) { return false; } }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (5,17): warning CS8851: 'C' defines 'Equals' but not 'GetHashCode' // public bool Equals(C c) { return false; } Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("C").WithLocation(5, 17)); } [Fact] public void EqualityOperators_01() { var source = @" record struct A(int X) { public bool Equals(ref A other) => throw null; static void Main() { Test(default, default); Test(default, new A(0)); Test(new A(1), new A(1)); Test(new A(2), new A(3)); var a = new A(11); Test(a, a); } static void Test(A a1, A a2) { System.Console.WriteLine(""{0} {1} {2} {3}"", a1 == a2, a2 == a1, a1 != a2, a2 != a1); } } "; var verifier = CompileAndVerify(source, expectedOutput: @" True True False False True True False False True True False False False False True True True True False False ").VerifyDiagnostics(); var comp = (CSharpCompilation)verifier.Compilation; MethodSymbol op = comp.GetMembers("A." + WellKnownMemberNames.EqualityOperatorName).OfType<SynthesizedRecordEqualityOperator>().Single(); Assert.Equal("System.Boolean A.op_Equality(A left, A right)", op.ToTestDisplayString()); Assert.Equal(Accessibility.Public, op.DeclaredAccessibility); Assert.True(op.IsStatic); Assert.False(op.IsAbstract); Assert.False(op.IsVirtual); Assert.False(op.IsOverride); Assert.False(op.IsSealed); Assert.True(op.IsImplicitlyDeclared); op = comp.GetMembers("A." + WellKnownMemberNames.InequalityOperatorName).OfType<SynthesizedRecordInequalityOperator>().Single(); Assert.Equal("System.Boolean A.op_Inequality(A left, A right)", op.ToTestDisplayString()); Assert.Equal(Accessibility.Public, op.DeclaredAccessibility); Assert.True(op.IsStatic); Assert.False(op.IsAbstract); Assert.False(op.IsVirtual); Assert.False(op.IsOverride); Assert.False(op.IsSealed); Assert.True(op.IsImplicitlyDeclared); verifier.VerifyIL("bool A.op_Equality(A, A)", @" { // Code size 9 (0x9) .maxstack 2 IL_0000: ldarga.s V_0 IL_0002: ldarg.1 IL_0003: call ""readonly bool A.Equals(A)"" IL_0008: ret } "); verifier.VerifyIL("bool A.op_Inequality(A, A)", @" { // Code size 11 (0xb) .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call ""bool A.op_Equality(A, A)"" IL_0007: ldc.i4.0 IL_0008: ceq IL_000a: ret } "); } [Fact] public void EqualityOperators_03() { var source = @" record struct A { public static bool operator==(A r1, A r2) => throw null; public static bool operator==(A r1, string r2) => throw null; public static bool operator!=(A r1, string r2) => throw null; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,32): error CS0111: Type 'A' already defines a member called 'op_Equality' with the same parameter types // public static bool operator==(A r1, A r2) Diagnostic(ErrorCode.ERR_MemberAlreadyExists, "==").WithArguments("op_Equality", "A").WithLocation(4, 32) ); } [Fact] public void EqualityOperators_04() { var source = @" record struct A { public static bool operator!=(A r1, A r2) => throw null; public static bool operator!=(string r1, A r2) => throw null; public static bool operator==(string r1, A r2) => throw null; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,32): error CS0111: Type 'A' already defines a member called 'op_Inequality' with the same parameter types // public static bool operator!=(A r1, A r2) Diagnostic(ErrorCode.ERR_MemberAlreadyExists, "!=").WithArguments("op_Inequality", "A").WithLocation(4, 32) ); } [Fact] public void EqualityOperators_05() { var source = @" record struct A { public static bool op_Equality(A r1, A r2) => throw null; public static bool op_Equality(string r1, A r2) => throw null; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,24): error CS0111: Type 'A' already defines a member called 'op_Equality' with the same parameter types // public static bool op_Equality(A r1, A r2) Diagnostic(ErrorCode.ERR_MemberAlreadyExists, "op_Equality").WithArguments("op_Equality", "A").WithLocation(4, 24) ); } [Fact] public void EqualityOperators_06() { var source = @" record struct A { public static bool op_Inequality(A r1, A r2) => throw null; public static bool op_Inequality(A r1, string r2) => throw null; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (4,24): error CS0111: Type 'A' already defines a member called 'op_Inequality' with the same parameter types // public static bool op_Inequality(A r1, A r2) Diagnostic(ErrorCode.ERR_MemberAlreadyExists, "op_Inequality").WithArguments("op_Inequality", "A").WithLocation(4, 24) ); } [Fact] public void EqualityOperators_07() { var source = @" record struct A { public static bool Equals(A other) => throw null; } "; var comp = CreateCompilation(source); comp.VerifyEmitDiagnostics( // (2,15): error CS0736: 'A' does not implement interface member 'IEquatable<A>.Equals(A)'. 'A.Equals(A)' cannot implement an interface member because it is static. // record struct A Diagnostic(ErrorCode.ERR_CloseUnimplementedInterfaceMemberStatic, "A").WithArguments("A", "System.IEquatable<A>.Equals(A)", "A.Equals(A)").WithLocation(2, 15), // (4,24): error CS8877: Record member 'A.Equals(A)' may not be static. // public static bool Equals(A other) Diagnostic(ErrorCode.ERR_StaticAPIInRecord, "Equals").WithArguments("A.Equals(A)").WithLocation(4, 24), // (4,24): warning CS8851: 'A' defines 'Equals' but not 'GetHashCode' // public static bool Equals(A other) Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("A").WithLocation(4, 24) ); } [Theory] [CombinatorialData] public void EqualityOperators_09(bool useImageReference) { var source1 = @" public record struct A(int X); "; var comp1 = CreateCompilation(source1); var source2 = @" class Program { static void Main() { Test(default, default); Test(default, new A(0)); Test(new A(1), new A(1)); Test(new A(2), new A(3)); } static void Test(A a1, A a2) { System.Console.WriteLine(""{0} {1} {2} {3}"", a1 == a2, a2 == a1, a1 != a2, a2 != a1); } } "; CompileAndVerify(source2, references: new[] { useImageReference ? comp1.EmitToImageReference() : comp1.ToMetadataReference() }, expectedOutput: @" True True False False True True False False True True False False False False True True ").VerifyDiagnostics(); } [Fact] public void GetSimpleNonTypeMembers_DirectApiCheck() { var src = @" public record struct RecordB(); "; var comp = CreateCompilation(src); var b = comp.GlobalNamespace.GetTypeMember("RecordB"); AssertEx.SetEqual(new[] { "System.Boolean RecordB.op_Equality(RecordB left, RecordB right)" }, b.GetSimpleNonTypeMembers("op_Equality").ToTestDisplayStrings()); } [Fact] public void ToString_NestedRecord() { var src = @" var c1 = new Outer.C1(42); System.Console.Write(c1.ToString()); public class Outer { public record struct C1(int I1); } "; var compDebug = CreateCompilation(new[] { src, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview, options: TestOptions.DebugExe); var compRelease = CreateCompilation(new[] { src, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview, options: TestOptions.ReleaseExe); CompileAndVerify(compDebug, expectedOutput: "C1 { I1 = 42 }"); compDebug.VerifyEmitDiagnostics(); CompileAndVerify(compRelease, expectedOutput: "C1 { I1 = 42 }"); compRelease.VerifyEmitDiagnostics(); } [Fact] public void ToString_TopLevelRecord_Empty() { var src = @" var c1 = new C1(); System.Console.Write(c1.ToString()); record struct C1; "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(); var v = CompileAndVerify(comp, expectedOutput: "C1 { }"); var print = comp.GetMember<MethodSymbol>("C1." + WellKnownMemberNames.PrintMembersMethodName); Assert.Equal(Accessibility.Private, print.DeclaredAccessibility); Assert.False(print.IsOverride); Assert.False(print.IsVirtual); Assert.False(print.IsAbstract); Assert.False(print.IsSealed); Assert.True(print.IsImplicitlyDeclared); var toString = comp.GetMember<MethodSymbol>("C1." + WellKnownMemberNames.ObjectToString); Assert.Equal(Accessibility.Public, toString.DeclaredAccessibility); Assert.True(toString.IsOverride); Assert.False(toString.IsVirtual); Assert.False(toString.IsAbstract); Assert.False(toString.IsSealed); Assert.True(toString.IsImplicitlyDeclared); v.VerifyIL("C1." + WellKnownMemberNames.PrintMembersMethodName, @" { // Code size 2 (0x2) .maxstack 1 IL_0000: ldc.i4.0 IL_0001: ret } "); v.VerifyIL("C1." + WellKnownMemberNames.ObjectToString, @" { // Code size 64 (0x40) .maxstack 2 .locals init (System.Text.StringBuilder V_0) IL_0000: newobj ""System.Text.StringBuilder..ctor()"" IL_0005: stloc.0 IL_0006: ldloc.0 IL_0007: ldstr ""C1"" IL_000c: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_0011: pop IL_0012: ldloc.0 IL_0013: ldstr "" { "" IL_0018: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_001d: pop IL_001e: ldarg.0 IL_001f: ldloc.0 IL_0020: call ""readonly bool C1.PrintMembers(System.Text.StringBuilder)"" IL_0025: brfalse.s IL_0030 IL_0027: ldloc.0 IL_0028: ldc.i4.s 32 IL_002a: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(char)"" IL_002f: pop IL_0030: ldloc.0 IL_0031: ldc.i4.s 125 IL_0033: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(char)"" IL_0038: pop IL_0039: ldloc.0 IL_003a: callvirt ""string object.ToString()"" IL_003f: ret } "); } [Fact] public void ToString_TopLevelRecord_MissingStringBuilder() { var src = @" record struct C1; "; var comp = CreateCompilation(src); comp.MakeTypeMissing(WellKnownType.System_Text_StringBuilder); comp.VerifyEmitDiagnostics( // (2,1): error CS0518: Predefined type 'System.Text.StringBuilder' is not defined or imported // record struct C1; Diagnostic(ErrorCode.ERR_PredefinedTypeNotFound, "record struct C1;").WithArguments("System.Text.StringBuilder").WithLocation(2, 1), // (2,1): error CS0656: Missing compiler required member 'System.Text.StringBuilder..ctor' // record struct C1; Diagnostic(ErrorCode.ERR_MissingPredefinedMember, "record struct C1;").WithArguments("System.Text.StringBuilder", ".ctor").WithLocation(2, 1), // (2,15): error CS0518: Predefined type 'System.Text.StringBuilder' is not defined or imported // record struct C1; Diagnostic(ErrorCode.ERR_PredefinedTypeNotFound, "C1").WithArguments("System.Text.StringBuilder").WithLocation(2, 15) ); } [Fact] public void ToString_TopLevelRecord_MissingStringBuilderCtor() { var src = @" record struct C1; "; var comp = CreateCompilation(src); comp.MakeMemberMissing(WellKnownMember.System_Text_StringBuilder__ctor); comp.VerifyEmitDiagnostics( // (2,1): error CS0656: Missing compiler required member 'System.Text.StringBuilder..ctor' // record struct C1; Diagnostic(ErrorCode.ERR_MissingPredefinedMember, "record struct C1;").WithArguments("System.Text.StringBuilder", ".ctor").WithLocation(2, 1) ); } [Fact] public void ToString_TopLevelRecord_MissingStringBuilderAppendString() { var src = @" record struct C1; "; var comp = CreateCompilation(src); comp.MakeMemberMissing(WellKnownMember.System_Text_StringBuilder__AppendString); comp.VerifyEmitDiagnostics( // (2,1): error CS0656: Missing compiler required member 'System.Text.StringBuilder.Append' // record struct C1; Diagnostic(ErrorCode.ERR_MissingPredefinedMember, "record struct C1;").WithArguments("System.Text.StringBuilder", "Append").WithLocation(2, 1) ); } [Fact] public void ToString_TopLevelRecord_OneProperty_MissingStringBuilderAppendString() { var src = @" record struct C1(int P); "; var comp = CreateCompilation(src); comp.MakeMemberMissing(WellKnownMember.System_Text_StringBuilder__AppendString); comp.VerifyEmitDiagnostics( // (2,1): error CS0656: Missing compiler required member 'System.Text.StringBuilder.Append' // record struct C1(int P); Diagnostic(ErrorCode.ERR_MissingPredefinedMember, "record struct C1(int P);").WithArguments("System.Text.StringBuilder", "Append").WithLocation(2, 1), // (2,1): error CS0656: Missing compiler required member 'System.Text.StringBuilder.Append' // record struct C1(int P); Diagnostic(ErrorCode.ERR_MissingPredefinedMember, "record struct C1(int P);").WithArguments("System.Text.StringBuilder", "Append").WithLocation(2, 1) ); } [Fact] public void ToString_RecordWithIndexer() { var src = @" var c1 = new C1(42); System.Console.Write(c1.ToString()); record struct C1(int I1) { private int field = 44; public int this[int i] => 0; public int PropertyWithoutGetter { set { } } public int P2 { get => 43; } public event System.Action a = null; private int field1 = 100; internal int field2 = 100; private int Property1 { get; set; } = 100; internal int Property2 { get; set; } = 100; } "; var comp = CreateCompilation(src); CompileAndVerify(comp, expectedOutput: "C1 { I1 = 42, P2 = 43 }"); comp.VerifyEmitDiagnostics( // (7,17): warning CS0414: The field 'C1.field' is assigned but its value is never used // private int field = 44; Diagnostic(ErrorCode.WRN_UnreferencedFieldAssg, "field").WithArguments("C1.field").WithLocation(7, 17), // (11,32): warning CS0414: The field 'C1.a' is assigned but its value is never used // public event System.Action a = null; Diagnostic(ErrorCode.WRN_UnreferencedFieldAssg, "a").WithArguments("C1.a").WithLocation(11, 32), // (13,17): warning CS0414: The field 'C1.field1' is assigned but its value is never used // private int field1 = 100; Diagnostic(ErrorCode.WRN_UnreferencedFieldAssg, "field1").WithArguments("C1.field1").WithLocation(13, 17) ); } [Fact] public void ToString_PrivateGetter() { var src = @" var c1 = new C1(); System.Console.Write(c1.ToString()); record struct C1 { public int P1 { private get => 43; set => throw null; } } "; var comp = CreateCompilation(src); CompileAndVerify(comp, expectedOutput: "C1 { P1 = 43 }"); comp.VerifyEmitDiagnostics(); } [Fact] public void ToString_TopLevelRecord_OneField_ValueType() { var src = @" var c1 = new C1() { field = 42 }; System.Console.Write(c1.ToString()); record struct C1 { public int field; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(); var v = CompileAndVerify(comp, expectedOutput: "C1 { field = 42 }"); var print = comp.GetMember<MethodSymbol>("C1." + WellKnownMemberNames.PrintMembersMethodName); Assert.Equal(Accessibility.Private, print.DeclaredAccessibility); Assert.False(print.IsOverride); Assert.False(print.IsVirtual); Assert.False(print.IsAbstract); Assert.False(print.IsSealed); Assert.True(print.IsImplicitlyDeclared); var toString = comp.GetMember<MethodSymbol>("C1." + WellKnownMemberNames.ObjectToString); Assert.Equal(Accessibility.Public, toString.DeclaredAccessibility); Assert.True(toString.IsOverride); Assert.False(toString.IsVirtual); Assert.False(toString.IsAbstract); Assert.False(toString.IsSealed); Assert.True(toString.IsImplicitlyDeclared); v.VerifyIL("C1." + WellKnownMemberNames.PrintMembersMethodName, @" { // Code size 38 (0x26) .maxstack 2 IL_0000: ldarg.1 IL_0001: ldstr ""field = "" IL_0006: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_000b: pop IL_000c: ldarg.1 IL_000d: ldarg.0 IL_000e: ldflda ""int C1.field"" IL_0013: constrained. ""int"" IL_0019: callvirt ""string object.ToString()"" IL_001e: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_0023: pop IL_0024: ldc.i4.1 IL_0025: ret } "); } [Fact] public void ToString_TopLevelRecord_OneField_ConstrainedValueType() { var src = @" var c1 = new C1<int>() { field = 42 }; System.Console.Write(c1.ToString()); record struct C1<T> where T : struct { public T field; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(); var v = CompileAndVerify(comp, expectedOutput: "C1 { field = 42 }"); v.VerifyIL("C1<T>." + WellKnownMemberNames.PrintMembersMethodName, @" { // Code size 41 (0x29) .maxstack 2 .locals init (T V_0) IL_0000: ldarg.1 IL_0001: ldstr ""field = "" IL_0006: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_000b: pop IL_000c: ldarg.1 IL_000d: ldarg.0 IL_000e: ldfld ""T C1<T>.field"" IL_0013: stloc.0 IL_0014: ldloca.s V_0 IL_0016: constrained. ""T"" IL_001c: callvirt ""string object.ToString()"" IL_0021: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_0026: pop IL_0027: ldc.i4.1 IL_0028: ret } "); } [Fact] public void ToString_TopLevelRecord_OneField_ReferenceType() { var src = @" var c1 = new C1() { field = ""hello"" }; System.Console.Write(c1.ToString()); record struct C1 { public string field; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(); var v = CompileAndVerify(comp, expectedOutput: "C1 { field = hello }"); v.VerifyIL("C1." + WellKnownMemberNames.PrintMembersMethodName, @" { // Code size 27 (0x1b) .maxstack 2 IL_0000: ldarg.1 IL_0001: ldstr ""field = "" IL_0006: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_000b: pop IL_000c: ldarg.1 IL_000d: ldarg.0 IL_000e: ldfld ""string C1.field"" IL_0013: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(object)"" IL_0018: pop IL_0019: ldc.i4.1 IL_001a: ret } "); } [Fact] public void ToString_TopLevelRecord_TwoFields_ReferenceType() { var src = @" var c1 = new C1(42) { field1 = ""hi"", field2 = null }; System.Console.Write(c1.ToString()); record struct C1(int I) { public string field1 = null; public string field2 = null; private string field3 = null; internal string field4 = null; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (10,20): warning CS0414: The field 'C1.field3' is assigned but its value is never used // private string field3 = null; Diagnostic(ErrorCode.WRN_UnreferencedFieldAssg, "field3").WithArguments("C1.field3").WithLocation(10, 20) ); var v = CompileAndVerify(comp, expectedOutput: "C1 { I = 42, field1 = hi, field2 = }"); v.VerifyIL("C1." + WellKnownMemberNames.PrintMembersMethodName, @" { // Code size 91 (0x5b) .maxstack 2 .locals init (int V_0) IL_0000: ldarg.1 IL_0001: ldstr ""I = "" IL_0006: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_000b: pop IL_000c: ldarg.1 IL_000d: ldarg.0 IL_000e: call ""readonly int C1.I.get"" IL_0013: stloc.0 IL_0014: ldloca.s V_0 IL_0016: constrained. ""int"" IL_001c: callvirt ""string object.ToString()"" IL_0021: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_0026: pop IL_0027: ldarg.1 IL_0028: ldstr "", field1 = "" IL_002d: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_0032: pop IL_0033: ldarg.1 IL_0034: ldarg.0 IL_0035: ldfld ""string C1.field1"" IL_003a: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(object)"" IL_003f: pop IL_0040: ldarg.1 IL_0041: ldstr "", field2 = "" IL_0046: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_004b: pop IL_004c: ldarg.1 IL_004d: ldarg.0 IL_004e: ldfld ""string C1.field2"" IL_0053: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(object)"" IL_0058: pop IL_0059: ldc.i4.1 IL_005a: ret } "); } [Fact] public void ToString_TopLevelRecord_Readonly() { var src = @" var c1 = new C1(42); System.Console.Write(c1.ToString()); readonly record struct C1(int I); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var v = CompileAndVerify(comp, expectedOutput: "C1 { I = 42 }", verify: Verification.Skipped /* init-only */); v.VerifyIL("C1." + WellKnownMemberNames.PrintMembersMethodName, @" { // Code size 41 (0x29) .maxstack 2 .locals init (int V_0) IL_0000: ldarg.1 IL_0001: ldstr ""I = "" IL_0006: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_000b: pop IL_000c: ldarg.1 IL_000d: ldarg.0 IL_000e: call ""int C1.I.get"" IL_0013: stloc.0 IL_0014: ldloca.s V_0 IL_0016: constrained. ""int"" IL_001c: callvirt ""string object.ToString()"" IL_0021: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_0026: pop IL_0027: ldc.i4.1 IL_0028: ret } "); v.VerifyIL("C1." + WellKnownMemberNames.ObjectToString, @" { // Code size 64 (0x40) .maxstack 2 .locals init (System.Text.StringBuilder V_0) IL_0000: newobj ""System.Text.StringBuilder..ctor()"" IL_0005: stloc.0 IL_0006: ldloc.0 IL_0007: ldstr ""C1"" IL_000c: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_0011: pop IL_0012: ldloc.0 IL_0013: ldstr "" { "" IL_0018: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(string)"" IL_001d: pop IL_001e: ldarg.0 IL_001f: ldloc.0 IL_0020: call ""bool C1.PrintMembers(System.Text.StringBuilder)"" IL_0025: brfalse.s IL_0030 IL_0027: ldloc.0 IL_0028: ldc.i4.s 32 IL_002a: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(char)"" IL_002f: pop IL_0030: ldloc.0 IL_0031: ldc.i4.s 125 IL_0033: callvirt ""System.Text.StringBuilder System.Text.StringBuilder.Append(char)"" IL_0038: pop IL_0039: ldloc.0 IL_003a: callvirt ""string object.ToString()"" IL_003f: ret } "); } [Fact] public void ToString_TopLevelRecord_UserDefinedToString() { var src = @" var c1 = new C1(); System.Console.Write(c1.ToString()); record struct C1 { public override string ToString() => ""RAN""; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(); CompileAndVerify(comp, expectedOutput: "RAN"); var print = comp.GetMember<MethodSymbol>("C1." + WellKnownMemberNames.PrintMembersMethodName); Assert.Equal("readonly System.Boolean C1." + WellKnownMemberNames.PrintMembersMethodName + "(System.Text.StringBuilder builder)", print.ToTestDisplayString()); } [Fact] public void ToString_TopLevelRecord_UserDefinedToString_New() { var src = @" record struct C1 { public new string ToString() => throw null; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (4,23): error CS8869: 'C1.ToString()' does not override expected method from 'object'. // public new string ToString() => throw null; Diagnostic(ErrorCode.ERR_DoesNotOverrideMethodFromObject, "ToString").WithArguments("C1.ToString()").WithLocation(4, 23) ); } [Fact] public void ToString_TopLevelRecord_UserDefinedToString_Sealed() { var src = @" record struct C1 { public sealed override string ToString() => throw null; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (4,35): error CS0106: The modifier 'sealed' is not valid for this item // public sealed override string ToString() => throw null; Diagnostic(ErrorCode.ERR_BadMemberFlag, "ToString").WithArguments("sealed").WithLocation(4, 35) ); } [Fact] public void ToString_UserDefinedPrintMembers_WithNullableStringBuilder() { var src = @" #nullable enable record struct C1 { private bool PrintMembers(System.Text.StringBuilder? builder) => throw null!; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(); } [Fact] public void ToString_UserDefinedPrintMembers_ErrorReturnType() { var src = @" record struct C1 { private Error PrintMembers(System.Text.StringBuilder builder) => throw null; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (4,13): error CS0246: The type or namespace name 'Error' could not be found (are you missing a using directive or an assembly reference?) // private Error PrintMembers(System.Text.StringBuilder builder) => throw null; Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "Error").WithArguments("Error").WithLocation(4, 13) ); } [Fact] public void ToString_UserDefinedPrintMembers_WrongReturnType() { var src = @" record struct C1 { private int PrintMembers(System.Text.StringBuilder builder) => throw null; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (4,17): error CS8874: Record member 'C1.PrintMembers(StringBuilder)' must return 'bool'. // private int PrintMembers(System.Text.StringBuilder builder) => throw null; Diagnostic(ErrorCode.ERR_SignatureMismatchInRecord, "PrintMembers").WithArguments("C1.PrintMembers(System.Text.StringBuilder)", "bool").WithLocation(4, 17) ); } [Fact] public void ToString_UserDefinedPrintMembers() { var src = @" var c1 = new C1(); System.Console.Write(c1.ToString()); System.Console.Write("" - ""); c1.M(); record struct C1 { private bool PrintMembers(System.Text.StringBuilder builder) { builder.Append(""RAN""); return true; } public void M() { var builder = new System.Text.StringBuilder(); if (PrintMembers(builder)) { System.Console.Write(builder.ToString()); } } } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(); CompileAndVerify(comp, expectedOutput: "C1 { RAN } - RAN"); } [Fact] public void ToString_CallingSynthesizedPrintMembers() { var src = @" var c1 = new C1(1, 2, 3); System.Console.Write(c1.ToString()); System.Console.Write("" - ""); c1.M(); record struct C1(int I, int I2, int I3) { public void M() { var builder = new System.Text.StringBuilder(); if (PrintMembers(builder)) { System.Console.Write(builder.ToString()); } } } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(); CompileAndVerify(comp, expectedOutput: "C1 { I = 1, I2 = 2, I3 = 3 } - I = 1, I2 = 2, I3 = 3"); } [Fact] public void ToString_UserDefinedPrintMembers_WrongAccessibility() { var src = @" var c = new C1(); System.Console.Write(c.ToString()); record struct C1 { internal bool PrintMembers(System.Text.StringBuilder builder) => throw null; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (7,19): error CS8879: Record member 'C1.PrintMembers(StringBuilder)' must be private. // internal bool PrintMembers(System.Text.StringBuilder builder) => throw null; Diagnostic(ErrorCode.ERR_NonPrivateAPIInRecord, "PrintMembers").WithArguments("C1.PrintMembers(System.Text.StringBuilder)").WithLocation(7, 19) ); } [Fact] public void ToString_UserDefinedPrintMembers_Static() { var src = @" record struct C1 { static private bool PrintMembers(System.Text.StringBuilder builder) => throw null; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (4,25): error CS8877: Record member 'C1.PrintMembers(StringBuilder)' may not be static. // static private bool PrintMembers(System.Text.StringBuilder builder) => throw null; Diagnostic(ErrorCode.ERR_StaticAPIInRecord, "PrintMembers").WithArguments("C1.PrintMembers(System.Text.StringBuilder)").WithLocation(4, 25) ); } [Fact] public void ToString_GeneratedAsReadOnly() { var src = @" record struct A(int I, string S); "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var method = comp.GetMember<SynthesizedRecordToString>("A.ToString"); Assert.True(method.IsDeclaredReadOnly); } [Fact] public void ToString_WihtNonReadOnlyGetter_GeneratedAsNonReadOnly() { var src = @" record struct A(int I, string S) { public double T => 0.1; } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var method = comp.GetMember<SynthesizedRecordToString>("A.ToString"); Assert.False(method.IsDeclaredReadOnly); } [Fact] public void AmbigCtor_WithPropertyInitializer() { // Scenario causes ambiguous ctor for record class, but not record struct var src = @" record struct R(R X) { public R X { get; init; } = X; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (4,14): error CS0523: Struct member 'R.X' of type 'R' causes a cycle in the struct layout // public R X { get; init; } = X; Diagnostic(ErrorCode.ERR_StructLayoutCycle, "X").WithArguments("R.X", "R").WithLocation(4, 14) ); var tree = comp.SyntaxTrees[0]; var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); var parameterSyntax = tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().Single(); var parameter = model.GetDeclaredSymbol(parameterSyntax)!; Assert.Equal("R X", parameter.ToTestDisplayString()); Assert.Equal(SymbolKind.Parameter, parameter.Kind); Assert.Equal("R..ctor(R X)", parameter.ContainingSymbol.ToTestDisplayString()); var initializerSyntax = tree.GetRoot().DescendantNodes().OfType<EqualsValueClauseSyntax>().Single(); var initializer = model.GetSymbolInfo(initializerSyntax.Value).Symbol!; Assert.Equal("R X", initializer.ToTestDisplayString()); Assert.Equal(SymbolKind.Parameter, initializer.Kind); Assert.Equal("R..ctor(R X)", initializer.ContainingSymbol.ToTestDisplayString()); var src2 = @" record struct R(R X); "; var comp2 = CreateCompilation(src2); comp2.VerifyEmitDiagnostics( // (2,19): error CS0523: Struct member 'R.X' of type 'R' causes a cycle in the struct layout // record struct R(R X); Diagnostic(ErrorCode.ERR_StructLayoutCycle, "X").WithArguments("R.X", "R").WithLocation(2, 19) ); } [Fact] public void GetDeclaredSymbolOnAnOutLocalInPropertyInitializer() { var src = @" record struct R(int I) { public int I { get; init; } = M(out int i); static int M(out int i) => throw null; } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (2,21): warning CS8907: Parameter 'I' is unread. Did you forget to use it to initialize the property with that name? // record struct R(int I) Diagnostic(ErrorCode.WRN_UnreadRecordParameter, "I").WithArguments("I").WithLocation(2, 21) ); var tree = comp.SyntaxTrees[0]; var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); var outVarSyntax = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Single(); var outVar = model.GetDeclaredSymbol(outVarSyntax)!; Assert.Equal("System.Int32 i", outVar.ToTestDisplayString()); Assert.Equal(SymbolKind.Local, outVar.Kind); Assert.Equal("System.Int32 R.<I>k__BackingField", outVar.ContainingSymbol.ToTestDisplayString()); } [Fact] public void AnalyzerActions_01() { // Test RegisterSyntaxNodeAction var text1 = @" record struct A([Attr1]int X = 0) : I1 { private int M() => 3; A(string S) : this(4) => throw null; } interface I1 {} class Attr1 : System.Attribute {} "; var analyzer = new AnalyzerActions_01_Analyzer(); var comp = CreateCompilation(text1); comp.GetAnalyzerDiagnostics(new[] { analyzer }, null).Verify(); Assert.Equal(1, analyzer.FireCount0); Assert.Equal(1, analyzer.FireCountRecordStructDeclarationA); Assert.Equal(1, analyzer.FireCountRecordStructDeclarationACtor); Assert.Equal(1, analyzer.FireCount3); Assert.Equal(1, analyzer.FireCountSimpleBaseTypeI1onA); Assert.Equal(1, analyzer.FireCount5); Assert.Equal(1, analyzer.FireCountParameterListAPrimaryCtor); Assert.Equal(1, analyzer.FireCount7); Assert.Equal(1, analyzer.FireCountConstructorDeclaration); Assert.Equal(1, analyzer.FireCountStringParameterList); Assert.Equal(1, analyzer.FireCountThisConstructorInitializer); Assert.Equal(1, analyzer.FireCount11); Assert.Equal(1, analyzer.FireCount12); } private class AnalyzerActions_01_Analyzer : DiagnosticAnalyzer { public int FireCount0; public int FireCountRecordStructDeclarationA; public int FireCountRecordStructDeclarationACtor; public int FireCount3; public int FireCountSimpleBaseTypeI1onA; public int FireCount5; public int FireCountParameterListAPrimaryCtor; public int FireCount7; public int FireCountConstructorDeclaration; public int FireCountStringParameterList; public int FireCountThisConstructorInitializer; public int FireCount11; public int FireCount12; private static readonly DiagnosticDescriptor Descriptor = new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Descriptor); public override void Initialize(AnalysisContext context) { context.RegisterSyntaxNodeAction(Handle1, SyntaxKind.NumericLiteralExpression); context.RegisterSyntaxNodeAction(Handle2, SyntaxKind.EqualsValueClause); context.RegisterSyntaxNodeAction(Fail, SyntaxKind.BaseConstructorInitializer); context.RegisterSyntaxNodeAction(Handle3, SyntaxKind.ThisConstructorInitializer); context.RegisterSyntaxNodeAction(Handle4, SyntaxKind.ConstructorDeclaration); context.RegisterSyntaxNodeAction(Fail, SyntaxKind.PrimaryConstructorBaseType); context.RegisterSyntaxNodeAction(Handle6, SyntaxKind.RecordStructDeclaration); context.RegisterSyntaxNodeAction(Handle7, SyntaxKind.IdentifierName); context.RegisterSyntaxNodeAction(Handle8, SyntaxKind.SimpleBaseType); context.RegisterSyntaxNodeAction(Handle9, SyntaxKind.ParameterList); context.RegisterSyntaxNodeAction(Handle10, SyntaxKind.ArgumentList); } protected void Handle1(SyntaxNodeAnalysisContext context) { var literal = (LiteralExpressionSyntax)context.Node; switch (literal.ToString()) { case "0": Interlocked.Increment(ref FireCount0); Assert.Equal("A..ctor([System.Int32 X = 0])", context.ContainingSymbol.ToTestDisplayString()); break; case "3": Interlocked.Increment(ref FireCount7); Assert.Equal("System.Int32 A.M()", context.ContainingSymbol.ToTestDisplayString()); break; case "4": Interlocked.Increment(ref FireCount12); Assert.Equal("A..ctor(System.String S)", context.ContainingSymbol.ToTestDisplayString()); break; default: Assert.True(false); break; } Assert.Same(literal.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); } protected void Handle2(SyntaxNodeAnalysisContext context) { var equalsValue = (EqualsValueClauseSyntax)context.Node; switch (equalsValue.ToString()) { case "= 0": Interlocked.Increment(ref FireCount3); Assert.Equal("A..ctor([System.Int32 X = 0])", context.ContainingSymbol.ToTestDisplayString()); break; default: Assert.True(false); break; } Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); } protected void Handle3(SyntaxNodeAnalysisContext context) { var initializer = (ConstructorInitializerSyntax)context.Node; switch (initializer.ToString()) { case ": this(4)": Interlocked.Increment(ref FireCountThisConstructorInitializer); Assert.Equal("A..ctor(System.String S)", context.ContainingSymbol.ToTestDisplayString()); break; default: Assert.True(false); break; } Assert.Same(initializer.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); } protected void Handle4(SyntaxNodeAnalysisContext context) { Interlocked.Increment(ref FireCountConstructorDeclaration); Assert.Equal("A..ctor(System.String S)", context.ContainingSymbol.ToTestDisplayString()); } protected void Fail(SyntaxNodeAnalysisContext context) { Assert.True(false); } protected void Handle6(SyntaxNodeAnalysisContext context) { var record = (RecordDeclarationSyntax)context.Node; Assert.Equal(SyntaxKind.RecordStructDeclaration, record.Kind()); switch (context.ContainingSymbol.ToTestDisplayString()) { case "A": Interlocked.Increment(ref FireCountRecordStructDeclarationA); break; case "A..ctor([System.Int32 X = 0])": Interlocked.Increment(ref FireCountRecordStructDeclarationACtor); break; default: Assert.True(false); break; } Assert.Same(record.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); } protected void Handle7(SyntaxNodeAnalysisContext context) { var identifier = (IdentifierNameSyntax)context.Node; switch (identifier.Identifier.ValueText) { case "Attr1": Interlocked.Increment(ref FireCount5); Assert.Equal("A..ctor([System.Int32 X = 0])", context.ContainingSymbol.ToTestDisplayString()); break; } } protected void Handle8(SyntaxNodeAnalysisContext context) { var baseType = (SimpleBaseTypeSyntax)context.Node; switch (baseType.ToString()) { case "I1": switch (context.ContainingSymbol.ToTestDisplayString()) { case "A": Interlocked.Increment(ref FireCountSimpleBaseTypeI1onA); break; default: Assert.True(false); break; } break; case "System.Attribute": break; default: Assert.True(false); break; } } protected void Handle9(SyntaxNodeAnalysisContext context) { var parameterList = (ParameterListSyntax)context.Node; switch (parameterList.ToString()) { case "([Attr1]int X = 0)": Interlocked.Increment(ref FireCountParameterListAPrimaryCtor); Assert.Equal("A..ctor([System.Int32 X = 0])", context.ContainingSymbol.ToTestDisplayString()); break; case "(string S)": Interlocked.Increment(ref FireCountStringParameterList); Assert.Equal("A..ctor(System.String S)", context.ContainingSymbol.ToTestDisplayString()); break; case "()": break; default: Assert.True(false); break; } } protected void Handle10(SyntaxNodeAnalysisContext context) { var argumentList = (ArgumentListSyntax)context.Node; switch (argumentList.ToString()) { case "(4)": Interlocked.Increment(ref FireCount11); Assert.Equal("A..ctor(System.String S)", context.ContainingSymbol.ToTestDisplayString()); break; default: Assert.True(false); break; } } } [Fact] public void AnalyzerActions_02() { // Test RegisterSymbolAction var text1 = @" record struct A(int X = 0) {} record struct C { C(int Z = 4) {} } "; var analyzer = new AnalyzerActions_02_Analyzer(); var comp = CreateCompilation(text1); comp.GetAnalyzerDiagnostics(new[] { analyzer }, null).Verify(); Assert.Equal(1, analyzer.FireCount1); Assert.Equal(1, analyzer.FireCount2); Assert.Equal(1, analyzer.FireCount3); Assert.Equal(1, analyzer.FireCount4); Assert.Equal(1, analyzer.FireCount5); Assert.Equal(1, analyzer.FireCount6); Assert.Equal(1, analyzer.FireCount7); } private class AnalyzerActions_02_Analyzer : DiagnosticAnalyzer { public int FireCount1; public int FireCount2; public int FireCount3; public int FireCount4; public int FireCount5; public int FireCount6; public int FireCount7; private static readonly DiagnosticDescriptor Descriptor = new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Descriptor); public override void Initialize(AnalysisContext context) { context.RegisterSymbolAction(Handle, SymbolKind.Method); context.RegisterSymbolAction(Handle, SymbolKind.Property); context.RegisterSymbolAction(Handle, SymbolKind.Parameter); context.RegisterSymbolAction(Handle, SymbolKind.NamedType); } private void Handle(SymbolAnalysisContext context) { switch (context.Symbol.ToTestDisplayString()) { case "A..ctor([System.Int32 X = 0])": Interlocked.Increment(ref FireCount1); break; case "System.Int32 A.X { get; set; }": Interlocked.Increment(ref FireCount2); break; case "[System.Int32 X = 0]": Interlocked.Increment(ref FireCount3); break; case "C..ctor([System.Int32 Z = 4])": Interlocked.Increment(ref FireCount4); break; case "[System.Int32 Z = 4]": Interlocked.Increment(ref FireCount5); break; case "A": Interlocked.Increment(ref FireCount6); break; case "C": Interlocked.Increment(ref FireCount7); break; case "System.Runtime.CompilerServices.IsExternalInit": break; default: Assert.True(false); break; } } } [Fact] public void AnalyzerActions_03() { // Test RegisterSymbolStartAction var text1 = @" readonly record struct A(int X = 0) {} readonly record struct C { C(int Z = 4) {} } "; var analyzer = new AnalyzerActions_03_Analyzer(); var comp = CreateCompilation(text1); comp.GetAnalyzerDiagnostics(new[] { analyzer }, null).Verify(); Assert.Equal(1, analyzer.FireCount1); Assert.Equal(1, analyzer.FireCount2); Assert.Equal(0, analyzer.FireCount3); Assert.Equal(1, analyzer.FireCount4); Assert.Equal(0, analyzer.FireCount5); Assert.Equal(1, analyzer.FireCount6); Assert.Equal(1, analyzer.FireCount7); Assert.Equal(1, analyzer.FireCount8); Assert.Equal(1, analyzer.FireCount9); Assert.Equal(1, analyzer.FireCount10); Assert.Equal(1, analyzer.FireCount11); Assert.Equal(1, analyzer.FireCount12); } private class AnalyzerActions_03_Analyzer : DiagnosticAnalyzer { public int FireCount1; public int FireCount2; public int FireCount3; public int FireCount4; public int FireCount5; public int FireCount6; public int FireCount7; public int FireCount8; public int FireCount9; public int FireCount10; public int FireCount11; public int FireCount12; private static readonly DiagnosticDescriptor Descriptor = new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Descriptor); public override void Initialize(AnalysisContext context) { context.RegisterSymbolStartAction(Handle1, SymbolKind.Method); context.RegisterSymbolStartAction(Handle1, SymbolKind.Property); context.RegisterSymbolStartAction(Handle1, SymbolKind.Parameter); context.RegisterSymbolStartAction(Handle1, SymbolKind.NamedType); } private void Handle1(SymbolStartAnalysisContext context) { switch (context.Symbol.ToTestDisplayString()) { case "A..ctor([System.Int32 X = 0])": Interlocked.Increment(ref FireCount1); context.RegisterSymbolEndAction(Handle2); break; case "System.Int32 A.X { get; init; }": Interlocked.Increment(ref FireCount2); context.RegisterSymbolEndAction(Handle3); break; case "[System.Int32 X = 0]": Interlocked.Increment(ref FireCount3); break; case "C..ctor([System.Int32 Z = 4])": Interlocked.Increment(ref FireCount4); context.RegisterSymbolEndAction(Handle4); break; case "[System.Int32 Z = 4]": Interlocked.Increment(ref FireCount5); break; case "A": Interlocked.Increment(ref FireCount9); Assert.Equal(0, FireCount1); Assert.Equal(0, FireCount2); Assert.Equal(0, FireCount6); Assert.Equal(0, FireCount7); context.RegisterSymbolEndAction(Handle5); break; case "C": Interlocked.Increment(ref FireCount10); Assert.Equal(0, FireCount4); Assert.Equal(0, FireCount8); context.RegisterSymbolEndAction(Handle6); break; case "System.Runtime.CompilerServices.IsExternalInit": break; default: Assert.True(false); break; } } private void Handle2(SymbolAnalysisContext context) { Assert.Equal("A..ctor([System.Int32 X = 0])", context.Symbol.ToTestDisplayString()); Interlocked.Increment(ref FireCount6); } private void Handle3(SymbolAnalysisContext context) { Assert.Equal("System.Int32 A.X { get; init; }", context.Symbol.ToTestDisplayString()); Interlocked.Increment(ref FireCount7); } private void Handle4(SymbolAnalysisContext context) { Assert.Equal("C..ctor([System.Int32 Z = 4])", context.Symbol.ToTestDisplayString()); Interlocked.Increment(ref FireCount8); } private void Handle5(SymbolAnalysisContext context) { Assert.Equal("A", context.Symbol.ToTestDisplayString()); Interlocked.Increment(ref FireCount11); Assert.Equal(1, FireCount1); Assert.Equal(1, FireCount2); Assert.Equal(1, FireCount6); Assert.Equal(1, FireCount7); } private void Handle6(SymbolAnalysisContext context) { Assert.Equal("C", context.Symbol.ToTestDisplayString()); Interlocked.Increment(ref FireCount12); Assert.Equal(1, FireCount4); Assert.Equal(1, FireCount8); } } [Fact] public void AnalyzerActions_04() { // Test RegisterOperationAction var text1 = @" record struct A([Attr1(100)]int X = 0) : I1 {} interface I1 {} "; var analyzer = new AnalyzerActions_04_Analyzer(); var comp = CreateCompilation(text1); comp.GetAnalyzerDiagnostics(new[] { analyzer }, null).Verify(); Assert.Equal(0, analyzer.FireCount1); Assert.Equal(1, analyzer.FireCount6); Assert.Equal(1, analyzer.FireCount7); Assert.Equal(1, analyzer.FireCount14); } private class AnalyzerActions_04_Analyzer : DiagnosticAnalyzer { public int FireCount1; public int FireCount6; public int FireCount7; public int FireCount14; private static readonly DiagnosticDescriptor Descriptor = new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Descriptor); public override void Initialize(AnalysisContext context) { context.RegisterOperationAction(HandleConstructorBody, OperationKind.ConstructorBody); context.RegisterOperationAction(HandleInvocation, OperationKind.Invocation); context.RegisterOperationAction(HandleLiteral, OperationKind.Literal); context.RegisterOperationAction(HandleParameterInitializer, OperationKind.ParameterInitializer); context.RegisterOperationAction(Fail, OperationKind.PropertyInitializer); context.RegisterOperationAction(Fail, OperationKind.FieldInitializer); } protected void HandleConstructorBody(OperationAnalysisContext context) { switch (context.ContainingSymbol.ToTestDisplayString()) { case "A..ctor([System.Int32 X = 0])": Interlocked.Increment(ref FireCount1); Assert.Equal(SyntaxKind.RecordDeclaration, context.Operation.Syntax.Kind()); VerifyOperationTree((CSharpCompilation)context.Compilation, context.Operation, @""); break; default: Assert.True(false); break; } } protected void HandleInvocation(OperationAnalysisContext context) { Assert.True(false); } protected void HandleLiteral(OperationAnalysisContext context) { switch (context.Operation.Syntax.ToString()) { case "100": Assert.Equal("A..ctor([System.Int32 X = 0])", context.ContainingSymbol.ToTestDisplayString()); Interlocked.Increment(ref FireCount6); break; case "0": Assert.Equal("A..ctor([System.Int32 X = 0])", context.ContainingSymbol.ToTestDisplayString()); Interlocked.Increment(ref FireCount7); break; default: Assert.True(false); break; } } protected void HandleParameterInitializer(OperationAnalysisContext context) { switch (context.Operation.Syntax.ToString()) { case "= 0": Assert.Equal("A..ctor([System.Int32 X = 0])", context.ContainingSymbol.ToTestDisplayString()); Interlocked.Increment(ref FireCount14); break; default: Assert.True(false); break; } } protected void Fail(OperationAnalysisContext context) { Assert.True(false); } } [Fact] public void AnalyzerActions_05() { // Test RegisterOperationBlockAction var text1 = @" record struct A([Attr1(100)]int X = 0) : I1 {} interface I1 {} "; var analyzer = new AnalyzerActions_05_Analyzer(); var comp = CreateCompilation(text1); comp.GetAnalyzerDiagnostics(new[] { analyzer }, null).Verify(); Assert.Equal(1, analyzer.FireCount1); } private class AnalyzerActions_05_Analyzer : DiagnosticAnalyzer { public int FireCount1; private static readonly DiagnosticDescriptor Descriptor = new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Descriptor); public override void Initialize(AnalysisContext context) { context.RegisterOperationBlockAction(Handle); } private void Handle(OperationBlockAnalysisContext context) { switch (context.OwningSymbol.ToTestDisplayString()) { case "A..ctor([System.Int32 X = 0])": Interlocked.Increment(ref FireCount1); Assert.Equal(2, context.OperationBlocks.Length); Assert.Equal(OperationKind.ParameterInitializer, context.OperationBlocks[0].Kind); Assert.Equal("= 0", context.OperationBlocks[0].Syntax.ToString()); Assert.Equal(OperationKind.None, context.OperationBlocks[1].Kind); Assert.Equal("Attr1(100)", context.OperationBlocks[1].Syntax.ToString()); break; default: Assert.True(false); break; } } } [Fact] public void AnalyzerActions_07() { // Test RegisterCodeBlockAction var text1 = @" record struct A([Attr1(100)]int X = 0) : I1 { int M() => 3; } interface I1 {} "; var analyzer = new AnalyzerActions_07_Analyzer(); var comp = CreateCompilation(text1); comp.GetAnalyzerDiagnostics(new[] { analyzer }, null).Verify(); Assert.Equal(1, analyzer.FireCount1); Assert.Equal(1, analyzer.FireCount4); } private class AnalyzerActions_07_Analyzer : DiagnosticAnalyzer { public int FireCount1; public int FireCount4; private static readonly DiagnosticDescriptor Descriptor = new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Descriptor); public override void Initialize(AnalysisContext context) { context.RegisterCodeBlockAction(Handle); } private void Handle(CodeBlockAnalysisContext context) { switch (context.OwningSymbol.ToTestDisplayString()) { case "A..ctor([System.Int32 X = 0])": switch (context.CodeBlock) { case RecordDeclarationSyntax { Identifier: { ValueText: "A" } }: Interlocked.Increment(ref FireCount1); break; default: Assert.True(false); break; } break; case "System.Int32 A.M()": switch (context.CodeBlock) { case MethodDeclarationSyntax { Identifier: { ValueText: "M" } }: Interlocked.Increment(ref FireCount4); break; default: Assert.True(false); break; } break; default: Assert.True(false); break; } } } [Fact] public void AnalyzerActions_08() { // Test RegisterCodeBlockStartAction var text1 = @" record struct A([Attr1]int X = 0) : I1 { private int M() => 3; A(string S) : this(4) => throw null; } interface I1 {} "; var analyzer = new AnalyzerActions_08_Analyzer(); var comp = CreateCompilation(text1); comp.GetAnalyzerDiagnostics(new[] { analyzer }, null).Verify(); Assert.Equal(1, analyzer.FireCount100); Assert.Equal(1, analyzer.FireCount400); Assert.Equal(1, analyzer.FireCount500); Assert.Equal(1, analyzer.FireCount0); Assert.Equal(0, analyzer.FireCountRecordStructDeclarationA); Assert.Equal(0, analyzer.FireCountRecordStructDeclarationACtor); Assert.Equal(1, analyzer.FireCount3); Assert.Equal(0, analyzer.FireCountSimpleBaseTypeI1onA); Assert.Equal(1, analyzer.FireCount5); Assert.Equal(0, analyzer.FireCountParameterListAPrimaryCtor); Assert.Equal(1, analyzer.FireCount7); Assert.Equal(0, analyzer.FireCountConstructorDeclaration); Assert.Equal(0, analyzer.FireCountStringParameterList); Assert.Equal(1, analyzer.FireCountThisConstructorInitializer); Assert.Equal(1, analyzer.FireCount11); Assert.Equal(1, analyzer.FireCount12); Assert.Equal(1, analyzer.FireCount1000); Assert.Equal(1, analyzer.FireCount4000); Assert.Equal(1, analyzer.FireCount5000); } private class AnalyzerActions_08_Analyzer : AnalyzerActions_01_Analyzer { public int FireCount100; public int FireCount400; public int FireCount500; public int FireCount1000; public int FireCount4000; public int FireCount5000; private static readonly DiagnosticDescriptor Descriptor = new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Descriptor); public override void Initialize(AnalysisContext context) { context.RegisterCodeBlockStartAction<SyntaxKind>(Handle); } private void Handle(CodeBlockStartAnalysisContext<SyntaxKind> context) { switch (context.OwningSymbol.ToTestDisplayString()) { case "A..ctor([System.Int32 X = 0])": switch (context.CodeBlock) { case RecordDeclarationSyntax { Identifier: { ValueText: "A" } }: Interlocked.Increment(ref FireCount100); break; default: Assert.True(false); break; } break; case "System.Int32 A.M()": switch (context.CodeBlock) { case MethodDeclarationSyntax { Identifier: { ValueText: "M" } }: Interlocked.Increment(ref FireCount400); break; default: Assert.True(false); break; } break; case "A..ctor(System.String S)": switch (context.CodeBlock) { case ConstructorDeclarationSyntax { Identifier: { ValueText: "A" } }: Interlocked.Increment(ref FireCount500); break; default: Assert.True(false); break; } break; default: Assert.True(false); break; } context.RegisterSyntaxNodeAction(Handle1, SyntaxKind.NumericLiteralExpression); context.RegisterSyntaxNodeAction(Handle2, SyntaxKind.EqualsValueClause); context.RegisterSyntaxNodeAction(Fail, SyntaxKind.BaseConstructorInitializer); context.RegisterSyntaxNodeAction(Handle3, SyntaxKind.ThisConstructorInitializer); context.RegisterSyntaxNodeAction(Handle4, SyntaxKind.ConstructorDeclaration); context.RegisterSyntaxNodeAction(Fail, SyntaxKind.PrimaryConstructorBaseType); context.RegisterSyntaxNodeAction(Handle6, SyntaxKind.RecordStructDeclaration); context.RegisterSyntaxNodeAction(Handle7, SyntaxKind.IdentifierName); context.RegisterSyntaxNodeAction(Handle8, SyntaxKind.SimpleBaseType); context.RegisterSyntaxNodeAction(Handle9, SyntaxKind.ParameterList); context.RegisterSyntaxNodeAction(Handle10, SyntaxKind.ArgumentList); context.RegisterCodeBlockEndAction(Handle11); } private void Handle11(CodeBlockAnalysisContext context) { switch (context.OwningSymbol.ToTestDisplayString()) { case "A..ctor([System.Int32 X = 0])": switch (context.CodeBlock) { case RecordDeclarationSyntax { Identifier: { ValueText: "A" } }: Interlocked.Increment(ref FireCount1000); break; default: Assert.True(false); break; } break; case "System.Int32 A.M()": switch (context.CodeBlock) { case MethodDeclarationSyntax { Identifier: { ValueText: "M" } }: Interlocked.Increment(ref FireCount4000); break; default: Assert.True(false); break; } break; case "A..ctor(System.String S)": switch (context.CodeBlock) { case ConstructorDeclarationSyntax { Identifier: { ValueText: "A" } }: Interlocked.Increment(ref FireCount5000); break; default: Assert.True(false); break; } break; default: Assert.True(false); break; } } } [Fact] public void AnalyzerActions_09() { var text1 = @" record A([Attr1(100)]int X = 0) : I1 {} record B([Attr2(200)]int Y = 1) : A(2), I1 { int M() => 3; } record C : A, I1 { C([Attr3(300)]int Z = 4) : base(5) {} } interface I1 {} "; var analyzer = new AnalyzerActions_09_Analyzer(); var comp = CreateCompilation(text1); comp.GetAnalyzerDiagnostics(new[] { analyzer }, null).Verify(); Assert.Equal(1, analyzer.FireCount1); Assert.Equal(1, analyzer.FireCount2); Assert.Equal(1, analyzer.FireCount3); Assert.Equal(1, analyzer.FireCount4); Assert.Equal(1, analyzer.FireCount5); Assert.Equal(1, analyzer.FireCount6); Assert.Equal(1, analyzer.FireCount7); Assert.Equal(1, analyzer.FireCount8); Assert.Equal(1, analyzer.FireCount9); } private class AnalyzerActions_09_Analyzer : DiagnosticAnalyzer { public int FireCount1; public int FireCount2; public int FireCount3; public int FireCount4; public int FireCount5; public int FireCount6; public int FireCount7; public int FireCount8; public int FireCount9; private static readonly DiagnosticDescriptor Descriptor = new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Descriptor); public override void Initialize(AnalysisContext context) { context.RegisterSymbolAction(Handle1, SymbolKind.Method); context.RegisterSymbolAction(Handle2, SymbolKind.Property); context.RegisterSymbolAction(Handle3, SymbolKind.Parameter); } private void Handle1(SymbolAnalysisContext context) { switch (context.Symbol.ToTestDisplayString()) { case "A..ctor([System.Int32 X = 0])": Interlocked.Increment(ref FireCount1); break; case "B..ctor([System.Int32 Y = 1])": Interlocked.Increment(ref FireCount2); break; case "C..ctor([System.Int32 Z = 4])": Interlocked.Increment(ref FireCount3); break; case "System.Int32 B.M()": Interlocked.Increment(ref FireCount4); break; default: Assert.True(false); break; } } private void Handle2(SymbolAnalysisContext context) { switch (context.Symbol.ToTestDisplayString()) { case "System.Int32 A.X { get; init; }": Interlocked.Increment(ref FireCount5); break; case "System.Int32 B.Y { get; init; }": Interlocked.Increment(ref FireCount6); break; default: Assert.True(false); break; } } private void Handle3(SymbolAnalysisContext context) { switch (context.Symbol.ToTestDisplayString()) { case "[System.Int32 X = 0]": Interlocked.Increment(ref FireCount7); break; case "[System.Int32 Y = 1]": Interlocked.Increment(ref FireCount8); break; case "[System.Int32 Z = 4]": Interlocked.Increment(ref FireCount9); break; default: Assert.True(false); break; } } } [Fact] public void WithExprOnStruct_LangVersion() { var src = @" var b = new B() { X = 1 }; var b2 = b.M(); System.Console.Write(b2.X); System.Console.Write("" ""); System.Console.Write(b.X); public struct B { public int X { get; set; } public B M() /*<bind>*/{ return this with { X = 42 }; }/*</bind>*/ }"; var comp = CreateCompilation(src, parseOptions: TestOptions.Regular9); comp.VerifyEmitDiagnostics( // (13,16): error CS8773: Feature 'with on structs' is not available in C# 9.0. Please use language version 10.0 or greater. // return this with { X = 42 }; Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "this with { X = 42 }").WithArguments("with on structs", "10.0").WithLocation(13, 16) ); comp = CreateCompilation(src); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "42 1"); verifier.VerifyIL("B.M", @" { // Code size 18 (0x12) .maxstack 2 .locals init (B V_0) IL_0000: ldarg.0 IL_0001: ldobj ""B"" IL_0006: stloc.0 IL_0007: ldloca.s V_0 IL_0009: ldc.i4.s 42 IL_000b: call ""void B.X.set"" IL_0010: ldloc.0 IL_0011: ret }"); var tree = comp.SyntaxTrees.First(); var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); var with = tree.GetRoot().DescendantNodes().OfType<WithExpressionSyntax>().Single(); var type = model.GetTypeInfo(with); Assert.Equal("B", type.Type.ToTestDisplayString()); var operation = model.GetOperation(with); VerifyOperationTree(comp, operation, @" IWithOperation (OperationKind.With, Type: B) (Syntax: 'this with { X = 42 }') Operand: IInstanceReferenceOperation (ReferenceKind: ContainingTypeInstance) (OperationKind.InstanceReference, Type: B) (Syntax: 'this') CloneMethod: null Initializer: IObjectOrCollectionInitializerOperation (OperationKind.ObjectOrCollectionInitializer, Type: B) (Syntax: '{ X = 42 }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32) (Syntax: 'X = 42') Left: IPropertyReferenceOperation: System.Int32 B.X { get; set; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'X') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: B, IsImplicit) (Syntax: 'X') Right: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 42) (Syntax: '42') "); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} .locals {R1} { CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (2) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'this') Value: IInstanceReferenceOperation (ReferenceKind: ContainingTypeInstance) (OperationKind.InstanceReference, Type: B) (Syntax: 'this') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32) (Syntax: 'X = 42') Left: IPropertyReferenceOperation: System.Int32 B.X { get; set; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'X') Instance Receiver: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'this') Right: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 42) (Syntax: '42') Next (Return) Block[B2] IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'this') Leaving: {R1} } Block[B2] - Exit Predecessors: [B1] Statements (0) "; var expectedDiagnostics = DiagnosticDescription.None; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExprOnStruct_ControlFlow_DuplicateInitialization() { var src = @" public struct B { public int X { get; set; } public B M() /*<bind>*/{ return this with { X = 42, X = 43 }; }/*</bind>*/ }"; var expectedDiagnostics = new[] { // (8,36): error CS1912: Duplicate initialization of member 'X' // return this with { X = 42, X = 43 }; Diagnostic(ErrorCode.ERR_MemberAlreadyInitialized, "X").WithArguments("X").WithLocation(8, 36) }; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(expectedDiagnostics); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} .locals {R1} { CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (3) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'this') Value: IInstanceReferenceOperation (ReferenceKind: ContainingTypeInstance) (OperationKind.InstanceReference, Type: B) (Syntax: 'this') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32) (Syntax: 'X = 42') Left: IPropertyReferenceOperation: System.Int32 B.X { get; set; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'X') Instance Receiver: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'this') Right: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 42) (Syntax: '42') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsInvalid) (Syntax: 'X = 43') Left: IPropertyReferenceOperation: System.Int32 B.X { get; set; } (OperationKind.PropertyReference, Type: System.Int32, IsInvalid) (Syntax: 'X') Instance Receiver: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'this') Right: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 43) (Syntax: '43') Next (Return) Block[B2] IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'this') Leaving: {R1} } Block[B2] - Exit Predecessors: [B1] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExprOnStruct_ControlFlow_NestedInitializer() { var src = @" public struct C { public int Y { get; set; } } public struct B { public C X { get; set; } public B M() /*<bind>*/{ return this with { X = { Y = 1 } }; }/*</bind>*/ }"; var expectedDiagnostics = new[] { // (12,32): error CS1525: Invalid expression term '{' // return this with { X = { Y = 1 } }; Diagnostic(ErrorCode.ERR_InvalidExprTerm, "{").WithArguments("{").WithLocation(12, 32), // (12,32): error CS1513: } expected // return this with { X = { Y = 1 } }; Diagnostic(ErrorCode.ERR_RbraceExpected, "{").WithLocation(12, 32), // (12,32): error CS1002: ; expected // return this with { X = { Y = 1 } }; Diagnostic(ErrorCode.ERR_SemicolonExpected, "{").WithLocation(12, 32), // (12,34): error CS0103: The name 'Y' does not exist in the current context // return this with { X = { Y = 1 } }; Diagnostic(ErrorCode.ERR_NameNotInContext, "Y").WithArguments("Y").WithLocation(12, 34), // (12,34): warning CS0162: Unreachable code detected // return this with { X = { Y = 1 } }; Diagnostic(ErrorCode.WRN_UnreachableCode, "Y").WithLocation(12, 34), // (12,40): error CS1002: ; expected // return this with { X = { Y = 1 } }; Diagnostic(ErrorCode.ERR_SemicolonExpected, "}").WithLocation(12, 40), // (12,43): error CS1597: Semicolon after method or accessor block is not valid // return this with { X = { Y = 1 } }; Diagnostic(ErrorCode.ERR_UnexpectedSemicolon, ";").WithLocation(12, 43), // (14,1): error CS1022: Type or namespace definition, or end-of-file expected // } Diagnostic(ErrorCode.ERR_EOFExpected, "}").WithLocation(14, 1) }; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(expectedDiagnostics); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} .locals {R1} { CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (2) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'this') Value: IInstanceReferenceOperation (ReferenceKind: ContainingTypeInstance) (OperationKind.InstanceReference, Type: B) (Syntax: 'this') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: C, IsInvalid) (Syntax: 'X = ') Left: IPropertyReferenceOperation: C B.X { get; set; } (OperationKind.PropertyReference, Type: C) (Syntax: 'X') Instance Receiver: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'this') Right: IInvalidOperation (OperationKind.Invalid, Type: null, IsInvalid) (Syntax: '') Children(0) Next (Return) Block[B3] IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'this') Leaving: {R1} } Block[B2] - Block [UnReachable] Predecessors (0) Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null, IsInvalid) (Syntax: 'Y = 1 ') Expression: ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: ?, IsInvalid) (Syntax: 'Y = 1') Left: IInvalidOperation (OperationKind.Invalid, Type: ?, IsInvalid) (Syntax: 'Y') Children(0) Right: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 1) (Syntax: '1') Next (Regular) Block[B3] Block[B3] - Exit Predecessors: [B1] [B2] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExprOnStruct_ControlFlow_NonAssignmentExpression() { var src = @" public struct B { public int X { get; set; } public B M(int i, int j) /*<bind>*/{ return this with { i, j++, M2(), X = 2}; }/*</bind>*/ static int M2() => 0; }"; var expectedDiagnostics = new[] { // (8,28): error CS0747: Invalid initializer member declarator // return this with { i, j++, M2(), X = 2}; Diagnostic(ErrorCode.ERR_InvalidInitializerElementInitializer, "i").WithLocation(8, 28), // (8,31): error CS0747: Invalid initializer member declarator // return this with { i, j++, M2(), X = 2}; Diagnostic(ErrorCode.ERR_InvalidInitializerElementInitializer, "j++").WithLocation(8, 31), // (8,36): error CS0747: Invalid initializer member declarator // return this with { i, j++, M2(), X = 2}; Diagnostic(ErrorCode.ERR_InvalidInitializerElementInitializer, "M2()").WithLocation(8, 36) }; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(expectedDiagnostics); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} .locals {R1} { CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (5) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'this') Value: IInstanceReferenceOperation (ReferenceKind: ContainingTypeInstance) (OperationKind.InstanceReference, Type: B) (Syntax: 'this') IInvalidOperation (OperationKind.Invalid, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'i') Children(1): IParameterReferenceOperation: i (OperationKind.ParameterReference, Type: System.Int32, IsInvalid) (Syntax: 'i') IInvalidOperation (OperationKind.Invalid, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'j++') Children(1): IIncrementOrDecrementOperation (Postfix) (OperationKind.Increment, Type: System.Int32, IsInvalid) (Syntax: 'j++') Target: IParameterReferenceOperation: j (OperationKind.ParameterReference, Type: System.Int32, IsInvalid) (Syntax: 'j') IInvalidOperation (OperationKind.Invalid, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'M2()') Children(1): IInvocationOperation (System.Int32 B.M2()) (OperationKind.Invocation, Type: System.Int32, IsInvalid) (Syntax: 'M2()') Instance Receiver: null Arguments(0) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32) (Syntax: 'X = 2') Left: IPropertyReferenceOperation: System.Int32 B.X { get; set; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'X') Instance Receiver: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'this') Right: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 2) (Syntax: '2') Next (Return) Block[B2] IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'this') Leaving: {R1} } Block[B2] - Exit Predecessors: [B1] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void ObjectCreationInitializer_ControlFlow_WithCoalescingExpressionForValue() { var src = @" public struct B { public string X; public void M(string hello) /*<bind>*/{ var x = new B() { X = Identity((string)null) ?? Identity(hello) }; }/*</bind>*/ T Identity<T>(T t) => t; }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} .locals {R1} { Locals: [B x] CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (1) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'new B() { X ... ty(hello) }') Value: IObjectCreationOperation (Constructor: B..ctor()) (OperationKind.ObjectCreation, Type: B) (Syntax: 'new B() { X ... ty(hello) }') Arguments(0) Initializer: null Next (Regular) Block[B2] Entering: {R2} {R3} .locals {R2} { CaptureIds: [2] .locals {R3} { CaptureIds: [1] Block[B2] - Block Predecessors: [B1] Statements (1) IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity((string)null)') Value: IInvocationOperation ( System.String B.Identity<System.String>(System.String t)) (OperationKind.Invocation, Type: System.String) (Syntax: 'Identity((string)null)') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ContainingTypeInstance) (OperationKind.InstanceReference, Type: B, IsImplicit) (Syntax: 'Identity') Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '(string)null') IConversionOperation (TryCast: False, Unchecked) (OperationKind.Conversion, Type: System.String, Constant: null) (Syntax: '(string)null') Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) (ImplicitReference) Operand: ILiteralOperation (OperationKind.Literal, Type: null, Constant: null) (Syntax: 'null') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Jump if True (Regular) to Block[B4] IIsNullOperation (OperationKind.IsNull, Type: System.Boolean, IsImplicit) (Syntax: 'Identity((string)null)') Operand: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.String, IsImplicit) (Syntax: 'Identity((string)null)') Leaving: {R3} Next (Regular) Block[B3] Block[B3] - Block Predecessors: [B2] Statements (1) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity((string)null)') Value: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.String, IsImplicit) (Syntax: 'Identity((string)null)') Next (Regular) Block[B5] Leaving: {R3} } Block[B4] - Block Predecessors: [B2] Statements (1) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(hello)') Value: IInvocationOperation ( System.String B.Identity<System.String>(System.String t)) (OperationKind.Invocation, Type: System.String) (Syntax: 'Identity(hello)') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ContainingTypeInstance) (OperationKind.InstanceReference, Type: B, IsImplicit) (Syntax: 'Identity') Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'hello') IParameterReferenceOperation: hello (OperationKind.ParameterReference, Type: System.String) (Syntax: 'hello') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B5] Block[B5] - Block Predecessors: [B3] [B4] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.String) (Syntax: 'X = Identit ... tity(hello)') Left: IFieldReferenceOperation: System.String B.X (OperationKind.FieldReference, Type: System.String) (Syntax: 'X') Instance Receiver: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'new B() { X ... ty(hello) }') Right: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: System.String, IsImplicit) (Syntax: 'Identity((s ... tity(hello)') Next (Regular) Block[B6] Leaving: {R2} } Block[B6] - Block Predecessors: [B5] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: B, IsImplicit) (Syntax: 'x = new B() ... ty(hello) }') Left: ILocalReferenceOperation: x (IsDeclaration: True) (OperationKind.LocalReference, Type: B, IsImplicit) (Syntax: 'x = new B() ... ty(hello) }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'new B() { X ... ty(hello) }') Next (Regular) Block[B7] Leaving: {R1} } Block[B7] - Exit Predecessors: [B6] Statements (0) "; var expectedDiagnostics = DiagnosticDescription.None; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics); } [Fact] public void WithExprOnStruct_ControlFlow_WithCoalescingExpressionForValue() { var src = @" var b = new B() { X = string.Empty }; var b2 = b.M(""hello""); System.Console.Write(b2.X); public struct B { public string X; public B M(string hello) /*<bind>*/{ return Identity(this) with { X = Identity((string)null) ?? Identity(hello) }; }/*</bind>*/ T Identity<T>(T t) => t; }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); CompileAndVerify(comp, expectedOutput: "hello"); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} .locals {R1} { CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (1) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(this)') Value: IInvocationOperation ( B B.Identity<B>(B t)) (OperationKind.Invocation, Type: B) (Syntax: 'Identity(this)') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ContainingTypeInstance) (OperationKind.InstanceReference, Type: B, IsImplicit) (Syntax: 'Identity') Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'this') IInstanceReferenceOperation (ReferenceKind: ContainingTypeInstance) (OperationKind.InstanceReference, Type: B) (Syntax: 'this') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B2] Entering: {R2} {R3} .locals {R2} { CaptureIds: [2] .locals {R3} { CaptureIds: [1] Block[B2] - Block Predecessors: [B1] Statements (1) IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity((string)null)') Value: IInvocationOperation ( System.String B.Identity<System.String>(System.String t)) (OperationKind.Invocation, Type: System.String) (Syntax: 'Identity((string)null)') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ContainingTypeInstance) (OperationKind.InstanceReference, Type: B, IsImplicit) (Syntax: 'Identity') Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '(string)null') IConversionOperation (TryCast: False, Unchecked) (OperationKind.Conversion, Type: System.String, Constant: null) (Syntax: '(string)null') Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) (ImplicitReference) Operand: ILiteralOperation (OperationKind.Literal, Type: null, Constant: null) (Syntax: 'null') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Jump if True (Regular) to Block[B4] IIsNullOperation (OperationKind.IsNull, Type: System.Boolean, IsImplicit) (Syntax: 'Identity((string)null)') Operand: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.String, IsImplicit) (Syntax: 'Identity((string)null)') Leaving: {R3} Next (Regular) Block[B3] Block[B3] - Block Predecessors: [B2] Statements (1) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity((string)null)') Value: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.String, IsImplicit) (Syntax: 'Identity((string)null)') Next (Regular) Block[B5] Leaving: {R3} } Block[B4] - Block Predecessors: [B2] Statements (1) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(hello)') Value: IInvocationOperation ( System.String B.Identity<System.String>(System.String t)) (OperationKind.Invocation, Type: System.String) (Syntax: 'Identity(hello)') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ContainingTypeInstance) (OperationKind.InstanceReference, Type: B, IsImplicit) (Syntax: 'Identity') Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'hello') IParameterReferenceOperation: hello (OperationKind.ParameterReference, Type: System.String) (Syntax: 'hello') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B5] Block[B5] - Block Predecessors: [B3] [B4] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.String) (Syntax: 'X = Identit ... tity(hello)') Left: IFieldReferenceOperation: System.String B.X (OperationKind.FieldReference, Type: System.String) (Syntax: 'X') Instance Receiver: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'Identity(this)') Right: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: System.String, IsImplicit) (Syntax: 'Identity((s ... tity(hello)') Next (Regular) Block[B6] Leaving: {R2} } Block[B6] - Block Predecessors: [B5] Statements (0) Next (Return) Block[B7] IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: B, IsImplicit) (Syntax: 'Identity(this)') Leaving: {R1} } Block[B7] - Exit Predecessors: [B6] Statements (0) "; var expectedDiagnostics = DiagnosticDescription.None; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExprOnStruct_OnParameter() { var src = @" var b = new B() { X = 1 }; var b2 = B.M(b); System.Console.Write(b2.X); public struct B { public int X { get; set; } public static B M(B b) { return b with { X = 42 }; } }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "42"); verifier.VerifyIL("B.M", @" { // Code size 13 (0xd) .maxstack 2 .locals init (B V_0) IL_0000: ldarg.0 IL_0001: stloc.0 IL_0002: ldloca.s V_0 IL_0004: ldc.i4.s 42 IL_0006: call ""void B.X.set"" IL_000b: ldloc.0 IL_000c: ret }"); } [Fact] public void WithExprOnStruct_OnThis() { var src = @" record struct C { public int X { get; set; } C(string ignored) { _ = this with { X = 42 }; // 1 this = default; } } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (8,13): error CS0188: The 'this' object cannot be used before all of its fields have been assigned // _ = this with { X = 42 }; // 1 Diagnostic(ErrorCode.ERR_UseDefViolationThis, "this").WithArguments("this").WithLocation(8, 13) ); } [Fact] public void WithExprOnStruct_OnTStructParameter() { var src = @" var b = new B() { X = 1 }; var b2 = B.M(b); System.Console.Write(b2.X); public interface I { int X { get; set; } } public struct B : I { public int X { get; set; } public static T M<T>(T b) where T : struct, I { return b with { X = 42 }; } }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "42"); verifier.VerifyIL("B.M<T>(T)", @" { // Code size 19 (0x13) .maxstack 2 .locals init (T V_0) IL_0000: ldarg.0 IL_0001: stloc.0 IL_0002: ldloca.s V_0 IL_0004: ldc.i4.s 42 IL_0006: constrained. ""T"" IL_000c: callvirt ""void I.X.set"" IL_0011: ldloc.0 IL_0012: ret }"); var tree = comp.SyntaxTrees.First(); var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); var with = tree.GetRoot().DescendantNodes().OfType<WithExpressionSyntax>().Single(); var type = model.GetTypeInfo(with); Assert.Equal("T", type.Type.ToTestDisplayString()); } [Fact] public void WithExprOnStruct_OnRecordStructParameter() { var src = @" var b = new B(1); var b2 = B.M(b); System.Console.Write(b2.X); public record struct B(int X) { public static B M(B b) { return b with { X = 42 }; } }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "42"); verifier.VerifyIL("B.M", @" { // Code size 13 (0xd) .maxstack 2 .locals init (B V_0) IL_0000: ldarg.0 IL_0001: stloc.0 IL_0002: ldloca.s V_0 IL_0004: ldc.i4.s 42 IL_0006: call ""void B.X.set"" IL_000b: ldloc.0 IL_000c: ret }"); } [Fact] public void WithExprOnStruct_OnRecordStructParameter_Readonly() { var src = @" var b = new B(1, 2); var b2 = B.M(b); System.Console.Write(b2.X); System.Console.Write(b2.Y); public readonly record struct B(int X, int Y) { public static B M(B b) { return b with { X = 42, Y = 43 }; } }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "4243", verify: Verification.Skipped /* init-only */); verifier.VerifyIL("B.M", @" { // Code size 22 (0x16) .maxstack 2 .locals init (B V_0) IL_0000: ldarg.0 IL_0001: stloc.0 IL_0002: ldloca.s V_0 IL_0004: ldc.i4.s 42 IL_0006: call ""void B.X.init"" IL_000b: ldloca.s V_0 IL_000d: ldc.i4.s 43 IL_000f: call ""void B.Y.init"" IL_0014: ldloc.0 IL_0015: ret }"); } [Fact] public void WithExprOnStruct_OnTuple() { var src = @" class C { static void Main() { var b = (1, 2); var b2 = M(b); System.Console.Write(b2.Item1); System.Console.Write(b2.Item2); } static (int, int) M((int, int) b) { return b with { Item1 = 42, Item2 = 43 }; } }"; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview, options: TestOptions.ReleaseExe); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "4243"); verifier.VerifyIL("C.M", @" { // Code size 22 (0x16) .maxstack 2 .locals init (System.ValueTuple<int, int> V_0) IL_0000: ldarg.0 IL_0001: stloc.0 IL_0002: ldloca.s V_0 IL_0004: ldc.i4.s 42 IL_0006: stfld ""int System.ValueTuple<int, int>.Item1"" IL_000b: ldloca.s V_0 IL_000d: ldc.i4.s 43 IL_000f: stfld ""int System.ValueTuple<int, int>.Item2"" IL_0014: ldloc.0 IL_0015: ret }"); } [Fact] public void WithExprOnStruct_OnTuple_WithNames() { var src = @" var b = (1, 2); var b2 = M(b); System.Console.Write(b2.Item1); System.Console.Write(b2.Item2); static (int, int) M((int X, int Y) b) { return b with { X = 42, Y = 43 }; }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "4243"); verifier.VerifyIL("Program.<<Main>$>g__M|0_0(System.ValueTuple<int, int>)", @" { // Code size 22 (0x16) .maxstack 2 .locals init (System.ValueTuple<int, int> V_0) IL_0000: ldarg.0 IL_0001: stloc.0 IL_0002: ldloca.s V_0 IL_0004: ldc.i4.s 42 IL_0006: stfld ""int System.ValueTuple<int, int>.Item1"" IL_000b: ldloca.s V_0 IL_000d: ldc.i4.s 43 IL_000f: stfld ""int System.ValueTuple<int, int>.Item2"" IL_0014: ldloc.0 IL_0015: ret }"); } [Fact] public void WithExprOnStruct_OnTuple_LongTuple() { var src = @" var b = (1, 2, 3, 4, 5, 6, 7, 8); var b2 = M(b); System.Console.Write(b2.Item7); System.Console.Write(b2.Item8); static (int, int, int, int, int, int, int, int) M((int, int, int, int, int, int, int, int) b) { return b with { Item7 = 42, Item8 = 43 }; }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "4243"); verifier.VerifyIL("Program.<<Main>$>g__M|0_0(System.ValueTuple<int, int, int, int, int, int, int, System.ValueTuple<int>>)", @" { // Code size 27 (0x1b) .maxstack 2 .locals init (System.ValueTuple<int, int, int, int, int, int, int, System.ValueTuple<int>> V_0) IL_0000: ldarg.0 IL_0001: stloc.0 IL_0002: ldloca.s V_0 IL_0004: ldc.i4.s 42 IL_0006: stfld ""int System.ValueTuple<int, int, int, int, int, int, int, System.ValueTuple<int>>.Item7"" IL_000b: ldloca.s V_0 IL_000d: ldflda ""System.ValueTuple<int> System.ValueTuple<int, int, int, int, int, int, int, System.ValueTuple<int>>.Rest"" IL_0012: ldc.i4.s 43 IL_0014: stfld ""int System.ValueTuple<int>.Item1"" IL_0019: ldloc.0 IL_001a: ret }"); } [Fact] public void WithExprOnStruct_OnReadonlyField() { var src = @" var b = new B { X = 1 }; // 1 public struct B { public readonly int X; public B M() { return this with { X = 42 }; // 2 } public static B M2(B b) { return b with { X = 42 }; // 3 } public B(int i) { this = default; _ = this with { X = 42 }; // 4 } }"; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (2,17): error CS0191: A readonly field cannot be assigned to (except in a constructor or init-only setter of the type in which the field is defined or a variable initializer) // var b = new B { X = 1 }; // 1 Diagnostic(ErrorCode.ERR_AssgReadonly, "X").WithLocation(2, 17), // (9,28): error CS0191: A readonly field cannot be assigned to (except in a constructor or init-only setter of the type in which the field is defined or a variable initializer) // return this with { X = 42 }; // 2 Diagnostic(ErrorCode.ERR_AssgReadonly, "X").WithLocation(9, 28), // (13,25): error CS0191: A readonly field cannot be assigned to (except in a constructor or init-only setter of the type in which the field is defined or a variable initializer) // return b with { X = 42 }; // 3 Diagnostic(ErrorCode.ERR_AssgReadonly, "X").WithLocation(13, 25), // (18,25): error CS0191: A readonly field cannot be assigned to (except in a constructor or init-only setter of the type in which the field is defined or a variable initializer) // _ = this with { X = 42 }; // 4 Diagnostic(ErrorCode.ERR_AssgReadonly, "X").WithLocation(18, 25) ); } [Fact] public void WithExprOnStruct_OnEnum() { var src = @" public enum E { } class C { static E M(E e) { return e with { }; } }"; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(); } [Fact] public void WithExprOnStruct_OnPointer() { var src = @" unsafe class C { static int* M(int* i) { return i with { }; } }"; var comp = CreateCompilation(src, options: TestOptions.UnsafeReleaseDll, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics( // (6,16): error CS8858: The receiver type 'int*' is not a valid record type and is not a struct type. // return i with { }; Diagnostic(ErrorCode.ERR_CannotClone, "i").WithArguments("int*").WithLocation(6, 16) ); } [Fact] public void WithExprOnStruct_OnInterface() { var src = @" public interface I { int X { get; set; } } class C { static I M(I i) { return i with { X = 42 }; } }"; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (10,16): error CS8858: The receiver type 'I' is not a valid record type and is not a value type. // return i with { X = 42 }; Diagnostic(ErrorCode.ERR_CannotClone, "i").WithArguments("I").WithLocation(10, 16) ); } [Fact] public void WithExprOnStruct_OnRefStruct() { // Similar to test RefLikeObjInitializers but with `with` expressions var text = @" using System; class Program { static S2 Test1() { S1 outer = default; S1 inner = stackalloc int[1]; // error return new S2() with { Field1 = outer, Field2 = inner }; } static S2 Test2() { S1 outer = default; S1 inner = stackalloc int[1]; S2 result; // error result = new S2() with { Field1 = inner, Field2 = outer }; return result; } static S2 Test3() { S1 outer = default; S1 inner = stackalloc int[1]; return new S2() with { Field1 = outer, Field2 = outer }; } public ref struct S1 { public static implicit operator S1(Span<int> o) => default; } public ref struct S2 { public S1 Field1; public S1 Field2; } } "; CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.RegularPreview).VerifyDiagnostics( // (12,48): error CS8352: Cannot use local 'inner' in this context because it may expose referenced variables outside of their declaration scope // return new S2() with { Field1 = outer, Field2 = inner }; Diagnostic(ErrorCode.ERR_EscapeLocal, "Field2 = inner").WithArguments("inner").WithLocation(12, 48), // (23,34): error CS8352: Cannot use local 'inner' in this context because it may expose referenced variables outside of their declaration scope // result = new S2() with { Field1 = inner, Field2 = outer }; Diagnostic(ErrorCode.ERR_EscapeLocal, "Field1 = inner").WithArguments("inner").WithLocation(23, 34) ); } [Fact] public void WithExprOnStruct_OnRefStruct_ReceiverMayWrap() { // Similar to test LocalWithNoInitializerEscape but wrapping method is used as receiver for `with` expression var text = @" using System; class Program { static void Main() { S1 sp; Span<int> local = stackalloc int[1]; sp = MayWrap(ref local) with { }; // 1, 2 } static S1 MayWrap(ref Span<int> arg) { return default; } ref struct S1 { public ref int this[int i] => throw null; } } "; CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.RegularPreview).VerifyDiagnostics( // (9,26): error CS8352: Cannot use local 'local' in this context because it may expose referenced variables outside of their declaration scope // sp = MayWrap(ref local) with { }; // 1, 2 Diagnostic(ErrorCode.ERR_EscapeLocal, "local").WithArguments("local").WithLocation(9, 26), // (9,14): error CS8347: Cannot use a result of 'Program.MayWrap(ref Span<int>)' in this context because it may expose variables referenced by parameter 'arg' outside of their declaration scope // sp = MayWrap(ref local) with { }; // 1, 2 Diagnostic(ErrorCode.ERR_EscapeCall, "MayWrap(ref local)").WithArguments("Program.MayWrap(ref System.Span<int>)", "arg").WithLocation(9, 14) ); } [Fact] public void WithExprOnStruct_OnRefStruct_ReceiverMayWrap_02() { var text = @" using System; class Program { static void Main() { Span<int> local = stackalloc int[1]; S1 sp = MayWrap(ref local) with { }; } static S1 MayWrap(ref Span<int> arg) { return default; } ref struct S1 { public ref int this[int i] => throw null; } } "; CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.RegularPreview).VerifyDiagnostics(); } [Fact] public void WithExpr_NullableAnalysis_01() { var src = @" #nullable enable record struct B(int X) { static void M(B b) { string? s = null; _ = b with { X = M(out s) }; s.ToString(); } static int M(out string s) { s = ""a""; return 42; } }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics(); } [Fact] public void WithExpr_NullableAnalysis_02() { var src = @" #nullable enable record struct B(string X) { static void M(B b, string? s) { b.X.ToString(); _ = b with { X = s }; // 1 b.X.ToString(); // 2 } }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (8,26): warning CS8601: Possible null reference assignment. // _ = b with { X = s }; // 1 Diagnostic(ErrorCode.WRN_NullReferenceAssignment, "s").WithLocation(8, 26)); } [Fact] public void WithExpr_NullableAnalysis_03() { var src = @" #nullable enable record struct B(string? X) { static void M1(B b, string s, bool flag) { if (flag) { b.X.ToString(); } // 1 _ = b with { X = s }; if (flag) { b.X.ToString(); } // 2 } static void M2(B b, string s, bool flag) { if (flag) { b.X.ToString(); } // 3 b = b with { X = s }; if (flag) { b.X.ToString(); } } }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (7,21): warning CS8602: Dereference of a possibly null reference. // if (flag) { b.X.ToString(); } // 1 Diagnostic(ErrorCode.WRN_NullReferenceReceiver, "b.X").WithLocation(7, 21), // (9,21): warning CS8602: Dereference of a possibly null reference. // if (flag) { b.X.ToString(); } // 2 Diagnostic(ErrorCode.WRN_NullReferenceReceiver, "b.X").WithLocation(9, 21), // (14,21): warning CS8602: Dereference of a possibly null reference. // if (flag) { b.X.ToString(); } // 3 Diagnostic(ErrorCode.WRN_NullReferenceReceiver, "b.X").WithLocation(14, 21)); } [Fact, WorkItem(44763, "https://github.com/dotnet/roslyn/issues/44763")] public void WithExpr_NullableAnalysis_05() { var src = @" #nullable enable record struct B(string? X, string? Y) { static void M1(bool flag) { B b = new B(""hello"", null); if (flag) { b.X.ToString(); // shouldn't warn b.Y.ToString(); // 1 } b = b with { Y = ""world"" }; b.X.ToString(); // shouldn't warn b.Y.ToString(); } }"; // records should propagate the nullability of the // constructor arguments to the corresponding properties. // https://github.com/dotnet/roslyn/issues/44763 var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (10,13): warning CS8602: Dereference of a possibly null reference. // b.X.ToString(); // shouldn't warn Diagnostic(ErrorCode.WRN_NullReferenceReceiver, "b.X").WithLocation(10, 13), // (11,13): warning CS8602: Dereference of a possibly null reference. // b.Y.ToString(); // 1 Diagnostic(ErrorCode.WRN_NullReferenceReceiver, "b.Y").WithLocation(11, 13), // (15,9): warning CS8602: Dereference of a possibly null reference. // b.X.ToString(); // shouldn't warn Diagnostic(ErrorCode.WRN_NullReferenceReceiver, "b.X").WithLocation(15, 9)); } [Fact] public void WithExpr_NullableAnalysis_06() { var src = @" #nullable enable struct B { public string? X { get; init; } public string? Y { get; init; } static void M1(bool flag) { B b = new B { X = ""hello"", Y = null }; if (flag) { b.X.ToString(); b.Y.ToString(); // 1 } b = b with { Y = ""world"" }; b.X.ToString(); b.Y.ToString(); } }"; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (14,13): warning CS8602: Dereference of a possibly null reference. // b.Y.ToString(); // 1 Diagnostic(ErrorCode.WRN_NullReferenceReceiver, "b.Y").WithLocation(14, 13) ); } [Fact] public void WithExprAssignToRef1() { var src = @" using System; record struct C(int Y) { private readonly int[] _a = new[] { 0 }; public ref int X => ref _a[0]; public static void Main() { var c = new C(0) { X = 5 }; Console.WriteLine(c.X); c = c with { X = 1 }; Console.WriteLine(c.X); } }"; var verifier = CompileAndVerify(src, expectedOutput: @" 5 1").VerifyDiagnostics(); verifier.VerifyIL("C.Main", @" { // Code size 59 (0x3b) .maxstack 2 .locals init (C V_0, //c C V_1) IL_0000: ldloca.s V_1 IL_0002: ldc.i4.0 IL_0003: call ""C..ctor(int)"" IL_0008: ldloca.s V_1 IL_000a: call ""ref int C.X.get"" IL_000f: ldc.i4.5 IL_0010: stind.i4 IL_0011: ldloc.1 IL_0012: stloc.0 IL_0013: ldloca.s V_0 IL_0015: call ""ref int C.X.get"" IL_001a: ldind.i4 IL_001b: call ""void System.Console.WriteLine(int)"" IL_0020: ldloc.0 IL_0021: stloc.1 IL_0022: ldloca.s V_1 IL_0024: call ""ref int C.X.get"" IL_0029: ldc.i4.1 IL_002a: stind.i4 IL_002b: ldloc.1 IL_002c: stloc.0 IL_002d: ldloca.s V_0 IL_002f: call ""ref int C.X.get"" IL_0034: ldind.i4 IL_0035: call ""void System.Console.WriteLine(int)"" IL_003a: ret }"); } [Fact] public void WithExpressionSameLHS() { var comp = CreateCompilation(@" record struct C(int X) { public static void Main() { var c = new C(0); c = c with { X = 1, X = 2}; } }"); comp.VerifyDiagnostics( // (7,29): error CS1912: Duplicate initialization of member 'X' // c = c with { X = 1, X = 2}; Diagnostic(ErrorCode.ERR_MemberAlreadyInitialized, "X").WithArguments("X").WithLocation(7, 29) ); } [Fact] public void WithExpr_AnonymousType_ChangeAllProperties() { var src = @" C.M(); public class C { public static void M() /*<bind>*/{ var a = new { A = 10, B = 20 }; var b = Identity(a) with { A = Identity(30), B = Identity(40) }; System.Console.Write(b); }/*</bind>*/ static T Identity<T>(T t) { System.Console.Write($""Identity({t}) ""); return t; } }"; var comp = CreateCompilation(src, parseOptions: TestOptions.Regular9); comp.VerifyEmitDiagnostics( // (9,17): error CS8773: Feature 'with on anonymous types' is not available in C# 9.0. Please use language version 10.0 or greater. // var b = Identity(a) with { A = Identity(30), B = Identity(40) }; Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "Identity(a) with { A = Identity(30), B = Identity(40) }").WithArguments("with on anonymous types", "10.0").WithLocation(9, 17) ); comp = CreateCompilation(src, parseOptions: TestOptions.Regular10); comp.VerifyEmitDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "Identity({ A = 10, B = 20 }) Identity(30) Identity(40) { A = 30, B = 40 }"); verifier.VerifyIL("C.M", @" { // Code size 42 (0x2a) .maxstack 2 .locals init (int V_0) IL_0000: ldc.i4.s 10 IL_0002: ldc.i4.s 20 IL_0004: newobj ""<>f__AnonymousType0<int, int>..ctor(int, int)"" IL_0009: call ""<anonymous type: int A, int B> C.Identity<<anonymous type: int A, int B>>(<anonymous type: int A, int B>)"" IL_000e: pop IL_000f: ldc.i4.s 30 IL_0011: call ""int C.Identity<int>(int)"" IL_0016: ldc.i4.s 40 IL_0018: call ""int C.Identity<int>(int)"" IL_001d: stloc.0 IL_001e: ldloc.0 IL_001f: newobj ""<>f__AnonymousType0<int, int>..ctor(int, int)"" IL_0024: call ""void System.Console.Write(object)"" IL_0029: ret } "); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A, System.Int32 B> a] [<anonymous type: System.Int32 A, System.Int32 B> b] .locals {R2} { CaptureIds: [0] [1] Block[B1] - Block Predecessors: [B0] Statements (3) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '20') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20) (Syntax: '20') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'new { A = 10, B = 20 }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 20) (Syntax: 'B = 20') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'B') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 20, IsImplicit) (Syntax: '20') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} } .locals {R3} { CaptureIds: [2] [3] Block[B2] - Block Predecessors: [B1] Statements (4) IInvocationOperation (<anonymous type: System.Int32 A, System.Int32 B> C.Identity<<anonymous type: System.Int32 A, System.Int32 B>>(<anonymous type: System.Int32 A, System.Int32 B> t)) (OperationKind.Invocation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'Identity(a)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'a') ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'a') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(30)') Value: IInvocationOperation (System.Int32 C.Identity<System.Int32>(System.Int32 t)) (OperationKind.Invocation, Type: System.Int32) (Syntax: 'Identity(30)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '30') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 30) (Syntax: '30') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 3 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(40)') Value: IInvocationOperation (System.Int32 C.Identity<System.Int32>(System.Int32 t)) (OperationKind.Invocation, Type: System.Int32) (Syntax: 'Identity(40)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '40') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 40) (Syntax: '40') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = Identit ... ntity(40) }') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = Identit ... ntity(40) }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'Identity(a) ... ntity(40) }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(40) }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(40) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a) ... ntity(40) }') Right: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a)') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(40) }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(40) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a) ... ntity(40) }') Right: IFlowCaptureReferenceOperation: 3 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a)') Next (Regular) Block[B3] Leaving: {R3} } Block[B3] - Block Predecessors: [B2] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'System.Console.Write(b);') Expression: IInvocationOperation (void System.Console.Write(System.Object value)) (OperationKind.Invocation, Type: System.Void) (Syntax: 'System.Console.Write(b)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument, Type: null) (Syntax: 'b') IConversionOperation (TryCast: False, Unchecked) (OperationKind.Conversion, Type: System.Object, IsImplicit) (Syntax: 'b') Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) (ImplicitReference) Operand: ILocalReferenceOperation: b (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'b') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B4] Leaving: {R1} } Block[B4] - Exit Predecessors: [B3] Statements (0) "; var expectedDiagnostics = DiagnosticDescription.None; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_ChangeAllProperties_ReverseOrder() { var src = @" C.M(); public class C { public static void M() /*<bind>*/{ var a = new { A = 10, B = 20 }; var b = Identity(a) with { B = Identity(40), A = Identity(30) }; System.Console.Write(b); }/*</bind>*/ static T Identity<T>(T t) { System.Console.Write($""Identity({t}) ""); return t; } }"; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "Identity({ A = 10, B = 20 }) Identity(40) Identity(30) { A = 30, B = 40 }"); verifier.VerifyIL("C.M", @" { // Code size 42 (0x2a) .maxstack 2 .locals init (int V_0) IL_0000: ldc.i4.s 10 IL_0002: ldc.i4.s 20 IL_0004: newobj ""<>f__AnonymousType0<int, int>..ctor(int, int)"" IL_0009: call ""<anonymous type: int A, int B> C.Identity<<anonymous type: int A, int B>>(<anonymous type: int A, int B>)"" IL_000e: pop IL_000f: ldc.i4.s 40 IL_0011: call ""int C.Identity<int>(int)"" IL_0016: stloc.0 IL_0017: ldc.i4.s 30 IL_0019: call ""int C.Identity<int>(int)"" IL_001e: ldloc.0 IL_001f: newobj ""<>f__AnonymousType0<int, int>..ctor(int, int)"" IL_0024: call ""void System.Console.Write(object)"" IL_0029: ret } "); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A, System.Int32 B> a] [<anonymous type: System.Int32 A, System.Int32 B> b] .locals {R2} { CaptureIds: [0] [1] Block[B1] - Block Predecessors: [B0] Statements (3) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '20') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20) (Syntax: '20') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'new { A = 10, B = 20 }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 20) (Syntax: 'B = 20') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'B') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 20, IsImplicit) (Syntax: '20') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} } .locals {R3} { CaptureIds: [2] [3] Block[B2] - Block Predecessors: [B1] Statements (4) IInvocationOperation (<anonymous type: System.Int32 A, System.Int32 B> C.Identity<<anonymous type: System.Int32 A, System.Int32 B>>(<anonymous type: System.Int32 A, System.Int32 B> t)) (OperationKind.Invocation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'Identity(a)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'a') ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'a') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(40)') Value: IInvocationOperation (System.Int32 C.Identity<System.Int32>(System.Int32 t)) (OperationKind.Invocation, Type: System.Int32) (Syntax: 'Identity(40)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '40') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 40) (Syntax: '40') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 3 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(30)') Value: IInvocationOperation (System.Int32 C.Identity<System.Int32>(System.Int32 t)) (OperationKind.Invocation, Type: System.Int32) (Syntax: 'Identity(30)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '30') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 30) (Syntax: '30') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = Identit ... ntity(30) }') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = Identit ... ntity(30) }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'Identity(a) ... ntity(30) }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Right: IFlowCaptureReferenceOperation: 3 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a)') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Right: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a)') Next (Regular) Block[B3] Leaving: {R3} } Block[B3] - Block Predecessors: [B2] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'System.Console.Write(b);') Expression: IInvocationOperation (void System.Console.Write(System.Object value)) (OperationKind.Invocation, Type: System.Void) (Syntax: 'System.Console.Write(b)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument, Type: null) (Syntax: 'b') IConversionOperation (TryCast: False, Unchecked) (OperationKind.Conversion, Type: System.Object, IsImplicit) (Syntax: 'b') Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) (ImplicitReference) Operand: ILocalReferenceOperation: b (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'b') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B4] Leaving: {R1} } Block[B4] - Exit Predecessors: [B3] Statements (0) "; var expectedDiagnostics = DiagnosticDescription.None; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_ChangeNoProperty() { var src = @" C.M(); public class C { public static void M() /*<bind>*/{ var a = new { A = 10, B = 20 }; var b = M2(a) with { }; System.Console.Write(b); }/*</bind>*/ static T M2<T>(T t) { System.Console.Write(""M2 ""); return t; } }"; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "M2 { A = 10, B = 20 }"); verifier.VerifyIL("C.M", @" { // Code size 38 (0x26) .maxstack 2 .locals init (<>f__AnonymousType0<int, int> V_0) IL_0000: ldc.i4.s 10 IL_0002: ldc.i4.s 20 IL_0004: newobj ""<>f__AnonymousType0<int, int>..ctor(int, int)"" IL_0009: call ""<anonymous type: int A, int B> C.M2<<anonymous type: int A, int B>>(<anonymous type: int A, int B>)"" IL_000e: stloc.0 IL_000f: ldloc.0 IL_0010: callvirt ""int <>f__AnonymousType0<int, int>.A.get"" IL_0015: ldloc.0 IL_0016: callvirt ""int <>f__AnonymousType0<int, int>.B.get"" IL_001b: newobj ""<>f__AnonymousType0<int, int>..ctor(int, int)"" IL_0020: call ""void System.Console.Write(object)"" IL_0025: ret } "); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A, System.Int32 B> a] [<anonymous type: System.Int32 A, System.Int32 B> b] .locals {R2} { CaptureIds: [0] [1] Block[B1] - Block Predecessors: [B0] Statements (3) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '20') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20) (Syntax: '20') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'new { A = 10, B = 20 }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 20) (Syntax: 'B = 20') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'B') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 20, IsImplicit) (Syntax: '20') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} {R4} } .locals {R3} { CaptureIds: [3] [4] .locals {R4} { CaptureIds: [2] Block[B2] - Block Predecessors: [B1] Statements (3) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'M2(a)') Value: IInvocationOperation (<anonymous type: System.Int32 A, System.Int32 B> C.M2<<anonymous type: System.Int32 A, System.Int32 B>>(<anonymous type: System.Int32 A, System.Int32 B> t)) (OperationKind.Invocation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'M2(a)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'a') ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'a') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 3 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'M2(a) with { }') Value: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'M2(a) with { }') Instance Receiver: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'M2(a)') IFlowCaptureOperation: 4 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'M2(a) with { }') Value: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'M2(a) with { }') Instance Receiver: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'M2(a)') Next (Regular) Block[B3] Leaving: {R4} } Block[B3] - Block Predecessors: [B2] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = M2(a) with { }') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = M2(a) with { }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'M2(a) with { }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'M2(a) with { }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'M2(a) with { }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'M2(a) with { }') Right: IFlowCaptureReferenceOperation: 3 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'M2(a)') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'M2(a) with { }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'M2(a) with { }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'M2(a) with { }') Right: IFlowCaptureReferenceOperation: 4 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'M2(a)') Next (Regular) Block[B4] Leaving: {R3} } Block[B4] - Block Predecessors: [B3] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'System.Console.Write(b);') Expression: IInvocationOperation (void System.Console.Write(System.Object value)) (OperationKind.Invocation, Type: System.Void) (Syntax: 'System.Console.Write(b)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument, Type: null) (Syntax: 'b') IConversionOperation (TryCast: False, Unchecked) (OperationKind.Conversion, Type: System.Object, IsImplicit) (Syntax: 'b') Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) (ImplicitReference) Operand: ILocalReferenceOperation: b (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'b') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B5] Leaving: {R1} } Block[B5] - Exit Predecessors: [B4] Statements (0) "; var expectedDiagnostics = DiagnosticDescription.None; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_ChangeOneProperty() { var src = @" C.M(); public class C { public static void M() /*<bind>*/{ var a = new { A = 10, B = 20 }; var b = a with { B = Identity(30) }; System.Console.Write(b); }/*</bind>*/ static T Identity<T>(T t) => t; }"; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "{ A = 10, B = 30 }"); verifier.VerifyIL("C.M", @" { // Code size 34 (0x22) .maxstack 2 .locals init (int V_0) IL_0000: ldc.i4.s 10 IL_0002: ldc.i4.s 20 IL_0004: newobj ""<>f__AnonymousType0<int, int>..ctor(int, int)"" IL_0009: ldc.i4.s 30 IL_000b: call ""int C.Identity<int>(int)"" IL_0010: stloc.0 IL_0011: callvirt ""int <>f__AnonymousType0<int, int>.A.get"" IL_0016: ldloc.0 IL_0017: newobj ""<>f__AnonymousType0<int, int>..ctor(int, int)"" IL_001c: call ""void System.Console.Write(object)"" IL_0021: ret } "); var tree = comp.SyntaxTrees.Single(); var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); var withExpr = tree.GetRoot().DescendantNodes().OfType<WithExpressionSyntax>().Single(); var operation = model.GetOperation(withExpr); VerifyOperationTree(comp, operation, @" IWithOperation (OperationKind.With, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'a with { B ... ntity(30) }') Operand: ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'a') CloneMethod: null Initializer: IObjectOrCollectionInitializerOperation (OperationKind.ObjectOrCollectionInitializer, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: '{ B = Identity(30) }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32) (Syntax: 'B = Identity(30)') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'B') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'B') Right: IInvocationOperation (System.Int32 C.Identity<System.Int32>(System.Int32 t)) (OperationKind.Invocation, Type: System.Int32) (Syntax: 'Identity(30)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '30') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 30) (Syntax: '30') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) "); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A, System.Int32 B> a] [<anonymous type: System.Int32 A, System.Int32 B> b] .locals {R2} { CaptureIds: [0] [1] Block[B1] - Block Predecessors: [B0] Statements (3) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '20') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20) (Syntax: '20') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'new { A = 10, B = 20 }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 20) (Syntax: 'B = 20') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'B') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 20, IsImplicit) (Syntax: '20') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} {R4} } .locals {R3} { CaptureIds: [3] [4] .locals {R4} { CaptureIds: [2] Block[B2] - Block Predecessors: [B1] Statements (3) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'a') Value: ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'a') IFlowCaptureOperation: 3 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(30)') Value: IInvocationOperation (System.Int32 C.Identity<System.Int32>(System.Int32 t)) (OperationKind.Invocation, Type: System.Int32) (Syntax: 'Identity(30)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '30') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 30) (Syntax: '30') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 4 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'a with { B ... ntity(30) }') Value: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'a with { B ... ntity(30) }') Instance Receiver: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a') Next (Regular) Block[B3] Leaving: {R4} } Block[B3] - Block Predecessors: [B2] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = a with ... ntity(30) }') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = a with ... ntity(30) }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'a with { B ... ntity(30) }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'a with { B ... ntity(30) }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'a with { B ... ntity(30) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a with { B ... ntity(30) }') Right: IFlowCaptureReferenceOperation: 4 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'a with { B ... ntity(30) }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'a with { B ... ntity(30) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a with { B ... ntity(30) }') Right: IFlowCaptureReferenceOperation: 3 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a') Next (Regular) Block[B4] Leaving: {R3} } Block[B4] - Block Predecessors: [B3] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'System.Console.Write(b);') Expression: IInvocationOperation (void System.Console.Write(System.Object value)) (OperationKind.Invocation, Type: System.Void) (Syntax: 'System.Console.Write(b)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument, Type: null) (Syntax: 'b') IConversionOperation (TryCast: False, Unchecked) (OperationKind.Conversion, Type: System.Object, IsImplicit) (Syntax: 'b') Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) (ImplicitReference) Operand: ILocalReferenceOperation: b (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'b') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B5] Leaving: {R1} } Block[B5] - Exit Predecessors: [B4] Statements (0) "; var expectedDiagnostics = DiagnosticDescription.None; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_ChangeOneProperty_WithMethodCallForTarget() { var src = @" C.M(); public class C { public static void M() /*<bind>*/{ var a = new { A = 10, B = 20 }; var b = Identity(a) with { B = 30 }; System.Console.Write(b); }/*</bind>*/ static T Identity<T>(T t) => t; }"; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "{ A = 10, B = 30 }"); verifier.VerifyIL("C.M", @" { // Code size 34 (0x22) .maxstack 2 .locals init (int V_0) IL_0000: ldc.i4.s 10 IL_0002: ldc.i4.s 20 IL_0004: newobj ""<>f__AnonymousType0<int, int>..ctor(int, int)"" IL_0009: call ""<anonymous type: int A, int B> C.Identity<<anonymous type: int A, int B>>(<anonymous type: int A, int B>)"" IL_000e: ldc.i4.s 30 IL_0010: stloc.0 IL_0011: callvirt ""int <>f__AnonymousType0<int, int>.A.get"" IL_0016: ldloc.0 IL_0017: newobj ""<>f__AnonymousType0<int, int>..ctor(int, int)"" IL_001c: call ""void System.Console.Write(object)"" IL_0021: ret } "); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A, System.Int32 B> a] [<anonymous type: System.Int32 A, System.Int32 B> b] .locals {R2} { CaptureIds: [0] [1] Block[B1] - Block Predecessors: [B0] Statements (3) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '20') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20) (Syntax: '20') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'new { A = 10, B = 20 }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 20) (Syntax: 'B = 20') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'B') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 20, IsImplicit) (Syntax: '20') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} {R4} } .locals {R3} { CaptureIds: [3] [4] .locals {R4} { CaptureIds: [2] Block[B2] - Block Predecessors: [B1] Statements (3) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(a)') Value: IInvocationOperation (<anonymous type: System.Int32 A, System.Int32 B> C.Identity<<anonymous type: System.Int32 A, System.Int32 B>>(<anonymous type: System.Int32 A, System.Int32 B> t)) (OperationKind.Invocation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'Identity(a)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'a') ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'a') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 3 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '30') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 30) (Syntax: '30') IFlowCaptureOperation: 4 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(a) ... { B = 30 }') Value: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... { B = 30 }') Instance Receiver: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a)') Next (Regular) Block[B3] Leaving: {R4} } Block[B3] - Block Predecessors: [B2] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = Identit ... { B = 30 }') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = Identit ... { B = 30 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'Identity(a) ... { B = 30 }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... { B = 30 }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... { B = 30 }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a) ... { B = 30 }') Right: IFlowCaptureReferenceOperation: 4 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a)') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... { B = 30 }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... { B = 30 }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a) ... { B = 30 }') Right: IFlowCaptureReferenceOperation: 3 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a)') Next (Regular) Block[B4] Leaving: {R3} } Block[B4] - Block Predecessors: [B3] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'System.Console.Write(b);') Expression: IInvocationOperation (void System.Console.Write(System.Object value)) (OperationKind.Invocation, Type: System.Void) (Syntax: 'System.Console.Write(b)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument, Type: null) (Syntax: 'b') IConversionOperation (TryCast: False, Unchecked) (OperationKind.Conversion, Type: System.Object, IsImplicit) (Syntax: 'b') Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) (ImplicitReference) Operand: ILocalReferenceOperation: b (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'b') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B5] Leaving: {R1} } Block[B5] - Exit Predecessors: [B4] Statements (0) "; var expectedDiagnostics = DiagnosticDescription.None; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_ChangeOneProperty_WithCoalescingExpressionForTarget() { var src = @" C.M(); public class C { public static void M() /*<bind>*/{ var a = new { A = 10, B = 20 }; var b = (Identity(a) ?? Identity2(a)) with { B = 30 }; System.Console.Write(b); }/*</bind>*/ static T Identity<T>(T t) => t; static T Identity2<T>(T t) => t; }"; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics(); CompileAndVerify(comp, expectedOutput: "{ A = 10, B = 30 }"); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A, System.Int32 B> a] [<anonymous type: System.Int32 A, System.Int32 B> b] .locals {R2} { CaptureIds: [0] [1] Block[B1] - Block Predecessors: [B0] Statements (3) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '20') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20) (Syntax: '20') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'a = new { A ... 0, B = 20 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'new { A = 10, B = 20 }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 20) (Syntax: 'B = 20') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'B') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'new { A = 10, B = 20 }') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 20, IsImplicit) (Syntax: '20') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} {R4} {R5} } .locals {R3} { CaptureIds: [4] [5] .locals {R4} { CaptureIds: [2] .locals {R5} { CaptureIds: [3] Block[B2] - Block Predecessors: [B1] Statements (1) IFlowCaptureOperation: 3 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(a)') Value: IInvocationOperation (<anonymous type: System.Int32 A, System.Int32 B> C.Identity<<anonymous type: System.Int32 A, System.Int32 B>>(<anonymous type: System.Int32 A, System.Int32 B> t)) (OperationKind.Invocation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'Identity(a)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'a') ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'a') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Jump if True (Regular) to Block[B4] IIsNullOperation (OperationKind.IsNull, Type: System.Boolean, IsImplicit) (Syntax: 'Identity(a)') Operand: IFlowCaptureReferenceOperation: 3 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a)') Leaving: {R5} Next (Regular) Block[B3] Block[B3] - Block Predecessors: [B2] Statements (1) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(a)') Value: IFlowCaptureReferenceOperation: 3 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a)') Next (Regular) Block[B5] Leaving: {R5} } Block[B4] - Block Predecessors: [B2] Statements (1) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity2(a)') Value: IInvocationOperation (<anonymous type: System.Int32 A, System.Int32 B> C.Identity2<<anonymous type: System.Int32 A, System.Int32 B>>(<anonymous type: System.Int32 A, System.Int32 B> t)) (OperationKind.Invocation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'Identity2(a)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'a') ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'a') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B5] Block[B5] - Block Predecessors: [B3] [B4] Statements (2) IFlowCaptureOperation: 4 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '30') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 30) (Syntax: '30') IFlowCaptureOperation: 5 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '(Identity(a ... { B = 30 }') Value: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: '(Identity(a ... { B = 30 }') Instance Receiver: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a) ... dentity2(a)') Next (Regular) Block[B6] Leaving: {R4} } Block[B6] - Block Predecessors: [B5] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = (Identi ... { B = 30 }') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'b = (Identi ... { B = 30 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: '(Identity(a ... { B = 30 }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: '(Identity(a ... { B = 30 }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: '(Identity(a ... { B = 30 }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: '(Identity(a ... { B = 30 }') Right: IFlowCaptureReferenceOperation: 5 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a) ... dentity2(a)') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: '(Identity(a ... { B = 30 }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 B>.B { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: '(Identity(a ... { B = 30 }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: '(Identity(a ... { B = 30 }') Right: IFlowCaptureReferenceOperation: 4 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 B>, IsImplicit) (Syntax: 'Identity(a) ... dentity2(a)') Next (Regular) Block[B7] Leaving: {R3} } Block[B7] - Block Predecessors: [B6] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'System.Console.Write(b);') Expression: IInvocationOperation (void System.Console.Write(System.Object value)) (OperationKind.Invocation, Type: System.Void) (Syntax: 'System.Console.Write(b)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument, Type: null) (Syntax: 'b') IConversionOperation (TryCast: False, Unchecked) (OperationKind.Conversion, Type: System.Object, IsImplicit) (Syntax: 'b') Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) (ImplicitReference) Operand: ILocalReferenceOperation: b (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 B>) (Syntax: 'b') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B8] Leaving: {R1} } Block[B8] - Exit Predecessors: [B7] Statements (0) "; var expectedDiagnostics = DiagnosticDescription.None; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_ChangeOneProperty_WithCoalescingExpressionForValue() { var src = @" C.M(""hello"", ""world""); public class C { public static void M(string hello, string world) /*<bind>*/{ var x = new { A = hello, B = string.Empty }; var y = x with { B = Identity(null) ?? Identity2(world) }; System.Console.Write(y); }/*</bind>*/ static string Identity(string t) => t; static string Identity2(string t) => t; }"; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics(); CompileAndVerify(comp, expectedOutput: "{ A = hello, B = world }"); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.String A, System.String B> x] [<anonymous type: System.String A, System.String B> y] .locals {R2} { CaptureIds: [0] [1] Block[B1] - Block Predecessors: [B0] Statements (3) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'hello') Value: IParameterReferenceOperation: hello (OperationKind.ParameterReference, Type: System.String) (Syntax: 'hello') IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'string.Empty') Value: IFieldReferenceOperation: System.String System.String.Empty (Static) (OperationKind.FieldReference, Type: System.String) (Syntax: 'string.Empty') Instance Receiver: null ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.String A, System.String B>, IsImplicit) (Syntax: 'x = new { A ... ing.Empty }') Left: ILocalReferenceOperation: x (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.String A, System.String B>, IsImplicit) (Syntax: 'x = new { A ... ing.Empty }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.String A, System.String B>) (Syntax: 'new { A = h ... ing.Empty }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.String) (Syntax: 'A = hello') Left: IPropertyReferenceOperation: System.String <anonymous type: System.String A, System.String B>.A { get; } (OperationKind.PropertyReference, Type: System.String) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.String A, System.String B>, IsImplicit) (Syntax: 'new { A = h ... ing.Empty }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.String, IsImplicit) (Syntax: 'hello') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.String) (Syntax: 'B = string.Empty') Left: IPropertyReferenceOperation: System.String <anonymous type: System.String A, System.String B>.B { get; } (OperationKind.PropertyReference, Type: System.String) (Syntax: 'B') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.String A, System.String B>, IsImplicit) (Syntax: 'new { A = h ... ing.Empty }') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.String, IsImplicit) (Syntax: 'string.Empty') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} {R4} } .locals {R3} { CaptureIds: [3] [5] .locals {R4} { CaptureIds: [2] Block[B2] - Block Predecessors: [B1] Statements (1) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'x') Value: ILocalReferenceOperation: x (OperationKind.LocalReference, Type: <anonymous type: System.String A, System.String B>) (Syntax: 'x') Next (Regular) Block[B3] Entering: {R5} .locals {R5} { CaptureIds: [4] Block[B3] - Block Predecessors: [B2] Statements (1) IFlowCaptureOperation: 4 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(null)') Value: IInvocationOperation (System.String C.Identity(System.String t)) (OperationKind.Invocation, Type: System.String) (Syntax: 'Identity(null)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'null') IConversionOperation (TryCast: False, Unchecked) (OperationKind.Conversion, Type: System.String, Constant: null, IsImplicit) (Syntax: 'null') Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) (ImplicitReference) Operand: ILiteralOperation (OperationKind.Literal, Type: null, Constant: null) (Syntax: 'null') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Jump if True (Regular) to Block[B5] IIsNullOperation (OperationKind.IsNull, Type: System.Boolean, IsImplicit) (Syntax: 'Identity(null)') Operand: IFlowCaptureReferenceOperation: 4 (OperationKind.FlowCaptureReference, Type: System.String, IsImplicit) (Syntax: 'Identity(null)') Leaving: {R5} Next (Regular) Block[B4] Block[B4] - Block Predecessors: [B3] Statements (1) IFlowCaptureOperation: 3 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(null)') Value: IFlowCaptureReferenceOperation: 4 (OperationKind.FlowCaptureReference, Type: System.String, IsImplicit) (Syntax: 'Identity(null)') Next (Regular) Block[B6] Leaving: {R5} } Block[B5] - Block Predecessors: [B3] Statements (1) IFlowCaptureOperation: 3 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity2(world)') Value: IInvocationOperation (System.String C.Identity2(System.String t)) (OperationKind.Invocation, Type: System.String) (Syntax: 'Identity2(world)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'world') IParameterReferenceOperation: world (OperationKind.ParameterReference, Type: System.String) (Syntax: 'world') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B6] Block[B6] - Block Predecessors: [B4] [B5] Statements (1) IFlowCaptureOperation: 5 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'x with { B ... y2(world) }') Value: IPropertyReferenceOperation: System.String <anonymous type: System.String A, System.String B>.A { get; } (OperationKind.PropertyReference, Type: System.String, IsImplicit) (Syntax: 'x with { B ... y2(world) }') Instance Receiver: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.String A, System.String B>, IsImplicit) (Syntax: 'x') Next (Regular) Block[B7] Leaving: {R4} } Block[B7] - Block Predecessors: [B6] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.String A, System.String B>, IsImplicit) (Syntax: 'y = x with ... y2(world) }') Left: ILocalReferenceOperation: y (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.String A, System.String B>, IsImplicit) (Syntax: 'y = x with ... y2(world) }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.String A, System.String B>) (Syntax: 'x with { B ... y2(world) }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.String, IsImplicit) (Syntax: 'x with { B ... y2(world) }') Left: IPropertyReferenceOperation: System.String <anonymous type: System.String A, System.String B>.A { get; } (OperationKind.PropertyReference, Type: System.String, IsImplicit) (Syntax: 'x with { B ... y2(world) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.String A, System.String B>, IsImplicit) (Syntax: 'x with { B ... y2(world) }') Right: IFlowCaptureReferenceOperation: 5 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.String A, System.String B>, IsImplicit) (Syntax: 'x') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.String, IsImplicit) (Syntax: 'x with { B ... y2(world) }') Left: IPropertyReferenceOperation: System.String <anonymous type: System.String A, System.String B>.B { get; } (OperationKind.PropertyReference, Type: System.String, IsImplicit) (Syntax: 'x with { B ... y2(world) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.String A, System.String B>, IsImplicit) (Syntax: 'x with { B ... y2(world) }') Right: IFlowCaptureReferenceOperation: 3 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.String A, System.String B>, IsImplicit) (Syntax: 'x') Next (Regular) Block[B8] Leaving: {R3} } Block[B8] - Block Predecessors: [B7] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'System.Console.Write(y);') Expression: IInvocationOperation (void System.Console.Write(System.Object value)) (OperationKind.Invocation, Type: System.Void) (Syntax: 'System.Console.Write(y)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument, Type: null) (Syntax: 'y') IConversionOperation (TryCast: False, Unchecked) (OperationKind.Conversion, Type: System.Object, IsImplicit) (Syntax: 'y') Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) (ImplicitReference) Operand: ILocalReferenceOperation: y (OperationKind.LocalReference, Type: <anonymous type: System.String A, System.String B>) (Syntax: 'y') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B9] Leaving: {R1} } Block[B9] - Exit Predecessors: [B8] Statements (0) "; var expectedDiagnostics = DiagnosticDescription.None; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_ErrorMember() { var src = @" public class C { public static void M() /*<bind>*/{ var a = new { A = 10 }; var b = a with { Error = Identity(20) }; }/*</bind>*/ static T Identity<T>(T t) => t; }"; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); var expectedDiagnostics = new[] { // (7,26): error CS0117: '<anonymous type: int A>' does not contain a definition for 'Error' // var b = a with { Error = Identity(20) }; Diagnostic(ErrorCode.ERR_NoSuchMember, "Error").WithArguments("<anonymous type: int A>", "Error").WithLocation(7, 26) }; comp.VerifyEmitDiagnostics(expectedDiagnostics); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A> a] [<anonymous type: System.Int32 A> b] .locals {R2} { CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (2) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a = new { A = 10 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a = new { A = 10 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A>) (Syntax: 'new { A = 10 }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'new { A = 10 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} {R4} } .locals {R3} { CaptureIds: [2] .locals {R4} { CaptureIds: [1] Block[B2] - Block Predecessors: [B1] Statements (3) IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'a') Value: ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>) (Syntax: 'a') IInvocationOperation (System.Int32 C.Identity<System.Int32>(System.Int32 t)) (OperationKind.Invocation, Type: System.Int32) (Syntax: 'Identity(20)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '20') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20) (Syntax: '20') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsInvalid, IsImplicit) (Syntax: 'a with { Er ... ntity(20) }') Value: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'a with { Er ... ntity(20) }') Instance Receiver: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a') Next (Regular) Block[B3] Leaving: {R4} } Block[B3] - Block Predecessors: [B2] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'b = a with ... ntity(20) }') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'b = a with ... ntity(20) }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A>, IsInvalid) (Syntax: 'a with { Er ... ntity(20) }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'a with { Er ... ntity(20) }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'a with { Er ... ntity(20) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'a with { Er ... ntity(20) }') Right: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a') Next (Regular) Block[B4] Leaving: {R3} {R1} } } Block[B4] - Exit Predecessors: [B3] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_ToString() { var src = @" public class C { public static void M() /*<bind>*/{ var a = new { A = 10 }; var b = a with { ToString = Identity(20) }; }/*</bind>*/ static T Identity<T>(T t) => t; }"; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); var expectedDiagnostics = new[] { // (7,26): error CS1913: Member 'ToString' cannot be initialized. It is not a field or property. // var b = a with { ToString = Identity(20) }; Diagnostic(ErrorCode.ERR_MemberCannotBeInitialized, "ToString").WithArguments("ToString").WithLocation(7, 26) }; comp.VerifyEmitDiagnostics(expectedDiagnostics); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A> a] [<anonymous type: System.Int32 A> b] .locals {R2} { CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (2) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a = new { A = 10 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a = new { A = 10 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A>) (Syntax: 'new { A = 10 }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'new { A = 10 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} {R4} } .locals {R3} { CaptureIds: [2] .locals {R4} { CaptureIds: [1] Block[B2] - Block Predecessors: [B1] Statements (3) IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'a') Value: ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>) (Syntax: 'a') IInvocationOperation (System.Int32 C.Identity<System.Int32>(System.Int32 t)) (OperationKind.Invocation, Type: System.Int32) (Syntax: 'Identity(20)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '20') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20) (Syntax: '20') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsInvalid, IsImplicit) (Syntax: 'a with { To ... ntity(20) }') Value: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'a with { To ... ntity(20) }') Instance Receiver: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a') Next (Regular) Block[B3] Leaving: {R4} } Block[B3] - Block Predecessors: [B2] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'b = a with ... ntity(20) }') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'b = a with ... ntity(20) }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A>, IsInvalid) (Syntax: 'a with { To ... ntity(20) }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'a with { To ... ntity(20) }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'a with { To ... ntity(20) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'a with { To ... ntity(20) }') Right: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a') Next (Regular) Block[B4] Leaving: {R3} {R1} } } Block[B4] - Exit Predecessors: [B3] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_NestedInitializer() { var src = @" C.M(); public class C { public static void M() /*<bind>*/{ var nested = new { A = 10 }; var a = new { Nested = nested }; var b = a with { Nested = { A = 20 } }; System.Console.Write(b); }/*</bind>*/ }"; var expectedDiagnostics = new[] { // (10,35): error CS1525: Invalid expression term '{' // var b = a with { Nested = { A = 20 } }; Diagnostic(ErrorCode.ERR_InvalidExprTerm, "{").WithArguments("{").WithLocation(10, 35), // (10,35): error CS1513: } expected // var b = a with { Nested = { A = 20 } }; Diagnostic(ErrorCode.ERR_RbraceExpected, "{").WithLocation(10, 35), // (10,35): error CS1002: ; expected // var b = a with { Nested = { A = 20 } }; Diagnostic(ErrorCode.ERR_SemicolonExpected, "{").WithLocation(10, 35), // (10,37): error CS0103: The name 'A' does not exist in the current context // var b = a with { Nested = { A = 20 } }; Diagnostic(ErrorCode.ERR_NameNotInContext, "A").WithArguments("A").WithLocation(10, 37), // (10,44): error CS1002: ; expected // var b = a with { Nested = { A = 20 } }; Diagnostic(ErrorCode.ERR_SemicolonExpected, "}").WithLocation(10, 44), // (10,47): error CS1597: Semicolon after method or accessor block is not valid // var b = a with { Nested = { A = 20 } }; Diagnostic(ErrorCode.ERR_UnexpectedSemicolon, ";").WithLocation(10, 47), // (11,29): error CS1519: Invalid token '(' in class, record, struct, or interface member declaration // System.Console.Write(b); Diagnostic(ErrorCode.ERR_InvalidMemberDecl, "(").WithArguments("(").WithLocation(11, 29), // (11,31): error CS8124: Tuple must contain at least two elements. // System.Console.Write(b); Diagnostic(ErrorCode.ERR_TupleTooFewElements, ")").WithLocation(11, 31), // (11,32): error CS1519: Invalid token ';' in class, record, struct, or interface member declaration // System.Console.Write(b); Diagnostic(ErrorCode.ERR_InvalidMemberDecl, ";").WithArguments(";").WithLocation(11, 32), // (13,1): error CS1022: Type or namespace definition, or end-of-file expected // } Diagnostic(ErrorCode.ERR_EOFExpected, "}").WithLocation(13, 1) }; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics(expectedDiagnostics); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A> nested] [<anonymous type: <anonymous type: System.Int32 A> Nested> a] [<anonymous type: <anonymous type: System.Int32 A> Nested> b] .locals {R2} { CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (2) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'nested = new { A = 10 }') Left: ILocalReferenceOperation: nested (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'nested = new { A = 10 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A>) (Syntax: 'new { A = 10 }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'new { A = 10 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} } .locals {R3} { CaptureIds: [1] Block[B2] - Block Predecessors: [B1] Statements (2) IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'nested') Value: ILocalReferenceOperation: nested (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>) (Syntax: 'nested') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: <anonymous type: System.Int32 A> Nested>, IsImplicit) (Syntax: 'a = new { N ... = nested }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: <anonymous type: System.Int32 A> Nested>, IsImplicit) (Syntax: 'a = new { N ... = nested }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: <anonymous type: System.Int32 A> Nested>) (Syntax: 'new { Nested = nested }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>) (Syntax: 'Nested = nested') Left: IPropertyReferenceOperation: <anonymous type: System.Int32 A> <anonymous type: <anonymous type: System.Int32 A> Nested>.Nested { get; } (OperationKind.PropertyReference, Type: <anonymous type: System.Int32 A>) (Syntax: 'Nested') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: <anonymous type: System.Int32 A> Nested>, IsImplicit) (Syntax: 'new { Nested = nested }') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'nested') Next (Regular) Block[B3] Leaving: {R3} Entering: {R4} } .locals {R4} { CaptureIds: [2] Block[B3] - Block Predecessors: [B2] Statements (3) ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: <anonymous type: System.Int32 A> Nested>) (Syntax: 'a') IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsInvalid, IsImplicit) (Syntax: '') Value: IInvalidOperation (OperationKind.Invalid, Type: null, IsInvalid) (Syntax: '') Children(0) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: <anonymous type: System.Int32 A> Nested>, IsInvalid, IsImplicit) (Syntax: 'b = a with { Nested = ') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: <anonymous type: System.Int32 A> Nested>, IsInvalid, IsImplicit) (Syntax: 'b = a with { Nested = ') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: <anonymous type: System.Int32 A> Nested>, IsInvalid) (Syntax: 'a with { Nested = ') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'a with { Nested = ') Left: IPropertyReferenceOperation: <anonymous type: System.Int32 A> <anonymous type: <anonymous type: System.Int32 A> Nested>.Nested { get; } (OperationKind.PropertyReference, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'a with { Nested = ') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: <anonymous type: System.Int32 A> Nested>, IsInvalid, IsImplicit) (Syntax: 'a with { Nested = ') Right: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: <anonymous type: System.Int32 A> Nested>, IsImplicit) (Syntax: 'a') Next (Regular) Block[B4] Leaving: {R4} } Block[B4] - Block Predecessors: [B3] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null, IsInvalid) (Syntax: 'A = 20 ') Expression: ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: ?, IsInvalid) (Syntax: 'A = 20') Left: IInvalidOperation (OperationKind.Invalid, Type: ?, IsInvalid) (Syntax: 'A') Children(0) Right: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20) (Syntax: '20') Next (Regular) Block[B5] Leaving: {R1} } Block[B5] - Exit Predecessors: [B4] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_NonAssignmentExpression() { var src = @" public class C { public static void M(int i, int j) /*<bind>*/{ var a = new { A = 10 }; var b = a with { i, j++, M2(), A = 20 }; }/*</bind>*/ static int M2() => 0; }"; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); var expectedDiagnostics = new[] { // (7,26): error CS0747: Invalid initializer member declarator // var b = a with { i, j++, M2(), A = 20 }; Diagnostic(ErrorCode.ERR_InvalidInitializerElementInitializer, "i").WithLocation(7, 26), // (7,29): error CS0747: Invalid initializer member declarator // var b = a with { i, j++, M2(), A = 20 }; Diagnostic(ErrorCode.ERR_InvalidInitializerElementInitializer, "j++").WithLocation(7, 29), // (7,34): error CS0747: Invalid initializer member declarator // var b = a with { i, j++, M2(), A = 20 }; Diagnostic(ErrorCode.ERR_InvalidInitializerElementInitializer, "M2()").WithLocation(7, 34) }; comp.VerifyEmitDiagnostics(expectedDiagnostics); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A> a] [<anonymous type: System.Int32 A> b] .locals {R2} { CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (2) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a = new { A = 10 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a = new { A = 10 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A>) (Syntax: 'new { A = 10 }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'new { A = 10 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} } .locals {R3} { CaptureIds: [1] Block[B2] - Block Predecessors: [B1] Statements (6) ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>) (Syntax: 'a') IInvalidOperation (OperationKind.Invalid, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'i') Children(1): IParameterReferenceOperation: i (OperationKind.ParameterReference, Type: System.Int32, IsInvalid) (Syntax: 'i') IInvalidOperation (OperationKind.Invalid, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'j++') Children(1): IIncrementOrDecrementOperation (Postfix) (OperationKind.Increment, Type: System.Int32, IsInvalid) (Syntax: 'j++') Target: IParameterReferenceOperation: j (OperationKind.ParameterReference, Type: System.Int32, IsInvalid) (Syntax: 'j') IInvalidOperation (OperationKind.Invalid, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'M2()') Children(1): IInvocationOperation (System.Int32 C.M2()) (OperationKind.Invocation, Type: System.Int32, IsInvalid) (Syntax: 'M2()') Instance Receiver: null Arguments(0) IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '20') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20) (Syntax: '20') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'b = a with ... ), A = 20 }') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'b = a with ... ), A = 20 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A>, IsInvalid) (Syntax: 'a with { i, ... ), A = 20 }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'a with { i, ... ), A = 20 }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'a with { i, ... ), A = 20 }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'a with { i, ... ), A = 20 }') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a') Next (Regular) Block[B3] Leaving: {R3} {R1} } } Block[B3] - Exit Predecessors: [B2] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_IndexerAccess() { var src = @" public class C { public static void M() /*<bind>*/{ var a = new { A = 10 }; var b = a with { [0] = 20 }; }/*</bind>*/ }"; var expectedDiagnostics = new[] { // (7,26): error CS1513: } expected // var b = a with { [0] = 20 }; Diagnostic(ErrorCode.ERR_RbraceExpected, "[").WithLocation(7, 26), // (7,26): error CS1002: ; expected // var b = a with { [0] = 20 }; Diagnostic(ErrorCode.ERR_SemicolonExpected, "[").WithLocation(7, 26), // (7,26): error CS7014: Attributes are not valid in this context. // var b = a with { [0] = 20 }; Diagnostic(ErrorCode.ERR_AttributesNotAllowed, "[").WithLocation(7, 26), // (7,27): error CS1001: Identifier expected // var b = a with { [0] = 20 }; Diagnostic(ErrorCode.ERR_IdentifierExpected, "0").WithLocation(7, 27), // (7,27): error CS1003: Syntax error, ']' expected // var b = a with { [0] = 20 }; Diagnostic(ErrorCode.ERR_SyntaxError, "0").WithArguments("]", "").WithLocation(7, 27), // (7,28): error CS1002: ; expected // var b = a with { [0] = 20 }; Diagnostic(ErrorCode.ERR_SemicolonExpected, "]").WithLocation(7, 28), // (7,28): error CS1513: } expected // var b = a with { [0] = 20 }; Diagnostic(ErrorCode.ERR_RbraceExpected, "]").WithLocation(7, 28), // (7,30): error CS1525: Invalid expression term '=' // var b = a with { [0] = 20 }; Diagnostic(ErrorCode.ERR_InvalidExprTerm, "=").WithArguments("=").WithLocation(7, 30), // (7,35): error CS1002: ; expected // var b = a with { [0] = 20 }; Diagnostic(ErrorCode.ERR_SemicolonExpected, "}").WithLocation(7, 35), // (7,36): error CS1597: Semicolon after method or accessor block is not valid // var b = a with { [0] = 20 }; Diagnostic(ErrorCode.ERR_UnexpectedSemicolon, ";").WithLocation(7, 36), // (9,1): error CS1022: Type or namespace definition, or end-of-file expected // } Diagnostic(ErrorCode.ERR_EOFExpected, "}").WithLocation(9, 1) }; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics(expectedDiagnostics); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A> a] [<anonymous type: System.Int32 A> b] .locals {R2} { CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (2) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a = new { A = 10 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a = new { A = 10 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A>) (Syntax: 'new { A = 10 }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'new { A = 10 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} {R4} } .locals {R3} { CaptureIds: [2] .locals {R4} { CaptureIds: [1] Block[B2] - Block Predecessors: [B1] Statements (2) IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'a') Value: ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>) (Syntax: 'a') IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsInvalid, IsImplicit) (Syntax: 'a with { ') Value: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'a with { ') Instance Receiver: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a') Next (Regular) Block[B3] Leaving: {R4} } Block[B3] - Block Predecessors: [B2] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'b = a with { ') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'b = a with { ') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A>, IsInvalid) (Syntax: 'a with { ') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'a with { ') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'a with { ') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'a with { ') Right: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a') Next (Regular) Block[B4] Leaving: {R3} } Block[B4] - Block Predecessors: [B3] Statements (2) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null, IsInvalid) (Syntax: '[0') Expression: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 0, IsInvalid) (Syntax: '0') IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null, IsInvalid) (Syntax: '= 20 ') Expression: ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: ?, IsInvalid) (Syntax: '= 20') Left: IInvalidOperation (OperationKind.Invalid, Type: null, IsInvalid) (Syntax: '') Children(0) Right: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20) (Syntax: '20') Next (Regular) Block[B5] Leaving: {R1} } Block[B5] - Exit Predecessors: [B4] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_CannotSet() { var src = @" public class C { public static void M() { var a = new { A = 10 }; a.A = 20; var b = new { B = a }; b.B.A = 30; } }"; var comp = CreateCompilation(src, parseOptions: TestOptions.Regular9); comp.VerifyEmitDiagnostics( // (7,9): error CS0200: Property or indexer '<anonymous type: int A>.A' cannot be assigned to -- it is read only // a.A = 20; Diagnostic(ErrorCode.ERR_AssgReadonlyProp, "a.A").WithArguments("<anonymous type: int A>.A").WithLocation(7, 9), // (10,9): error CS0200: Property or indexer '<anonymous type: int A>.A' cannot be assigned to -- it is read only // b.B.A = 30; Diagnostic(ErrorCode.ERR_AssgReadonlyProp, "b.B.A").WithArguments("<anonymous type: int A>.A").WithLocation(10, 9) ); } [Fact] public void WithExpr_AnonymousType_DuplicateMemberInDeclaration() { var src = @" public class C { public static void M() /*<bind>*/{ var a = new { A = 10, A = 20 }; var b = Identity(a) with { A = Identity(30) }; System.Console.Write(b); }/*</bind>*/ static T Identity<T>(T t) => t; }"; var expectedDiagnostics = new[] { // (6,31): error CS0833: An anonymous type cannot have multiple properties with the same name // var a = new { A = 10, A = 20 }; Diagnostic(ErrorCode.ERR_AnonymousTypeDuplicatePropertyName, "A = 20").WithLocation(6, 31) }; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics(expectedDiagnostics); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A, System.Int32 $1> a] [<anonymous type: System.Int32 A, System.Int32 $1> b] .locals {R2} { CaptureIds: [0] [1] Block[B1] - Block Predecessors: [B0] Statements (3) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsInvalid, IsImplicit) (Syntax: '20') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 20, IsInvalid) (Syntax: '20') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsInvalid, IsImplicit) (Syntax: 'a = new { A ... 0, A = 20 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsInvalid, IsImplicit) (Syntax: 'a = new { A ... 0, A = 20 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsInvalid) (Syntax: 'new { A = 10, A = 20 }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 $1>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsInvalid, IsImplicit) (Syntax: 'new { A = 10, A = 20 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 20, IsInvalid) (Syntax: 'A = 20') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 $1>.$1 { get; } (OperationKind.PropertyReference, Type: System.Int32, IsInvalid) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsInvalid, IsImplicit) (Syntax: 'new { A = 10, A = 20 }') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 20, IsInvalid, IsImplicit) (Syntax: '20') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} {R4} } .locals {R3} { CaptureIds: [3] [4] .locals {R4} { CaptureIds: [2] Block[B2] - Block Predecessors: [B1] Statements (3) IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(a)') Value: IInvocationOperation (<anonymous type: System.Int32 A, System.Int32 $1> C.Identity<<anonymous type: System.Int32 A, System.Int32 $1>>(<anonymous type: System.Int32 A, System.Int32 $1> t)) (OperationKind.Invocation, Type: <anonymous type: System.Int32 A, System.Int32 $1>) (Syntax: 'Identity(a)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'a') ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 $1>) (Syntax: 'a') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 3 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(30)') Value: IInvocationOperation (System.Int32 C.Identity<System.Int32>(System.Int32 t)) (OperationKind.Invocation, Type: System.Int32) (Syntax: 'Identity(30)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '30') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 30) (Syntax: '30') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 4 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Value: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 $1>.$1 { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Instance Receiver: IFlowCaptureReferenceOperation: 2 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsImplicit) (Syntax: 'Identity(a)') Next (Regular) Block[B3] Leaving: {R4} } Block[B3] - Block Predecessors: [B2] Statements (1) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsImplicit) (Syntax: 'b = Identit ... ntity(30) }') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsImplicit) (Syntax: 'b = Identit ... ntity(30) }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A, System.Int32 $1>) (Syntax: 'Identity(a) ... ntity(30) }') Initializers(2): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 $1>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Right: IFlowCaptureReferenceOperation: 3 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsImplicit) (Syntax: 'Identity(a)') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A, System.Int32 $1>.$1 { get; } (OperationKind.PropertyReference, Type: System.Int32, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsImplicit) (Syntax: 'Identity(a) ... ntity(30) }') Right: IFlowCaptureReferenceOperation: 4 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A, System.Int32 $1>, IsImplicit) (Syntax: 'Identity(a)') Next (Regular) Block[B4] Leaving: {R3} } Block[B4] - Block Predecessors: [B3] Statements (1) IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'System.Console.Write(b);') Expression: IInvocationOperation (void System.Console.Write(System.Object value)) (OperationKind.Invocation, Type: System.Void) (Syntax: 'System.Console.Write(b)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument, Type: null) (Syntax: 'b') IConversionOperation (TryCast: False, Unchecked) (OperationKind.Conversion, Type: System.Object, IsImplicit) (Syntax: 'b') Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) (ImplicitReference) Operand: ILocalReferenceOperation: b (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A, System.Int32 $1>) (Syntax: 'b') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Next (Regular) Block[B5] Leaving: {R1} } Block[B5] - Exit Predecessors: [B4] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact] public void WithExpr_AnonymousType_DuplicateInitialization() { var src = @" public class C { public static void M() /*<bind>*/{ var a = new { A = 10 }; var b = Identity(a) with { A = Identity(30), A = Identity(40) }; }/*</bind>*/ static T Identity<T>(T t) => t; }"; var expectedDiagnostics = new[] { // (7,54): error CS1912: Duplicate initialization of member 'A' // var b = Identity(a) with { A = Identity(30), A = Identity(40) }; Diagnostic(ErrorCode.ERR_MemberAlreadyInitialized, "A").WithArguments("A").WithLocation(7, 54) }; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics(expectedDiagnostics); var expectedFlowGraph = @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Entering: {R1} {R2} .locals {R1} { Locals: [<anonymous type: System.Int32 A> a] [<anonymous type: System.Int32 A> b] .locals {R2} { CaptureIds: [0] Block[B1] - Block Predecessors: [B0] Statements (2) IFlowCaptureOperation: 0 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: '10') Value: ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 10) (Syntax: '10') ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a = new { A = 10 }') Left: ILocalReferenceOperation: a (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'a = new { A = 10 }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A>) (Syntax: 'new { A = 10 }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, Constant: 10) (Syntax: 'A = 10') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32) (Syntax: 'A') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'new { A = 10 }') Right: IFlowCaptureReferenceOperation: 0 (OperationKind.FlowCaptureReference, Type: System.Int32, Constant: 10, IsImplicit) (Syntax: '10') Next (Regular) Block[B2] Leaving: {R2} Entering: {R3} } .locals {R3} { CaptureIds: [1] Block[B2] - Block Predecessors: [B1] Statements (4) IInvocationOperation (<anonymous type: System.Int32 A> C.Identity<<anonymous type: System.Int32 A>>(<anonymous type: System.Int32 A> t)) (OperationKind.Invocation, Type: <anonymous type: System.Int32 A>) (Syntax: 'Identity(a)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: 'a') ILocalReferenceOperation: a (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>) (Syntax: 'a') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'Identity(30)') Value: IInvocationOperation (System.Int32 C.Identity<System.Int32>(System.Int32 t)) (OperationKind.Invocation, Type: System.Int32) (Syntax: 'Identity(30)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '30') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 30) (Syntax: '30') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) IInvocationOperation (System.Int32 C.Identity<System.Int32>(System.Int32 t)) (OperationKind.Invocation, Type: System.Int32) (Syntax: 'Identity(40)') Instance Receiver: null Arguments(1): IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: t) (OperationKind.Argument, Type: null) (Syntax: '40') ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 40) (Syntax: '40') InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'b = Identit ... ntity(40) }') Left: ILocalReferenceOperation: b (IsDeclaration: True) (OperationKind.LocalReference, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'b = Identit ... ntity(40) }') Right: IAnonymousObjectCreationOperation (OperationKind.AnonymousObjectCreation, Type: <anonymous type: System.Int32 A>, IsInvalid) (Syntax: 'Identity(a) ... ntity(40) }') Initializers(1): ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'Identity(a) ... ntity(40) }') Left: IPropertyReferenceOperation: System.Int32 <anonymous type: System.Int32 A>.A { get; } (OperationKind.PropertyReference, Type: System.Int32, IsInvalid, IsImplicit) (Syntax: 'Identity(a) ... ntity(40) }') Instance Receiver: IInstanceReferenceOperation (ReferenceKind: ImplicitReceiver) (OperationKind.InstanceReference, Type: <anonymous type: System.Int32 A>, IsInvalid, IsImplicit) (Syntax: 'Identity(a) ... ntity(40) }') Right: IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: <anonymous type: System.Int32 A>, IsImplicit) (Syntax: 'Identity(a)') Next (Regular) Block[B3] Leaving: {R3} {R1} } } Block[B3] - Exit Predecessors: [B2] Statements (0) "; VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(src, expectedFlowGraph, expectedDiagnostics, parseOptions: TestOptions.RegularPreview); } [Fact, WorkItem(53849, "https://github.com/dotnet/roslyn/issues/53849")] public void WithExpr_AnonymousType_ValueIsLoweredToo() { var src = @" var x = new { Property = 42 }; var adjusted = x with { Property = x.Property + 2 }; System.Console.WriteLine(adjusted); "; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); var verifier = CompileAndVerify(comp, expectedOutput: "{ Property = 44 }"); verifier.VerifyDiagnostics(); } [Fact, WorkItem(53849, "https://github.com/dotnet/roslyn/issues/53849")] public void WithExpr_AnonymousType_ValueIsLoweredToo_NestedWith() { var src = @" var x = new { Property = 42 }; var container = new { Item = x }; var adjusted = container with { Item = x with { Property = x.Property + 2 } }; System.Console.WriteLine(adjusted); "; var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreview); var verifier = CompileAndVerify(comp, expectedOutput: "{ Item = { Property = 44 } }"); verifier.VerifyDiagnostics(); } [Fact] public void AttributesOnPrimaryConstructorParameters_01() { string source = @" [System.AttributeUsage(System.AttributeTargets.Field, AllowMultiple = true) ] public class A : System.Attribute { } [System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple = true) ] public class B : System.Attribute { } [System.AttributeUsage(System.AttributeTargets.Parameter, AllowMultiple = true) ] public class C : System.Attribute { } [System.AttributeUsage(System.AttributeTargets.Parameter, AllowMultiple = true) ] public class D : System.Attribute { } public readonly record struct Test( [field: A] [property: B] [param: C] [D] int P1) { } "; Action<ModuleSymbol> symbolValidator = moduleSymbol => { var @class = moduleSymbol.GlobalNamespace.GetMember<NamedTypeSymbol>("Test"); var prop1 = @class.GetMember<PropertySymbol>("P1"); AssertEx.SetEqual(new[] { "B" }, getAttributeStrings(prop1)); var field1 = @class.GetMember<FieldSymbol>("<P1>k__BackingField"); AssertEx.SetEqual(new[] { "A" }, getAttributeStrings(field1)); var param1 = @class.GetMembers(".ctor").OfType<MethodSymbol>().Where(m => m.Parameters.AsSingleton()?.Name == "P1").Single().Parameters[0]; AssertEx.SetEqual(new[] { "C", "D" }, getAttributeStrings(param1)); }; var comp = CompileAndVerify(new[] { source, IsExternalInitTypeDefinition }, sourceSymbolValidator: symbolValidator, symbolValidator: symbolValidator, parseOptions: TestOptions.RegularPreview, // init-only is unverifiable verify: Verification.Skipped, options: TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All)); comp.VerifyDiagnostics(); IEnumerable<string> getAttributeStrings(Symbol symbol) { return GetAttributeStrings(symbol.GetAttributes().Where(a => a.AttributeClass!.Name is "A" or "B" or "C" or "D")); } } [Fact] public void FieldAsPositionalMember() { var source = @" var a = new A(42); System.Console.Write(a.X); System.Console.Write("" - ""); a.Deconstruct(out int x); System.Console.Write(x); record struct A(int X) { public int X = X; } "; var comp = CreateCompilation(source, parseOptions: TestOptions.Regular9); comp.VerifyEmitDiagnostics( // (8,8): error CS8773: Feature 'record structs' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct A(int X) Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "struct").WithArguments("record structs", "10.0").WithLocation(8, 8), // (8,17): error CS8773: Feature 'positional fields in records' is not available in C# 9.0. Please use language version 10.0 or greater. // record struct A(int X) Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion9, "int X").WithArguments("positional fields in records", "10.0").WithLocation(8, 17) ); comp = CreateCompilation(source, parseOptions: TestOptions.Regular10); comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "42 - 42"); verifier.VerifyIL("A.Deconstruct", @" { // Code size 9 (0x9) .maxstack 2 IL_0000: ldarg.1 IL_0001: ldarg.0 IL_0002: ldfld ""int A.X"" IL_0007: stind.i4 IL_0008: ret } "); } [Fact] public void FieldAsPositionalMember_Readonly() { var source = @" readonly record struct A(int X) { public int X = X; // 1 } readonly record struct B(int X) { public readonly int X = X; } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics( // (4,16): error CS8340: Instance fields of readonly structs must be readonly. // public int X = X; // 1 Diagnostic(ErrorCode.ERR_FieldsInRoStruct, "X").WithLocation(4, 16) ); } [Fact] public void FieldAsPositionalMember_Fixed() { var src = @" unsafe record struct C(int[] P) { public fixed int P[2]; public int[] X = P; }"; var comp = CreateCompilation(src, options: TestOptions.UnsafeReleaseDll, parseOptions: TestOptions.RegularPreview); comp.VerifyEmitDiagnostics( // (2,30): error CS8866: Record member 'C.P' must be a readable instance property or field of type 'int[]' to match positional parameter 'P'. // unsafe record struct C(int[] P) Diagnostic(ErrorCode.ERR_BadRecordMemberForPositionalParameter, "P").WithArguments("C.P", "int[]", "P").WithLocation(2, 30), // (4,22): error CS8908: The type 'int*' may not be used for a field of a record. // public fixed int P[2]; Diagnostic(ErrorCode.ERR_BadFieldTypeInRecord, "P").WithArguments("int*").WithLocation(4, 22) ); } [Fact] public void FieldAsPositionalMember_WrongType() { var source = @" record struct A(int X) { public string X = null; public int Y = X; } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics( // (2,21): error CS8866: Record member 'A.X' must be a readable instance property or field of type 'int' to match positional parameter 'X'. // record struct A(int X) Diagnostic(ErrorCode.ERR_BadRecordMemberForPositionalParameter, "X").WithArguments("A.X", "int", "X").WithLocation(2, 21) ); } [Fact] public void FieldAsPositionalMember_DuplicateFields() { var source = @" record struct A(int X) { public int X = 0; public int X = 0; public int Y = X; } "; var comp = CreateCompilation(source); comp.VerifyDiagnostics( // (5,16): error CS0102: The type 'A' already contains a definition for 'X' // public int X = 0; Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "X").WithArguments("A", "X").WithLocation(5, 16) ); } [Fact] public void SyntaxFactory_TypeDeclaration() { var expected = @"record struct Point { }"; AssertEx.AssertEqualToleratingWhitespaceDifferences(expected, SyntaxFactory.TypeDeclaration(SyntaxKind.RecordStructDeclaration, "Point").NormalizeWhitespace().ToString()); } [Fact] public void InterfaceWithParameters() { var src = @" public interface I { } record struct R(int X) : I() { } record struct R2(int X) : I(X) { } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (6,27): error CS8861: Unexpected argument list. // record struct R(int X) : I() Diagnostic(ErrorCode.ERR_UnexpectedArgumentList, "()").WithLocation(6, 27), // (10,28): error CS8861: Unexpected argument list. // record struct R2(int X) : I(X) Diagnostic(ErrorCode.ERR_UnexpectedArgumentList, "(X)").WithLocation(10, 28) ); } [Fact] public void InterfaceWithParameters_NoPrimaryConstructor() { var src = @" public interface I { } record struct R : I() { } record struct R2 : I(0) { } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (6,20): error CS8861: Unexpected argument list. // record struct R : I() Diagnostic(ErrorCode.ERR_UnexpectedArgumentList, "()").WithLocation(6, 20), // (10,21): error CS8861: Unexpected argument list. // record struct R2 : I(0) Diagnostic(ErrorCode.ERR_UnexpectedArgumentList, "(0)").WithLocation(10, 21) ); } [Fact] public void InterfaceWithParameters_Struct() { var src = @" public interface I { } struct C : I() { } struct C2 : I(0) { } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (6,13): error CS8861: Unexpected argument list. // struct C : I() Diagnostic(ErrorCode.ERR_UnexpectedArgumentList, "()").WithLocation(6, 13), // (10,14): error CS8861: Unexpected argument list. // struct C2 : I(0) Diagnostic(ErrorCode.ERR_UnexpectedArgumentList, "(0)").WithLocation(10, 14) ); } [Fact] public void BaseArguments_Speculation() { var src = @" record struct R1(int X) : Error1(0, 1) { } record struct R2(int X) : Error2() { } record struct R3(int X) : Error3 { } "; var comp = CreateCompilation(src); comp.VerifyDiagnostics( // (2,27): error CS0246: The type or namespace name 'Error1' could not be found (are you missing a using directive or an assembly reference?) // record struct R1(int X) : Error1(0, 1) Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "Error1").WithArguments("Error1").WithLocation(2, 27), // (2,33): error CS8861: Unexpected argument list. // record struct R1(int X) : Error1(0, 1) Diagnostic(ErrorCode.ERR_UnexpectedArgumentList, "(0, 1)").WithLocation(2, 33), // (5,27): error CS0246: The type or namespace name 'Error2' could not be found (are you missing a using directive or an assembly reference?) // record struct R2(int X) : Error2() Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "Error2").WithArguments("Error2").WithLocation(5, 27), // (5,33): error CS8861: Unexpected argument list. // record struct R2(int X) : Error2() Diagnostic(ErrorCode.ERR_UnexpectedArgumentList, "()").WithLocation(5, 33), // (8,27): error CS0246: The type or namespace name 'Error3' could not be found (are you missing a using directive or an assembly reference?) // record struct R3(int X) : Error3 Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "Error3").WithArguments("Error3").WithLocation(8, 27) ); var tree = comp.SyntaxTrees.First(); var model = comp.GetSemanticModel(tree); var baseWithargs = tree.GetRoot().DescendantNodes().OfType<PrimaryConstructorBaseTypeSyntax>().First(); Assert.Equal("Error1(0, 1)", baseWithargs.ToString()); var speculativeBase = baseWithargs.WithArgumentList(baseWithargs.ArgumentList.WithArguments(baseWithargs.ArgumentList.Arguments.RemoveAt(1))); Assert.Equal("Error1(0)", speculativeBase.ToString()); Assert.False(model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBase, out _)); var baseWithoutargs = tree.GetRoot().DescendantNodes().OfType<PrimaryConstructorBaseTypeSyntax>().Skip(1).First(); Assert.Equal("Error2()", baseWithoutargs.ToString()); Assert.False(model.TryGetSpeculativeSemanticModel(baseWithoutargs.ArgumentList.OpenParenToken.SpanStart, speculativeBase, out _)); var baseWithoutParens = tree.GetRoot().DescendantNodes().OfType<SimpleBaseTypeSyntax>().Single(); Assert.Equal("Error3", baseWithoutParens.ToString()); Assert.False(model.TryGetSpeculativeSemanticModel(baseWithoutParens.SpanStart + 2, speculativeBase, out _)); } [Fact, WorkItem(54413, "https://github.com/dotnet/roslyn/issues/54413")] public void ValueTypeCopyConstructorLike_NoThisInitializer() { var src = @" record struct Value(string Text) { private Value(int X) { } // 1 private Value(Value original) { } // 2 } record class Boxed(string Text) { private Boxed(int X) { } // 3 private Boxed(Boxed original) { } // 4 } "; var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (4,13): error CS8862: A constructor declared in a record with parameter list must have 'this' constructor initializer. // private Value(int X) { } // 1 Diagnostic(ErrorCode.ERR_UnexpectedOrMissingConstructorInitializerInRecord, "Value").WithLocation(4, 13), // (5,13): error CS8862: A constructor declared in a record with parameter list must have 'this' constructor initializer. // private Value(Value original) { } // 2 Diagnostic(ErrorCode.ERR_UnexpectedOrMissingConstructorInitializerInRecord, "Value").WithLocation(5, 13), // (10,13): error CS8862: A constructor declared in a record with parameter list must have 'this' constructor initializer. // private Boxed(int X) { } // 3 Diagnostic(ErrorCode.ERR_UnexpectedOrMissingConstructorInitializerInRecord, "Boxed").WithLocation(10, 13), // (11,13): error CS8878: A copy constructor 'Boxed.Boxed(Boxed)' must be public or protected because the record is not sealed. // private Boxed(Boxed original) { } // 4 Diagnostic(ErrorCode.ERR_CopyConstructorWrongAccessibility, "Boxed").WithArguments("Boxed.Boxed(Boxed)").WithLocation(11, 13) ); } [Fact] public void ValueTypeCopyConstructorLike() { var src = @" System.Console.Write(new Value(new Value(0))); record struct Value(int I) { public Value(Value original) : this(42) { } } "; var comp = CreateCompilation(src); CompileAndVerify(comp, expectedOutput: "Value { I = 42 }"); } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/VisualStudio/Core/Impl/Options/OptionPreviewControl.xaml.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System; using System.Linq; using System.Windows; using System.Windows.Automation; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Input; using Microsoft.CodeAnalysis.Options; using Microsoft.VisualStudio.LanguageServices.Implementation.Utilities; namespace Microsoft.VisualStudio.LanguageServices.Implementation.Options { internal partial class OptionPreviewControl : AbstractOptionPageControl { internal AbstractOptionPreviewViewModel ViewModel; private readonly IServiceProvider _serviceProvider; private readonly Func<OptionStore, IServiceProvider, AbstractOptionPreviewViewModel> _createViewModel; internal OptionPreviewControl(IServiceProvider serviceProvider, OptionStore optionStore, Func<OptionStore, IServiceProvider, AbstractOptionPreviewViewModel> createViewModel) : base(optionStore) { InitializeComponent(); // AutomationDelegatingListView is defined in ServicesVisualStudio, which has // InternalsVisibleTo this project. But, the markup compiler doesn't consider the IVT // relationship, so declaring the AutomationDelegatingListView in XAML would require // duplicating that type in this project. Declaring and setting it here avoids the // markup compiler completely, allowing us to reference the internal // AutomationDelegatingListView without issue. var listview = new AutomationDelegatingListView(); listview.Name = "Options"; listview.SelectionMode = SelectionMode.Single; listview.PreviewKeyDown += Options_PreviewKeyDown; listview.SelectionChanged += Options_SelectionChanged; listview.SetBinding(ItemsControl.ItemsSourceProperty, new Binding { Path = new PropertyPath(nameof(ViewModel.Items)) }); AutomationProperties.SetName(listview, ServicesVSResources.Options); listViewContentControl.Content = listview; _serviceProvider = serviceProvider; _createViewModel = createViewModel; } private void Options_SelectionChanged(object sender, SelectionChangedEventArgs e) { var listView = (AutomationDelegatingListView)sender; if (listView.SelectedItem is CheckBoxOptionViewModel checkbox) { ViewModel.UpdatePreview(checkbox.GetPreview()); } if (listView.SelectedItem is AbstractRadioButtonViewModel radioButton) { ViewModel.UpdatePreview(radioButton.Preview); } if (listView.SelectedItem is CheckBoxWithComboOptionViewModel checkBoxWithCombo) { ViewModel.UpdatePreview(checkBoxWithCombo.GetPreview()); } } private void Options_PreviewKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Space && e.KeyboardDevice.Modifiers == ModifierKeys.None) { var listView = (AutomationDelegatingListView)sender; if (listView.SelectedItem is CheckBoxOptionViewModel checkBox) { checkBox.IsChecked = !checkBox.IsChecked; e.Handled = true; } if (listView.SelectedItem is AbstractRadioButtonViewModel radioButton) { radioButton.IsChecked = true; e.Handled = true; } if (listView.SelectedItem is CheckBoxWithComboOptionViewModel checkBoxWithCombo) { checkBoxWithCombo.IsChecked = !checkBoxWithCombo.IsChecked; e.Handled = true; } } } internal override void OnLoad() { this.ViewModel = _createViewModel(this.OptionStore, _serviceProvider); // Use the first item's preview. var firstItem = this.ViewModel.Items.OfType<CheckBoxOptionViewModel>().First(); this.ViewModel.SetOptionAndUpdatePreview(firstItem.IsChecked, firstItem.Option, firstItem.GetPreview()); DataContext = ViewModel; } internal override void Close() { base.Close(); if (this.ViewModel != null) { this.ViewModel.Dispose(); } } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System; using System.Linq; using System.Windows; using System.Windows.Automation; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Input; using Microsoft.CodeAnalysis.Options; using Microsoft.VisualStudio.LanguageServices.Implementation.Utilities; namespace Microsoft.VisualStudio.LanguageServices.Implementation.Options { internal partial class OptionPreviewControl : AbstractOptionPageControl { internal AbstractOptionPreviewViewModel ViewModel; private readonly IServiceProvider _serviceProvider; private readonly Func<OptionStore, IServiceProvider, AbstractOptionPreviewViewModel> _createViewModel; internal OptionPreviewControl(IServiceProvider serviceProvider, OptionStore optionStore, Func<OptionStore, IServiceProvider, AbstractOptionPreviewViewModel> createViewModel) : base(optionStore) { InitializeComponent(); // AutomationDelegatingListView is defined in ServicesVisualStudio, which has // InternalsVisibleTo this project. But, the markup compiler doesn't consider the IVT // relationship, so declaring the AutomationDelegatingListView in XAML would require // duplicating that type in this project. Declaring and setting it here avoids the // markup compiler completely, allowing us to reference the internal // AutomationDelegatingListView without issue. var listview = new AutomationDelegatingListView(); listview.Name = "Options"; listview.SelectionMode = SelectionMode.Single; listview.PreviewKeyDown += Options_PreviewKeyDown; listview.SelectionChanged += Options_SelectionChanged; listview.SetBinding(ItemsControl.ItemsSourceProperty, new Binding { Path = new PropertyPath(nameof(ViewModel.Items)) }); AutomationProperties.SetName(listview, ServicesVSResources.Options); listViewContentControl.Content = listview; _serviceProvider = serviceProvider; _createViewModel = createViewModel; } private void Options_SelectionChanged(object sender, SelectionChangedEventArgs e) { var listView = (AutomationDelegatingListView)sender; if (listView.SelectedItem is CheckBoxOptionViewModel checkbox) { ViewModel.UpdatePreview(checkbox.GetPreview()); } if (listView.SelectedItem is AbstractRadioButtonViewModel radioButton) { ViewModel.UpdatePreview(radioButton.Preview); } if (listView.SelectedItem is CheckBoxWithComboOptionViewModel checkBoxWithCombo) { ViewModel.UpdatePreview(checkBoxWithCombo.GetPreview()); } } private void Options_PreviewKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Space && e.KeyboardDevice.Modifiers == ModifierKeys.None) { var listView = (AutomationDelegatingListView)sender; if (listView.SelectedItem is CheckBoxOptionViewModel checkBox) { checkBox.IsChecked = !checkBox.IsChecked; e.Handled = true; } if (listView.SelectedItem is AbstractRadioButtonViewModel radioButton) { radioButton.IsChecked = true; e.Handled = true; } if (listView.SelectedItem is CheckBoxWithComboOptionViewModel checkBoxWithCombo) { checkBoxWithCombo.IsChecked = !checkBoxWithCombo.IsChecked; e.Handled = true; } } } internal override void OnLoad() { this.ViewModel = _createViewModel(this.OptionStore, _serviceProvider); // Use the first item's preview. var firstItem = this.ViewModel.Items.OfType<CheckBoxOptionViewModel>().First(); this.ViewModel.SetOptionAndUpdatePreview(firstItem.IsChecked, firstItem.Option, firstItem.GetPreview()); DataContext = ViewModel; } internal override void Close() { base.Close(); if (this.ViewModel != null) { this.ViewModel.Dispose(); } } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Tools/BuildBoss/InternalsVisibleTo.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Xml.Linq; namespace BuildBoss { internal readonly struct InternalsVisibleTo { public InternalsVisibleTo(string targetAssembly, string publicKey, string loadsWithinVisualStudio, string workItem) { TargetAssembly = targetAssembly; PublicKey = publicKey; LoadsWithinVisualStudio = loadsWithinVisualStudio; WorkItem = workItem; } public string TargetAssembly { get; } public string PublicKey { get; } public string LoadsWithinVisualStudio { get; } public string WorkItem { get; } public override string ToString() { var element = new XElement("InternalsVisibleTo"); if (TargetAssembly is object) { element.Add(new XAttribute("Include", TargetAssembly)); } if (PublicKey is object) { element.Add(new XAttribute("Key", PublicKey)); } if (LoadsWithinVisualStudio is object) { element.Add(new XAttribute("LoadsWithinVisualStudio", LoadsWithinVisualStudio)); } if (WorkItem is object) { element.Add(new XAttribute("WorkItem", WorkItem)); } return element.ToString(); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Xml.Linq; namespace BuildBoss { internal readonly struct InternalsVisibleTo { public InternalsVisibleTo(string targetAssembly, string publicKey, string loadsWithinVisualStudio, string workItem) { TargetAssembly = targetAssembly; PublicKey = publicKey; LoadsWithinVisualStudio = loadsWithinVisualStudio; WorkItem = workItem; } public string TargetAssembly { get; } public string PublicKey { get; } public string LoadsWithinVisualStudio { get; } public string WorkItem { get; } public override string ToString() { var element = new XElement("InternalsVisibleTo"); if (TargetAssembly is object) { element.Add(new XAttribute("Include", TargetAssembly)); } if (PublicKey is object) { element.Add(new XAttribute("Key", PublicKey)); } if (LoadsWithinVisualStudio is object) { element.Add(new XAttribute("LoadsWithinVisualStudio", LoadsWithinVisualStudio)); } if (WorkItem is object) { element.Add(new XAttribute("WorkItem", WorkItem)); } return element.ToString(); } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Features/Core/Portable/NavigationBar/NavigationBarItems/RoslynNavigationBarItem.GenerateDefaultConstructorItem.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; namespace Microsoft.CodeAnalysis.NavigationBar { internal abstract partial class RoslynNavigationBarItem { public class GenerateDefaultConstructor : AbstractGenerateCodeItem, IEquatable<GenerateDefaultConstructor> { public GenerateDefaultConstructor(string text, SymbolKey destinationTypeSymbolKey) : base(RoslynNavigationBarItemKind.GenerateDefaultConstructor, text, Glyph.MethodPublic, destinationTypeSymbolKey) { } protected internal override SerializableNavigationBarItem Dehydrate() => SerializableNavigationBarItem.GenerateDefaultConstructor(Text, DestinationTypeSymbolKey); public override bool Equals(object? obj) => Equals(obj as GenerateDefaultConstructor); public bool Equals(GenerateDefaultConstructor? other) => base.Equals(other); public override int GetHashCode() => throw new NotImplementedException(); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; namespace Microsoft.CodeAnalysis.NavigationBar { internal abstract partial class RoslynNavigationBarItem { public class GenerateDefaultConstructor : AbstractGenerateCodeItem, IEquatable<GenerateDefaultConstructor> { public GenerateDefaultConstructor(string text, SymbolKey destinationTypeSymbolKey) : base(RoslynNavigationBarItemKind.GenerateDefaultConstructor, text, Glyph.MethodPublic, destinationTypeSymbolKey) { } protected internal override SerializableNavigationBarItem Dehydrate() => SerializableNavigationBarItem.GenerateDefaultConstructor(Text, DestinationTypeSymbolKey); public override bool Equals(object? obj) => Equals(obj as GenerateDefaultConstructor); public bool Equals(GenerateDefaultConstructor? other) => base.Equals(other); public override int GetHashCode() => throw new NotImplementedException(); } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Utilities/UsingsAndExternAliasesDirectiveComparer.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Collections.Generic; using System.Diagnostics; using Microsoft.CodeAnalysis.CSharp.Syntax; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.CSharp.Utilities { internal class UsingsAndExternAliasesDirectiveComparer : IComparer<SyntaxNode?> { public static readonly IComparer<SyntaxNode> NormalInstance = new UsingsAndExternAliasesDirectiveComparer( NameSyntaxComparer.Create(TokenComparer.NormalInstance), TokenComparer.NormalInstance); public static readonly IComparer<SyntaxNode> SystemFirstInstance = new UsingsAndExternAliasesDirectiveComparer( NameSyntaxComparer.Create(TokenComparer.SystemFirstInstance), TokenComparer.SystemFirstInstance); private readonly IComparer<NameSyntax> _nameComparer; private readonly IComparer<SyntaxToken> _tokenComparer; private UsingsAndExternAliasesDirectiveComparer( IComparer<NameSyntax> nameComparer, IComparer<SyntaxToken> tokenComparer) { RoslynDebug.AssertNotNull(nameComparer); RoslynDebug.AssertNotNull(tokenComparer); _nameComparer = nameComparer; _tokenComparer = tokenComparer; } private enum UsingKind { Extern, GlobalNamespace, GlobalUsingStatic, GlobalAlias, Namespace, UsingStatic, Alias } private static UsingKind GetUsingKind(UsingDirectiveSyntax? usingDirective, ExternAliasDirectiveSyntax? externDirective) { if (externDirective != null) { return UsingKind.Extern; } else { RoslynDebug.AssertNotNull(usingDirective); } if (usingDirective.GlobalKeyword != default) { if (usingDirective.Alias != null) return UsingKind.GlobalAlias; if (usingDirective.StaticKeyword != default) return UsingKind.GlobalUsingStatic; return UsingKind.GlobalNamespace; } else { if (usingDirective.Alias != null) return UsingKind.Alias; if (usingDirective.StaticKeyword != default) return UsingKind.UsingStatic; return UsingKind.Namespace; } } public int Compare(SyntaxNode? directive1, SyntaxNode? directive2) { if (directive1 is null) return directive2 is null ? 0 : -1; else if (directive2 is null) return 1; if (directive1 == directive2) return 0; var using1 = directive1 as UsingDirectiveSyntax; var using2 = directive2 as UsingDirectiveSyntax; var extern1 = directive1 as ExternAliasDirectiveSyntax; var extern2 = directive2 as ExternAliasDirectiveSyntax; var directive1Kind = GetUsingKind(using1, extern1); var directive2Kind = GetUsingKind(using2, extern2); // different types of usings get broken up into groups. // * externs // * usings // * using statics // * aliases var directiveKindDifference = directive1Kind - directive2Kind; if (directiveKindDifference != 0) { return directiveKindDifference; } // ok, it's the same type of using now. switch (directive1Kind) { case UsingKind.Extern: // they're externs, sort by the alias return _tokenComparer.Compare(extern1!.Identifier, extern2!.Identifier); case UsingKind.Alias: var aliasComparisonResult = _tokenComparer.Compare(using1!.Alias!.Name.Identifier, using2!.Alias!.Name.Identifier); if (aliasComparisonResult == 0) { // They both use the same alias, so compare the names. return _nameComparer.Compare(using1.Name, using2.Name); } return aliasComparisonResult; default: return _nameComparer.Compare(using1!.Name, using2!.Name); } } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Collections.Generic; using System.Diagnostics; using Microsoft.CodeAnalysis.CSharp.Syntax; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.CSharp.Utilities { internal class UsingsAndExternAliasesDirectiveComparer : IComparer<SyntaxNode?> { public static readonly IComparer<SyntaxNode> NormalInstance = new UsingsAndExternAliasesDirectiveComparer( NameSyntaxComparer.Create(TokenComparer.NormalInstance), TokenComparer.NormalInstance); public static readonly IComparer<SyntaxNode> SystemFirstInstance = new UsingsAndExternAliasesDirectiveComparer( NameSyntaxComparer.Create(TokenComparer.SystemFirstInstance), TokenComparer.SystemFirstInstance); private readonly IComparer<NameSyntax> _nameComparer; private readonly IComparer<SyntaxToken> _tokenComparer; private UsingsAndExternAliasesDirectiveComparer( IComparer<NameSyntax> nameComparer, IComparer<SyntaxToken> tokenComparer) { RoslynDebug.AssertNotNull(nameComparer); RoslynDebug.AssertNotNull(tokenComparer); _nameComparer = nameComparer; _tokenComparer = tokenComparer; } private enum UsingKind { Extern, GlobalNamespace, GlobalUsingStatic, GlobalAlias, Namespace, UsingStatic, Alias } private static UsingKind GetUsingKind(UsingDirectiveSyntax? usingDirective, ExternAliasDirectiveSyntax? externDirective) { if (externDirective != null) { return UsingKind.Extern; } else { RoslynDebug.AssertNotNull(usingDirective); } if (usingDirective.GlobalKeyword != default) { if (usingDirective.Alias != null) return UsingKind.GlobalAlias; if (usingDirective.StaticKeyword != default) return UsingKind.GlobalUsingStatic; return UsingKind.GlobalNamespace; } else { if (usingDirective.Alias != null) return UsingKind.Alias; if (usingDirective.StaticKeyword != default) return UsingKind.UsingStatic; return UsingKind.Namespace; } } public int Compare(SyntaxNode? directive1, SyntaxNode? directive2) { if (directive1 is null) return directive2 is null ? 0 : -1; else if (directive2 is null) return 1; if (directive1 == directive2) return 0; var using1 = directive1 as UsingDirectiveSyntax; var using2 = directive2 as UsingDirectiveSyntax; var extern1 = directive1 as ExternAliasDirectiveSyntax; var extern2 = directive2 as ExternAliasDirectiveSyntax; var directive1Kind = GetUsingKind(using1, extern1); var directive2Kind = GetUsingKind(using2, extern2); // different types of usings get broken up into groups. // * externs // * usings // * using statics // * aliases var directiveKindDifference = directive1Kind - directive2Kind; if (directiveKindDifference != 0) { return directiveKindDifference; } // ok, it's the same type of using now. switch (directive1Kind) { case UsingKind.Extern: // they're externs, sort by the alias return _tokenComparer.Compare(extern1!.Identifier, extern2!.Identifier); case UsingKind.Alias: var aliasComparisonResult = _tokenComparer.Compare(using1!.Alias!.Name.Identifier, using2!.Alias!.Name.Identifier); if (aliasComparisonResult == 0) { // They both use the same alias, so compare the names. return _nameComparer.Compare(using1.Name, using2.Name); } return aliasComparisonResult; default: return _nameComparer.Compare(using1!.Name, using2!.Name); } } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Workspaces/Core/Portable/Workspace/TextExtensions.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Collections.Immutable; using System.Threading; using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.Text { // The parts of a workspace that deal with open documents internal static class TextExtensions { /// <summary> /// Gets the documents from the corresponding workspace's current solution that are associated with the source text's container, /// updated to contain the same text as the source if necessary. /// </summary> public static ImmutableArray<Document> GetRelatedDocumentsWithChanges(this SourceText text) { if (Workspace.TryGetWorkspace(text.Container, out var workspace)) { var documentId = workspace.GetDocumentIdInCurrentContext(text.Container); if (documentId == null) { return ImmutableArray<Document>.Empty; } var solution = workspace.CurrentSolution; if (workspace.TryGetOpenSourceGeneratedDocumentIdentity(documentId, out var documentIdentity)) { // For source generated documents, we won't count them as linked across multiple projects; this is because // the generated documents in each target may have different source so other features might be surprised if we // return the same documents but with different text. So in this case, we'll just return a single document. return ImmutableArray.Create(solution.WithFrozenSourceGeneratedDocument(documentIdentity, text)); } var relatedIds = solution.GetRelatedDocumentIds(documentId); solution = solution.WithDocumentText(relatedIds, text, PreservationMode.PreserveIdentity); return relatedIds.SelectAsArray((id, solution) => solution.GetRequiredDocument(id), solution); } return ImmutableArray<Document>.Empty; } /// <summary> /// Gets the document from the corresponding workspace's current solution that is associated with the source text's container /// in its current project context, updated to contain the same text as the source if necessary. /// </summary> public static Document? GetOpenDocumentInCurrentContextWithChanges(this SourceText text) { if (Workspace.TryGetWorkspace(text.Container, out var workspace)) { var solution = workspace.CurrentSolution; var id = workspace.GetDocumentIdInCurrentContext(text.Container); if (id == null) { return null; } if (workspace.TryGetOpenSourceGeneratedDocumentIdentity(id, out var documentIdentity)) { return solution.WithFrozenSourceGeneratedDocument(documentIdentity, text); } // We update all linked files to ensure they are all in sync. Otherwise code might try to jump from // one linked file to another and be surprised if the text is entirely different. var allIds = solution.GetRelatedDocumentIds(id); return solution.WithDocumentText(allIds, text, PreservationMode.PreserveIdentity) .GetDocument(id); } return null; } /// <summary> /// Gets the documents from the corresponding workspace's current solution that are associated with the text container. /// </summary> public static ImmutableArray<Document> GetRelatedDocuments(this SourceTextContainer container) { if (Workspace.TryGetWorkspace(container, out var workspace)) { var solution = workspace.CurrentSolution; var documentId = workspace.GetDocumentIdInCurrentContext(container); if (documentId != null) { var relatedIds = solution.GetRelatedDocumentIds(documentId); return relatedIds.SelectAsArray((id, solution) => solution.GetRequiredDocument(id), solution); } } return ImmutableArray<Document>.Empty; } /// <summary> /// Gets the document from the corresponding workspace's current solution that is associated with the text container /// in its current project context. /// </summary> public static Document? GetOpenDocumentInCurrentContext(this SourceTextContainer container) { if (Workspace.TryGetWorkspace(container, out var workspace)) { var id = workspace.GetDocumentIdInCurrentContext(container); return workspace.CurrentSolution.GetDocument(id); } return null; } /// <summary> /// Tries to get the document corresponding to the text from the current partial solution /// associated with the text's container. If the document does not contain the exact text a document /// from a new solution containing the specified text is constructed. If no document is associated /// with the specified text's container, or the text's container isn't associated with a workspace, /// then the method returns false. /// </summary> internal static Document? GetDocumentWithFrozenPartialSemantics(this SourceText text, CancellationToken cancellationToken) { var document = text.GetOpenDocumentInCurrentContextWithChanges(); return document?.WithFrozenPartialSemantics(cancellationToken); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Collections.Immutable; using System.Threading; using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.Text { // The parts of a workspace that deal with open documents internal static class TextExtensions { /// <summary> /// Gets the documents from the corresponding workspace's current solution that are associated with the source text's container, /// updated to contain the same text as the source if necessary. /// </summary> public static ImmutableArray<Document> GetRelatedDocumentsWithChanges(this SourceText text) { if (Workspace.TryGetWorkspace(text.Container, out var workspace)) { var documentId = workspace.GetDocumentIdInCurrentContext(text.Container); if (documentId == null) { return ImmutableArray<Document>.Empty; } var solution = workspace.CurrentSolution; if (workspace.TryGetOpenSourceGeneratedDocumentIdentity(documentId, out var documentIdentity)) { // For source generated documents, we won't count them as linked across multiple projects; this is because // the generated documents in each target may have different source so other features might be surprised if we // return the same documents but with different text. So in this case, we'll just return a single document. return ImmutableArray.Create(solution.WithFrozenSourceGeneratedDocument(documentIdentity, text)); } var relatedIds = solution.GetRelatedDocumentIds(documentId); solution = solution.WithDocumentText(relatedIds, text, PreservationMode.PreserveIdentity); return relatedIds.SelectAsArray((id, solution) => solution.GetRequiredDocument(id), solution); } return ImmutableArray<Document>.Empty; } /// <summary> /// Gets the document from the corresponding workspace's current solution that is associated with the source text's container /// in its current project context, updated to contain the same text as the source if necessary. /// </summary> public static Document? GetOpenDocumentInCurrentContextWithChanges(this SourceText text) { if (Workspace.TryGetWorkspace(text.Container, out var workspace)) { var solution = workspace.CurrentSolution; var id = workspace.GetDocumentIdInCurrentContext(text.Container); if (id == null) { return null; } if (workspace.TryGetOpenSourceGeneratedDocumentIdentity(id, out var documentIdentity)) { return solution.WithFrozenSourceGeneratedDocument(documentIdentity, text); } // We update all linked files to ensure they are all in sync. Otherwise code might try to jump from // one linked file to another and be surprised if the text is entirely different. var allIds = solution.GetRelatedDocumentIds(id); return solution.WithDocumentText(allIds, text, PreservationMode.PreserveIdentity) .GetDocument(id); } return null; } /// <summary> /// Gets the documents from the corresponding workspace's current solution that are associated with the text container. /// </summary> public static ImmutableArray<Document> GetRelatedDocuments(this SourceTextContainer container) { if (Workspace.TryGetWorkspace(container, out var workspace)) { var solution = workspace.CurrentSolution; var documentId = workspace.GetDocumentIdInCurrentContext(container); if (documentId != null) { var relatedIds = solution.GetRelatedDocumentIds(documentId); return relatedIds.SelectAsArray((id, solution) => solution.GetRequiredDocument(id), solution); } } return ImmutableArray<Document>.Empty; } /// <summary> /// Gets the document from the corresponding workspace's current solution that is associated with the text container /// in its current project context. /// </summary> public static Document? GetOpenDocumentInCurrentContext(this SourceTextContainer container) { if (Workspace.TryGetWorkspace(container, out var workspace)) { var id = workspace.GetDocumentIdInCurrentContext(container); return workspace.CurrentSolution.GetDocument(id); } return null; } /// <summary> /// Tries to get the document corresponding to the text from the current partial solution /// associated with the text's container. If the document does not contain the exact text a document /// from a new solution containing the specified text is constructed. If no document is associated /// with the specified text's container, or the text's container isn't associated with a workspace, /// then the method returns false. /// </summary> internal static Document? GetDocumentWithFrozenPartialSemantics(this SourceText text, CancellationToken cancellationToken) { var document = text.GetOpenDocumentInCurrentContextWithChanges(); return document?.WithFrozenPartialSemantics(cancellationToken); } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Workspaces/Core/Portable/LinkedFileDiffMerging/ILinkedFileMergeConflictCommentAdditionService.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using Microsoft.CodeAnalysis.Host; namespace Microsoft.CodeAnalysis { internal interface ILinkedFileMergeConflictCommentAdditionService : ILanguageService, IMergeConflictHandler { } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using Microsoft.CodeAnalysis.Host; namespace Microsoft.CodeAnalysis { internal interface ILinkedFileMergeConflictCommentAdditionService : ILanguageService, IMergeConflictHandler { } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Compilers/CSharp/Portable/Binder/Binder.OverflowChecks.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Text; namespace Microsoft.CodeAnalysis.CSharp { internal partial class Binder { protected enum OverflowChecks { /// <summary> /// Outside of <c>checked</c>, <c>unchecked</c> expression/block. /// </summary> Implicit, /// <summary> /// Within <c>unchecked</c> expression/block. /// </summary> Disabled, /// <summary> /// Within <c>checked</c> expression/block. /// </summary> Enabled } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Text; namespace Microsoft.CodeAnalysis.CSharp { internal partial class Binder { protected enum OverflowChecks { /// <summary> /// Outside of <c>checked</c>, <c>unchecked</c> expression/block. /// </summary> Implicit, /// <summary> /// Within <c>unchecked</c> expression/block. /// </summary> Disabled, /// <summary> /// Within <c>checked</c> expression/block. /// </summary> Enabled } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./scripts/merge-vs-deps.ps1
[CmdletBinding(PositionalBinding=$false)] Param([string]$accessToken = "") # name and email are only used for merge commit, it doesn't really matter what we put in there. git config user.name "RoslynValidation" git config user.email "[email protected]" if ($accessToken -eq "") { git pull origin main-vs-deps } else { $base64Pat = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes(":$accessToken")) git -c http.extraheader="AUTHORIZATION: Basic $base64Pat" pull origin main-vs-deps } if (-not $?) { Write-Host "##vso[task.logissue type=error]Failed to merge main-vs-deps into source branch" exit 1 }
[CmdletBinding(PositionalBinding=$false)] Param([string]$accessToken = "") # name and email are only used for merge commit, it doesn't really matter what we put in there. git config user.name "RoslynValidation" git config user.email "[email protected]" if ($accessToken -eq "") { git pull origin main-vs-deps } else { $base64Pat = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes(":$accessToken")) git -c http.extraheader="AUTHORIZATION: Basic $base64Pat" pull origin main-vs-deps } if (-not $?) { Write-Host "##vso[task.logissue type=error]Failed to merge main-vs-deps into source branch" exit 1 }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Compilers/Test/Core/Extensions/OperationExtensions.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable namespace Microsoft.CodeAnalysis.Test.Utilities { internal static class OperationTestExtensions { public static bool MustHaveNullType(this IOperation operation) { switch (operation.Kind) { // TODO: Expand to cover all operations that must always have null type. case OperationKind.ArrayInitializer: case OperationKind.Argument: return true; default: return false; } } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable namespace Microsoft.CodeAnalysis.Test.Utilities { internal static class OperationTestExtensions { public static bool MustHaveNullType(this IOperation operation) { switch (operation.Kind) { // TODO: Expand to cover all operations that must always have null type. case OperationKind.ArrayInitializer: case OperationKind.Argument: return true; default: return false; } } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Workspaces/Remote/Core/ExternalAccess/UnitTesting/Api/UnitTestingRemoteServiceCallbackDispatcherRegistry.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.Collections.Immutable; using Microsoft.CodeAnalysis.Remote; namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api { internal sealed class UnitTestingRemoteServiceCallbackDispatcherRegistry : IRemoteServiceCallbackDispatcherProvider { public static readonly UnitTestingRemoteServiceCallbackDispatcherRegistry Empty = new(Array.Empty<(Type, UnitTestingRemoteServiceCallbackDispatcher)>()); private readonly ImmutableDictionary<Type, UnitTestingRemoteServiceCallbackDispatcher> _lazyDispatchers; public UnitTestingRemoteServiceCallbackDispatcherRegistry(IEnumerable<(Type serviceType, UnitTestingRemoteServiceCallbackDispatcher dispatcher)> lazyDispatchers) { _lazyDispatchers = lazyDispatchers.ToImmutableDictionary(e => e.serviceType, e => e.dispatcher); } IRemoteServiceCallbackDispatcher IRemoteServiceCallbackDispatcherProvider.GetDispatcher(Type serviceType) => _lazyDispatchers[serviceType]; } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.Collections.Immutable; using Microsoft.CodeAnalysis.Remote; namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api { internal sealed class UnitTestingRemoteServiceCallbackDispatcherRegistry : IRemoteServiceCallbackDispatcherProvider { public static readonly UnitTestingRemoteServiceCallbackDispatcherRegistry Empty = new(Array.Empty<(Type, UnitTestingRemoteServiceCallbackDispatcher)>()); private readonly ImmutableDictionary<Type, UnitTestingRemoteServiceCallbackDispatcher> _lazyDispatchers; public UnitTestingRemoteServiceCallbackDispatcherRegistry(IEnumerable<(Type serviceType, UnitTestingRemoteServiceCallbackDispatcher dispatcher)> lazyDispatchers) { _lazyDispatchers = lazyDispatchers.ToImmutableDictionary(e => e.serviceType, e => e.dispatcher); } IRemoteServiceCallbackDispatcher IRemoteServiceCallbackDispatcherProvider.GetDispatcher(Type serviceType) => _lazyDispatchers[serviceType]; } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Workspaces/VisualBasic/Portable/Formatting/Engine/Trivia/TriviaDataFactory.ComplexTrivia.vb
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports System.Threading Imports Microsoft.CodeAnalysis Imports Microsoft.CodeAnalysis.Diagnostics Imports Microsoft.CodeAnalysis.Formatting Imports Microsoft.CodeAnalysis.Text Namespace Microsoft.CodeAnalysis.VisualBasic.Formatting Partial Friend Class TriviaDataFactory ''' <summary> ''' represents a general trivia between two tokens. slightly more expensive than others since it ''' needs to calculate stuff unlike other cases ''' </summary> Private Class ComplexTrivia Inherits AbstractComplexTrivia Public Sub New(options As AnalyzerConfigOptions, treeInfo As TreeData, token1 As SyntaxToken, token2 As SyntaxToken) MyBase.New(options, treeInfo, token1, token2) Contract.ThrowIfNull(treeInfo) End Sub Protected Overrides Sub ExtractLineAndSpace(text As String, ByRef lines As Integer, ByRef spaces As Integer) text.ProcessTextBetweenTokens(Me.TreeInfo, Me.Token1, Me.Options.GetOption(FormattingOptions2.TabSize), lines, spaces) End Sub Protected Overrides Function CreateComplexTrivia(line As Integer, space As Integer) As TriviaData Return New ModifiedComplexTrivia(Me.Options, Me, line, space) End Function Protected Overrides Function CreateComplexTrivia(line As Integer, space As Integer, indentation As Integer) As TriviaData ' We cannot always choose indentation over space because sometimes the complex trivia may contain some text, which ' are part of the leadingTrivia of the following token, in the same line as the following token. ' Case : ' _ ' : Imports ' In the above case, the indentation of the Imports token will be '0' but since it contains the colontrivia we cannot take the ' new indentation. ' if given indentation is negative, and actual formatting shows that we can touch the last line (space == 0) ' then, keep the negative indentation. Return New ModifiedComplexTrivia(Me.Options, Me, line, If(space = 0 AndAlso indentation < 0, indentation, space)) End Function Protected Overrides Function Format(context As FormattingContext, formattingRules As ChainedFormattingRules, lines As Integer, spaces As Integer, cancellationToken As CancellationToken) As TriviaDataWithList Return New FormattedComplexTrivia(context, formattingRules, Me.Token1, Me.Token2, lines, spaces, Me.OriginalString, cancellationToken) End Function Protected Overrides Function ContainsSkippedTokensOrText(list As TriviaList) As Boolean Return CodeShapeAnalyzer.ContainsSkippedTokensOrText(list) End Function Private Function ShouldFormat(context As FormattingContext) As Boolean Dim commonToken1 As SyntaxToken = Me.Token1 Dim commonToken2 As SyntaxToken = Me.Token2 Dim list As TriviaList = New TriviaList(commonToken1.TrailingTrivia, commonToken2.LeadingTrivia) Contract.ThrowIfFalse(list.Count > 0) ' okay, now, check whether we need or are able to format noisy tokens If ContainsSkippedTokensOrText(list) Then Return False End If Dim beginningOfNewLine = Me.Token1.Kind = SyntaxKind.None If Not Me.SecondTokenIsFirstTokenOnLine AndAlso Not beginningOfNewLine Then Return CodeShapeAnalyzer.ShouldFormatSingleLine(list) End If Debug.Assert(Me.SecondTokenIsFirstTokenOnLine OrElse beginningOfNewLine) If Me.Options.GetOption(FormattingOptions2.UseTabs) Then Return True End If Return CodeShapeAnalyzer.ShouldFormatMultiLine(context, beginningOfNewLine, list) End Function Public Overrides Sub Format(context As FormattingContext, formattingRules As ChainedFormattingRules, formattingResultApplier As Action(Of Integer, TokenStream, TriviaData), cancellationToken As CancellationToken, Optional tokenPairIndex As Integer = TokenPairIndexNotNeeded) If Not ShouldFormat(context) Then Return End If formattingResultApplier(tokenPairIndex, context.TokenStream, Format(context, formattingRules, Me.LineBreaks, Me.Spaces, cancellationToken)) End Sub Public Overrides Function GetTextChanges(span As TextSpan) As IEnumerable(Of TextChange) Throw New NotImplementedException() End Function Public Overrides Function GetTriviaList(cancellationToken As CancellationToken) As SyntaxTriviaList Throw New NotImplementedException() End Function End Class End Class End Namespace
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports System.Threading Imports Microsoft.CodeAnalysis Imports Microsoft.CodeAnalysis.Diagnostics Imports Microsoft.CodeAnalysis.Formatting Imports Microsoft.CodeAnalysis.Text Namespace Microsoft.CodeAnalysis.VisualBasic.Formatting Partial Friend Class TriviaDataFactory ''' <summary> ''' represents a general trivia between two tokens. slightly more expensive than others since it ''' needs to calculate stuff unlike other cases ''' </summary> Private Class ComplexTrivia Inherits AbstractComplexTrivia Public Sub New(options As AnalyzerConfigOptions, treeInfo As TreeData, token1 As SyntaxToken, token2 As SyntaxToken) MyBase.New(options, treeInfo, token1, token2) Contract.ThrowIfNull(treeInfo) End Sub Protected Overrides Sub ExtractLineAndSpace(text As String, ByRef lines As Integer, ByRef spaces As Integer) text.ProcessTextBetweenTokens(Me.TreeInfo, Me.Token1, Me.Options.GetOption(FormattingOptions2.TabSize), lines, spaces) End Sub Protected Overrides Function CreateComplexTrivia(line As Integer, space As Integer) As TriviaData Return New ModifiedComplexTrivia(Me.Options, Me, line, space) End Function Protected Overrides Function CreateComplexTrivia(line As Integer, space As Integer, indentation As Integer) As TriviaData ' We cannot always choose indentation over space because sometimes the complex trivia may contain some text, which ' are part of the leadingTrivia of the following token, in the same line as the following token. ' Case : ' _ ' : Imports ' In the above case, the indentation of the Imports token will be '0' but since it contains the colontrivia we cannot take the ' new indentation. ' if given indentation is negative, and actual formatting shows that we can touch the last line (space == 0) ' then, keep the negative indentation. Return New ModifiedComplexTrivia(Me.Options, Me, line, If(space = 0 AndAlso indentation < 0, indentation, space)) End Function Protected Overrides Function Format(context As FormattingContext, formattingRules As ChainedFormattingRules, lines As Integer, spaces As Integer, cancellationToken As CancellationToken) As TriviaDataWithList Return New FormattedComplexTrivia(context, formattingRules, Me.Token1, Me.Token2, lines, spaces, Me.OriginalString, cancellationToken) End Function Protected Overrides Function ContainsSkippedTokensOrText(list As TriviaList) As Boolean Return CodeShapeAnalyzer.ContainsSkippedTokensOrText(list) End Function Private Function ShouldFormat(context As FormattingContext) As Boolean Dim commonToken1 As SyntaxToken = Me.Token1 Dim commonToken2 As SyntaxToken = Me.Token2 Dim list As TriviaList = New TriviaList(commonToken1.TrailingTrivia, commonToken2.LeadingTrivia) Contract.ThrowIfFalse(list.Count > 0) ' okay, now, check whether we need or are able to format noisy tokens If ContainsSkippedTokensOrText(list) Then Return False End If Dim beginningOfNewLine = Me.Token1.Kind = SyntaxKind.None If Not Me.SecondTokenIsFirstTokenOnLine AndAlso Not beginningOfNewLine Then Return CodeShapeAnalyzer.ShouldFormatSingleLine(list) End If Debug.Assert(Me.SecondTokenIsFirstTokenOnLine OrElse beginningOfNewLine) If Me.Options.GetOption(FormattingOptions2.UseTabs) Then Return True End If Return CodeShapeAnalyzer.ShouldFormatMultiLine(context, beginningOfNewLine, list) End Function Public Overrides Sub Format(context As FormattingContext, formattingRules As ChainedFormattingRules, formattingResultApplier As Action(Of Integer, TokenStream, TriviaData), cancellationToken As CancellationToken, Optional tokenPairIndex As Integer = TokenPairIndexNotNeeded) If Not ShouldFormat(context) Then Return End If formattingResultApplier(tokenPairIndex, context.TokenStream, Format(context, formattingRules, Me.LineBreaks, Me.Spaces, cancellationToken)) End Sub Public Overrides Function GetTextChanges(span As TextSpan) As IEnumerable(Of TextChange) Throw New NotImplementedException() End Function Public Overrides Function GetTriviaList(cancellationToken As CancellationToken) As SyntaxTriviaList Throw New NotImplementedException() End Function End Class End Class End Namespace
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Features/Core/Portable/CodeFixes/CodeFixContextExtensions.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Collections.Generic; using System.Collections.Immutable; using Microsoft.CodeAnalysis.CodeActions; namespace Microsoft.CodeAnalysis.CodeFixes { internal static class CodeFixContextExtensions { /// <summary> /// Use this helper to register multiple fixes (<paramref name="actions"/>) each of which addresses / fixes the same supplied <paramref name="diagnostic"/>. /// </summary> internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, Diagnostic diagnostic) { foreach (var action in actions) { context.RegisterCodeFix(action, diagnostic); } } /// <summary> /// Use this helper to register multiple fixes (<paramref name="actions"/>) each of which addresses / fixes the same set of supplied <paramref name="diagnostics"/>. /// </summary> internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, ImmutableArray<Diagnostic> diagnostics) { if (actions != null) { foreach (var action in actions) { context.RegisterCodeFix(action, diagnostics); } } } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Collections.Generic; using System.Collections.Immutable; using Microsoft.CodeAnalysis.CodeActions; namespace Microsoft.CodeAnalysis.CodeFixes { internal static class CodeFixContextExtensions { /// <summary> /// Use this helper to register multiple fixes (<paramref name="actions"/>) each of which addresses / fixes the same supplied <paramref name="diagnostic"/>. /// </summary> internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, Diagnostic diagnostic) { foreach (var action in actions) { context.RegisterCodeFix(action, diagnostic); } } /// <summary> /// Use this helper to register multiple fixes (<paramref name="actions"/>) each of which addresses / fixes the same set of supplied <paramref name="diagnostics"/>. /// </summary> internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, ImmutableArray<Diagnostic> diagnostics) { if (actions != null) { foreach (var action in actions) { context.RegisterCodeFix(action, diagnostics); } } } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Compilers/Core/Portable/PEWriter/MemberRefComparer.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using Roslyn.Utilities; namespace Microsoft.Cci { internal sealed class MemberRefComparer : IEqualityComparer<ITypeMemberReference> { private readonly MetadataWriter _metadataWriter; internal MemberRefComparer(MetadataWriter metadataWriter) { _metadataWriter = metadataWriter; } public bool Equals(ITypeMemberReference? x, ITypeMemberReference? y) { if (x == y) { return true; } RoslynDebug.Assert(x is object && y is object); if (x.GetContainingType(_metadataWriter.Context) != y.GetContainingType(_metadataWriter.Context)) { if (_metadataWriter.GetMemberReferenceParent(x) != _metadataWriter.GetMemberReferenceParent(y)) { return false; } } if (x.Name != y.Name) { return false; } var xf = x as IFieldReference; var yf = y as IFieldReference; if (xf != null && yf != null) { return _metadataWriter.GetFieldSignatureIndex(xf) == _metadataWriter.GetFieldSignatureIndex(yf); } var xm = x as IMethodReference; var ym = y as IMethodReference; if (xm != null && ym != null) { return _metadataWriter.GetMethodSignatureHandle(xm) == _metadataWriter.GetMethodSignatureHandle(ym); } return false; } public int GetHashCode(ITypeMemberReference memberRef) { int hash = Hash.Combine(memberRef.Name, _metadataWriter.GetMemberReferenceParent(memberRef).GetHashCode()); var fieldRef = memberRef as IFieldReference; if (fieldRef != null) { hash = Hash.Combine(hash, _metadataWriter.GetFieldSignatureIndex(fieldRef).GetHashCode()); } else { var methodRef = memberRef as IMethodReference; if (methodRef != null) { hash = Hash.Combine(hash, _metadataWriter.GetMethodSignatureHandle(methodRef).GetHashCode()); } } return hash; } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using Roslyn.Utilities; namespace Microsoft.Cci { internal sealed class MemberRefComparer : IEqualityComparer<ITypeMemberReference> { private readonly MetadataWriter _metadataWriter; internal MemberRefComparer(MetadataWriter metadataWriter) { _metadataWriter = metadataWriter; } public bool Equals(ITypeMemberReference? x, ITypeMemberReference? y) { if (x == y) { return true; } RoslynDebug.Assert(x is object && y is object); if (x.GetContainingType(_metadataWriter.Context) != y.GetContainingType(_metadataWriter.Context)) { if (_metadataWriter.GetMemberReferenceParent(x) != _metadataWriter.GetMemberReferenceParent(y)) { return false; } } if (x.Name != y.Name) { return false; } var xf = x as IFieldReference; var yf = y as IFieldReference; if (xf != null && yf != null) { return _metadataWriter.GetFieldSignatureIndex(xf) == _metadataWriter.GetFieldSignatureIndex(yf); } var xm = x as IMethodReference; var ym = y as IMethodReference; if (xm != null && ym != null) { return _metadataWriter.GetMethodSignatureHandle(xm) == _metadataWriter.GetMethodSignatureHandle(ym); } return false; } public int GetHashCode(ITypeMemberReference memberRef) { int hash = Hash.Combine(memberRef.Name, _metadataWriter.GetMemberReferenceParent(memberRef).GetHashCode()); var fieldRef = memberRef as IFieldReference; if (fieldRef != null) { hash = Hash.Combine(hash, _metadataWriter.GetFieldSignatureIndex(fieldRef).GetHashCode()); } else { var methodRef = memberRef as IMethodReference; if (methodRef != null) { hash = Hash.Combine(hash, _metadataWriter.GetMethodSignatureHandle(methodRef).GetHashCode()); } } return hash; } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Workspaces/CoreTestUtilities/MEF/IMefHostExportProviderExtensions.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Collections.Generic; using System.Linq; using Microsoft.CodeAnalysis.Host.Mef; namespace Microsoft.CodeAnalysis.Test.Utilities { internal static class IMefHostExportProviderExtensions { public static TExtension GetExportedValue<TExtension>(this IMefHostExportProvider provider) => provider.GetExports<TExtension>().Single().Value; public static IEnumerable<TExtension> GetExportedValues<TExtension>(this IMefHostExportProvider provider) => provider.GetExports<TExtension>().Select(l => l.Value); } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Collections.Generic; using System.Linq; using Microsoft.CodeAnalysis.Host.Mef; namespace Microsoft.CodeAnalysis.Test.Utilities { internal static class IMefHostExportProviderExtensions { public static TExtension GetExportedValue<TExtension>(this IMefHostExportProvider provider) => provider.GetExports<TExtension>().Single().Value; public static IEnumerable<TExtension> GetExportedValues<TExtension>(this IMefHostExportProvider provider) => provider.GetExports<TExtension>().Select(l => l.Value); } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Workspaces/Remote/ServiceHub/Services/DiagnosticAnalyzer/PerformanceQueue.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System; using System.Collections.Generic; using System.Linq; using Microsoft.CodeAnalysis.Diagnostics; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.Remote.Diagnostics { /// <summary> /// This queue hold onto raw performance data. this type itself is not thread safe. the one who uses this type /// should take care of that. /// </summary> /// <threadsafety static="false" instance="false"/> internal class PerformanceQueue { // we need at least 100 samples for result to be stable private const int MinSampleSize = 100; private readonly int _maxSampleSize; private readonly LinkedList<Snapshot> _snapshots; public PerformanceQueue(int maxSampleSize) { Contract.ThrowIfFalse(maxSampleSize > MinSampleSize); _maxSampleSize = maxSampleSize; _snapshots = new LinkedList<Snapshot>(); } public int Count => _snapshots.Count; public void Add(IEnumerable<(string analyzerId, TimeSpan timeSpan)> rawData, int unitCount) { if (_snapshots.Count < _maxSampleSize) { _snapshots.AddLast(new Snapshot(rawData, unitCount)); } else { // remove the first one var first = _snapshots.First; _snapshots.RemoveFirst(); // update data to new data and put it back first.Value.Update(rawData, unitCount); _snapshots.AddLast(first); } } public void GetPerformanceData(Dictionary<string, (double average, double stddev)> aggregatedPerformanceDataPerAnalyzer) { if (_snapshots.Count < MinSampleSize) { // we don't have enough data to report this return; } using var pooledMap = SharedPools.Default<Dictionary<int, string>>().GetPooledObject(); using var pooledSet = SharedPools.Default<HashSet<int>>().GetPooledObject(); using var pooledList = SharedPools.Default<List<double>>().GetPooledObject(); var reverseMap = pooledMap.Object; AnalyzerNumberAssigner.Instance.GetReverseMap(reverseMap); var analyzerSet = pooledSet.Object; // get all analyzers foreach (var snapshot in _snapshots) { snapshot.AppendAnalyzers(analyzerSet); } var list = pooledList.Object; // calculate aggregated data per analyzer foreach (var assignedAnalyzerNumber in analyzerSet) { foreach (var snapshot in _snapshots) { var timeSpan = snapshot.GetTimeSpanInMillisecond(assignedAnalyzerNumber); if (timeSpan == null) { // not all snapshot contains all analyzers continue; } list.Add(timeSpan.Value); } // data is only stable once we have more than certain set // of samples if (list.Count < MinSampleSize) { continue; } // set performance data aggregatedPerformanceDataPerAnalyzer[reverseMap[assignedAnalyzerNumber]] = GetAverageAndAdjustedStandardDeviation(list); list.Clear(); } } private static (double average, double stddev) GetAverageAndAdjustedStandardDeviation(List<double> data) { var average = data.Average(); var stddev = Math.Sqrt(data.Select(ms => Math.Pow(ms - average, 2)).Average()); var squareLength = Math.Sqrt(data.Count); return (average, stddev / squareLength); } private class Snapshot { /// <summary> /// Raw performance data. /// Keyed by analyzer unique number got from AnalyzerNumberAssigner. /// Value is delta (TimeSpan - minSpan) among span in this snapshot /// </summary> private readonly Dictionary<int, double> _performanceMap; public Snapshot(IEnumerable<(string analyzerId, TimeSpan timeSpan)> snapshot, int unitCount) : this(Convert(snapshot), unitCount) { } public Snapshot(IEnumerable<(int assignedAnalyzerNumber, TimeSpan timeSpan)> rawData, int unitCount) { _performanceMap = new Dictionary<int, double>(); Reset(_performanceMap, rawData, unitCount); } public void Update(IEnumerable<(string analyzerId, TimeSpan timeSpan)> rawData, int unitCount) => Reset(_performanceMap, Convert(rawData), unitCount); public void AppendAnalyzers(HashSet<int> analyzerSet) => analyzerSet.UnionWith(_performanceMap.Keys); public double? GetTimeSpanInMillisecond(int assignedAnalyzerNumber) { if (!_performanceMap.TryGetValue(assignedAnalyzerNumber, out var value)) { return null; } return value; } private static void Reset( Dictionary<int, double> map, IEnumerable<(int assignedAnalyzerNumber, TimeSpan timeSpan)> rawData, int fileCount) { // get smallest timespan in the snapshot var minSpan = rawData.Select(kv => kv.timeSpan).Min(); // for now, we just clear the map, if reusing dictionary blindly became an issue due to // dictionary grew too big, then we need to do a bit more work to determine such case // and re-create new dictionary map.Clear(); // map is normalized to current timespan - min timspan of the snapshot foreach (var (assignedAnalyzerNumber, timeSpan) in rawData) { map[assignedAnalyzerNumber] = (timeSpan.TotalMilliseconds - minSpan.TotalMilliseconds) / fileCount; } } private static IEnumerable<(int assignedAnalyzerNumber, TimeSpan timeSpan)> Convert(IEnumerable<(string analyzerId, TimeSpan timeSpan)> rawData) => rawData.Select(kv => (AnalyzerNumberAssigner.Instance.GetUniqueNumber(kv.analyzerId), kv.timeSpan)); } /// <summary> /// Assign unique number to diagnostic analyzers /// </summary> private class AnalyzerNumberAssigner { public static readonly AnalyzerNumberAssigner Instance = new AnalyzerNumberAssigner(); private int _currentId; // use simple approach for now. we don't expect it to grow too much. so entry added // won't be removed until process goes away private readonly Dictionary<string, int> _idMap; private AnalyzerNumberAssigner() { _currentId = 0; _idMap = new Dictionary<string, int>(); } public int GetUniqueNumber(DiagnosticAnalyzer analyzer) => GetUniqueNumber(analyzer.GetAnalyzerId()); public int GetUniqueNumber(string analyzerName) { if (!_idMap.TryGetValue(analyzerName, out var id)) { id = _currentId++; _idMap.Add(analyzerName, id); } return id; } public void GetReverseMap(Dictionary<int, string> reverseMap) { reverseMap.Clear(); foreach (var kv in _idMap) { reverseMap.Add(kv.Value, kv.Key); } } } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System; using System.Collections.Generic; using System.Linq; using Microsoft.CodeAnalysis.Diagnostics; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.Remote.Diagnostics { /// <summary> /// This queue hold onto raw performance data. this type itself is not thread safe. the one who uses this type /// should take care of that. /// </summary> /// <threadsafety static="false" instance="false"/> internal class PerformanceQueue { // we need at least 100 samples for result to be stable private const int MinSampleSize = 100; private readonly int _maxSampleSize; private readonly LinkedList<Snapshot> _snapshots; public PerformanceQueue(int maxSampleSize) { Contract.ThrowIfFalse(maxSampleSize > MinSampleSize); _maxSampleSize = maxSampleSize; _snapshots = new LinkedList<Snapshot>(); } public int Count => _snapshots.Count; public void Add(IEnumerable<(string analyzerId, TimeSpan timeSpan)> rawData, int unitCount) { if (_snapshots.Count < _maxSampleSize) { _snapshots.AddLast(new Snapshot(rawData, unitCount)); } else { // remove the first one var first = _snapshots.First; _snapshots.RemoveFirst(); // update data to new data and put it back first.Value.Update(rawData, unitCount); _snapshots.AddLast(first); } } public void GetPerformanceData(Dictionary<string, (double average, double stddev)> aggregatedPerformanceDataPerAnalyzer) { if (_snapshots.Count < MinSampleSize) { // we don't have enough data to report this return; } using var pooledMap = SharedPools.Default<Dictionary<int, string>>().GetPooledObject(); using var pooledSet = SharedPools.Default<HashSet<int>>().GetPooledObject(); using var pooledList = SharedPools.Default<List<double>>().GetPooledObject(); var reverseMap = pooledMap.Object; AnalyzerNumberAssigner.Instance.GetReverseMap(reverseMap); var analyzerSet = pooledSet.Object; // get all analyzers foreach (var snapshot in _snapshots) { snapshot.AppendAnalyzers(analyzerSet); } var list = pooledList.Object; // calculate aggregated data per analyzer foreach (var assignedAnalyzerNumber in analyzerSet) { foreach (var snapshot in _snapshots) { var timeSpan = snapshot.GetTimeSpanInMillisecond(assignedAnalyzerNumber); if (timeSpan == null) { // not all snapshot contains all analyzers continue; } list.Add(timeSpan.Value); } // data is only stable once we have more than certain set // of samples if (list.Count < MinSampleSize) { continue; } // set performance data aggregatedPerformanceDataPerAnalyzer[reverseMap[assignedAnalyzerNumber]] = GetAverageAndAdjustedStandardDeviation(list); list.Clear(); } } private static (double average, double stddev) GetAverageAndAdjustedStandardDeviation(List<double> data) { var average = data.Average(); var stddev = Math.Sqrt(data.Select(ms => Math.Pow(ms - average, 2)).Average()); var squareLength = Math.Sqrt(data.Count); return (average, stddev / squareLength); } private class Snapshot { /// <summary> /// Raw performance data. /// Keyed by analyzer unique number got from AnalyzerNumberAssigner. /// Value is delta (TimeSpan - minSpan) among span in this snapshot /// </summary> private readonly Dictionary<int, double> _performanceMap; public Snapshot(IEnumerable<(string analyzerId, TimeSpan timeSpan)> snapshot, int unitCount) : this(Convert(snapshot), unitCount) { } public Snapshot(IEnumerable<(int assignedAnalyzerNumber, TimeSpan timeSpan)> rawData, int unitCount) { _performanceMap = new Dictionary<int, double>(); Reset(_performanceMap, rawData, unitCount); } public void Update(IEnumerable<(string analyzerId, TimeSpan timeSpan)> rawData, int unitCount) => Reset(_performanceMap, Convert(rawData), unitCount); public void AppendAnalyzers(HashSet<int> analyzerSet) => analyzerSet.UnionWith(_performanceMap.Keys); public double? GetTimeSpanInMillisecond(int assignedAnalyzerNumber) { if (!_performanceMap.TryGetValue(assignedAnalyzerNumber, out var value)) { return null; } return value; } private static void Reset( Dictionary<int, double> map, IEnumerable<(int assignedAnalyzerNumber, TimeSpan timeSpan)> rawData, int fileCount) { // get smallest timespan in the snapshot var minSpan = rawData.Select(kv => kv.timeSpan).Min(); // for now, we just clear the map, if reusing dictionary blindly became an issue due to // dictionary grew too big, then we need to do a bit more work to determine such case // and re-create new dictionary map.Clear(); // map is normalized to current timespan - min timspan of the snapshot foreach (var (assignedAnalyzerNumber, timeSpan) in rawData) { map[assignedAnalyzerNumber] = (timeSpan.TotalMilliseconds - minSpan.TotalMilliseconds) / fileCount; } } private static IEnumerable<(int assignedAnalyzerNumber, TimeSpan timeSpan)> Convert(IEnumerable<(string analyzerId, TimeSpan timeSpan)> rawData) => rawData.Select(kv => (AnalyzerNumberAssigner.Instance.GetUniqueNumber(kv.analyzerId), kv.timeSpan)); } /// <summary> /// Assign unique number to diagnostic analyzers /// </summary> private class AnalyzerNumberAssigner { public static readonly AnalyzerNumberAssigner Instance = new AnalyzerNumberAssigner(); private int _currentId; // use simple approach for now. we don't expect it to grow too much. so entry added // won't be removed until process goes away private readonly Dictionary<string, int> _idMap; private AnalyzerNumberAssigner() { _currentId = 0; _idMap = new Dictionary<string, int>(); } public int GetUniqueNumber(DiagnosticAnalyzer analyzer) => GetUniqueNumber(analyzer.GetAnalyzerId()); public int GetUniqueNumber(string analyzerName) { if (!_idMap.TryGetValue(analyzerName, out var id)) { id = _currentId++; _idMap.Add(analyzerName, id); } return id; } public void GetReverseMap(Dictionary<int, string> reverseMap) { reverseMap.Clear(); foreach (var kv in _idMap) { reverseMap.Add(kv.Value, kv.Key); } } } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Features/Core/Portable/CodeCleanup/OrganizeUsingsSettings.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable namespace Microsoft.CodeAnalysis.CodeCleanup { /// <summary> /// Indicates which, if any, Organize Usings features are enabled for code cleanup. /// </summary> internal sealed class OrganizeUsingsSet { public bool IsRemoveUnusedImportEnabled { get; } public bool IsSortImportsEnabled { get; } public OrganizeUsingsSet(bool isRemoveUnusedImportEnabled, bool isSortImportsEnabled) { IsRemoveUnusedImportEnabled = isRemoveUnusedImportEnabled; IsSortImportsEnabled = isSortImportsEnabled; } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable namespace Microsoft.CodeAnalysis.CodeCleanup { /// <summary> /// Indicates which, if any, Organize Usings features are enabled for code cleanup. /// </summary> internal sealed class OrganizeUsingsSet { public bool IsRemoveUnusedImportEnabled { get; } public bool IsSortImportsEnabled { get; } public OrganizeUsingsSet(bool isRemoveUnusedImportEnabled, bool isSortImportsEnabled) { IsRemoveUnusedImportEnabled = isRemoveUnusedImportEnabled; IsSortImportsEnabled = isSortImportsEnabled; } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/HoistedStateMachineLocalTests.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System; using System.Collections.Immutable; using System.Linq; using Microsoft.CodeAnalysis.CodeGen; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Microsoft.CodeAnalysis.ExpressionEvaluator; using Microsoft.CodeAnalysis.ExpressionEvaluator.UnitTests; using Microsoft.CodeAnalysis.PooledObjects; using Microsoft.DiaSymReader; using Roslyn.Test.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.UnitTests { public class HoistedStateMachineLocalTests : ExpressionCompilerTestBase { private const string asyncLambdaSourceTemplate = @" using System; using System.Threading.Tasks; public class D {{ private double t; public {0} void M(char u) {{ int x = 1; Func<char, Task<int>> f = async ch => {1}; }} }} "; private const string genericAsyncLambdaSourceTemplate = @" using System; using System.Threading.Tasks; public class D<T> {{ private T t; public {0} void M<U>(U u) {{ int x = 1; Func<char, Task<int>> f = async ch => {1}; }} }} "; [Fact] public void Iterator() { var source = @" using System.Collections.Generic; class C { static IEnumerable<int> M() { #line 500 DummySequencePoint(); { #line 550 int x = 0; yield return x; x++; #line 600 } #line 650 DummySequencePoint(); { #line 700 int x = 0; yield return x; x++; #line 750 } #line 800 DummySequencePoint(); } static void DummySequencePoint() { } } "; var expectedError = "error CS0103: The name 'x' does not exist in the current context"; var expectedIlTemplate = @" {{ // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1) IL_0000: ldarg.0 IL_0001: ldfld ""int C.<M>d__0.{0}"" IL_0006: ret }} "; var comp = CreateCompilation(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { EvaluationContext context; CompilationTestData testData; string error; context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 500); context.CompileExpression("x", out error); Assert.Equal(expectedError, error); testData = new CompilationTestData(); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 550); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(string.Format(expectedIlTemplate, "<x>5__1")); testData = new CompilationTestData(); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 600); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(string.Format(expectedIlTemplate, "<x>5__1")); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 650); context.CompileExpression("x", out error); Assert.Equal(expectedError, error); testData = new CompilationTestData(); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 700); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(string.Format(expectedIlTemplate, "<x>5__2")); testData = new CompilationTestData(); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 750); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(string.Format(expectedIlTemplate, "<x>5__2")); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 800); context.CompileExpression("x", out error); Assert.Equal(expectedError, error); }); } [Fact] public void Async() { var source = @" using System.Threading.Tasks; class C { static async Task M() { #line 500 DummySequencePoint(); { #line 550 int x = 0; await M(); x++; #line 600 } #line 650 DummySequencePoint(); { #line 700 int x = 0; await M(); x++; #line 750 } #line 800 DummySequencePoint(); } static void DummySequencePoint() { } } "; var expectedError = "error CS0103: The name 'x' does not exist in the current context"; var expectedIlTemplate = @" {{ // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, System.Runtime.CompilerServices.TaskAwaiter V_1, C.<M>d__0 V_2, int V_3, System.Runtime.CompilerServices.TaskAwaiter V_4, System.Exception V_5) IL_0000: ldarg.0 IL_0001: ldfld ""int C.<M>d__0.{0}"" IL_0006: ret }} "; var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { EvaluationContext context; CompilationTestData testData; string error; context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 500); context.CompileExpression("x", out error); Assert.Equal(expectedError, error); testData = new CompilationTestData(); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 550); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(string.Format(expectedIlTemplate, "<x>5__1")); testData = new CompilationTestData(); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 600); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(string.Format(expectedIlTemplate, "<x>5__1")); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 650); context.CompileExpression("x", out error); Assert.Equal(expectedError, error); testData = new CompilationTestData(); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 700); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(string.Format(expectedIlTemplate, "<x>5__2")); testData = new CompilationTestData(); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 750); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(string.Format(expectedIlTemplate, "<x>5__2")); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 800); context.CompileExpression("x", out error); Assert.Equal(expectedError, error); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void AsyncLambda_Instance_CaptureNothing() { var source = string.Format(asyncLambdaSourceTemplate, "/*instance*/", "1"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c.<<M>b__1_0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0027: Keyword 'this' is not available in the current context", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D.<>c.<<M>b__1_0>d.ch"" IL_0006: ret } "); AssertEx.SetEqual(GetLocalNames(context), "ch"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void AsyncLambda_Instance_CaptureLocal() { var source = string.Format(asyncLambdaSourceTemplate, "/*instance*/", "x"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__DisplayClass1_0.<<M>b__0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0027: Keyword 'this' is not available in the current context", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D.<>c__DisplayClass1_0 D.<>c__DisplayClass1_0.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""int D.<>c__DisplayClass1_0.x"" IL_000b: ret } "); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D.<>c__DisplayClass1_0.<<M>b__0>d.ch"" IL_0006: ret } "); AssertEx.SetEqual(GetLocalNames(context), "ch", "x"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void AsyncLambda_Instance_CaptureParameter() { var source = string.Format(asyncLambdaSourceTemplate, "/*instance*/", "u.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__DisplayClass1_0.<<M>b__0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0027: Keyword 'this' is not available in the current context", error); testData = new CompilationTestData(); context.CompileExpression("u", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D.<>c__DisplayClass1_0 D.<>c__DisplayClass1_0.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""char D.<>c__DisplayClass1_0.u"" IL_000b: ret } "); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D.<>c__DisplayClass1_0.<<M>b__0>d.ch"" IL_0006: ret } "); AssertEx.SetEqual(GetLocalNames(context), "ch", "u"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void AsyncLambda_Instance_CaptureLambdaParameter() { var source = string.Format(asyncLambdaSourceTemplate, "/*instance*/", "ch.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c.<<M>b__1_0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0027: Keyword 'this' is not available in the current context", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D.<>c.<<M>b__1_0>d.ch"" IL_0006: ret } "); AssertEx.SetEqual(GetLocalNames(context), "ch"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void AsyncLambda_Instance_CaptureThis() { var source = string.Format(asyncLambdaSourceTemplate, "/*instance*/", "t.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<<M>b__1_0>d.MoveNext"); string error; CompilationTestData testData; testData = new CompilationTestData(); context.CompileExpression("t", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D D.<<M>b__1_0>d.<>4__this"" IL_0006: ldfld ""double D.t"" IL_000b: ret } "); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D.<<M>b__1_0>d.ch"" IL_0006: ret } "); AssertEx.SetEqual(GetLocalNames(context), "this", "ch"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void AsyncLambda_Instance_CaptureThisAndLocal() { var source = string.Format(asyncLambdaSourceTemplate, "/*instance*/", "x + t.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__DisplayClass1_0.<<M>b__0>d.MoveNext"); string error; CompilationTestData testData; testData = new CompilationTestData(); context.CompileExpression("t", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 17 (0x11) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D.<>c__DisplayClass1_0 D.<>c__DisplayClass1_0.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""D D.<>c__DisplayClass1_0.<>4__this"" IL_000b: ldfld ""double D.t"" IL_0010: ret } "); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D.<>c__DisplayClass1_0 D.<>c__DisplayClass1_0.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""int D.<>c__DisplayClass1_0.x"" IL_000b: ret } "); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D.<>c__DisplayClass1_0.<<M>b__0>d.ch"" IL_0006: ret } "); AssertEx.SetEqual(GetLocalNames(context), "this", "ch", "x"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void AsyncLambda_Static_CaptureNothing() { var source = string.Format(asyncLambdaSourceTemplate, "static", "1"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c.<<M>b__1_0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0120: An object reference is required for the non-static field, method, or property 'D.t'", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D.<>c.<<M>b__1_0>d.ch"" IL_0006: ret } "); AssertEx.SetEqual(GetLocalNames(context), "ch"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void AsyncLambda_Static_CaptureLocal() { var source = string.Format(asyncLambdaSourceTemplate, "static", "x"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__DisplayClass1_0.<<M>b__0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0120: An object reference is required for the non-static field, method, or property 'D.t'", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D.<>c__DisplayClass1_0 D.<>c__DisplayClass1_0.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""int D.<>c__DisplayClass1_0.x"" IL_000b: ret } "); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D.<>c__DisplayClass1_0.<<M>b__0>d.ch"" IL_0006: ret } "); AssertEx.SetEqual(GetLocalNames(context), "ch", "x"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void AsyncLambda_Static_CaptureParameter() { var source = string.Format(asyncLambdaSourceTemplate, "static", "u.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__DisplayClass1_0.<<M>b__0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0120: An object reference is required for the non-static field, method, or property 'D.t'", error); testData = new CompilationTestData(); context.CompileExpression("u", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D.<>c__DisplayClass1_0 D.<>c__DisplayClass1_0.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""char D.<>c__DisplayClass1_0.u"" IL_000b: ret } "); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D.<>c__DisplayClass1_0.<<M>b__0>d.ch"" IL_0006: ret } "); AssertEx.SetEqual(GetLocalNames(context), "ch", "u"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void AsyncLambda_Static_CaptureLambdaParameter() { var source = string.Format(asyncLambdaSourceTemplate, "static", "ch.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c.<<M>b__1_0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0120: An object reference is required for the non-static field, method, or property 'D.t'", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D.<>c.<<M>b__1_0>d.ch"" IL_0006: ret } "); AssertEx.SetEqual(GetLocalNames(context), "ch"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void GenericAsyncLambda_Instance_CaptureNothing() { var source = string.Format(genericAsyncLambdaSourceTemplate, "/*instance*/", "1"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__1.<<M>b__1_0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0027: Keyword 'this' is not available in the current context", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D<T>.<>c__1<U>.<<M>b__1_0>d.ch"" IL_0006: ret } "); context.CompileExpression("typeof(T)", out error); Assert.Null(error); context.CompileExpression("typeof(U)", out error); Assert.Null(error); AssertEx.SetEqual(GetLocalNames(context), "ch", "<>TypeVariables"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void GenericAsyncLambda_Instance_CaptureLocal() { var source = string.Format(genericAsyncLambdaSourceTemplate, "/*instance*/", "x"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__DisplayClass1_0.<<M>b__0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0027: Keyword 'this' is not available in the current context", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D<T>.<>c__DisplayClass1_0<U> D<T>.<>c__DisplayClass1_0<U>.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""int D<T>.<>c__DisplayClass1_0<U>.x"" IL_000b: ret } "); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D<T>.<>c__DisplayClass1_0<U>.<<M>b__0>d.ch"" IL_0006: ret } "); context.CompileExpression("typeof(T)", out error); Assert.Null(error); context.CompileExpression("typeof(U)", out error); Assert.Null(error); AssertEx.SetEqual(GetLocalNames(context), "ch", "x", "<>TypeVariables"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void GenericAsyncLambda_Instance_CaptureParameter() { var source = string.Format(genericAsyncLambdaSourceTemplate, "/*instance*/", "u.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__DisplayClass1_0.<<M>b__0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0027: Keyword 'this' is not available in the current context", error); testData = new CompilationTestData(); context.CompileExpression("u", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D<T>.<>c__DisplayClass1_0<U> D<T>.<>c__DisplayClass1_0<U>.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""U D<T>.<>c__DisplayClass1_0<U>.u"" IL_000b: ret } "); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D<T>.<>c__DisplayClass1_0<U>.<<M>b__0>d.ch"" IL_0006: ret } "); context.CompileExpression("typeof(T)", out error); Assert.Null(error); context.CompileExpression("typeof(U)", out error); Assert.Null(error); AssertEx.SetEqual(GetLocalNames(context), "ch", "u", "<>TypeVariables"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void GenericAsyncLambda_Instance_CaptureLambdaParameter() { var source = string.Format(genericAsyncLambdaSourceTemplate, "/*instance*/", "ch.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__1.<<M>b__1_0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0027: Keyword 'this' is not available in the current context", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D<T>.<>c__1<U>.<<M>b__1_0>d.ch"" IL_0006: ret } "); context.CompileExpression("typeof(T)", out error); Assert.Null(error); context.CompileExpression("typeof(U)", out error); Assert.Null(error); AssertEx.SetEqual(GetLocalNames(context), "ch", "<>TypeVariables"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void GenericAsyncLambda_Instance_CaptureThis() { var source = string.Format(genericAsyncLambdaSourceTemplate, "/*instance*/", "t.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<<M>b__1_0>d.MoveNext"); string error; CompilationTestData testData; testData = new CompilationTestData(); context.CompileExpression("t", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D<T> D<T>.<<M>b__1_0>d<U>.<>4__this"" IL_0006: ldfld ""T D<T>.t"" IL_000b: ret } "); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D<T>.<<M>b__1_0>d<U>.ch"" IL_0006: ret } "); context.CompileExpression("typeof(T)", out error); Assert.Null(error); context.CompileExpression("typeof(U)", out error); Assert.Null(error); AssertEx.SetEqual(GetLocalNames(context), "this", "ch", "<>TypeVariables"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void GenericAsyncLambda_Instance_CaptureThisAndLocal() { var source = string.Format(genericAsyncLambdaSourceTemplate, "/*instance*/", "x + t.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__DisplayClass1_0.<<M>b__0>d.MoveNext"); string error; CompilationTestData testData; testData = new CompilationTestData(); context.CompileExpression("t", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 17 (0x11) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D<T>.<>c__DisplayClass1_0<U> D<T>.<>c__DisplayClass1_0<U>.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""D<T> D<T>.<>c__DisplayClass1_0<U>.<>4__this"" IL_000b: ldfld ""T D<T>.t"" IL_0010: ret } "); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D<T>.<>c__DisplayClass1_0<U> D<T>.<>c__DisplayClass1_0<U>.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""int D<T>.<>c__DisplayClass1_0<U>.x"" IL_000b: ret } "); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D<T>.<>c__DisplayClass1_0<U>.<<M>b__0>d.ch"" IL_0006: ret } "); context.CompileExpression("typeof(T)", out error); Assert.Null(error); context.CompileExpression("typeof(U)", out error); Assert.Null(error); AssertEx.SetEqual(GetLocalNames(context), "this", "ch", "x", "<>TypeVariables"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void GenericAsyncLambda_Static_CaptureNothing() { var source = string.Format(genericAsyncLambdaSourceTemplate, "static", "1"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__1.<<M>b__1_0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0120: An object reference is required for the non-static field, method, or property 'D<T>.t'", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D<T>.<>c__1<U>.<<M>b__1_0>d.ch"" IL_0006: ret } "); context.CompileExpression("typeof(T)", out error); Assert.Null(error); context.CompileExpression("typeof(U)", out error); Assert.Null(error); AssertEx.SetEqual(GetLocalNames(context), "ch", "<>TypeVariables"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void GenericAsyncLambda_Static_CaptureLocal() { var source = string.Format(genericAsyncLambdaSourceTemplate, "static", "x"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__DisplayClass1_0.<<M>b__0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0120: An object reference is required for the non-static field, method, or property 'D<T>.t'", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D<T>.<>c__DisplayClass1_0<U> D<T>.<>c__DisplayClass1_0<U>.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""int D<T>.<>c__DisplayClass1_0<U>.x"" IL_000b: ret } "); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D<T>.<>c__DisplayClass1_0<U>.<<M>b__0>d.ch"" IL_0006: ret } "); context.CompileExpression("typeof(T)", out error); Assert.Null(error); context.CompileExpression("typeof(U)", out error); Assert.Null(error); AssertEx.SetEqual(GetLocalNames(context), "ch", "x", "<>TypeVariables"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void GenericAsyncLambda_Static_CaptureParameter() { var source = string.Format(genericAsyncLambdaSourceTemplate, "static", "u.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__DisplayClass1_0.<<M>b__0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0120: An object reference is required for the non-static field, method, or property 'D<T>.t'", error); testData = new CompilationTestData(); context.CompileExpression("u", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D<T>.<>c__DisplayClass1_0<U> D<T>.<>c__DisplayClass1_0<U>.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""U D<T>.<>c__DisplayClass1_0<U>.u"" IL_000b: ret } "); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D<T>.<>c__DisplayClass1_0<U>.<<M>b__0>d.ch"" IL_0006: ret } "); context.CompileExpression("typeof(T)", out error); Assert.Null(error); context.CompileExpression("typeof(U)", out error); Assert.Null(error); AssertEx.SetEqual(GetLocalNames(context), "ch", "u", "<>TypeVariables"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void GenericAsyncLambda_Static_CaptureLambdaParameter() { var source = string.Format(genericAsyncLambdaSourceTemplate, "static", "ch.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__1.<<M>b__1_0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0120: An object reference is required for the non-static field, method, or property 'D<T>.t'", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D<T>.<>c__1<U>.<<M>b__1_0>d.ch"" IL_0006: ret } "); context.CompileExpression("typeof(T)", out error); Assert.Null(error); context.CompileExpression("typeof(U)", out error); Assert.Null(error); AssertEx.SetEqual(GetLocalNames(context), "ch", "<>TypeVariables"); }); } [WorkItem(1134746, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1134746")] [Fact] public void CacheInvalidation() { var source = @" using System.Collections.Generic; class C { static IEnumerable<int> M() { #line 100 int x = 1; yield return x; { #line 200 int y = x + 1; yield return y; } } }"; var compilation0 = CreateCompilation(source, options: TestOptions.DebugDll); WithRuntimeInstance(compilation0, runtime => { ImmutableArray<MetadataBlock> blocks; Guid moduleVersionId; ISymUnmanagedReader symReader; int methodToken; int localSignatureToken; GetContextState(runtime, "C.<M>d__0.MoveNext", out blocks, out moduleVersionId, out symReader, out methodToken, out localSignatureToken); var appDomain = new AppDomain(); uint ilOffset = ExpressionCompilerTestHelpers.GetOffset(methodToken, symReader, atLineNumber: 100); var context = CreateMethodContext( appDomain, blocks, symReader, moduleVersionId, methodToken: methodToken, methodVersion: 1, ilOffset: ilOffset, localSignatureToken: localSignatureToken, kind: MakeAssemblyReferencesKind.AllAssemblies); string error; context.CompileExpression("x", out error); Assert.Null(error); context.CompileExpression("y", out error); Assert.Equal("error CS0103: The name 'y' does not exist in the current context", error); ilOffset = ExpressionCompilerTestHelpers.GetOffset(methodToken, symReader, atLineNumber: 200); context = CreateMethodContext( appDomain, blocks, symReader, moduleVersionId, methodToken: methodToken, methodVersion: 1, ilOffset: ilOffset, localSignatureToken: localSignatureToken, kind: MakeAssemblyReferencesKind.AllAssemblies); context.CompileExpression("x", out error); Assert.Null(error); context.CompileExpression("y", out error); Assert.Null(error); }); } private static string[] GetLocalNames(EvaluationContext context) { string unused; var locals = new ArrayBuilder<LocalAndMethod>(); context.CompileGetLocals(locals, argumentsOnly: false, typeName: out unused, testData: null); return locals.Select(l => l.LocalName).ToArray(); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System; using System.Collections.Immutable; using System.Linq; using Microsoft.CodeAnalysis.CodeGen; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Microsoft.CodeAnalysis.ExpressionEvaluator; using Microsoft.CodeAnalysis.ExpressionEvaluator.UnitTests; using Microsoft.CodeAnalysis.PooledObjects; using Microsoft.DiaSymReader; using Roslyn.Test.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.UnitTests { public class HoistedStateMachineLocalTests : ExpressionCompilerTestBase { private const string asyncLambdaSourceTemplate = @" using System; using System.Threading.Tasks; public class D {{ private double t; public {0} void M(char u) {{ int x = 1; Func<char, Task<int>> f = async ch => {1}; }} }} "; private const string genericAsyncLambdaSourceTemplate = @" using System; using System.Threading.Tasks; public class D<T> {{ private T t; public {0} void M<U>(U u) {{ int x = 1; Func<char, Task<int>> f = async ch => {1}; }} }} "; [Fact] public void Iterator() { var source = @" using System.Collections.Generic; class C { static IEnumerable<int> M() { #line 500 DummySequencePoint(); { #line 550 int x = 0; yield return x; x++; #line 600 } #line 650 DummySequencePoint(); { #line 700 int x = 0; yield return x; x++; #line 750 } #line 800 DummySequencePoint(); } static void DummySequencePoint() { } } "; var expectedError = "error CS0103: The name 'x' does not exist in the current context"; var expectedIlTemplate = @" {{ // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1) IL_0000: ldarg.0 IL_0001: ldfld ""int C.<M>d__0.{0}"" IL_0006: ret }} "; var comp = CreateCompilation(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { EvaluationContext context; CompilationTestData testData; string error; context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 500); context.CompileExpression("x", out error); Assert.Equal(expectedError, error); testData = new CompilationTestData(); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 550); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(string.Format(expectedIlTemplate, "<x>5__1")); testData = new CompilationTestData(); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 600); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(string.Format(expectedIlTemplate, "<x>5__1")); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 650); context.CompileExpression("x", out error); Assert.Equal(expectedError, error); testData = new CompilationTestData(); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 700); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(string.Format(expectedIlTemplate, "<x>5__2")); testData = new CompilationTestData(); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 750); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(string.Format(expectedIlTemplate, "<x>5__2")); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 800); context.CompileExpression("x", out error); Assert.Equal(expectedError, error); }); } [Fact] public void Async() { var source = @" using System.Threading.Tasks; class C { static async Task M() { #line 500 DummySequencePoint(); { #line 550 int x = 0; await M(); x++; #line 600 } #line 650 DummySequencePoint(); { #line 700 int x = 0; await M(); x++; #line 750 } #line 800 DummySequencePoint(); } static void DummySequencePoint() { } } "; var expectedError = "error CS0103: The name 'x' does not exist in the current context"; var expectedIlTemplate = @" {{ // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, System.Runtime.CompilerServices.TaskAwaiter V_1, C.<M>d__0 V_2, int V_3, System.Runtime.CompilerServices.TaskAwaiter V_4, System.Exception V_5) IL_0000: ldarg.0 IL_0001: ldfld ""int C.<M>d__0.{0}"" IL_0006: ret }} "; var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { EvaluationContext context; CompilationTestData testData; string error; context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 500); context.CompileExpression("x", out error); Assert.Equal(expectedError, error); testData = new CompilationTestData(); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 550); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(string.Format(expectedIlTemplate, "<x>5__1")); testData = new CompilationTestData(); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 600); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(string.Format(expectedIlTemplate, "<x>5__1")); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 650); context.CompileExpression("x", out error); Assert.Equal(expectedError, error); testData = new CompilationTestData(); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 700); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(string.Format(expectedIlTemplate, "<x>5__2")); testData = new CompilationTestData(); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 750); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(string.Format(expectedIlTemplate, "<x>5__2")); context = CreateMethodContext(runtime, "C.<M>d__0.MoveNext", atLineNumber: 800); context.CompileExpression("x", out error); Assert.Equal(expectedError, error); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void AsyncLambda_Instance_CaptureNothing() { var source = string.Format(asyncLambdaSourceTemplate, "/*instance*/", "1"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c.<<M>b__1_0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0027: Keyword 'this' is not available in the current context", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D.<>c.<<M>b__1_0>d.ch"" IL_0006: ret } "); AssertEx.SetEqual(GetLocalNames(context), "ch"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void AsyncLambda_Instance_CaptureLocal() { var source = string.Format(asyncLambdaSourceTemplate, "/*instance*/", "x"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__DisplayClass1_0.<<M>b__0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0027: Keyword 'this' is not available in the current context", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D.<>c__DisplayClass1_0 D.<>c__DisplayClass1_0.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""int D.<>c__DisplayClass1_0.x"" IL_000b: ret } "); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D.<>c__DisplayClass1_0.<<M>b__0>d.ch"" IL_0006: ret } "); AssertEx.SetEqual(GetLocalNames(context), "ch", "x"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void AsyncLambda_Instance_CaptureParameter() { var source = string.Format(asyncLambdaSourceTemplate, "/*instance*/", "u.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__DisplayClass1_0.<<M>b__0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0027: Keyword 'this' is not available in the current context", error); testData = new CompilationTestData(); context.CompileExpression("u", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D.<>c__DisplayClass1_0 D.<>c__DisplayClass1_0.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""char D.<>c__DisplayClass1_0.u"" IL_000b: ret } "); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D.<>c__DisplayClass1_0.<<M>b__0>d.ch"" IL_0006: ret } "); AssertEx.SetEqual(GetLocalNames(context), "ch", "u"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void AsyncLambda_Instance_CaptureLambdaParameter() { var source = string.Format(asyncLambdaSourceTemplate, "/*instance*/", "ch.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c.<<M>b__1_0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0027: Keyword 'this' is not available in the current context", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D.<>c.<<M>b__1_0>d.ch"" IL_0006: ret } "); AssertEx.SetEqual(GetLocalNames(context), "ch"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void AsyncLambda_Instance_CaptureThis() { var source = string.Format(asyncLambdaSourceTemplate, "/*instance*/", "t.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<<M>b__1_0>d.MoveNext"); string error; CompilationTestData testData; testData = new CompilationTestData(); context.CompileExpression("t", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D D.<<M>b__1_0>d.<>4__this"" IL_0006: ldfld ""double D.t"" IL_000b: ret } "); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D.<<M>b__1_0>d.ch"" IL_0006: ret } "); AssertEx.SetEqual(GetLocalNames(context), "this", "ch"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void AsyncLambda_Instance_CaptureThisAndLocal() { var source = string.Format(asyncLambdaSourceTemplate, "/*instance*/", "x + t.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__DisplayClass1_0.<<M>b__0>d.MoveNext"); string error; CompilationTestData testData; testData = new CompilationTestData(); context.CompileExpression("t", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 17 (0x11) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D.<>c__DisplayClass1_0 D.<>c__DisplayClass1_0.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""D D.<>c__DisplayClass1_0.<>4__this"" IL_000b: ldfld ""double D.t"" IL_0010: ret } "); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D.<>c__DisplayClass1_0 D.<>c__DisplayClass1_0.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""int D.<>c__DisplayClass1_0.x"" IL_000b: ret } "); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D.<>c__DisplayClass1_0.<<M>b__0>d.ch"" IL_0006: ret } "); AssertEx.SetEqual(GetLocalNames(context), "this", "ch", "x"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void AsyncLambda_Static_CaptureNothing() { var source = string.Format(asyncLambdaSourceTemplate, "static", "1"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c.<<M>b__1_0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0120: An object reference is required for the non-static field, method, or property 'D.t'", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D.<>c.<<M>b__1_0>d.ch"" IL_0006: ret } "); AssertEx.SetEqual(GetLocalNames(context), "ch"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void AsyncLambda_Static_CaptureLocal() { var source = string.Format(asyncLambdaSourceTemplate, "static", "x"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__DisplayClass1_0.<<M>b__0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0120: An object reference is required for the non-static field, method, or property 'D.t'", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D.<>c__DisplayClass1_0 D.<>c__DisplayClass1_0.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""int D.<>c__DisplayClass1_0.x"" IL_000b: ret } "); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D.<>c__DisplayClass1_0.<<M>b__0>d.ch"" IL_0006: ret } "); AssertEx.SetEqual(GetLocalNames(context), "ch", "x"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void AsyncLambda_Static_CaptureParameter() { var source = string.Format(asyncLambdaSourceTemplate, "static", "u.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__DisplayClass1_0.<<M>b__0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0120: An object reference is required for the non-static field, method, or property 'D.t'", error); testData = new CompilationTestData(); context.CompileExpression("u", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D.<>c__DisplayClass1_0 D.<>c__DisplayClass1_0.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""char D.<>c__DisplayClass1_0.u"" IL_000b: ret } "); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D.<>c__DisplayClass1_0.<<M>b__0>d.ch"" IL_0006: ret } "); AssertEx.SetEqual(GetLocalNames(context), "ch", "u"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void AsyncLambda_Static_CaptureLambdaParameter() { var source = string.Format(asyncLambdaSourceTemplate, "static", "ch.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c.<<M>b__1_0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0120: An object reference is required for the non-static field, method, or property 'D.t'", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D.<>c.<<M>b__1_0>d.ch"" IL_0006: ret } "); AssertEx.SetEqual(GetLocalNames(context), "ch"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void GenericAsyncLambda_Instance_CaptureNothing() { var source = string.Format(genericAsyncLambdaSourceTemplate, "/*instance*/", "1"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__1.<<M>b__1_0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0027: Keyword 'this' is not available in the current context", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D<T>.<>c__1<U>.<<M>b__1_0>d.ch"" IL_0006: ret } "); context.CompileExpression("typeof(T)", out error); Assert.Null(error); context.CompileExpression("typeof(U)", out error); Assert.Null(error); AssertEx.SetEqual(GetLocalNames(context), "ch", "<>TypeVariables"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void GenericAsyncLambda_Instance_CaptureLocal() { var source = string.Format(genericAsyncLambdaSourceTemplate, "/*instance*/", "x"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__DisplayClass1_0.<<M>b__0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0027: Keyword 'this' is not available in the current context", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D<T>.<>c__DisplayClass1_0<U> D<T>.<>c__DisplayClass1_0<U>.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""int D<T>.<>c__DisplayClass1_0<U>.x"" IL_000b: ret } "); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D<T>.<>c__DisplayClass1_0<U>.<<M>b__0>d.ch"" IL_0006: ret } "); context.CompileExpression("typeof(T)", out error); Assert.Null(error); context.CompileExpression("typeof(U)", out error); Assert.Null(error); AssertEx.SetEqual(GetLocalNames(context), "ch", "x", "<>TypeVariables"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void GenericAsyncLambda_Instance_CaptureParameter() { var source = string.Format(genericAsyncLambdaSourceTemplate, "/*instance*/", "u.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__DisplayClass1_0.<<M>b__0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0027: Keyword 'this' is not available in the current context", error); testData = new CompilationTestData(); context.CompileExpression("u", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D<T>.<>c__DisplayClass1_0<U> D<T>.<>c__DisplayClass1_0<U>.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""U D<T>.<>c__DisplayClass1_0<U>.u"" IL_000b: ret } "); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D<T>.<>c__DisplayClass1_0<U>.<<M>b__0>d.ch"" IL_0006: ret } "); context.CompileExpression("typeof(T)", out error); Assert.Null(error); context.CompileExpression("typeof(U)", out error); Assert.Null(error); AssertEx.SetEqual(GetLocalNames(context), "ch", "u", "<>TypeVariables"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void GenericAsyncLambda_Instance_CaptureLambdaParameter() { var source = string.Format(genericAsyncLambdaSourceTemplate, "/*instance*/", "ch.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__1.<<M>b__1_0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0027: Keyword 'this' is not available in the current context", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D<T>.<>c__1<U>.<<M>b__1_0>d.ch"" IL_0006: ret } "); context.CompileExpression("typeof(T)", out error); Assert.Null(error); context.CompileExpression("typeof(U)", out error); Assert.Null(error); AssertEx.SetEqual(GetLocalNames(context), "ch", "<>TypeVariables"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void GenericAsyncLambda_Instance_CaptureThis() { var source = string.Format(genericAsyncLambdaSourceTemplate, "/*instance*/", "t.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<<M>b__1_0>d.MoveNext"); string error; CompilationTestData testData; testData = new CompilationTestData(); context.CompileExpression("t", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D<T> D<T>.<<M>b__1_0>d<U>.<>4__this"" IL_0006: ldfld ""T D<T>.t"" IL_000b: ret } "); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D<T>.<<M>b__1_0>d<U>.ch"" IL_0006: ret } "); context.CompileExpression("typeof(T)", out error); Assert.Null(error); context.CompileExpression("typeof(U)", out error); Assert.Null(error); AssertEx.SetEqual(GetLocalNames(context), "this", "ch", "<>TypeVariables"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void GenericAsyncLambda_Instance_CaptureThisAndLocal() { var source = string.Format(genericAsyncLambdaSourceTemplate, "/*instance*/", "x + t.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__DisplayClass1_0.<<M>b__0>d.MoveNext"); string error; CompilationTestData testData; testData = new CompilationTestData(); context.CompileExpression("t", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 17 (0x11) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D<T>.<>c__DisplayClass1_0<U> D<T>.<>c__DisplayClass1_0<U>.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""D<T> D<T>.<>c__DisplayClass1_0<U>.<>4__this"" IL_000b: ldfld ""T D<T>.t"" IL_0010: ret } "); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D<T>.<>c__DisplayClass1_0<U> D<T>.<>c__DisplayClass1_0<U>.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""int D<T>.<>c__DisplayClass1_0<U>.x"" IL_000b: ret } "); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D<T>.<>c__DisplayClass1_0<U>.<<M>b__0>d.ch"" IL_0006: ret } "); context.CompileExpression("typeof(T)", out error); Assert.Null(error); context.CompileExpression("typeof(U)", out error); Assert.Null(error); AssertEx.SetEqual(GetLocalNames(context), "this", "ch", "x", "<>TypeVariables"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void GenericAsyncLambda_Static_CaptureNothing() { var source = string.Format(genericAsyncLambdaSourceTemplate, "static", "1"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__1.<<M>b__1_0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0120: An object reference is required for the non-static field, method, or property 'D<T>.t'", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D<T>.<>c__1<U>.<<M>b__1_0>d.ch"" IL_0006: ret } "); context.CompileExpression("typeof(T)", out error); Assert.Null(error); context.CompileExpression("typeof(U)", out error); Assert.Null(error); AssertEx.SetEqual(GetLocalNames(context), "ch", "<>TypeVariables"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void GenericAsyncLambda_Static_CaptureLocal() { var source = string.Format(genericAsyncLambdaSourceTemplate, "static", "x"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__DisplayClass1_0.<<M>b__0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0120: An object reference is required for the non-static field, method, or property 'D<T>.t'", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("x", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D<T>.<>c__DisplayClass1_0<U> D<T>.<>c__DisplayClass1_0<U>.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""int D<T>.<>c__DisplayClass1_0<U>.x"" IL_000b: ret } "); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D<T>.<>c__DisplayClass1_0<U>.<<M>b__0>d.ch"" IL_0006: ret } "); context.CompileExpression("typeof(T)", out error); Assert.Null(error); context.CompileExpression("typeof(U)", out error); Assert.Null(error); AssertEx.SetEqual(GetLocalNames(context), "ch", "x", "<>TypeVariables"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void GenericAsyncLambda_Static_CaptureParameter() { var source = string.Format(genericAsyncLambdaSourceTemplate, "static", "u.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__DisplayClass1_0.<<M>b__0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0120: An object reference is required for the non-static field, method, or property 'D<T>.t'", error); testData = new CompilationTestData(); context.CompileExpression("u", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 12 (0xc) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""D<T>.<>c__DisplayClass1_0<U> D<T>.<>c__DisplayClass1_0<U>.<<M>b__0>d.<>4__this"" IL_0006: ldfld ""U D<T>.<>c__DisplayClass1_0<U>.u"" IL_000b: ret } "); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D<T>.<>c__DisplayClass1_0<U>.<<M>b__0>d.ch"" IL_0006: ret } "); context.CompileExpression("typeof(T)", out error); Assert.Null(error); context.CompileExpression("typeof(U)", out error); Assert.Null(error); AssertEx.SetEqual(GetLocalNames(context), "ch", "u", "<>TypeVariables"); }); } [WorkItem(1112496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1112496")] [Fact] public void GenericAsyncLambda_Static_CaptureLambdaParameter() { var source = string.Format(genericAsyncLambdaSourceTemplate, "static", "ch.GetHashCode()"); var comp = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugDll, assemblyName: GetUniqueName()); WithRuntimeInstance(comp, runtime => { var context = CreateMethodContext(runtime, "D.<>c__1.<<M>b__1_0>d.MoveNext"); string error; CompilationTestData testData; context.CompileExpression("t", out error); Assert.Equal("error CS0120: An object reference is required for the non-static field, method, or property 'D<T>.t'", error); context.CompileExpression("u", out error); Assert.Equal("error CS0103: The name 'u' does not exist in the current context", error); context.CompileExpression("x", out error); Assert.Equal("error CS0103: The name 'x' does not exist in the current context", error); testData = new CompilationTestData(); context.CompileExpression("ch", out error, testData); Assert.Null(error); testData.GetMethodData("<>x<T, U>.<>m0").VerifyIL(@" { // Code size 7 (0x7) .maxstack 1 .locals init (int V_0, int V_1, System.Exception V_2) IL_0000: ldarg.0 IL_0001: ldfld ""char D<T>.<>c__1<U>.<<M>b__1_0>d.ch"" IL_0006: ret } "); context.CompileExpression("typeof(T)", out error); Assert.Null(error); context.CompileExpression("typeof(U)", out error); Assert.Null(error); AssertEx.SetEqual(GetLocalNames(context), "ch", "<>TypeVariables"); }); } [WorkItem(1134746, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1134746")] [Fact] public void CacheInvalidation() { var source = @" using System.Collections.Generic; class C { static IEnumerable<int> M() { #line 100 int x = 1; yield return x; { #line 200 int y = x + 1; yield return y; } } }"; var compilation0 = CreateCompilation(source, options: TestOptions.DebugDll); WithRuntimeInstance(compilation0, runtime => { ImmutableArray<MetadataBlock> blocks; Guid moduleVersionId; ISymUnmanagedReader symReader; int methodToken; int localSignatureToken; GetContextState(runtime, "C.<M>d__0.MoveNext", out blocks, out moduleVersionId, out symReader, out methodToken, out localSignatureToken); var appDomain = new AppDomain(); uint ilOffset = ExpressionCompilerTestHelpers.GetOffset(methodToken, symReader, atLineNumber: 100); var context = CreateMethodContext( appDomain, blocks, symReader, moduleVersionId, methodToken: methodToken, methodVersion: 1, ilOffset: ilOffset, localSignatureToken: localSignatureToken, kind: MakeAssemblyReferencesKind.AllAssemblies); string error; context.CompileExpression("x", out error); Assert.Null(error); context.CompileExpression("y", out error); Assert.Equal("error CS0103: The name 'y' does not exist in the current context", error); ilOffset = ExpressionCompilerTestHelpers.GetOffset(methodToken, symReader, atLineNumber: 200); context = CreateMethodContext( appDomain, blocks, symReader, moduleVersionId, methodToken: methodToken, methodVersion: 1, ilOffset: ilOffset, localSignatureToken: localSignatureToken, kind: MakeAssemblyReferencesKind.AllAssemblies); context.CompileExpression("x", out error); Assert.Null(error); context.CompileExpression("y", out error); Assert.Null(error); }); } private static string[] GetLocalNames(EvaluationContext context) { string unused; var locals = new ArrayBuilder<LocalAndMethod>(); context.CompileGetLocals(locals, argumentsOnly: false, typeName: out unused, testData: null); return locals.Select(l => l.LocalName).ToArray(); } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Compilers/CSharp/Test/Symbol/Symbols/Metadata/PE/LoadingMethods.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Linq; using Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE; using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Microsoft.CodeAnalysis.Test.Utilities; using Roslyn.Test.Utilities; using Xunit; using System.Reflection; using static Roslyn.Test.Utilities.TestMetadata; //test namespace Microsoft.CodeAnalysis.CSharp.UnitTests.Symbols.Metadata.PE { public class LoadingMethods : CSharpTestBase { [Fact] public void Test1() { var assemblies = MetadataTestHelpers.GetSymbolsForReferences(mrefs: new[] { TestReferences.SymbolsTests.MDTestLib1, TestReferences.SymbolsTests.MDTestLib2, TestReferences.SymbolsTests.Methods.CSMethods, TestReferences.SymbolsTests.Methods.VBMethods, Net40.mscorlib, TestReferences.SymbolsTests.Methods.ByRefReturn }, options: TestOptions.ReleaseDll.WithMetadataImportOptions(MetadataImportOptions.Internal)); var module1 = assemblies[0].Modules[0]; var module2 = assemblies[1].Modules[0]; var module3 = assemblies[2].Modules[0]; var module4 = assemblies[3].Modules[0]; var module5 = assemblies[4].Modules[0]; var byrefReturn = assemblies[5].Modules[0]; var varTC10 = module2.GlobalNamespace.GetTypeMembers("TC10").Single(); Assert.Equal(6, varTC10.GetMembers().Length); var localM1 = (MethodSymbol)varTC10.GetMembers("M1").Single(); var localM2 = (MethodSymbol)varTC10.GetMembers("M2").Single(); var localM3 = (MethodSymbol)varTC10.GetMembers("M3").Single(); var localM4 = (MethodSymbol)varTC10.GetMembers("M4").Single(); var localM5 = (MethodSymbol)varTC10.GetMembers("M5").Single(); Assert.Equal("void TC10.M1()", localM1.ToTestDisplayString()); Assert.True(localM1.ReturnsVoid); Assert.Equal(Accessibility.Public, localM1.DeclaredAccessibility); Assert.Same(module2, localM1.Locations.Single().MetadataModuleInternal); Assert.Equal("void TC10.M2(System.Int32 m1_1)", localM2.ToTestDisplayString()); Assert.True(localM2.ReturnsVoid); Assert.Equal(Accessibility.Protected, localM2.DeclaredAccessibility); var localM1_1 = localM2.Parameters[0]; Assert.IsType<PEParameterSymbol>(localM1_1); Assert.Same(localM1_1.ContainingSymbol, localM2); Assert.Equal(SymbolKind.Parameter, localM1_1.Kind); Assert.Equal(Accessibility.NotApplicable, localM1_1.DeclaredAccessibility); Assert.False(localM1_1.IsAbstract); Assert.False(localM1_1.IsSealed); Assert.False(localM1_1.IsVirtual); Assert.False(localM1_1.IsOverride); Assert.False(localM1_1.IsStatic); Assert.False(localM1_1.IsExtern); Assert.Equal(0, localM1_1.TypeWithAnnotations.CustomModifiers.Length); Assert.Equal("TC8 TC10.M3()", localM3.ToTestDisplayString()); Assert.False(localM3.ReturnsVoid); Assert.Equal(Accessibility.Protected, localM3.DeclaredAccessibility); Assert.Equal("C1<System.Type> TC10.M4(ref C1<System.Type> x, ref TC8 y)", localM4.ToTestDisplayString()); Assert.False(localM4.ReturnsVoid); Assert.Equal(Accessibility.Internal, localM4.DeclaredAccessibility); Assert.Equal("void TC10.M5(ref C1<System.Type>[,,] x, ref TC8[] y)", localM5.ToTestDisplayString()); Assert.True(localM5.ReturnsVoid); Assert.Equal(Accessibility.ProtectedOrInternal, localM5.DeclaredAccessibility); var localM6 = varTC10.GetMembers("M6"); Assert.Equal(0, localM6.Length); var localC107 = module1.GlobalNamespace.GetTypeMembers("C107").Single(); var varC108 = localC107.GetMembers("C108").Single(); Assert.Equal(SymbolKind.NamedType, varC108.Kind); var csharpC1 = module3.GlobalNamespace.GetTypeMembers("C1").Single(); var sameName1 = csharpC1.GetMembers("SameName").Single(); var sameName2 = csharpC1.GetMembers("sameName").Single(); Assert.Equal(SymbolKind.NamedType, sameName1.Kind); Assert.Equal("SameName", sameName1.Name); Assert.Equal(SymbolKind.Method, sameName2.Kind); Assert.Equal("sameName", sameName2.Name); Assert.Equal(2, csharpC1.GetMembers("SameName2").Length); Assert.Equal(1, csharpC1.GetMembers("sameName2").Length); Assert.Equal(0, csharpC1.GetMembers("DoesntExist").Length); var basicC1 = module4.GlobalNamespace.GetTypeMembers("C1").Single(); var basicC1_M1 = (MethodSymbol)basicC1.GetMembers("M1").Single(); var basicC1_M2 = (MethodSymbol)basicC1.GetMembers("M2").Single(); var basicC1_M3 = (MethodSymbol)basicC1.GetMembers("M3").Single(); var basicC1_M4 = (MethodSymbol)basicC1.GetMembers("M4").Single(); Assert.False(basicC1_M1.Parameters[0].IsOptional); Assert.False(basicC1_M1.Parameters[0].HasExplicitDefaultValue); Assert.Same(module4, basicC1_M1.Parameters[0].Locations.Single().MetadataModuleInternal); Assert.True(basicC1_M2.Parameters[0].IsOptional); Assert.False(basicC1_M2.Parameters[0].HasExplicitDefaultValue); Assert.True(basicC1_M3.Parameters[0].IsOptional); Assert.True(basicC1_M3.Parameters[0].HasExplicitDefaultValue); Assert.True(basicC1_M4.Parameters[0].IsOptional); Assert.False(basicC1_M4.Parameters[0].HasExplicitDefaultValue); var emptyStructure = module4.GlobalNamespace.GetTypeMembers("EmptyStructure").Single(); Assert.Equal(1, emptyStructure.GetMembers().Length); //synthesized parameterless constructor Assert.Equal(0, emptyStructure.GetMembers("NoMembersOrTypes").Length); var basicC1_M5 = (MethodSymbol)basicC1.GetMembers("M5").Single(); var basicC1_M6 = (MethodSymbol)basicC1.GetMembers("M6").Single(); var basicC1_M7 = (MethodSymbol)basicC1.GetMembers("M7").Single(); var basicC1_M8 = (MethodSymbol)basicC1.GetMembers("M8").Single(); var basicC1_M9 = basicC1.GetMembers("M9").OfType<MethodSymbol>().ToArray(); Assert.False(basicC1_M5.IsGenericMethod); // Check genericity before cracking signature Assert.True(basicC1_M6.ReturnsVoid); Assert.False(basicC1_M6.IsGenericMethod); // Check genericity after cracking signature Assert.True(basicC1_M7.IsGenericMethod); // Check genericity before cracking signature Assert.Equal("void C1.M7<T>(System.Int32 x)", basicC1_M7.ToTestDisplayString()); Assert.True(basicC1_M6.ReturnsVoid); Assert.True(basicC1_M8.IsGenericMethod); // Check genericity after cracking signature Assert.Equal("void C1.M8<T>(System.Int32 x)", basicC1_M8.ToTestDisplayString()); Assert.Equal(2, basicC1_M9.Count()); Assert.Equal(1, basicC1_M9.Count(m => m.IsGenericMethod)); Assert.Equal(1, basicC1_M9.Count(m => !m.IsGenericMethod)); var basicC1_M10 = (MethodSymbol)basicC1.GetMembers("M10").Single(); Assert.Equal("void C1.M10<T1>(T1 x)", basicC1_M10.ToTestDisplayString()); var basicC1_M11 = (MethodSymbol)basicC1.GetMembers("M11").Single(); Assert.Equal("T3 C1.M11<T2, T3>(T2 x)", basicC1_M11.ToTestDisplayString()); Assert.Equal(0, basicC1_M11.TypeParameters[0].ConstraintTypes().Length); Assert.Same(basicC1, basicC1_M11.TypeParameters[1].ConstraintTypes().Single()); var basicC1_M12 = (MethodSymbol)basicC1.GetMembers("M12").Single(); Assert.Equal(0, basicC1_M12.TypeArgumentsWithAnnotations.Length); Assert.False(basicC1_M12.IsVararg); Assert.False(basicC1_M12.IsExtern); Assert.False(basicC1_M12.IsStatic); var loadLibrary = (MethodSymbol)basicC1.GetMembers("LoadLibrary").Single(); Assert.True(loadLibrary.IsExtern); var basicC2 = module4.GlobalNamespace.GetTypeMembers("C2").Single(); var basicC2_M1 = (MethodSymbol)basicC2.GetMembers("M1").Single(); Assert.Equal("void C2<T4>.M1<T5>(T5 x, T4 y)", basicC2_M1.ToTestDisplayString()); var console = module5.GlobalNamespace.GetMembers("System").OfType<NamespaceSymbol>().Single(). GetTypeMembers("Console").Single(); Assert.Equal(1, console.GetMembers("WriteLine").OfType<MethodSymbol>().Count(m => m.IsVararg)); Assert.True(console.GetMembers("WriteLine").OfType<MethodSymbol>().Single(m => m.IsVararg).IsStatic); var basicModifiers1 = module4.GlobalNamespace.GetTypeMembers("Modifiers1").Single(); var basicModifiers1_M1 = (MethodSymbol)basicModifiers1.GetMembers("M1").Single(); var basicModifiers1_M2 = (MethodSymbol)basicModifiers1.GetMembers("M2").Single(); var basicModifiers1_M3 = (MethodSymbol)basicModifiers1.GetMembers("M3").Single(); var basicModifiers1_M4 = (MethodSymbol)basicModifiers1.GetMembers("M4").Single(); var basicModifiers1_M5 = (MethodSymbol)basicModifiers1.GetMembers("M5").Single(); var basicModifiers1_M6 = (MethodSymbol)basicModifiers1.GetMembers("M6").Single(); var basicModifiers1_M7 = (MethodSymbol)basicModifiers1.GetMembers("M7").Single(); var basicModifiers1_M8 = (MethodSymbol)basicModifiers1.GetMembers("M8").Single(); var basicModifiers1_M9 = (MethodSymbol)basicModifiers1.GetMembers("M9").Single(); Assert.True(basicModifiers1_M1.IsAbstract); Assert.False(basicModifiers1_M1.IsVirtual); Assert.False(basicModifiers1_M1.IsSealed); Assert.True(basicModifiers1_M1.HidesBaseMethodsByName); Assert.False(basicModifiers1_M1.IsOverride); Assert.False(basicModifiers1_M2.IsAbstract); Assert.True(basicModifiers1_M2.IsVirtual); Assert.False(basicModifiers1_M2.IsSealed); Assert.True(basicModifiers1_M2.HidesBaseMethodsByName); Assert.False(basicModifiers1_M2.IsOverride); Assert.False(basicModifiers1_M3.IsAbstract); Assert.False(basicModifiers1_M3.IsVirtual); Assert.False(basicModifiers1_M3.IsSealed); Assert.False(basicModifiers1_M3.HidesBaseMethodsByName); Assert.False(basicModifiers1_M3.IsOverride); Assert.False(basicModifiers1_M4.IsAbstract); Assert.False(basicModifiers1_M4.IsVirtual); Assert.False(basicModifiers1_M4.IsSealed); Assert.True(basicModifiers1_M4.HidesBaseMethodsByName); Assert.False(basicModifiers1_M4.IsOverride); Assert.False(basicModifiers1_M5.IsAbstract); Assert.False(basicModifiers1_M5.IsVirtual); Assert.False(basicModifiers1_M5.IsSealed); Assert.True(basicModifiers1_M5.HidesBaseMethodsByName); Assert.False(basicModifiers1_M5.IsOverride); Assert.True(basicModifiers1_M6.IsAbstract); Assert.False(basicModifiers1_M6.IsVirtual); Assert.False(basicModifiers1_M6.IsSealed); Assert.False(basicModifiers1_M6.HidesBaseMethodsByName); Assert.False(basicModifiers1_M6.IsOverride); Assert.False(basicModifiers1_M7.IsAbstract); Assert.True(basicModifiers1_M7.IsVirtual); Assert.False(basicModifiers1_M7.IsSealed); Assert.False(basicModifiers1_M7.HidesBaseMethodsByName); Assert.False(basicModifiers1_M7.IsOverride); Assert.True(basicModifiers1_M8.IsAbstract); Assert.False(basicModifiers1_M8.IsVirtual); Assert.False(basicModifiers1_M8.IsSealed); Assert.True(basicModifiers1_M8.HidesBaseMethodsByName); Assert.False(basicModifiers1_M8.IsOverride); Assert.False(basicModifiers1_M9.IsAbstract); Assert.True(basicModifiers1_M9.IsVirtual); Assert.False(basicModifiers1_M9.IsSealed); Assert.True(basicModifiers1_M9.HidesBaseMethodsByName); Assert.False(basicModifiers1_M9.IsOverride); var basicModifiers2 = module4.GlobalNamespace.GetTypeMembers("Modifiers2").Single(); var basicModifiers2_M1 = (MethodSymbol)basicModifiers2.GetMembers("M1").Single(); var basicModifiers2_M2 = (MethodSymbol)basicModifiers2.GetMembers("M2").Single(); var basicModifiers2_M6 = (MethodSymbol)basicModifiers2.GetMembers("M6").Single(); var basicModifiers2_M7 = (MethodSymbol)basicModifiers2.GetMembers("M7").Single(); Assert.True(basicModifiers2_M1.IsAbstract); Assert.False(basicModifiers2_M1.IsVirtual); Assert.False(basicModifiers2_M1.IsSealed); Assert.True(basicModifiers2_M1.HidesBaseMethodsByName); Assert.True(basicModifiers2_M1.IsOverride); Assert.False(basicModifiers2_M2.IsAbstract); Assert.False(basicModifiers2_M2.IsVirtual); Assert.True(basicModifiers2_M2.IsSealed); Assert.True(basicModifiers2_M2.HidesBaseMethodsByName); Assert.True(basicModifiers2_M2.IsOverride); Assert.True(basicModifiers2_M6.IsAbstract); Assert.False(basicModifiers2_M6.IsVirtual); Assert.False(basicModifiers2_M6.IsSealed); Assert.False(basicModifiers2_M6.HidesBaseMethodsByName); Assert.True(basicModifiers2_M6.IsOverride); Assert.False(basicModifiers2_M7.IsAbstract); Assert.False(basicModifiers2_M7.IsVirtual); Assert.True(basicModifiers2_M7.IsSealed); Assert.False(basicModifiers2_M7.HidesBaseMethodsByName); Assert.True(basicModifiers2_M7.IsOverride); var basicModifiers3 = module4.GlobalNamespace.GetTypeMembers("Modifiers3").Single(); var basicModifiers3_M1 = (MethodSymbol)basicModifiers3.GetMembers("M1").Single(); var basicModifiers3_M6 = (MethodSymbol)basicModifiers3.GetMembers("M6").Single(); Assert.False(basicModifiers3_M1.IsAbstract); Assert.False(basicModifiers3_M1.IsVirtual); Assert.False(basicModifiers3_M1.IsSealed); Assert.True(basicModifiers3_M1.HidesBaseMethodsByName); Assert.True(basicModifiers3_M1.IsOverride); Assert.False(basicModifiers3_M6.IsAbstract); Assert.False(basicModifiers3_M6.IsVirtual); Assert.False(basicModifiers3_M6.IsSealed); Assert.False(basicModifiers3_M6.HidesBaseMethodsByName); Assert.True(basicModifiers3_M6.IsOverride); var csharpModifiers1 = module3.GlobalNamespace.GetTypeMembers("Modifiers1").Single(); var csharpModifiers1_M1 = (MethodSymbol)csharpModifiers1.GetMembers("M1").Single(); var csharpModifiers1_M2 = (MethodSymbol)csharpModifiers1.GetMembers("M2").Single(); var csharpModifiers1_M3 = (MethodSymbol)csharpModifiers1.GetMembers("M3").Single(); var csharpModifiers1_M4 = (MethodSymbol)csharpModifiers1.GetMembers("M4").Single(); Assert.True(csharpModifiers1_M1.IsAbstract); Assert.False(csharpModifiers1_M1.IsVirtual); Assert.False(csharpModifiers1_M1.IsSealed); Assert.False(csharpModifiers1_M1.HidesBaseMethodsByName); Assert.False(csharpModifiers1_M1.IsOverride); Assert.False(csharpModifiers1_M2.IsAbstract); Assert.True(csharpModifiers1_M2.IsVirtual); Assert.False(csharpModifiers1_M2.IsSealed); Assert.False(csharpModifiers1_M2.HidesBaseMethodsByName); Assert.False(csharpModifiers1_M2.IsOverride); Assert.False(csharpModifiers1_M3.IsAbstract); Assert.False(csharpModifiers1_M3.IsVirtual); Assert.False(csharpModifiers1_M3.IsSealed); Assert.False(csharpModifiers1_M3.HidesBaseMethodsByName); Assert.False(csharpModifiers1_M3.IsOverride); Assert.False(csharpModifiers1_M4.IsAbstract); Assert.True(csharpModifiers1_M4.IsVirtual); Assert.False(csharpModifiers1_M4.IsSealed); Assert.False(csharpModifiers1_M4.HidesBaseMethodsByName); Assert.False(csharpModifiers1_M4.IsOverride); var csharpModifiers2 = module3.GlobalNamespace.GetTypeMembers("Modifiers2").Single(); var csharpModifiers2_M1 = (MethodSymbol)csharpModifiers2.GetMembers("M1").Single(); var csharpModifiers2_M2 = (MethodSymbol)csharpModifiers2.GetMembers("M2").Single(); var csharpModifiers2_M3 = (MethodSymbol)csharpModifiers2.GetMembers("M3").Single(); Assert.False(csharpModifiers2_M1.IsAbstract); Assert.False(csharpModifiers2_M1.IsVirtual); Assert.True(csharpModifiers2_M1.IsSealed); Assert.False(csharpModifiers2_M1.HidesBaseMethodsByName); Assert.True(csharpModifiers2_M1.IsOverride); Assert.True(csharpModifiers2_M2.IsAbstract); Assert.False(csharpModifiers2_M2.IsVirtual); Assert.False(csharpModifiers2_M2.IsSealed); Assert.False(csharpModifiers2_M2.HidesBaseMethodsByName); Assert.True(csharpModifiers2_M2.IsOverride); Assert.False(csharpModifiers2_M3.IsAbstract); Assert.True(csharpModifiers2_M3.IsVirtual); Assert.False(csharpModifiers2_M3.IsSealed); Assert.False(csharpModifiers2_M3.HidesBaseMethodsByName); Assert.False(csharpModifiers2_M3.IsOverride); var csharpModifiers3 = module3.GlobalNamespace.GetTypeMembers("Modifiers3").Single(); var csharpModifiers3_M1 = (MethodSymbol)csharpModifiers3.GetMembers("M1").Single(); var csharpModifiers3_M3 = (MethodSymbol)csharpModifiers3.GetMembers("M3").Single(); var csharpModifiers3_M4 = (MethodSymbol)csharpModifiers3.GetMembers("M4").Single(); Assert.False(csharpModifiers3_M1.IsAbstract); Assert.False(csharpModifiers3_M1.IsVirtual); Assert.False(csharpModifiers3_M1.IsSealed); Assert.False(csharpModifiers3_M1.HidesBaseMethodsByName); Assert.True(csharpModifiers3_M1.IsOverride); Assert.False(csharpModifiers3_M3.IsAbstract); Assert.False(csharpModifiers3_M3.IsVirtual); Assert.False(csharpModifiers3_M3.IsSealed); Assert.False(csharpModifiers3_M3.HidesBaseMethodsByName); Assert.False(csharpModifiers3_M3.IsOverride); Assert.True(csharpModifiers3_M4.IsAbstract); Assert.False(csharpModifiers3_M4.IsVirtual); Assert.False(csharpModifiers3_M4.IsSealed); Assert.False(csharpModifiers3_M4.HidesBaseMethodsByName); Assert.False(csharpModifiers3_M4.IsOverride); var byrefReturnMethod = byrefReturn.GlobalNamespace.GetTypeMembers("ByRefReturn").Single().GetMembers("M").OfType<MethodSymbol>().Single(); Assert.Equal(RefKind.Ref, byrefReturnMethod.RefKind); Assert.Equal(TypeKind.Struct, byrefReturnMethod.ReturnType.TypeKind); } [Fact] public void TestExplicitImplementationSimple() { var assembly = MetadataTestHelpers.GetSymbolForReference( TestReferences.SymbolsTests.ExplicitInterfaceImplementation.Methods.CSharp); var globalNamespace = assembly.GlobalNamespace; var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Interface").Single(); Assert.Equal(TypeKind.Interface, @interface.TypeKind); var interfaceMethod = (MethodSymbol)@interface.GetMembers("Method").Single(); var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Class").Single(); Assert.Equal(TypeKind.Class, @class.TypeKind); Assert.True(@class.Interfaces().Contains(@interface)); var classMethod = (MethodSymbol)@class.GetMembers("Interface.Method").Single(); Assert.Equal(MethodKind.ExplicitInterfaceImplementation, classMethod.MethodKind); var explicitImpl = classMethod.ExplicitInterfaceImplementations.Single(); Assert.Equal(interfaceMethod, explicitImpl); } [Fact] public void TestExplicitImplementationMultiple() { var assembly = MetadataTestHelpers.GetSymbolForReference( TestReferences.SymbolsTests.ExplicitInterfaceImplementation.Methods.IL); var globalNamespace = assembly.GlobalNamespace; var interface1 = (NamedTypeSymbol)globalNamespace.GetTypeMembers("I1").Single(); Assert.Equal(TypeKind.Interface, interface1.TypeKind); var interface1Method = (MethodSymbol)interface1.GetMembers("Method1").Single(); var interface2 = (NamedTypeSymbol)globalNamespace.GetTypeMembers("I2").Single(); Assert.Equal(TypeKind.Interface, interface2.TypeKind); var interface2Method = (MethodSymbol)interface2.GetMembers("Method2").Single(); var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("C").Single(); Assert.Equal(TypeKind.Class, @class.TypeKind); Assert.True(@class.Interfaces().Contains(interface1)); Assert.True(@class.Interfaces().Contains(interface2)); var classMethod = (MethodSymbol)@class.GetMembers("Method").Single(); // the method is considered to be Ordinary Assert.Equal(MethodKind.Ordinary, classMethod.MethodKind); // because it has name without '.' var explicitImpls = classMethod.ExplicitInterfaceImplementations; Assert.Equal(2, explicitImpls.Length); Assert.Equal(interface1Method, explicitImpls[0]); Assert.Equal(interface2Method, explicitImpls[1]); } [Fact] public void TestExplicitImplementationGeneric() { var assemblies = MetadataTestHelpers.GetSymbolsForReferences( mrefs: new[] { Net451.mscorlib, TestReferences.SymbolsTests.ExplicitInterfaceImplementation.Methods.CSharp, }); var globalNamespace = assemblies.ElementAt(1).GlobalNamespace; var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IGeneric").Single(); Assert.Equal(TypeKind.Interface, @interface.TypeKind); var interfaceMethod = (MethodSymbol)@interface.GetMembers("Method").Last(); //this assumes decl order Assert.Equal("void IGeneric<T>.Method<U>(T t, U u)", interfaceMethod.ToTestDisplayString()); //make sure we got the one we expected var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Generic").Single(); Assert.Equal(TypeKind.Class, @class.TypeKind); var substitutedInterface = @class.Interfaces().Single(); Assert.Equal(@interface, substitutedInterface.ConstructedFrom); var substitutedInterfaceMethod = (MethodSymbol)substitutedInterface.GetMembers("Method").Last(); //this assumes decl order Assert.Equal("void IGeneric<S>.Method<U>(S t, U u)", substitutedInterfaceMethod.ToTestDisplayString()); //make sure we got the one we expected Assert.Equal(interfaceMethod, substitutedInterfaceMethod.OriginalDefinition); var classMethod = (MethodSymbol)@class.GetMembers("IGeneric<S>.Method").Last(); //this assumes decl order Assert.Equal("void Generic<S>.IGeneric<S>.Method<V>(S s, V v)", classMethod.ToTestDisplayString()); //make sure we got the one we expected Assert.Equal(MethodKind.ExplicitInterfaceImplementation, classMethod.MethodKind); var explicitImpl = classMethod.ExplicitInterfaceImplementations.Single(); Assert.Equal(substitutedInterfaceMethod, explicitImpl); } [Fact] public void TestExplicitImplementationConstructed() { var assemblies = MetadataTestHelpers.GetSymbolsForReferences( new[] { Net451.mscorlib, TestReferences.SymbolsTests.ExplicitInterfaceImplementation.Methods.CSharp, }); var globalNamespace = assemblies.ElementAt(1).GlobalNamespace; var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IGeneric").Single(); Assert.Equal(TypeKind.Interface, @interface.TypeKind); var interfaceMethod = (MethodSymbol)@interface.GetMembers("Method").Last(); //this assumes decl order Assert.Equal("void IGeneric<T>.Method<U>(T t, U u)", interfaceMethod.ToTestDisplayString()); //make sure we got the one we expected var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Constructed").Single(); Assert.Equal(TypeKind.Class, @class.TypeKind); var substitutedInterface = @class.Interfaces().Single(); Assert.Equal(@interface, substitutedInterface.ConstructedFrom); var substitutedInterfaceMethod = (MethodSymbol)substitutedInterface.GetMembers("Method").Last(); //this assumes decl order Assert.Equal("void IGeneric<System.Int32>.Method<U>(System.Int32 t, U u)", substitutedInterfaceMethod.ToTestDisplayString()); //make sure we got the one we expected Assert.Equal(interfaceMethod, substitutedInterfaceMethod.OriginalDefinition); var classMethod = (MethodSymbol)@class.GetMembers("IGeneric<System.Int32>.Method").Last(); //this assumes decl order Assert.Equal("void Constructed.IGeneric<System.Int32>.Method<W>(System.Int32 i, W w)", classMethod.ToTestDisplayString()); //make sure we got the one we expected Assert.Equal(MethodKind.ExplicitInterfaceImplementation, classMethod.MethodKind); var explicitImpl = classMethod.ExplicitInterfaceImplementations.Single(); Assert.Equal(substitutedInterfaceMethod, explicitImpl); } [Fact] public void TestExplicitImplementationInterfaceCycleSuccess() { var assembly = MetadataTestHelpers.GetSymbolForReference( TestReferences.SymbolsTests.ExplicitInterfaceImplementation.Methods.IL); var globalNamespace = assembly.GlobalNamespace; var cyclicInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("ImplementsSelf").Single(); Assert.Equal(TypeKind.Interface, cyclicInterface.TypeKind); var implementedInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("I1").Single(); Assert.Equal(TypeKind.Interface, implementedInterface.TypeKind); var interface2Method = (MethodSymbol)implementedInterface.GetMembers("Method1").Single(); var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("InterfaceCycleSuccess").Single(); Assert.Equal(TypeKind.Class, @class.TypeKind); Assert.True(@class.Interfaces().Contains(cyclicInterface)); Assert.True(@class.Interfaces().Contains(implementedInterface)); var classMethod = (MethodSymbol)@class.GetMembers("Method").Single(); // the method is considered to be Ordinary Assert.Equal(MethodKind.Ordinary, classMethod.MethodKind); // because it has name without '.' var explicitImpl = classMethod.ExplicitInterfaceImplementations.Single(); Assert.Equal(interface2Method, explicitImpl); } [Fact] public void TestExplicitImplementationInterfaceCycleFailure() { var assembly = MetadataTestHelpers.GetSymbolForReference( TestReferences.SymbolsTests.ExplicitInterfaceImplementation.Methods.IL); var globalNamespace = assembly.GlobalNamespace; var cyclicInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("ImplementsSelf").Single(); Assert.Equal(TypeKind.Interface, cyclicInterface.TypeKind); var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("InterfaceCycleFailure").Single(); Assert.Equal(TypeKind.Class, @class.TypeKind); Assert.True(@class.Interfaces().Contains(cyclicInterface)); var classMethod = (MethodSymbol)@class.GetMembers("Method").Single(); //we couldn't find an interface method that's explicitly implemented, so we have no reason to believe the method isn't ordinary Assert.Equal(MethodKind.Ordinary, classMethod.MethodKind); var explicitImpls = classMethod.ExplicitInterfaceImplementations; Assert.False(explicitImpls.Any()); } /// <summary> /// A type def explicitly implements an interface, also a type def, but only /// indirectly, via a type ref. /// </summary> [Fact] public void TestExplicitImplementationDefRefDef() { var assemblies = MetadataTestHelpers.GetSymbolsForReferences( new[] { Net451.mscorlib, TestReferences.SymbolsTests.ExplicitInterfaceImplementation.Methods.CSharp, }); var globalNamespace = assemblies.ElementAt(1).GlobalNamespace; var defInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Interface").Single(); Assert.Equal(TypeKind.Interface, defInterface.TypeKind); var defInterfaceMethod = (MethodSymbol)defInterface.GetMembers("Method").Single(); var refInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IGenericInterface").Single(); Assert.Equal(TypeKind.Interface, defInterface.TypeKind); Assert.True(refInterface.Interfaces().Contains(defInterface)); var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IndirectImplementation").Single(); Assert.Equal(TypeKind.Class, @class.TypeKind); var classInterfacesConstructedFrom = @class.Interfaces().Select(i => i.ConstructedFrom); Assert.Equal(2, classInterfacesConstructedFrom.Count()); Assert.Contains(defInterface, classInterfacesConstructedFrom); Assert.Contains(refInterface, classInterfacesConstructedFrom); var classMethod = (MethodSymbol)@class.GetMembers("Interface.Method").Single(); Assert.Equal(MethodKind.ExplicitInterfaceImplementation, classMethod.MethodKind); var explicitImpl = classMethod.ExplicitInterfaceImplementations.Single(); Assert.Equal(defInterfaceMethod, explicitImpl); } /// <summary> /// IL type explicitly overrides a class (vs interface) method. /// ExplicitInterfaceImplementations should be empty. /// </summary> [Fact] public void TestExplicitImplementationOfClassMethod() { var assembly = MetadataTestHelpers.GetSymbolForReference( TestReferences.SymbolsTests.ExplicitInterfaceImplementation.Methods.IL); var globalNamespace = assembly.GlobalNamespace; var baseClass = (NamedTypeSymbol)globalNamespace.GetTypeMembers("ExplicitlyImplementedClass").Single(); Assert.Equal(TypeKind.Class, baseClass.TypeKind); var derivedClass = (NamedTypeSymbol)globalNamespace.GetTypeMembers("ExplicitlyImplementsAClass").Single(); Assert.Equal(TypeKind.Class, derivedClass.TypeKind); Assert.Equal(baseClass, derivedClass.BaseType()); var derivedClassMethod = (MethodSymbol)derivedClass.GetMembers("Method").Single(); Assert.Equal(MethodKind.Ordinary, derivedClassMethod.MethodKind); Assert.Equal(0, derivedClassMethod.ExplicitInterfaceImplementations.Length); } /// <summary> /// IL type explicitly overrides an interface method on an unrelated interface. /// ExplicitInterfaceImplementations should be empty. /// </summary> [Fact] public void TestExplicitImplementationOfUnrelatedInterfaceMethod() { var assembly = MetadataTestHelpers.GetSymbolForReference( TestReferences.SymbolsTests.ExplicitInterfaceImplementation.Methods.IL); var globalNamespace = assembly.GlobalNamespace; var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IUnrelated").First(); //decl order Assert.Equal(0, @interface.Arity); Assert.Equal(TypeKind.Interface, @interface.TypeKind); var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("ExplicitlyImplementsUnrelatedInterfaceMethods").Single(); Assert.Equal(TypeKind.Class, @class.TypeKind); Assert.Equal(0, @class.AllInterfaces().Length); var classMethod = (MethodSymbol)@class.GetMembers("Method1").Single(); Assert.Equal(MethodKind.Ordinary, classMethod.MethodKind); Assert.Equal(0, classMethod.ExplicitInterfaceImplementations.Length); var classGenericMethod = (MethodSymbol)@class.GetMembers("Method1").Single(); Assert.Equal(MethodKind.Ordinary, classGenericMethod.MethodKind); Assert.Equal(0, classGenericMethod.ExplicitInterfaceImplementations.Length); } /// <summary> /// IL type explicitly overrides an interface method on an unrelated generic interface. /// ExplicitInterfaceImplementations should be empty. /// </summary> [Fact] public void TestExplicitImplementationOfUnrelatedGenericInterfaceMethod() { var assemblies = MetadataTestHelpers.GetSymbolsForReferences( new[] { Net451.mscorlib, TestReferences.SymbolsTests.ExplicitInterfaceImplementation.Methods.IL, }); var globalNamespace = assemblies.ElementAt(1).GlobalNamespace; var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IUnrelated").Last(); //decl order Assert.Equal(1, @interface.Arity); Assert.Equal(TypeKind.Interface, @interface.TypeKind); var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("ExplicitlyImplementsUnrelatedInterfaceMethods").Single(); Assert.Equal(TypeKind.Class, @class.TypeKind); Assert.Equal(0, @class.AllInterfaces().Length); var classMethod = (MethodSymbol)@class.GetMembers("Method2").Single(); Assert.Equal(MethodKind.Ordinary, classMethod.MethodKind); Assert.Equal(0, classMethod.ExplicitInterfaceImplementations.Length); var classGenericMethod = (MethodSymbol)@class.GetMembers("Method2").Single(); Assert.Equal(MethodKind.Ordinary, classGenericMethod.MethodKind); Assert.Equal(0, classGenericMethod.ExplicitInterfaceImplementations.Length); } /// <summary> /// In metadata, nested types implicitly share all type parameters of their containing types. /// This results in some extra computations when mapping a type parameter position to a type /// parameter symbol. /// </summary> [Fact] public void TestTypeParameterPositions() { var assemblies = MetadataTestHelpers.GetSymbolsForReferences( new[] { Net451.mscorlib, TestReferences.SymbolsTests.ExplicitInterfaceImplementation.Methods.CSharp, }); var globalNamespace = assemblies.ElementAt(1).GlobalNamespace; var outerInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IGeneric2").Single(); Assert.Equal(1, outerInterface.Arity); Assert.Equal(TypeKind.Interface, outerInterface.TypeKind); var outerInterfaceMethod = outerInterface.GetMembers().Single(); var outerClass = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Outer").Single(); Assert.Equal(1, outerClass.Arity); Assert.Equal(TypeKind.Class, outerClass.TypeKind); var innerInterface = (NamedTypeSymbol)outerClass.GetTypeMembers("IInner").Single(); Assert.Equal(1, innerInterface.Arity); Assert.Equal(TypeKind.Interface, innerInterface.TypeKind); var innerInterfaceMethod = innerInterface.GetMembers().Single(); var innerClass1 = (NamedTypeSymbol)outerClass.GetTypeMembers("Inner1").Single(); CheckInnerClassHelper(innerClass1, "IGeneric2<A>.Method", outerInterfaceMethod); var innerClass2 = (NamedTypeSymbol)outerClass.GetTypeMembers("Inner2").Single(); CheckInnerClassHelper(innerClass2, "IGeneric2<T>.Method", outerInterfaceMethod); var innerClass3 = (NamedTypeSymbol)outerClass.GetTypeMembers("Inner3").Single(); CheckInnerClassHelper(innerClass3, "Outer<T>.IInner<C>.Method", innerInterfaceMethod); var innerClass4 = (NamedTypeSymbol)outerClass.GetTypeMembers("Inner4").Single(); CheckInnerClassHelper(innerClass4, "Outer<T>.IInner<T>.Method", innerInterfaceMethod); } private static void CheckInnerClassHelper(NamedTypeSymbol innerClass, string methodName, Symbol interfaceMethod) { var @interface = interfaceMethod.ContainingType; Assert.Equal(1, innerClass.Arity); Assert.Equal(TypeKind.Class, innerClass.TypeKind); Assert.Equal(@interface, innerClass.Interfaces().Single().ConstructedFrom); var innerClassMethod = (MethodSymbol)innerClass.GetMembers(methodName).Single(); var innerClassImplementingMethod = innerClassMethod.ExplicitInterfaceImplementations.Single(); Assert.Equal(interfaceMethod, innerClassImplementingMethod.OriginalDefinition); Assert.Equal(@interface, innerClassImplementingMethod.ContainingType.ConstructedFrom); } [Fact] public void TestVirtualnessFlags_Invoke() { var source = @" class Invoke { void Goo(MetadataModifiers m) { m.M00(); m.M01(); m.M02(); m.M03(); m.M04(); m.M05(); m.M06(); m.M07(); m.M08(); m.M09(); m.M10(); m.M11(); m.M12(); m.M13(); m.M14(); m.M15(); } } "; var compilation = CreateCompilation(source, new[] { TestReferences.SymbolsTests.Methods.ILMethods }); compilation.VerifyDiagnostics(); // No errors, as in Dev10 } [Fact] public void TestVirtualnessFlags_NoOverride() { var source = @" class Abstract : MetadataModifiers { //CS0534 for methods 2, 5, 8, 9, 11, 12, 14, 15 } "; var compilation = CreateCompilation(source, new[] { TestReferences.SymbolsTests.Methods.ILMethods }); compilation.VerifyDiagnostics( // (2,7): error CS0534: 'Abstract' does not implement inherited abstract member 'MetadataModifiers.M02()' Diagnostic(ErrorCode.ERR_UnimplementedAbstractMethod, "Abstract").WithArguments("Abstract", "MetadataModifiers.M02()"), // (2,7): error CS0534: 'Abstract' does not implement inherited abstract member 'MetadataModifiers.M05()' Diagnostic(ErrorCode.ERR_UnimplementedAbstractMethod, "Abstract").WithArguments("Abstract", "MetadataModifiers.M05()"), // (2,7): error CS0534: 'Abstract' does not implement inherited abstract member 'MetadataModifiers.M08()' Diagnostic(ErrorCode.ERR_UnimplementedAbstractMethod, "Abstract").WithArguments("Abstract", "MetadataModifiers.M08()"), // (2,7): error CS0534: 'Abstract' does not implement inherited abstract member 'MetadataModifiers.M09()' Diagnostic(ErrorCode.ERR_UnimplementedAbstractMethod, "Abstract").WithArguments("Abstract", "MetadataModifiers.M09()"), // (2,7): error CS0534: 'Abstract' does not implement inherited abstract member 'MetadataModifiers.M11()' Diagnostic(ErrorCode.ERR_UnimplementedAbstractMethod, "Abstract").WithArguments("Abstract", "MetadataModifiers.M11()"), // (2,7): error CS0534: 'Abstract' does not implement inherited abstract member 'MetadataModifiers.M12()' Diagnostic(ErrorCode.ERR_UnimplementedAbstractMethod, "Abstract").WithArguments("Abstract", "MetadataModifiers.M12()"), // (2,7): error CS0534: 'Abstract' does not implement inherited abstract member 'MetadataModifiers.M14()' Diagnostic(ErrorCode.ERR_UnimplementedAbstractMethod, "Abstract").WithArguments("Abstract", "MetadataModifiers.M14()"), // (2,7): error CS0534: 'Abstract' does not implement inherited abstract member 'MetadataModifiers.M15()' Diagnostic(ErrorCode.ERR_UnimplementedAbstractMethod, "Abstract").WithArguments("Abstract", "MetadataModifiers.M15()")); } [Fact] public void TestVirtualnessFlags_Override() { var source = @" class Override : MetadataModifiers { public override void M00() { } //CS0506 public override void M01() { } //CS0506 public override void M02() { } public override void M03() { } public override void M04() { } //CS0506 public override void M05() { } public override void M06() { } public override void M07() { } //CS0506 public override void M08() { } public override void M09() { } public override void M10() { } //CS0239 (Dev10 reports CS0506, presumably because MetadataModifiers.M10 isn't overriding anything) public override void M11() { } public override void M12() { } public override void M13() { } //CS0506 public override void M14() { } public override void M15() { } } "; var compilation = CreateCompilation(source, new[] { TestReferences.SymbolsTests.Methods.ILMethods }); compilation.VerifyDiagnostics( // (4,26): error CS0506: 'Override.M00()': cannot override inherited member 'MetadataModifiers.M00()' because it is not marked virtual, abstract, or override Diagnostic(ErrorCode.ERR_CantOverrideNonVirtual, "M00").WithArguments("Override.M00()", "MetadataModifiers.M00()"), // (5,26): error CS0506: 'Override.M01()': cannot override inherited member 'MetadataModifiers.M01()' because it is not marked virtual, abstract, or override Diagnostic(ErrorCode.ERR_CantOverrideNonVirtual, "M01").WithArguments("Override.M01()", "MetadataModifiers.M01()"), // (8,26): error CS0506: 'Override.M04()': cannot override inherited member 'MetadataModifiers.M04()' because it is not marked virtual, abstract, or override Diagnostic(ErrorCode.ERR_CantOverrideNonVirtual, "M04").WithArguments("Override.M04()", "MetadataModifiers.M04()"), // (11,26): error CS0506: 'Override.M07()': cannot override inherited member 'MetadataModifiers.M07()' because it is not marked virtual, abstract, or override Diagnostic(ErrorCode.ERR_CantOverrideNonVirtual, "M07").WithArguments("Override.M07()", "MetadataModifiers.M07()"), // (14,26): error CS0239: 'Override.M10()': cannot override inherited member 'MetadataModifiers.M10()' because it is sealed Diagnostic(ErrorCode.ERR_CantOverrideSealed, "M10").WithArguments("Override.M10()", "MetadataModifiers.M10()"), // (17,26): error CS0506: 'Override.M13()': cannot override inherited member 'MetadataModifiers.M13()' because it is not marked virtual, abstract, or override Diagnostic(ErrorCode.ERR_CantOverrideNonVirtual, "M13").WithArguments("Override.M13()", "MetadataModifiers.M13()")); } [ClrOnlyFact] public void TestVirtualnessFlags_CSharpRepresentation() { // All combinations of VirtualContract, NewSlotVTable, AbstractImpl, and FinalContract - without explicit overriding // NOTE: some won't peverify (newslot/final/abstract without virtual, abstract with final) CheckLoadingVirtualnessFlags(SymbolVirtualness.NonVirtual, 0, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.Override, MethodAttributes.Virtual, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.NonVirtual, MethodAttributes.NewSlot, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.Abstract, MethodAttributes.Abstract, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.NonVirtual, MethodAttributes.Final, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.Virtual, MethodAttributes.Virtual | MethodAttributes.NewSlot, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.AbstractOverride, MethodAttributes.Virtual | MethodAttributes.Abstract, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.SealedOverride, MethodAttributes.Virtual | MethodAttributes.Final, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.Abstract, MethodAttributes.NewSlot | MethodAttributes.Abstract, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.NonVirtual, MethodAttributes.NewSlot | MethodAttributes.Final, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.Abstract, MethodAttributes.Abstract | MethodAttributes.Final, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.Abstract, MethodAttributes.NewSlot | MethodAttributes.Abstract | MethodAttributes.Final, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.AbstractOverride, MethodAttributes.Virtual | MethodAttributes.Abstract | MethodAttributes.Final, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.NonVirtual, MethodAttributes.Virtual | MethodAttributes.NewSlot | MethodAttributes.Final, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.Abstract, MethodAttributes.Virtual | MethodAttributes.NewSlot | MethodAttributes.Abstract, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.Abstract, MethodAttributes.Virtual | MethodAttributes.NewSlot | MethodAttributes.Abstract | MethodAttributes.Final, isExplicitOverride: false); // All combinations of VirtualContract, NewSlotVTable, AbstractImpl, and FinalContract - with explicit overriding CheckLoadingVirtualnessFlags(SymbolVirtualness.NonVirtual, 0, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.Override, MethodAttributes.Virtual, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.NonVirtual, MethodAttributes.NewSlot, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.Abstract, MethodAttributes.Abstract, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.NonVirtual, MethodAttributes.Final, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.Override, MethodAttributes.Virtual | MethodAttributes.NewSlot, isExplicitOverride: true); //differs from above CheckLoadingVirtualnessFlags(SymbolVirtualness.AbstractOverride, MethodAttributes.Virtual | MethodAttributes.Abstract, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.SealedOverride, MethodAttributes.Virtual | MethodAttributes.Final, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.Abstract, MethodAttributes.NewSlot | MethodAttributes.Abstract, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.NonVirtual, MethodAttributes.NewSlot | MethodAttributes.Final, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.Abstract, MethodAttributes.Abstract | MethodAttributes.Final, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.Abstract, MethodAttributes.NewSlot | MethodAttributes.Abstract | MethodAttributes.Final, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.AbstractOverride, MethodAttributes.Virtual | MethodAttributes.Abstract | MethodAttributes.Final, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.SealedOverride, MethodAttributes.Virtual | MethodAttributes.NewSlot | MethodAttributes.Final, isExplicitOverride: true); //differs from above CheckLoadingVirtualnessFlags(SymbolVirtualness.AbstractOverride, MethodAttributes.Virtual | MethodAttributes.NewSlot | MethodAttributes.Abstract, isExplicitOverride: true); //differs from above CheckLoadingVirtualnessFlags(SymbolVirtualness.AbstractOverride, MethodAttributes.Virtual | MethodAttributes.NewSlot | MethodAttributes.Abstract | MethodAttributes.Final, isExplicitOverride: true); //differs from above } private void CheckLoadingVirtualnessFlags(SymbolVirtualness expectedVirtualness, MethodAttributes flags, bool isExplicitOverride) { const string ilTemplate = @" .class public auto ansi beforefieldinit Base extends [mscorlib]System.Object {{ .method public hidebysig newslot virtual instance void M() cil managed {{ ret }} .method public hidebysig specialname rtspecialname instance void .ctor() cil managed {{ ldarg.0 call instance void [mscorlib]System.Object::.ctor() ret }} }} // end of class Base .class public abstract auto ansi beforefieldinit Derived extends Base {{ .method public hidebysig{0} instance void M() cil managed {{ {1} {2} }} .method public hidebysig specialname rtspecialname instance void .ctor() cil managed {{ ldarg.0 call instance void [mscorlib]System.Object::.ctor() ret }} }} // end of class Derived "; string modifiers = ""; if ((flags & MethodAttributes.NewSlot) != 0) { modifiers += " newslot"; } if ((flags & MethodAttributes.Abstract) != 0) { modifiers += " abstract"; } if ((flags & MethodAttributes.Virtual) != 0) { modifiers += " virtual"; } if ((flags & MethodAttributes.Final) != 0) { modifiers += " final"; } string explicitOverride = isExplicitOverride ? ".override Base::M" : ""; string body = ((flags & MethodAttributes.Abstract) != 0) ? "" : "ret"; CompileWithCustomILSource("", string.Format(ilTemplate, modifiers, explicitOverride, body), compilation => { var derivedClass = compilation.GlobalNamespace.GetMember<PENamedTypeSymbol>("Derived"); var method = derivedClass.GetMember<MethodSymbol>("M"); switch (expectedVirtualness) { case SymbolVirtualness.NonVirtual: Assert.False(method.IsVirtual); Assert.False(method.IsOverride); Assert.False(method.IsAbstract); Assert.False(method.IsSealed); break; case SymbolVirtualness.Virtual: Assert.True(method.IsVirtual); Assert.False(method.IsOverride); Assert.False(method.IsAbstract); Assert.False(method.IsSealed); break; case SymbolVirtualness.Override: Assert.False(method.IsVirtual); Assert.True(method.IsOverride); Assert.False(method.IsAbstract); Assert.False(method.IsSealed); break; case SymbolVirtualness.SealedOverride: Assert.False(method.IsVirtual); Assert.True(method.IsOverride); Assert.False(method.IsAbstract); Assert.True(method.IsSealed); break; case SymbolVirtualness.Abstract: Assert.False(method.IsVirtual); Assert.False(method.IsOverride); Assert.True(method.IsAbstract); Assert.False(method.IsSealed); break; case SymbolVirtualness.AbstractOverride: Assert.False(method.IsVirtual); Assert.True(method.IsOverride); Assert.True(method.IsAbstract); Assert.False(method.IsSealed); break; default: Assert.False(true, "Unexpected enum value " + expectedVirtualness); break; } }); } // Note that not all combinations are possible. private enum SymbolVirtualness { NonVirtual, Virtual, Override, SealedOverride, Abstract, AbstractOverride, } [Fact] public void Constructors1() { string ilSource = @" .class private auto ansi cls1 extends [mscorlib]System.Object { .method public specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } .method public specialname rtspecialname static void .cctor() cil managed { // Code size 1 (0x1) .maxstack 8 IL_0000: ret } } .class private auto ansi Instance_vs_Static extends [mscorlib]System.Object { .method public specialname rtspecialname static void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } .method public specialname rtspecialname instance void .cctor() cil managed { // Code size 1 (0x1) .maxstack 8 IL_0000: ret } } .class private auto ansi ReturnAValue1 extends [mscorlib]System.Object { .method public specialname rtspecialname instance int32 .ctor(int32 x) cil managed { // Code size 6 (0x6) .maxstack 1 .locals init (int32 V_0) IL_0000: ldc.i4.0 IL_0001: stloc.0 IL_0002: br.s IL_0004 IL_0004: ldloc.0 IL_0005: ret } .method private specialname rtspecialname static int32 .cctor() cil managed { // Code size 6 (0x6) .maxstack 1 .locals init (int32 V_0) IL_0000: ldc.i4.0 IL_0001: stloc.0 IL_0002: br.s IL_0004 IL_0004: ldloc.0 IL_0005: ret } } .class private auto ansi ReturnAValue2 extends [mscorlib]System.Object { .method public specialname rtspecialname static int32 .cctor() cil managed { // Code size 6 (0x6) .maxstack 1 .locals init (int32 V_0) IL_0000: ldc.i4.0 IL_0001: stloc.0 IL_0002: br.s IL_0004 IL_0004: ldloc.0 IL_0005: ret } } .class private auto ansi Generic1 extends [mscorlib]System.Object { .method public specialname rtspecialname instance void .ctor<T>() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } .method private specialname rtspecialname static void .cctor<T>() cil managed { // Code size 1 (0x1) .maxstack 8 IL_0000: ret } } .class private auto ansi Generic2 extends [mscorlib]System.Object { .method public specialname rtspecialname static void .cctor<T>() cil managed { // Code size 1 (0x1) .maxstack 8 IL_0000: ret } } .class private auto ansi HasParameter extends [mscorlib]System.Object { .method public specialname rtspecialname static void .cctor(int32 x) cil managed { // Code size 1 (0x1) .maxstack 8 IL_0000: ret } } .class private auto ansi Virtual extends [mscorlib]System.Object { .method public newslot strict virtual specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } } "; var compilation = CreateCompilationWithILAndMscorlib40("", ilSource); foreach (var m in compilation.GetTypeByMetadataName("cls1").GetMembers()) { Assert.Equal(m.Name == ".cctor" ? MethodKind.StaticConstructor : MethodKind.Constructor, ((MethodSymbol)m).MethodKind); } foreach (var m in compilation.GetTypeByMetadataName("Instance_vs_Static").GetMembers()) { Assert.Equal(MethodKind.Ordinary, ((MethodSymbol)m).MethodKind); } foreach (var m in compilation.GetTypeByMetadataName("ReturnAValue1").GetMembers()) { Assert.Equal(MethodKind.Ordinary, ((MethodSymbol)m).MethodKind); } foreach (var m in compilation.GetTypeByMetadataName("ReturnAValue2").GetMembers()) { Assert.Equal(MethodKind.Ordinary, ((MethodSymbol)m).MethodKind); } foreach (var m in compilation.GetTypeByMetadataName("Generic1").GetMembers()) { Assert.Equal(MethodKind.Ordinary, ((MethodSymbol)m).MethodKind); } foreach (var m in compilation.GetTypeByMetadataName("Generic2").GetMembers()) { Assert.Equal(MethodKind.Ordinary, ((MethodSymbol)m).MethodKind); } foreach (var m in compilation.GetTypeByMetadataName("HasParameter").GetMembers()) { Assert.Equal(MethodKind.Ordinary, ((MethodSymbol)m).MethodKind); } foreach (var m in compilation.GetTypeByMetadataName("Virtual").GetMembers()) { Assert.Equal(MethodKind.Ordinary, ((MethodSymbol)m).MethodKind); } } [Fact] public void OverridesAndLackOfNewSlot() { string ilSource = @" .class interface public abstract auto ansi serializable Microsoft.FSharp.Control.IDelegateEvent`1<([mscorlib]System.Delegate) TDelegate> { .method public hidebysig abstract virtual instance void AddHandler(!TDelegate 'handler') cil managed { } // end of method IDelegateEvent`1::AddHandler .method public hidebysig abstract virtual instance void RemoveHandler(!TDelegate 'handler') cil managed { } // end of method IDelegateEvent`1::RemoveHandler } // end of class Microsoft.FSharp.Control.IDelegateEvent`1 "; var compilation = CreateCompilationWithILAndMscorlib40("", ilSource); foreach (var m in compilation.GetTypeByMetadataName("Microsoft.FSharp.Control.IDelegateEvent`1").GetMembers()) { Assert.False(((MethodSymbol)m).IsVirtual); Assert.True(((MethodSymbol)m).IsAbstract); Assert.False(((MethodSymbol)m).IsOverride); } } [Fact] public void MemberSignature_LongFormType() { string source = @" public class D { public static void Main() { string s = C.RT(); double d = C.VT(); } } "; var longFormRef = MetadataReference.CreateFromImage(TestResources.MetadataTests.Invalid.LongTypeFormInSignature); var c = CreateCompilation(source, new[] { longFormRef }); c.VerifyDiagnostics( // (6,20): error CS0570: 'C.RT()' is not supported by the language Diagnostic(ErrorCode.ERR_BindToBogus, "RT").WithArguments("C.RT()"), // (7,20): error CS0570: 'C.VT()' is not supported by the language Diagnostic(ErrorCode.ERR_BindToBogus, "VT").WithArguments("C.VT()")); } [WorkItem(7971, "https://github.com/dotnet/roslyn/issues/7971")] [Fact(Skip = "7971")] public void MemberSignature_CycleTrhuTypeSpecInCustomModifiers() { string source = @" class P { static void Main() { User.X(new Extender()); } } "; var lib = MetadataReference.CreateFromImage(TestResources.MetadataTests.Invalid.Signatures.SignatureCycle2); var c = CreateCompilation(source, new[] { lib }); c.VerifyDiagnostics(); } [WorkItem(7970, "https://github.com/dotnet/roslyn/issues/7970")] [Fact] public void MemberSignature_TypeSpecInWrongPlace() { string source = @" class P { static void Main() { User.X(new System.Collections.Generic.List<int>()); } } "; var lib = MetadataReference.CreateFromImage(TestResources.MetadataTests.Invalid.Signatures.TypeSpecInWrongPlace); var c = CreateCompilation(source, new[] { lib }); c.VerifyDiagnostics( // (6,14): error CS0570: 'User.X(?)' is not supported by the language // User.X(new System.Collections.Generic.List<int>()); Diagnostic(ErrorCode.ERR_BindToBogus, "X").WithArguments("User.X(?)")); } [WorkItem(666162, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/666162")] [Fact] public void Repro666162() { var il = @" .assembly extern mscorlib { } .assembly extern Missing { } .assembly Lib { } .class public auto ansi beforefieldinit Test extends [mscorlib]System.Object { .method public hidebysig instance class Test modreq (bool)& M() cil managed { ldnull throw } .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { ldarg.0 call instance void [mscorlib]System.Object::.ctor() ret } } // end of class Test "; var ilRef = CompileIL(il, prependDefaultHeader: false); var comp = CreateEmptyCompilation("", new[] { ilRef }); var type = comp.GlobalNamespace.GetMember<NamedTypeSymbol>("Test"); var method = type.GetMember<MethodSymbol>("M"); Assert.False(method.ReturnTypeWithAnnotations.IsDefault); } [Fact, WorkItem(217681, "https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems?id=217681")] public void LoadingMethodWithPublicAndPrivateAccessibility() { string source = @" public class D { public static void Main() { new C().M(); System.Console.WriteLine(new C().F); new C.C2().M2(); } } "; var references = new[] { MetadataReference.CreateFromImage(TestResources.SymbolsTests.Metadata.PublicAndPrivateFlags) }; var comp = CreateCompilation(source, references: references); // The method, field and nested type with public and private accessibility flags get loaded as private. comp.VerifyDiagnostics( // (6,15): error CS0122: 'C.M()' is inaccessible due to its protection level // new C().M(); Diagnostic(ErrorCode.ERR_BadAccess, "M").WithArguments("C.M()").WithLocation(6, 15), // (7,40): error CS0122: 'C.F' is inaccessible due to its protection level // System.Console.WriteLine(new C().F); Diagnostic(ErrorCode.ERR_BadAccess, "F").WithArguments("C.F").WithLocation(7, 40), // (8,13): error CS0122: 'C.C2' is inaccessible due to its protection level // new C.C2().M2(); Diagnostic(ErrorCode.ERR_BadAccess, "C2").WithArguments("C.C2").WithLocation(8, 13) ); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Linq; using Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE; using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Microsoft.CodeAnalysis.Test.Utilities; using Roslyn.Test.Utilities; using Xunit; using System.Reflection; using static Roslyn.Test.Utilities.TestMetadata; //test namespace Microsoft.CodeAnalysis.CSharp.UnitTests.Symbols.Metadata.PE { public class LoadingMethods : CSharpTestBase { [Fact] public void Test1() { var assemblies = MetadataTestHelpers.GetSymbolsForReferences(mrefs: new[] { TestReferences.SymbolsTests.MDTestLib1, TestReferences.SymbolsTests.MDTestLib2, TestReferences.SymbolsTests.Methods.CSMethods, TestReferences.SymbolsTests.Methods.VBMethods, Net40.mscorlib, TestReferences.SymbolsTests.Methods.ByRefReturn }, options: TestOptions.ReleaseDll.WithMetadataImportOptions(MetadataImportOptions.Internal)); var module1 = assemblies[0].Modules[0]; var module2 = assemblies[1].Modules[0]; var module3 = assemblies[2].Modules[0]; var module4 = assemblies[3].Modules[0]; var module5 = assemblies[4].Modules[0]; var byrefReturn = assemblies[5].Modules[0]; var varTC10 = module2.GlobalNamespace.GetTypeMembers("TC10").Single(); Assert.Equal(6, varTC10.GetMembers().Length); var localM1 = (MethodSymbol)varTC10.GetMembers("M1").Single(); var localM2 = (MethodSymbol)varTC10.GetMembers("M2").Single(); var localM3 = (MethodSymbol)varTC10.GetMembers("M3").Single(); var localM4 = (MethodSymbol)varTC10.GetMembers("M4").Single(); var localM5 = (MethodSymbol)varTC10.GetMembers("M5").Single(); Assert.Equal("void TC10.M1()", localM1.ToTestDisplayString()); Assert.True(localM1.ReturnsVoid); Assert.Equal(Accessibility.Public, localM1.DeclaredAccessibility); Assert.Same(module2, localM1.Locations.Single().MetadataModuleInternal); Assert.Equal("void TC10.M2(System.Int32 m1_1)", localM2.ToTestDisplayString()); Assert.True(localM2.ReturnsVoid); Assert.Equal(Accessibility.Protected, localM2.DeclaredAccessibility); var localM1_1 = localM2.Parameters[0]; Assert.IsType<PEParameterSymbol>(localM1_1); Assert.Same(localM1_1.ContainingSymbol, localM2); Assert.Equal(SymbolKind.Parameter, localM1_1.Kind); Assert.Equal(Accessibility.NotApplicable, localM1_1.DeclaredAccessibility); Assert.False(localM1_1.IsAbstract); Assert.False(localM1_1.IsSealed); Assert.False(localM1_1.IsVirtual); Assert.False(localM1_1.IsOverride); Assert.False(localM1_1.IsStatic); Assert.False(localM1_1.IsExtern); Assert.Equal(0, localM1_1.TypeWithAnnotations.CustomModifiers.Length); Assert.Equal("TC8 TC10.M3()", localM3.ToTestDisplayString()); Assert.False(localM3.ReturnsVoid); Assert.Equal(Accessibility.Protected, localM3.DeclaredAccessibility); Assert.Equal("C1<System.Type> TC10.M4(ref C1<System.Type> x, ref TC8 y)", localM4.ToTestDisplayString()); Assert.False(localM4.ReturnsVoid); Assert.Equal(Accessibility.Internal, localM4.DeclaredAccessibility); Assert.Equal("void TC10.M5(ref C1<System.Type>[,,] x, ref TC8[] y)", localM5.ToTestDisplayString()); Assert.True(localM5.ReturnsVoid); Assert.Equal(Accessibility.ProtectedOrInternal, localM5.DeclaredAccessibility); var localM6 = varTC10.GetMembers("M6"); Assert.Equal(0, localM6.Length); var localC107 = module1.GlobalNamespace.GetTypeMembers("C107").Single(); var varC108 = localC107.GetMembers("C108").Single(); Assert.Equal(SymbolKind.NamedType, varC108.Kind); var csharpC1 = module3.GlobalNamespace.GetTypeMembers("C1").Single(); var sameName1 = csharpC1.GetMembers("SameName").Single(); var sameName2 = csharpC1.GetMembers("sameName").Single(); Assert.Equal(SymbolKind.NamedType, sameName1.Kind); Assert.Equal("SameName", sameName1.Name); Assert.Equal(SymbolKind.Method, sameName2.Kind); Assert.Equal("sameName", sameName2.Name); Assert.Equal(2, csharpC1.GetMembers("SameName2").Length); Assert.Equal(1, csharpC1.GetMembers("sameName2").Length); Assert.Equal(0, csharpC1.GetMembers("DoesntExist").Length); var basicC1 = module4.GlobalNamespace.GetTypeMembers("C1").Single(); var basicC1_M1 = (MethodSymbol)basicC1.GetMembers("M1").Single(); var basicC1_M2 = (MethodSymbol)basicC1.GetMembers("M2").Single(); var basicC1_M3 = (MethodSymbol)basicC1.GetMembers("M3").Single(); var basicC1_M4 = (MethodSymbol)basicC1.GetMembers("M4").Single(); Assert.False(basicC1_M1.Parameters[0].IsOptional); Assert.False(basicC1_M1.Parameters[0].HasExplicitDefaultValue); Assert.Same(module4, basicC1_M1.Parameters[0].Locations.Single().MetadataModuleInternal); Assert.True(basicC1_M2.Parameters[0].IsOptional); Assert.False(basicC1_M2.Parameters[0].HasExplicitDefaultValue); Assert.True(basicC1_M3.Parameters[0].IsOptional); Assert.True(basicC1_M3.Parameters[0].HasExplicitDefaultValue); Assert.True(basicC1_M4.Parameters[0].IsOptional); Assert.False(basicC1_M4.Parameters[0].HasExplicitDefaultValue); var emptyStructure = module4.GlobalNamespace.GetTypeMembers("EmptyStructure").Single(); Assert.Equal(1, emptyStructure.GetMembers().Length); //synthesized parameterless constructor Assert.Equal(0, emptyStructure.GetMembers("NoMembersOrTypes").Length); var basicC1_M5 = (MethodSymbol)basicC1.GetMembers("M5").Single(); var basicC1_M6 = (MethodSymbol)basicC1.GetMembers("M6").Single(); var basicC1_M7 = (MethodSymbol)basicC1.GetMembers("M7").Single(); var basicC1_M8 = (MethodSymbol)basicC1.GetMembers("M8").Single(); var basicC1_M9 = basicC1.GetMembers("M9").OfType<MethodSymbol>().ToArray(); Assert.False(basicC1_M5.IsGenericMethod); // Check genericity before cracking signature Assert.True(basicC1_M6.ReturnsVoid); Assert.False(basicC1_M6.IsGenericMethod); // Check genericity after cracking signature Assert.True(basicC1_M7.IsGenericMethod); // Check genericity before cracking signature Assert.Equal("void C1.M7<T>(System.Int32 x)", basicC1_M7.ToTestDisplayString()); Assert.True(basicC1_M6.ReturnsVoid); Assert.True(basicC1_M8.IsGenericMethod); // Check genericity after cracking signature Assert.Equal("void C1.M8<T>(System.Int32 x)", basicC1_M8.ToTestDisplayString()); Assert.Equal(2, basicC1_M9.Count()); Assert.Equal(1, basicC1_M9.Count(m => m.IsGenericMethod)); Assert.Equal(1, basicC1_M9.Count(m => !m.IsGenericMethod)); var basicC1_M10 = (MethodSymbol)basicC1.GetMembers("M10").Single(); Assert.Equal("void C1.M10<T1>(T1 x)", basicC1_M10.ToTestDisplayString()); var basicC1_M11 = (MethodSymbol)basicC1.GetMembers("M11").Single(); Assert.Equal("T3 C1.M11<T2, T3>(T2 x)", basicC1_M11.ToTestDisplayString()); Assert.Equal(0, basicC1_M11.TypeParameters[0].ConstraintTypes().Length); Assert.Same(basicC1, basicC1_M11.TypeParameters[1].ConstraintTypes().Single()); var basicC1_M12 = (MethodSymbol)basicC1.GetMembers("M12").Single(); Assert.Equal(0, basicC1_M12.TypeArgumentsWithAnnotations.Length); Assert.False(basicC1_M12.IsVararg); Assert.False(basicC1_M12.IsExtern); Assert.False(basicC1_M12.IsStatic); var loadLibrary = (MethodSymbol)basicC1.GetMembers("LoadLibrary").Single(); Assert.True(loadLibrary.IsExtern); var basicC2 = module4.GlobalNamespace.GetTypeMembers("C2").Single(); var basicC2_M1 = (MethodSymbol)basicC2.GetMembers("M1").Single(); Assert.Equal("void C2<T4>.M1<T5>(T5 x, T4 y)", basicC2_M1.ToTestDisplayString()); var console = module5.GlobalNamespace.GetMembers("System").OfType<NamespaceSymbol>().Single(). GetTypeMembers("Console").Single(); Assert.Equal(1, console.GetMembers("WriteLine").OfType<MethodSymbol>().Count(m => m.IsVararg)); Assert.True(console.GetMembers("WriteLine").OfType<MethodSymbol>().Single(m => m.IsVararg).IsStatic); var basicModifiers1 = module4.GlobalNamespace.GetTypeMembers("Modifiers1").Single(); var basicModifiers1_M1 = (MethodSymbol)basicModifiers1.GetMembers("M1").Single(); var basicModifiers1_M2 = (MethodSymbol)basicModifiers1.GetMembers("M2").Single(); var basicModifiers1_M3 = (MethodSymbol)basicModifiers1.GetMembers("M3").Single(); var basicModifiers1_M4 = (MethodSymbol)basicModifiers1.GetMembers("M4").Single(); var basicModifiers1_M5 = (MethodSymbol)basicModifiers1.GetMembers("M5").Single(); var basicModifiers1_M6 = (MethodSymbol)basicModifiers1.GetMembers("M6").Single(); var basicModifiers1_M7 = (MethodSymbol)basicModifiers1.GetMembers("M7").Single(); var basicModifiers1_M8 = (MethodSymbol)basicModifiers1.GetMembers("M8").Single(); var basicModifiers1_M9 = (MethodSymbol)basicModifiers1.GetMembers("M9").Single(); Assert.True(basicModifiers1_M1.IsAbstract); Assert.False(basicModifiers1_M1.IsVirtual); Assert.False(basicModifiers1_M1.IsSealed); Assert.True(basicModifiers1_M1.HidesBaseMethodsByName); Assert.False(basicModifiers1_M1.IsOverride); Assert.False(basicModifiers1_M2.IsAbstract); Assert.True(basicModifiers1_M2.IsVirtual); Assert.False(basicModifiers1_M2.IsSealed); Assert.True(basicModifiers1_M2.HidesBaseMethodsByName); Assert.False(basicModifiers1_M2.IsOverride); Assert.False(basicModifiers1_M3.IsAbstract); Assert.False(basicModifiers1_M3.IsVirtual); Assert.False(basicModifiers1_M3.IsSealed); Assert.False(basicModifiers1_M3.HidesBaseMethodsByName); Assert.False(basicModifiers1_M3.IsOverride); Assert.False(basicModifiers1_M4.IsAbstract); Assert.False(basicModifiers1_M4.IsVirtual); Assert.False(basicModifiers1_M4.IsSealed); Assert.True(basicModifiers1_M4.HidesBaseMethodsByName); Assert.False(basicModifiers1_M4.IsOverride); Assert.False(basicModifiers1_M5.IsAbstract); Assert.False(basicModifiers1_M5.IsVirtual); Assert.False(basicModifiers1_M5.IsSealed); Assert.True(basicModifiers1_M5.HidesBaseMethodsByName); Assert.False(basicModifiers1_M5.IsOverride); Assert.True(basicModifiers1_M6.IsAbstract); Assert.False(basicModifiers1_M6.IsVirtual); Assert.False(basicModifiers1_M6.IsSealed); Assert.False(basicModifiers1_M6.HidesBaseMethodsByName); Assert.False(basicModifiers1_M6.IsOverride); Assert.False(basicModifiers1_M7.IsAbstract); Assert.True(basicModifiers1_M7.IsVirtual); Assert.False(basicModifiers1_M7.IsSealed); Assert.False(basicModifiers1_M7.HidesBaseMethodsByName); Assert.False(basicModifiers1_M7.IsOverride); Assert.True(basicModifiers1_M8.IsAbstract); Assert.False(basicModifiers1_M8.IsVirtual); Assert.False(basicModifiers1_M8.IsSealed); Assert.True(basicModifiers1_M8.HidesBaseMethodsByName); Assert.False(basicModifiers1_M8.IsOverride); Assert.False(basicModifiers1_M9.IsAbstract); Assert.True(basicModifiers1_M9.IsVirtual); Assert.False(basicModifiers1_M9.IsSealed); Assert.True(basicModifiers1_M9.HidesBaseMethodsByName); Assert.False(basicModifiers1_M9.IsOverride); var basicModifiers2 = module4.GlobalNamespace.GetTypeMembers("Modifiers2").Single(); var basicModifiers2_M1 = (MethodSymbol)basicModifiers2.GetMembers("M1").Single(); var basicModifiers2_M2 = (MethodSymbol)basicModifiers2.GetMembers("M2").Single(); var basicModifiers2_M6 = (MethodSymbol)basicModifiers2.GetMembers("M6").Single(); var basicModifiers2_M7 = (MethodSymbol)basicModifiers2.GetMembers("M7").Single(); Assert.True(basicModifiers2_M1.IsAbstract); Assert.False(basicModifiers2_M1.IsVirtual); Assert.False(basicModifiers2_M1.IsSealed); Assert.True(basicModifiers2_M1.HidesBaseMethodsByName); Assert.True(basicModifiers2_M1.IsOverride); Assert.False(basicModifiers2_M2.IsAbstract); Assert.False(basicModifiers2_M2.IsVirtual); Assert.True(basicModifiers2_M2.IsSealed); Assert.True(basicModifiers2_M2.HidesBaseMethodsByName); Assert.True(basicModifiers2_M2.IsOverride); Assert.True(basicModifiers2_M6.IsAbstract); Assert.False(basicModifiers2_M6.IsVirtual); Assert.False(basicModifiers2_M6.IsSealed); Assert.False(basicModifiers2_M6.HidesBaseMethodsByName); Assert.True(basicModifiers2_M6.IsOverride); Assert.False(basicModifiers2_M7.IsAbstract); Assert.False(basicModifiers2_M7.IsVirtual); Assert.True(basicModifiers2_M7.IsSealed); Assert.False(basicModifiers2_M7.HidesBaseMethodsByName); Assert.True(basicModifiers2_M7.IsOverride); var basicModifiers3 = module4.GlobalNamespace.GetTypeMembers("Modifiers3").Single(); var basicModifiers3_M1 = (MethodSymbol)basicModifiers3.GetMembers("M1").Single(); var basicModifiers3_M6 = (MethodSymbol)basicModifiers3.GetMembers("M6").Single(); Assert.False(basicModifiers3_M1.IsAbstract); Assert.False(basicModifiers3_M1.IsVirtual); Assert.False(basicModifiers3_M1.IsSealed); Assert.True(basicModifiers3_M1.HidesBaseMethodsByName); Assert.True(basicModifiers3_M1.IsOverride); Assert.False(basicModifiers3_M6.IsAbstract); Assert.False(basicModifiers3_M6.IsVirtual); Assert.False(basicModifiers3_M6.IsSealed); Assert.False(basicModifiers3_M6.HidesBaseMethodsByName); Assert.True(basicModifiers3_M6.IsOverride); var csharpModifiers1 = module3.GlobalNamespace.GetTypeMembers("Modifiers1").Single(); var csharpModifiers1_M1 = (MethodSymbol)csharpModifiers1.GetMembers("M1").Single(); var csharpModifiers1_M2 = (MethodSymbol)csharpModifiers1.GetMembers("M2").Single(); var csharpModifiers1_M3 = (MethodSymbol)csharpModifiers1.GetMembers("M3").Single(); var csharpModifiers1_M4 = (MethodSymbol)csharpModifiers1.GetMembers("M4").Single(); Assert.True(csharpModifiers1_M1.IsAbstract); Assert.False(csharpModifiers1_M1.IsVirtual); Assert.False(csharpModifiers1_M1.IsSealed); Assert.False(csharpModifiers1_M1.HidesBaseMethodsByName); Assert.False(csharpModifiers1_M1.IsOverride); Assert.False(csharpModifiers1_M2.IsAbstract); Assert.True(csharpModifiers1_M2.IsVirtual); Assert.False(csharpModifiers1_M2.IsSealed); Assert.False(csharpModifiers1_M2.HidesBaseMethodsByName); Assert.False(csharpModifiers1_M2.IsOverride); Assert.False(csharpModifiers1_M3.IsAbstract); Assert.False(csharpModifiers1_M3.IsVirtual); Assert.False(csharpModifiers1_M3.IsSealed); Assert.False(csharpModifiers1_M3.HidesBaseMethodsByName); Assert.False(csharpModifiers1_M3.IsOverride); Assert.False(csharpModifiers1_M4.IsAbstract); Assert.True(csharpModifiers1_M4.IsVirtual); Assert.False(csharpModifiers1_M4.IsSealed); Assert.False(csharpModifiers1_M4.HidesBaseMethodsByName); Assert.False(csharpModifiers1_M4.IsOverride); var csharpModifiers2 = module3.GlobalNamespace.GetTypeMembers("Modifiers2").Single(); var csharpModifiers2_M1 = (MethodSymbol)csharpModifiers2.GetMembers("M1").Single(); var csharpModifiers2_M2 = (MethodSymbol)csharpModifiers2.GetMembers("M2").Single(); var csharpModifiers2_M3 = (MethodSymbol)csharpModifiers2.GetMembers("M3").Single(); Assert.False(csharpModifiers2_M1.IsAbstract); Assert.False(csharpModifiers2_M1.IsVirtual); Assert.True(csharpModifiers2_M1.IsSealed); Assert.False(csharpModifiers2_M1.HidesBaseMethodsByName); Assert.True(csharpModifiers2_M1.IsOverride); Assert.True(csharpModifiers2_M2.IsAbstract); Assert.False(csharpModifiers2_M2.IsVirtual); Assert.False(csharpModifiers2_M2.IsSealed); Assert.False(csharpModifiers2_M2.HidesBaseMethodsByName); Assert.True(csharpModifiers2_M2.IsOverride); Assert.False(csharpModifiers2_M3.IsAbstract); Assert.True(csharpModifiers2_M3.IsVirtual); Assert.False(csharpModifiers2_M3.IsSealed); Assert.False(csharpModifiers2_M3.HidesBaseMethodsByName); Assert.False(csharpModifiers2_M3.IsOverride); var csharpModifiers3 = module3.GlobalNamespace.GetTypeMembers("Modifiers3").Single(); var csharpModifiers3_M1 = (MethodSymbol)csharpModifiers3.GetMembers("M1").Single(); var csharpModifiers3_M3 = (MethodSymbol)csharpModifiers3.GetMembers("M3").Single(); var csharpModifiers3_M4 = (MethodSymbol)csharpModifiers3.GetMembers("M4").Single(); Assert.False(csharpModifiers3_M1.IsAbstract); Assert.False(csharpModifiers3_M1.IsVirtual); Assert.False(csharpModifiers3_M1.IsSealed); Assert.False(csharpModifiers3_M1.HidesBaseMethodsByName); Assert.True(csharpModifiers3_M1.IsOverride); Assert.False(csharpModifiers3_M3.IsAbstract); Assert.False(csharpModifiers3_M3.IsVirtual); Assert.False(csharpModifiers3_M3.IsSealed); Assert.False(csharpModifiers3_M3.HidesBaseMethodsByName); Assert.False(csharpModifiers3_M3.IsOverride); Assert.True(csharpModifiers3_M4.IsAbstract); Assert.False(csharpModifiers3_M4.IsVirtual); Assert.False(csharpModifiers3_M4.IsSealed); Assert.False(csharpModifiers3_M4.HidesBaseMethodsByName); Assert.False(csharpModifiers3_M4.IsOverride); var byrefReturnMethod = byrefReturn.GlobalNamespace.GetTypeMembers("ByRefReturn").Single().GetMembers("M").OfType<MethodSymbol>().Single(); Assert.Equal(RefKind.Ref, byrefReturnMethod.RefKind); Assert.Equal(TypeKind.Struct, byrefReturnMethod.ReturnType.TypeKind); } [Fact] public void TestExplicitImplementationSimple() { var assembly = MetadataTestHelpers.GetSymbolForReference( TestReferences.SymbolsTests.ExplicitInterfaceImplementation.Methods.CSharp); var globalNamespace = assembly.GlobalNamespace; var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Interface").Single(); Assert.Equal(TypeKind.Interface, @interface.TypeKind); var interfaceMethod = (MethodSymbol)@interface.GetMembers("Method").Single(); var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Class").Single(); Assert.Equal(TypeKind.Class, @class.TypeKind); Assert.True(@class.Interfaces().Contains(@interface)); var classMethod = (MethodSymbol)@class.GetMembers("Interface.Method").Single(); Assert.Equal(MethodKind.ExplicitInterfaceImplementation, classMethod.MethodKind); var explicitImpl = classMethod.ExplicitInterfaceImplementations.Single(); Assert.Equal(interfaceMethod, explicitImpl); } [Fact] public void TestExplicitImplementationMultiple() { var assembly = MetadataTestHelpers.GetSymbolForReference( TestReferences.SymbolsTests.ExplicitInterfaceImplementation.Methods.IL); var globalNamespace = assembly.GlobalNamespace; var interface1 = (NamedTypeSymbol)globalNamespace.GetTypeMembers("I1").Single(); Assert.Equal(TypeKind.Interface, interface1.TypeKind); var interface1Method = (MethodSymbol)interface1.GetMembers("Method1").Single(); var interface2 = (NamedTypeSymbol)globalNamespace.GetTypeMembers("I2").Single(); Assert.Equal(TypeKind.Interface, interface2.TypeKind); var interface2Method = (MethodSymbol)interface2.GetMembers("Method2").Single(); var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("C").Single(); Assert.Equal(TypeKind.Class, @class.TypeKind); Assert.True(@class.Interfaces().Contains(interface1)); Assert.True(@class.Interfaces().Contains(interface2)); var classMethod = (MethodSymbol)@class.GetMembers("Method").Single(); // the method is considered to be Ordinary Assert.Equal(MethodKind.Ordinary, classMethod.MethodKind); // because it has name without '.' var explicitImpls = classMethod.ExplicitInterfaceImplementations; Assert.Equal(2, explicitImpls.Length); Assert.Equal(interface1Method, explicitImpls[0]); Assert.Equal(interface2Method, explicitImpls[1]); } [Fact] public void TestExplicitImplementationGeneric() { var assemblies = MetadataTestHelpers.GetSymbolsForReferences( mrefs: new[] { Net451.mscorlib, TestReferences.SymbolsTests.ExplicitInterfaceImplementation.Methods.CSharp, }); var globalNamespace = assemblies.ElementAt(1).GlobalNamespace; var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IGeneric").Single(); Assert.Equal(TypeKind.Interface, @interface.TypeKind); var interfaceMethod = (MethodSymbol)@interface.GetMembers("Method").Last(); //this assumes decl order Assert.Equal("void IGeneric<T>.Method<U>(T t, U u)", interfaceMethod.ToTestDisplayString()); //make sure we got the one we expected var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Generic").Single(); Assert.Equal(TypeKind.Class, @class.TypeKind); var substitutedInterface = @class.Interfaces().Single(); Assert.Equal(@interface, substitutedInterface.ConstructedFrom); var substitutedInterfaceMethod = (MethodSymbol)substitutedInterface.GetMembers("Method").Last(); //this assumes decl order Assert.Equal("void IGeneric<S>.Method<U>(S t, U u)", substitutedInterfaceMethod.ToTestDisplayString()); //make sure we got the one we expected Assert.Equal(interfaceMethod, substitutedInterfaceMethod.OriginalDefinition); var classMethod = (MethodSymbol)@class.GetMembers("IGeneric<S>.Method").Last(); //this assumes decl order Assert.Equal("void Generic<S>.IGeneric<S>.Method<V>(S s, V v)", classMethod.ToTestDisplayString()); //make sure we got the one we expected Assert.Equal(MethodKind.ExplicitInterfaceImplementation, classMethod.MethodKind); var explicitImpl = classMethod.ExplicitInterfaceImplementations.Single(); Assert.Equal(substitutedInterfaceMethod, explicitImpl); } [Fact] public void TestExplicitImplementationConstructed() { var assemblies = MetadataTestHelpers.GetSymbolsForReferences( new[] { Net451.mscorlib, TestReferences.SymbolsTests.ExplicitInterfaceImplementation.Methods.CSharp, }); var globalNamespace = assemblies.ElementAt(1).GlobalNamespace; var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IGeneric").Single(); Assert.Equal(TypeKind.Interface, @interface.TypeKind); var interfaceMethod = (MethodSymbol)@interface.GetMembers("Method").Last(); //this assumes decl order Assert.Equal("void IGeneric<T>.Method<U>(T t, U u)", interfaceMethod.ToTestDisplayString()); //make sure we got the one we expected var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Constructed").Single(); Assert.Equal(TypeKind.Class, @class.TypeKind); var substitutedInterface = @class.Interfaces().Single(); Assert.Equal(@interface, substitutedInterface.ConstructedFrom); var substitutedInterfaceMethod = (MethodSymbol)substitutedInterface.GetMembers("Method").Last(); //this assumes decl order Assert.Equal("void IGeneric<System.Int32>.Method<U>(System.Int32 t, U u)", substitutedInterfaceMethod.ToTestDisplayString()); //make sure we got the one we expected Assert.Equal(interfaceMethod, substitutedInterfaceMethod.OriginalDefinition); var classMethod = (MethodSymbol)@class.GetMembers("IGeneric<System.Int32>.Method").Last(); //this assumes decl order Assert.Equal("void Constructed.IGeneric<System.Int32>.Method<W>(System.Int32 i, W w)", classMethod.ToTestDisplayString()); //make sure we got the one we expected Assert.Equal(MethodKind.ExplicitInterfaceImplementation, classMethod.MethodKind); var explicitImpl = classMethod.ExplicitInterfaceImplementations.Single(); Assert.Equal(substitutedInterfaceMethod, explicitImpl); } [Fact] public void TestExplicitImplementationInterfaceCycleSuccess() { var assembly = MetadataTestHelpers.GetSymbolForReference( TestReferences.SymbolsTests.ExplicitInterfaceImplementation.Methods.IL); var globalNamespace = assembly.GlobalNamespace; var cyclicInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("ImplementsSelf").Single(); Assert.Equal(TypeKind.Interface, cyclicInterface.TypeKind); var implementedInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("I1").Single(); Assert.Equal(TypeKind.Interface, implementedInterface.TypeKind); var interface2Method = (MethodSymbol)implementedInterface.GetMembers("Method1").Single(); var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("InterfaceCycleSuccess").Single(); Assert.Equal(TypeKind.Class, @class.TypeKind); Assert.True(@class.Interfaces().Contains(cyclicInterface)); Assert.True(@class.Interfaces().Contains(implementedInterface)); var classMethod = (MethodSymbol)@class.GetMembers("Method").Single(); // the method is considered to be Ordinary Assert.Equal(MethodKind.Ordinary, classMethod.MethodKind); // because it has name without '.' var explicitImpl = classMethod.ExplicitInterfaceImplementations.Single(); Assert.Equal(interface2Method, explicitImpl); } [Fact] public void TestExplicitImplementationInterfaceCycleFailure() { var assembly = MetadataTestHelpers.GetSymbolForReference( TestReferences.SymbolsTests.ExplicitInterfaceImplementation.Methods.IL); var globalNamespace = assembly.GlobalNamespace; var cyclicInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("ImplementsSelf").Single(); Assert.Equal(TypeKind.Interface, cyclicInterface.TypeKind); var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("InterfaceCycleFailure").Single(); Assert.Equal(TypeKind.Class, @class.TypeKind); Assert.True(@class.Interfaces().Contains(cyclicInterface)); var classMethod = (MethodSymbol)@class.GetMembers("Method").Single(); //we couldn't find an interface method that's explicitly implemented, so we have no reason to believe the method isn't ordinary Assert.Equal(MethodKind.Ordinary, classMethod.MethodKind); var explicitImpls = classMethod.ExplicitInterfaceImplementations; Assert.False(explicitImpls.Any()); } /// <summary> /// A type def explicitly implements an interface, also a type def, but only /// indirectly, via a type ref. /// </summary> [Fact] public void TestExplicitImplementationDefRefDef() { var assemblies = MetadataTestHelpers.GetSymbolsForReferences( new[] { Net451.mscorlib, TestReferences.SymbolsTests.ExplicitInterfaceImplementation.Methods.CSharp, }); var globalNamespace = assemblies.ElementAt(1).GlobalNamespace; var defInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Interface").Single(); Assert.Equal(TypeKind.Interface, defInterface.TypeKind); var defInterfaceMethod = (MethodSymbol)defInterface.GetMembers("Method").Single(); var refInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IGenericInterface").Single(); Assert.Equal(TypeKind.Interface, defInterface.TypeKind); Assert.True(refInterface.Interfaces().Contains(defInterface)); var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IndirectImplementation").Single(); Assert.Equal(TypeKind.Class, @class.TypeKind); var classInterfacesConstructedFrom = @class.Interfaces().Select(i => i.ConstructedFrom); Assert.Equal(2, classInterfacesConstructedFrom.Count()); Assert.Contains(defInterface, classInterfacesConstructedFrom); Assert.Contains(refInterface, classInterfacesConstructedFrom); var classMethod = (MethodSymbol)@class.GetMembers("Interface.Method").Single(); Assert.Equal(MethodKind.ExplicitInterfaceImplementation, classMethod.MethodKind); var explicitImpl = classMethod.ExplicitInterfaceImplementations.Single(); Assert.Equal(defInterfaceMethod, explicitImpl); } /// <summary> /// IL type explicitly overrides a class (vs interface) method. /// ExplicitInterfaceImplementations should be empty. /// </summary> [Fact] public void TestExplicitImplementationOfClassMethod() { var assembly = MetadataTestHelpers.GetSymbolForReference( TestReferences.SymbolsTests.ExplicitInterfaceImplementation.Methods.IL); var globalNamespace = assembly.GlobalNamespace; var baseClass = (NamedTypeSymbol)globalNamespace.GetTypeMembers("ExplicitlyImplementedClass").Single(); Assert.Equal(TypeKind.Class, baseClass.TypeKind); var derivedClass = (NamedTypeSymbol)globalNamespace.GetTypeMembers("ExplicitlyImplementsAClass").Single(); Assert.Equal(TypeKind.Class, derivedClass.TypeKind); Assert.Equal(baseClass, derivedClass.BaseType()); var derivedClassMethod = (MethodSymbol)derivedClass.GetMembers("Method").Single(); Assert.Equal(MethodKind.Ordinary, derivedClassMethod.MethodKind); Assert.Equal(0, derivedClassMethod.ExplicitInterfaceImplementations.Length); } /// <summary> /// IL type explicitly overrides an interface method on an unrelated interface. /// ExplicitInterfaceImplementations should be empty. /// </summary> [Fact] public void TestExplicitImplementationOfUnrelatedInterfaceMethod() { var assembly = MetadataTestHelpers.GetSymbolForReference( TestReferences.SymbolsTests.ExplicitInterfaceImplementation.Methods.IL); var globalNamespace = assembly.GlobalNamespace; var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IUnrelated").First(); //decl order Assert.Equal(0, @interface.Arity); Assert.Equal(TypeKind.Interface, @interface.TypeKind); var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("ExplicitlyImplementsUnrelatedInterfaceMethods").Single(); Assert.Equal(TypeKind.Class, @class.TypeKind); Assert.Equal(0, @class.AllInterfaces().Length); var classMethod = (MethodSymbol)@class.GetMembers("Method1").Single(); Assert.Equal(MethodKind.Ordinary, classMethod.MethodKind); Assert.Equal(0, classMethod.ExplicitInterfaceImplementations.Length); var classGenericMethod = (MethodSymbol)@class.GetMembers("Method1").Single(); Assert.Equal(MethodKind.Ordinary, classGenericMethod.MethodKind); Assert.Equal(0, classGenericMethod.ExplicitInterfaceImplementations.Length); } /// <summary> /// IL type explicitly overrides an interface method on an unrelated generic interface. /// ExplicitInterfaceImplementations should be empty. /// </summary> [Fact] public void TestExplicitImplementationOfUnrelatedGenericInterfaceMethod() { var assemblies = MetadataTestHelpers.GetSymbolsForReferences( new[] { Net451.mscorlib, TestReferences.SymbolsTests.ExplicitInterfaceImplementation.Methods.IL, }); var globalNamespace = assemblies.ElementAt(1).GlobalNamespace; var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IUnrelated").Last(); //decl order Assert.Equal(1, @interface.Arity); Assert.Equal(TypeKind.Interface, @interface.TypeKind); var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("ExplicitlyImplementsUnrelatedInterfaceMethods").Single(); Assert.Equal(TypeKind.Class, @class.TypeKind); Assert.Equal(0, @class.AllInterfaces().Length); var classMethod = (MethodSymbol)@class.GetMembers("Method2").Single(); Assert.Equal(MethodKind.Ordinary, classMethod.MethodKind); Assert.Equal(0, classMethod.ExplicitInterfaceImplementations.Length); var classGenericMethod = (MethodSymbol)@class.GetMembers("Method2").Single(); Assert.Equal(MethodKind.Ordinary, classGenericMethod.MethodKind); Assert.Equal(0, classGenericMethod.ExplicitInterfaceImplementations.Length); } /// <summary> /// In metadata, nested types implicitly share all type parameters of their containing types. /// This results in some extra computations when mapping a type parameter position to a type /// parameter symbol. /// </summary> [Fact] public void TestTypeParameterPositions() { var assemblies = MetadataTestHelpers.GetSymbolsForReferences( new[] { Net451.mscorlib, TestReferences.SymbolsTests.ExplicitInterfaceImplementation.Methods.CSharp, }); var globalNamespace = assemblies.ElementAt(1).GlobalNamespace; var outerInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IGeneric2").Single(); Assert.Equal(1, outerInterface.Arity); Assert.Equal(TypeKind.Interface, outerInterface.TypeKind); var outerInterfaceMethod = outerInterface.GetMembers().Single(); var outerClass = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Outer").Single(); Assert.Equal(1, outerClass.Arity); Assert.Equal(TypeKind.Class, outerClass.TypeKind); var innerInterface = (NamedTypeSymbol)outerClass.GetTypeMembers("IInner").Single(); Assert.Equal(1, innerInterface.Arity); Assert.Equal(TypeKind.Interface, innerInterface.TypeKind); var innerInterfaceMethod = innerInterface.GetMembers().Single(); var innerClass1 = (NamedTypeSymbol)outerClass.GetTypeMembers("Inner1").Single(); CheckInnerClassHelper(innerClass1, "IGeneric2<A>.Method", outerInterfaceMethod); var innerClass2 = (NamedTypeSymbol)outerClass.GetTypeMembers("Inner2").Single(); CheckInnerClassHelper(innerClass2, "IGeneric2<T>.Method", outerInterfaceMethod); var innerClass3 = (NamedTypeSymbol)outerClass.GetTypeMembers("Inner3").Single(); CheckInnerClassHelper(innerClass3, "Outer<T>.IInner<C>.Method", innerInterfaceMethod); var innerClass4 = (NamedTypeSymbol)outerClass.GetTypeMembers("Inner4").Single(); CheckInnerClassHelper(innerClass4, "Outer<T>.IInner<T>.Method", innerInterfaceMethod); } private static void CheckInnerClassHelper(NamedTypeSymbol innerClass, string methodName, Symbol interfaceMethod) { var @interface = interfaceMethod.ContainingType; Assert.Equal(1, innerClass.Arity); Assert.Equal(TypeKind.Class, innerClass.TypeKind); Assert.Equal(@interface, innerClass.Interfaces().Single().ConstructedFrom); var innerClassMethod = (MethodSymbol)innerClass.GetMembers(methodName).Single(); var innerClassImplementingMethod = innerClassMethod.ExplicitInterfaceImplementations.Single(); Assert.Equal(interfaceMethod, innerClassImplementingMethod.OriginalDefinition); Assert.Equal(@interface, innerClassImplementingMethod.ContainingType.ConstructedFrom); } [Fact] public void TestVirtualnessFlags_Invoke() { var source = @" class Invoke { void Goo(MetadataModifiers m) { m.M00(); m.M01(); m.M02(); m.M03(); m.M04(); m.M05(); m.M06(); m.M07(); m.M08(); m.M09(); m.M10(); m.M11(); m.M12(); m.M13(); m.M14(); m.M15(); } } "; var compilation = CreateCompilation(source, new[] { TestReferences.SymbolsTests.Methods.ILMethods }); compilation.VerifyDiagnostics(); // No errors, as in Dev10 } [Fact] public void TestVirtualnessFlags_NoOverride() { var source = @" class Abstract : MetadataModifiers { //CS0534 for methods 2, 5, 8, 9, 11, 12, 14, 15 } "; var compilation = CreateCompilation(source, new[] { TestReferences.SymbolsTests.Methods.ILMethods }); compilation.VerifyDiagnostics( // (2,7): error CS0534: 'Abstract' does not implement inherited abstract member 'MetadataModifiers.M02()' Diagnostic(ErrorCode.ERR_UnimplementedAbstractMethod, "Abstract").WithArguments("Abstract", "MetadataModifiers.M02()"), // (2,7): error CS0534: 'Abstract' does not implement inherited abstract member 'MetadataModifiers.M05()' Diagnostic(ErrorCode.ERR_UnimplementedAbstractMethod, "Abstract").WithArguments("Abstract", "MetadataModifiers.M05()"), // (2,7): error CS0534: 'Abstract' does not implement inherited abstract member 'MetadataModifiers.M08()' Diagnostic(ErrorCode.ERR_UnimplementedAbstractMethod, "Abstract").WithArguments("Abstract", "MetadataModifiers.M08()"), // (2,7): error CS0534: 'Abstract' does not implement inherited abstract member 'MetadataModifiers.M09()' Diagnostic(ErrorCode.ERR_UnimplementedAbstractMethod, "Abstract").WithArguments("Abstract", "MetadataModifiers.M09()"), // (2,7): error CS0534: 'Abstract' does not implement inherited abstract member 'MetadataModifiers.M11()' Diagnostic(ErrorCode.ERR_UnimplementedAbstractMethod, "Abstract").WithArguments("Abstract", "MetadataModifiers.M11()"), // (2,7): error CS0534: 'Abstract' does not implement inherited abstract member 'MetadataModifiers.M12()' Diagnostic(ErrorCode.ERR_UnimplementedAbstractMethod, "Abstract").WithArguments("Abstract", "MetadataModifiers.M12()"), // (2,7): error CS0534: 'Abstract' does not implement inherited abstract member 'MetadataModifiers.M14()' Diagnostic(ErrorCode.ERR_UnimplementedAbstractMethod, "Abstract").WithArguments("Abstract", "MetadataModifiers.M14()"), // (2,7): error CS0534: 'Abstract' does not implement inherited abstract member 'MetadataModifiers.M15()' Diagnostic(ErrorCode.ERR_UnimplementedAbstractMethod, "Abstract").WithArguments("Abstract", "MetadataModifiers.M15()")); } [Fact] public void TestVirtualnessFlags_Override() { var source = @" class Override : MetadataModifiers { public override void M00() { } //CS0506 public override void M01() { } //CS0506 public override void M02() { } public override void M03() { } public override void M04() { } //CS0506 public override void M05() { } public override void M06() { } public override void M07() { } //CS0506 public override void M08() { } public override void M09() { } public override void M10() { } //CS0239 (Dev10 reports CS0506, presumably because MetadataModifiers.M10 isn't overriding anything) public override void M11() { } public override void M12() { } public override void M13() { } //CS0506 public override void M14() { } public override void M15() { } } "; var compilation = CreateCompilation(source, new[] { TestReferences.SymbolsTests.Methods.ILMethods }); compilation.VerifyDiagnostics( // (4,26): error CS0506: 'Override.M00()': cannot override inherited member 'MetadataModifiers.M00()' because it is not marked virtual, abstract, or override Diagnostic(ErrorCode.ERR_CantOverrideNonVirtual, "M00").WithArguments("Override.M00()", "MetadataModifiers.M00()"), // (5,26): error CS0506: 'Override.M01()': cannot override inherited member 'MetadataModifiers.M01()' because it is not marked virtual, abstract, or override Diagnostic(ErrorCode.ERR_CantOverrideNonVirtual, "M01").WithArguments("Override.M01()", "MetadataModifiers.M01()"), // (8,26): error CS0506: 'Override.M04()': cannot override inherited member 'MetadataModifiers.M04()' because it is not marked virtual, abstract, or override Diagnostic(ErrorCode.ERR_CantOverrideNonVirtual, "M04").WithArguments("Override.M04()", "MetadataModifiers.M04()"), // (11,26): error CS0506: 'Override.M07()': cannot override inherited member 'MetadataModifiers.M07()' because it is not marked virtual, abstract, or override Diagnostic(ErrorCode.ERR_CantOverrideNonVirtual, "M07").WithArguments("Override.M07()", "MetadataModifiers.M07()"), // (14,26): error CS0239: 'Override.M10()': cannot override inherited member 'MetadataModifiers.M10()' because it is sealed Diagnostic(ErrorCode.ERR_CantOverrideSealed, "M10").WithArguments("Override.M10()", "MetadataModifiers.M10()"), // (17,26): error CS0506: 'Override.M13()': cannot override inherited member 'MetadataModifiers.M13()' because it is not marked virtual, abstract, or override Diagnostic(ErrorCode.ERR_CantOverrideNonVirtual, "M13").WithArguments("Override.M13()", "MetadataModifiers.M13()")); } [ClrOnlyFact] public void TestVirtualnessFlags_CSharpRepresentation() { // All combinations of VirtualContract, NewSlotVTable, AbstractImpl, and FinalContract - without explicit overriding // NOTE: some won't peverify (newslot/final/abstract without virtual, abstract with final) CheckLoadingVirtualnessFlags(SymbolVirtualness.NonVirtual, 0, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.Override, MethodAttributes.Virtual, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.NonVirtual, MethodAttributes.NewSlot, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.Abstract, MethodAttributes.Abstract, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.NonVirtual, MethodAttributes.Final, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.Virtual, MethodAttributes.Virtual | MethodAttributes.NewSlot, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.AbstractOverride, MethodAttributes.Virtual | MethodAttributes.Abstract, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.SealedOverride, MethodAttributes.Virtual | MethodAttributes.Final, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.Abstract, MethodAttributes.NewSlot | MethodAttributes.Abstract, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.NonVirtual, MethodAttributes.NewSlot | MethodAttributes.Final, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.Abstract, MethodAttributes.Abstract | MethodAttributes.Final, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.Abstract, MethodAttributes.NewSlot | MethodAttributes.Abstract | MethodAttributes.Final, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.AbstractOverride, MethodAttributes.Virtual | MethodAttributes.Abstract | MethodAttributes.Final, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.NonVirtual, MethodAttributes.Virtual | MethodAttributes.NewSlot | MethodAttributes.Final, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.Abstract, MethodAttributes.Virtual | MethodAttributes.NewSlot | MethodAttributes.Abstract, isExplicitOverride: false); CheckLoadingVirtualnessFlags(SymbolVirtualness.Abstract, MethodAttributes.Virtual | MethodAttributes.NewSlot | MethodAttributes.Abstract | MethodAttributes.Final, isExplicitOverride: false); // All combinations of VirtualContract, NewSlotVTable, AbstractImpl, and FinalContract - with explicit overriding CheckLoadingVirtualnessFlags(SymbolVirtualness.NonVirtual, 0, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.Override, MethodAttributes.Virtual, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.NonVirtual, MethodAttributes.NewSlot, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.Abstract, MethodAttributes.Abstract, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.NonVirtual, MethodAttributes.Final, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.Override, MethodAttributes.Virtual | MethodAttributes.NewSlot, isExplicitOverride: true); //differs from above CheckLoadingVirtualnessFlags(SymbolVirtualness.AbstractOverride, MethodAttributes.Virtual | MethodAttributes.Abstract, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.SealedOverride, MethodAttributes.Virtual | MethodAttributes.Final, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.Abstract, MethodAttributes.NewSlot | MethodAttributes.Abstract, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.NonVirtual, MethodAttributes.NewSlot | MethodAttributes.Final, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.Abstract, MethodAttributes.Abstract | MethodAttributes.Final, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.Abstract, MethodAttributes.NewSlot | MethodAttributes.Abstract | MethodAttributes.Final, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.AbstractOverride, MethodAttributes.Virtual | MethodAttributes.Abstract | MethodAttributes.Final, isExplicitOverride: true); CheckLoadingVirtualnessFlags(SymbolVirtualness.SealedOverride, MethodAttributes.Virtual | MethodAttributes.NewSlot | MethodAttributes.Final, isExplicitOverride: true); //differs from above CheckLoadingVirtualnessFlags(SymbolVirtualness.AbstractOverride, MethodAttributes.Virtual | MethodAttributes.NewSlot | MethodAttributes.Abstract, isExplicitOverride: true); //differs from above CheckLoadingVirtualnessFlags(SymbolVirtualness.AbstractOverride, MethodAttributes.Virtual | MethodAttributes.NewSlot | MethodAttributes.Abstract | MethodAttributes.Final, isExplicitOverride: true); //differs from above } private void CheckLoadingVirtualnessFlags(SymbolVirtualness expectedVirtualness, MethodAttributes flags, bool isExplicitOverride) { const string ilTemplate = @" .class public auto ansi beforefieldinit Base extends [mscorlib]System.Object {{ .method public hidebysig newslot virtual instance void M() cil managed {{ ret }} .method public hidebysig specialname rtspecialname instance void .ctor() cil managed {{ ldarg.0 call instance void [mscorlib]System.Object::.ctor() ret }} }} // end of class Base .class public abstract auto ansi beforefieldinit Derived extends Base {{ .method public hidebysig{0} instance void M() cil managed {{ {1} {2} }} .method public hidebysig specialname rtspecialname instance void .ctor() cil managed {{ ldarg.0 call instance void [mscorlib]System.Object::.ctor() ret }} }} // end of class Derived "; string modifiers = ""; if ((flags & MethodAttributes.NewSlot) != 0) { modifiers += " newslot"; } if ((flags & MethodAttributes.Abstract) != 0) { modifiers += " abstract"; } if ((flags & MethodAttributes.Virtual) != 0) { modifiers += " virtual"; } if ((flags & MethodAttributes.Final) != 0) { modifiers += " final"; } string explicitOverride = isExplicitOverride ? ".override Base::M" : ""; string body = ((flags & MethodAttributes.Abstract) != 0) ? "" : "ret"; CompileWithCustomILSource("", string.Format(ilTemplate, modifiers, explicitOverride, body), compilation => { var derivedClass = compilation.GlobalNamespace.GetMember<PENamedTypeSymbol>("Derived"); var method = derivedClass.GetMember<MethodSymbol>("M"); switch (expectedVirtualness) { case SymbolVirtualness.NonVirtual: Assert.False(method.IsVirtual); Assert.False(method.IsOverride); Assert.False(method.IsAbstract); Assert.False(method.IsSealed); break; case SymbolVirtualness.Virtual: Assert.True(method.IsVirtual); Assert.False(method.IsOverride); Assert.False(method.IsAbstract); Assert.False(method.IsSealed); break; case SymbolVirtualness.Override: Assert.False(method.IsVirtual); Assert.True(method.IsOverride); Assert.False(method.IsAbstract); Assert.False(method.IsSealed); break; case SymbolVirtualness.SealedOverride: Assert.False(method.IsVirtual); Assert.True(method.IsOverride); Assert.False(method.IsAbstract); Assert.True(method.IsSealed); break; case SymbolVirtualness.Abstract: Assert.False(method.IsVirtual); Assert.False(method.IsOverride); Assert.True(method.IsAbstract); Assert.False(method.IsSealed); break; case SymbolVirtualness.AbstractOverride: Assert.False(method.IsVirtual); Assert.True(method.IsOverride); Assert.True(method.IsAbstract); Assert.False(method.IsSealed); break; default: Assert.False(true, "Unexpected enum value " + expectedVirtualness); break; } }); } // Note that not all combinations are possible. private enum SymbolVirtualness { NonVirtual, Virtual, Override, SealedOverride, Abstract, AbstractOverride, } [Fact] public void Constructors1() { string ilSource = @" .class private auto ansi cls1 extends [mscorlib]System.Object { .method public specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } .method public specialname rtspecialname static void .cctor() cil managed { // Code size 1 (0x1) .maxstack 8 IL_0000: ret } } .class private auto ansi Instance_vs_Static extends [mscorlib]System.Object { .method public specialname rtspecialname static void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } .method public specialname rtspecialname instance void .cctor() cil managed { // Code size 1 (0x1) .maxstack 8 IL_0000: ret } } .class private auto ansi ReturnAValue1 extends [mscorlib]System.Object { .method public specialname rtspecialname instance int32 .ctor(int32 x) cil managed { // Code size 6 (0x6) .maxstack 1 .locals init (int32 V_0) IL_0000: ldc.i4.0 IL_0001: stloc.0 IL_0002: br.s IL_0004 IL_0004: ldloc.0 IL_0005: ret } .method private specialname rtspecialname static int32 .cctor() cil managed { // Code size 6 (0x6) .maxstack 1 .locals init (int32 V_0) IL_0000: ldc.i4.0 IL_0001: stloc.0 IL_0002: br.s IL_0004 IL_0004: ldloc.0 IL_0005: ret } } .class private auto ansi ReturnAValue2 extends [mscorlib]System.Object { .method public specialname rtspecialname static int32 .cctor() cil managed { // Code size 6 (0x6) .maxstack 1 .locals init (int32 V_0) IL_0000: ldc.i4.0 IL_0001: stloc.0 IL_0002: br.s IL_0004 IL_0004: ldloc.0 IL_0005: ret } } .class private auto ansi Generic1 extends [mscorlib]System.Object { .method public specialname rtspecialname instance void .ctor<T>() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } .method private specialname rtspecialname static void .cctor<T>() cil managed { // Code size 1 (0x1) .maxstack 8 IL_0000: ret } } .class private auto ansi Generic2 extends [mscorlib]System.Object { .method public specialname rtspecialname static void .cctor<T>() cil managed { // Code size 1 (0x1) .maxstack 8 IL_0000: ret } } .class private auto ansi HasParameter extends [mscorlib]System.Object { .method public specialname rtspecialname static void .cctor(int32 x) cil managed { // Code size 1 (0x1) .maxstack 8 IL_0000: ret } } .class private auto ansi Virtual extends [mscorlib]System.Object { .method public newslot strict virtual specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } } "; var compilation = CreateCompilationWithILAndMscorlib40("", ilSource); foreach (var m in compilation.GetTypeByMetadataName("cls1").GetMembers()) { Assert.Equal(m.Name == ".cctor" ? MethodKind.StaticConstructor : MethodKind.Constructor, ((MethodSymbol)m).MethodKind); } foreach (var m in compilation.GetTypeByMetadataName("Instance_vs_Static").GetMembers()) { Assert.Equal(MethodKind.Ordinary, ((MethodSymbol)m).MethodKind); } foreach (var m in compilation.GetTypeByMetadataName("ReturnAValue1").GetMembers()) { Assert.Equal(MethodKind.Ordinary, ((MethodSymbol)m).MethodKind); } foreach (var m in compilation.GetTypeByMetadataName("ReturnAValue2").GetMembers()) { Assert.Equal(MethodKind.Ordinary, ((MethodSymbol)m).MethodKind); } foreach (var m in compilation.GetTypeByMetadataName("Generic1").GetMembers()) { Assert.Equal(MethodKind.Ordinary, ((MethodSymbol)m).MethodKind); } foreach (var m in compilation.GetTypeByMetadataName("Generic2").GetMembers()) { Assert.Equal(MethodKind.Ordinary, ((MethodSymbol)m).MethodKind); } foreach (var m in compilation.GetTypeByMetadataName("HasParameter").GetMembers()) { Assert.Equal(MethodKind.Ordinary, ((MethodSymbol)m).MethodKind); } foreach (var m in compilation.GetTypeByMetadataName("Virtual").GetMembers()) { Assert.Equal(MethodKind.Ordinary, ((MethodSymbol)m).MethodKind); } } [Fact] public void OverridesAndLackOfNewSlot() { string ilSource = @" .class interface public abstract auto ansi serializable Microsoft.FSharp.Control.IDelegateEvent`1<([mscorlib]System.Delegate) TDelegate> { .method public hidebysig abstract virtual instance void AddHandler(!TDelegate 'handler') cil managed { } // end of method IDelegateEvent`1::AddHandler .method public hidebysig abstract virtual instance void RemoveHandler(!TDelegate 'handler') cil managed { } // end of method IDelegateEvent`1::RemoveHandler } // end of class Microsoft.FSharp.Control.IDelegateEvent`1 "; var compilation = CreateCompilationWithILAndMscorlib40("", ilSource); foreach (var m in compilation.GetTypeByMetadataName("Microsoft.FSharp.Control.IDelegateEvent`1").GetMembers()) { Assert.False(((MethodSymbol)m).IsVirtual); Assert.True(((MethodSymbol)m).IsAbstract); Assert.False(((MethodSymbol)m).IsOverride); } } [Fact] public void MemberSignature_LongFormType() { string source = @" public class D { public static void Main() { string s = C.RT(); double d = C.VT(); } } "; var longFormRef = MetadataReference.CreateFromImage(TestResources.MetadataTests.Invalid.LongTypeFormInSignature); var c = CreateCompilation(source, new[] { longFormRef }); c.VerifyDiagnostics( // (6,20): error CS0570: 'C.RT()' is not supported by the language Diagnostic(ErrorCode.ERR_BindToBogus, "RT").WithArguments("C.RT()"), // (7,20): error CS0570: 'C.VT()' is not supported by the language Diagnostic(ErrorCode.ERR_BindToBogus, "VT").WithArguments("C.VT()")); } [WorkItem(7971, "https://github.com/dotnet/roslyn/issues/7971")] [Fact(Skip = "7971")] public void MemberSignature_CycleTrhuTypeSpecInCustomModifiers() { string source = @" class P { static void Main() { User.X(new Extender()); } } "; var lib = MetadataReference.CreateFromImage(TestResources.MetadataTests.Invalid.Signatures.SignatureCycle2); var c = CreateCompilation(source, new[] { lib }); c.VerifyDiagnostics(); } [WorkItem(7970, "https://github.com/dotnet/roslyn/issues/7970")] [Fact] public void MemberSignature_TypeSpecInWrongPlace() { string source = @" class P { static void Main() { User.X(new System.Collections.Generic.List<int>()); } } "; var lib = MetadataReference.CreateFromImage(TestResources.MetadataTests.Invalid.Signatures.TypeSpecInWrongPlace); var c = CreateCompilation(source, new[] { lib }); c.VerifyDiagnostics( // (6,14): error CS0570: 'User.X(?)' is not supported by the language // User.X(new System.Collections.Generic.List<int>()); Diagnostic(ErrorCode.ERR_BindToBogus, "X").WithArguments("User.X(?)")); } [WorkItem(666162, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/666162")] [Fact] public void Repro666162() { var il = @" .assembly extern mscorlib { } .assembly extern Missing { } .assembly Lib { } .class public auto ansi beforefieldinit Test extends [mscorlib]System.Object { .method public hidebysig instance class Test modreq (bool)& M() cil managed { ldnull throw } .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { ldarg.0 call instance void [mscorlib]System.Object::.ctor() ret } } // end of class Test "; var ilRef = CompileIL(il, prependDefaultHeader: false); var comp = CreateEmptyCompilation("", new[] { ilRef }); var type = comp.GlobalNamespace.GetMember<NamedTypeSymbol>("Test"); var method = type.GetMember<MethodSymbol>("M"); Assert.False(method.ReturnTypeWithAnnotations.IsDefault); } [Fact, WorkItem(217681, "https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems?id=217681")] public void LoadingMethodWithPublicAndPrivateAccessibility() { string source = @" public class D { public static void Main() { new C().M(); System.Console.WriteLine(new C().F); new C.C2().M2(); } } "; var references = new[] { MetadataReference.CreateFromImage(TestResources.SymbolsTests.Metadata.PublicAndPrivateFlags) }; var comp = CreateCompilation(source, references: references); // The method, field and nested type with public and private accessibility flags get loaded as private. comp.VerifyDiagnostics( // (6,15): error CS0122: 'C.M()' is inaccessible due to its protection level // new C().M(); Diagnostic(ErrorCode.ERR_BadAccess, "M").WithArguments("C.M()").WithLocation(6, 15), // (7,40): error CS0122: 'C.F' is inaccessible due to its protection level // System.Console.WriteLine(new C().F); Diagnostic(ErrorCode.ERR_BadAccess, "F").WithArguments("C.F").WithLocation(7, 40), // (8,13): error CS0122: 'C.C2' is inaccessible due to its protection level // new C.C2().M2(); Diagnostic(ErrorCode.ERR_BadAccess, "C2").WithArguments("C.C2").WithLocation(8, 13) ); } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/EditorFeatures/VisualBasicTest/ExtractMethod/ExtractMethodTests.DataFlowAnalysis.vb
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.ExtractMethod Partial Public Class ExtractMethodTests ''' <summary> ''' This contains tests for Extract Method scenarios that depend on Data Flow Analysis API ''' Implements scenarios outlined in /Services/CSharp/Impl/Refactoring/ExtractMethod/ExtractMethodMatrix.xlsx ''' </summary> ''' <remarks></remarks> <[UseExportProvider]> Public Class DataFlowPass <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod1() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) [|Dim i As Integer i = 10|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) NewMethod() End Sub Private Shared Sub NewMethod() Dim i As Integer = 10 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod2() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) [|Dim i As Integer = 10 Dim i2 As Integer = 10|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) NewMethod() End Sub Private Shared Sub NewMethod() Dim i As Integer = 10 Dim i2 As Integer = 10 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod3() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer = 10 [|Dim i2 As Integer = i|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer = 10 NewMethod(i) End Sub Private Shared Sub NewMethod(i As Integer) Dim i2 As Integer = i End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod4() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer = 10 Dim i2 As Integer = i [|i2 += i|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer = 10 Dim i2 As Integer = i i2 = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer, i2 As Integer) As Integer i2 += i Return i2 End Function End Class</text> Await TestExtractMethodAsync(code, expected, temporaryFailing:=True) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod5() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer = 10 Dim i2 As Integer = i [|i2 = i|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer = 10 Dim i2 As Integer = i i2 = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod6() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Dim field As Integer Sub Test(args As String()) Dim i As Integer = 10 [|field = i|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Dim field As Integer Sub Test(args As String()) Dim i As Integer = 10 NewMethod(i) End Sub Private Sub NewMethod(i As Integer) field = i End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod7() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim a As String() = Nothing [|Test(a)|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim a As String() = Nothing NewMethod(a) End Sub Private Sub NewMethod(a() As String) Test(a) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod8() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Test(args As String()) Dim a As String() = Nothing [|Test(a)|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Test(args As String()) Dim a As String() = Nothing NewMethod(a) End Sub Private Shared Sub NewMethod(a() As String) Test(a) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod9() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer Dim s As String [|i = 10 s = args(0) + i.ToString()|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer Dim s As String NewMethod(args, i, s) End Sub Private Shared Sub NewMethod(args() As String, ByRef i As Integer, ByRef s As String) i = 10 s = args(0) + i.ToString() End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod10() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) [|Dim i As Integer i = 10 Dim s As String s = args(0) + i.ToString()|] Console.WriteLine(s) End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim s As String = NewMethod(args) Console.WriteLine(s) End Sub Private Shared Function NewMethod(args() As String) As String Dim i As Integer = 10 Dim s As String s = args(0) + i.ToString() Return s End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod11() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) [|Dim i As Integer Dim i2 As Integer = 10|] i = 10 End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer NewMethod() i = 10 End Sub Private Shared Sub NewMethod() Dim i2 As Integer = 10 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod11_1() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) [|Dim i As Integer Dim i2 As Integer = 10|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) NewMethod() End Sub Private Shared Sub NewMethod() Dim i As Integer Dim i2 As Integer = 10 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod12() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer = 10 [|i = i + 1|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer = 10 i = NewMethod(i) Console.WriteLine(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer i = i + 1 Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod13() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) For Each s In args [|Console.WriteLine(s)|] Next End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) For Each s In args NewMethod(s) Next End Sub Private Shared Sub NewMethod(s As String) Console.WriteLine(s) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod14() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) i = 1 While i &lt; 10 [|Console.WriteLine(i)|] i = i + 1 End While End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) i = 1 While i &lt; 10 NewMethod(i) i = i + 1 End While End Sub Private Shared Sub NewMethod(i As Integer) Console.WriteLine(i) End Sub End Class</text> Await TestExtractMethodAsync(code, expected, temporaryFailing:=True) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod15() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) [|Dim s As Integer = 10, i As Integer = 1 Dim b As Integer = s + i|] System.Console.WriteLine(s) System.Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim s As Integer = Nothing Dim i As Integer = Nothing NewMethod(s, i) System.Console.WriteLine(s) System.Console.WriteLine(i) End Sub Private Shared Sub NewMethod(ByRef s As Integer, ByRef i As Integer) s = 10 i = 1 Dim b As Integer = s + i End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod16() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) [|Dim i As Integer = 1|] System.Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer = NewMethod() System.Console.WriteLine(i) End Sub Private Shared Function NewMethod() As Integer Return 1 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539197, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539197")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod17() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(Of T)(ByRef t2 As T) [|Dim t1 As T Test(t1) t2 = t1|] System.Console.WriteLine(t1.ToString()) End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(Of T)(ByRef t2 As T) Dim t1 As T = Nothing NewMethod(t2, t1) System.Console.WriteLine(t1.ToString()) End Sub Private Sub NewMethod(Of T)(ByRef t2 As T, ByRef t1 As T) Test(t1) t2 = t1 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(527775, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/527775")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod18() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(Of T)(ByRef t3 As T) [|Dim t1 As T = GetValue(t3)|] System.Console.WriteLine(t1.ToString()) End Sub Private Function GetValue(Of T)(ByRef t2 As T) As T Return t2 End Function End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(Of T)(ByRef t3 As T) Dim t1 As T = Nothing NewMethod(t3, t1) System.Console.WriteLine(t1.ToString()) End Sub Private Sub NewMethod(Of T)(ByRef t3 As T, ByRef t1 As T) t1 = GetValue(t3) End Sub Private Function GetValue(Of T)(ByRef t2 As T) As T Return t2 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod19() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test() [|Dim i As Integer = 1|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test() NewMethod() End Sub Private Shared Sub NewMethod() Dim i As Integer = 1 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod20() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Module Program Sub Test() [|Dim i As Integer = 1|] End Sub End Module</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Module Program Sub Test() NewMethod() End Sub Private Sub NewMethod() Dim i As Integer = 1 End Sub End Module</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod21() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test() [|Dim i As Integer = 1|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test() NewMethod() End Sub Private Shared Sub NewMethod() Dim i As Integer = 1 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod22() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test() Dim i As Integer [|Dim b As Integer = 10 If b &lt; 10 i = 5 End If|] i = 6 Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test() Dim i As Integer i = NewMethod(i) i = 6 Console.WriteLine(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Dim b As Integer = 10 If b &lt; 10 i = 5 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod23() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main(args As String()) If True [|Console.WriteLine(args(0).ToString())|] End If End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main(args As String()) If True NewMethod(args) End If End Sub Private Shared Sub NewMethod(args() As String) Console.WriteLine(args(0).ToString()) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod24() As Task Dim code = <text>Imports System Class Program Shared Sub Main(args As String()) Dim y As Integer = [|Integer.Parse(args(0).ToString())|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main(args As String()) Dim y As Integer = GetY(args) End Sub Private Shared Function GetY(args() As String) As Integer Return Integer.Parse(args(0).ToString()) End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod25() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main(args As String()) If([|New Integer(){ 1, 2, 3 }|]).Any() Then Return End If End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main(args As String()) If (NewMethod()).Any() Then Return End If End Sub Private Shared Function NewMethod() As Integer() Return New Integer() {1, 2, 3} End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod26() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main(args As String()) If [|(New Integer(){ 1, 2, 3 })|].Any() Return End If End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main(args As String()) If NewMethod().Any() Return End If End Sub Private Shared Function NewMethod() As Integer() Return (New Integer() {1, 2, 3}) End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod27() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test() Dim i As Integer = 1 [|Dim b As Integer = 10 If b &lt; 10 i = 5 End If|] i = 6 Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test() Dim i As Integer = 1 i = NewMethod(i) i = 6 Console.WriteLine(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Dim b As Integer = 10 If b &lt; 10 i = 5 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540046, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540046")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod28() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Function Test() As Integer [|Return 1|] End Function End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Function Test() As Integer Return NewMethod() End Function Private Shared Function NewMethod() As Integer Return 1 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540046, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540046")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod29() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Function Test() As Integer Dim i As Integer = 0 [|If i &lt; 0 Return 1 Else Return 0 End If|] End Function End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Function Test() As Integer Dim i As Integer = 0 Return NewMethod(i) End Function Private Shared Function NewMethod(i As Integer) As Integer If i &lt; 0 Return 1 Else Return 0 End If End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod30() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(ByRef i As Integer) [|i = 10|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(ByRef i As Integer) i = NewMethod() End Sub Private Shared Function NewMethod() As Integer Return 10 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod31() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Text Class Program Sub Test() Dim builder As StringBuilder = New StringBuilder() [|builder.Append("Hello") builder.Append("From") builder.Append("Roslyn")|] Return builder.ToString() End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Text Class Program Sub Test() Dim builder As StringBuilder = New StringBuilder() NewMethod(builder) Return builder.ToString() End Sub Private Shared Sub NewMethod(builder As StringBuilder) builder.Append("Hello") builder.Append("From") builder.Append("Roslyn") End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod32() As Task Dim code = <text>Imports System Class Program Sub Test() Dim v As Integer = 0 Console.Write([|v|]) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test() Dim v As Integer = 0 Console.Write(GetV(v)) End Sub Private Shared Function GetV(v As Integer) As Integer Return v End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod34() As Task Dim code = <text>Imports System Class Program Shared Sub Main(args As String()) Dim x As Integer = 1 Dim y As Integer = 2 Dim z As Integer = [|x + y|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main(args As String()) Dim x As Integer = 1 Dim y As Integer = 2 Dim z As Integer = GetZ(x, y) End Sub Private Shared Function GetZ(x As Integer, y As Integer) As Integer Return x + y End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538239, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538239")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod35() As Task Dim code = <text>Imports System Class Program Shared Sub Main(args As String()) Dim r As Integer() = [|New Integer(){ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 }|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main(args As String()) Dim r As Integer() = GetR() End Sub Private Shared Function GetR() As Integer() Return New Integer() {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20} End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod36() As Task Dim code = <text>Imports System Class Program Shared Sub Main(ByRef i As Integer) [|i = 1|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main(ByRef i As Integer) i = NewMethod() End Sub Private Shared Function NewMethod() As Integer Return 1 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod37() As Task Dim code = <text>Imports System Class Program Shared Sub Main(ByRef i As Integer) [|i = 1|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main(ByRef i As Integer) i = NewMethod() End Sub Private Shared Function NewMethod() As Integer Return 1 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538231, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538231")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod38() As Task Dim code = <text>Imports System Class Program Shared Sub Main(args As String()) &apos; int v = 0; &apos; while (true) Dim unassigned As Integer &apos; { &apos; NewMethod(v++); [|unassigned = unassigned + 10|] &apos; NewMethod(ReturnVal(v++)); &apos; } End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main(args As String()) ' int v = 0; ' while (true) Dim unassigned As Integer ' { ' NewMethod(v++); unassigned = NewMethod(unassigned) ' NewMethod(ReturnVal(v++)); ' } End Sub Private Shared Function NewMethod(unassigned As Integer) As Integer unassigned = unassigned + 10 Return unassigned End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538231, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538231")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod39() As Task Dim code = <text>Imports System Class Program Shared Sub Main(args As String()) &apos; int v = 0; &apos; while (true) Dim unassigned As Integer &apos; { [|&apos; NewMethod(v++); unassigned = unassigned + 10 &apos; NewMethod(ReturnVal(v++));|] &apos; } End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main(args As String()) ' int v = 0; ' while (true) Dim unassigned As Integer ' { unassigned = NewMethod(unassigned) ' } End Sub Private Shared Function NewMethod(unassigned As Integer) As Integer ' NewMethod(v++); unassigned = unassigned + 10 ' NewMethod(ReturnVal(v++)); Return unassigned End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538303, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538303")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function ExtractMethod40() As Task Dim code = <text>Class Program Shared Sub Main(args As String()) [|Dim x As Integer|] End Sub End Class</text> Await ExpectExtractMethodToFailAsync(code) End Function <WorkItem(538314, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538314")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod41() As Task Dim code = <text>Class Program Shared Sub Main(args As String()) Dim x As Integer = 10 [|Dim y As Integer If x = 10 y = 5 End If|] Console.WriteLine(y) End Sub End Class</text> Dim expected = <text>Class Program Shared Sub Main(args As String()) Dim x As Integer = 10 Dim y As Integer = NewMethod(x) Console.WriteLine(y) End Sub Private Shared Function NewMethod(x As Integer) As Integer Dim y As Integer If x = 10 y = 5 End If Return y End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(527499, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/527499")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix3992() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Integer = 1 [|While False Console.WriteLine(x) End While|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Integer = 1 NewMethod(x) End Sub Private Shared Sub NewMethod(x As Integer) While False Console.WriteLine(x) End While End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538327, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538327")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod42() As Task Dim code = <text>Imports System Class Program Shared Sub Main(args As String()) Dim a As Integer, b As Integer [|a = 5 b = 7|] Console.Write(a + b) End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main(args As String()) Dim a As Integer, b As Integer NewMethod(a, b) Console.Write(a + b) End Sub Private Shared Sub NewMethod(ByRef a As Integer, ByRef b As Integer) a = 5 b = 7 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538327, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538327")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod43() As Task Dim code = <text>Imports System Class Program Shared Sub Main(args As String()) Dim a As Integer, b As Integer [|a = 5 b = 7 Dim c As Integer Dim d As Integer Dim e As Integer, f As Integer c = 1 d = 1 e = 1 f = 1|] Console.Write(a + b) End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main(args As String()) Dim a As Integer, b As Integer NewMethod(a, b) Console.Write(a + b) End Sub Private Shared Sub NewMethod(ByRef a As Integer, ByRef b As Integer) a = 5 b = 7 Dim c As Integer Dim d As Integer Dim e As Integer, f As Integer c = 1 d = 1 e = 1 f = 1 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538328, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538328")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod44() As Task Dim code = <text>Imports System Class Program Shared Sub Main(args As String()) Dim a As Integer &apos; comment [|a = 1|] &apos; comment Console.Write(a) End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main(args As String()) Dim a As Integer &apos; comment a = NewMethod() &apos; comment Console.Write(a) End Sub Private Shared Function NewMethod() As Integer Return 1 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538393, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538393")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod46() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Integer = 1 [|Goo(x)|] Console.WriteLine(x) End Sub Shared Sub Goo(ByRef x As Integer) x = x + 1 End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Integer = 1 x = NewMethod(x) Console.WriteLine(x) End Sub Private Shared Function NewMethod(x As Integer) As Integer Goo(x) Return x End Function Shared Sub Goo(ByRef x As Integer) x = x + 1 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538399, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538399")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod47() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Integer = 1 [|While True Console.WriteLine(x) End While|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Integer = 1 NewMethod(x) End Sub Private Shared Sub NewMethod(x As Integer) While True Console.WriteLine(x) End While End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538401, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538401")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod48() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Integer() = [|{ 1, 2, 3 }|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Integer() = GetX() End Sub Private Shared Function GetX() As Integer() Return {1, 2, 3} End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538405, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538405")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod49() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Goo(GetX As Integer) Dim x As Integer = [|1|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Goo(GetX As Integer) Dim x As Integer = GetX1() End Sub Private Shared Function GetX1() As Integer Return 1 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodNormalProperty() As Task Dim code = <text>Class [Class] Private Shared name As String Public Shared Property Names As String Get Return 1 End Get Set name = value End Set End Property Shared Sub Goo(i As Integer) Dim str As String = [|[Class].Names|] End Sub End Class</text> Dim expected = <text>Class [Class] Private Shared name As String Public Shared Property Names As String Get Return 1 End Get Set name = value End Set End Property Shared Sub Goo(i As Integer) Dim str As String = GetStr() End Sub Private Shared Function GetStr() As String Return [Class].Names End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538932, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538932")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodAutoProperty() As Task Dim code = <text>Class [Class] Public Property Name As String Shared Sub Main() Dim str As String = New [Class]().[|Name|] End Sub End Class</text> Dim expected = <text>Class [Class] Public Property Name As String Shared Sub Main() Dim str As String = GetStr() End Sub Private Shared Function GetStr() As String Return New [Class]().Name End Function End Class</text> ' given span is not an expression, use suggestion Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538402, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538402")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix3994() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Byte = [|1|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Byte = GetX() End Sub Private Shared Function GetX() As Byte Return 1 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538404, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538404")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix3996() As Task Dim code = <text>Class A(Of T) Class D Inherits A(Of T) End Class Class B End Class Shared Function Goo() As D.B Return Nothing End Function Class C(Of T2) Shared Sub Bar() Dim x As D.B = [|Goo()|] End Sub End Class End Class</text> Dim expected = <text>Class A(Of T) Class D Inherits A(Of T) End Class Class B End Class Shared Function Goo() As D.B Return Nothing End Function Class C(Of T2) Shared Sub Bar() Dim x As D.B = GetX() End Sub Private Shared Function GetX() As B Return Goo() End Function End Class End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestInsertionPoint() As Task Dim code = <text>Class Test Sub Method(i As String) Dim y2 As Integer = [|1|] End Sub Sub Method(i As Integer) End Sub End Class</text> Dim expected = <text>Class Test Sub Method(i As String) Dim y2 As Integer = GetY2() End Sub Private Shared Function GetY2() As Integer Return 1 End Function Sub Method(i As Integer) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538980, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538980")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4757() As Task Dim code = <text>Class GenericMethod Sub Method(Of T)(t1 As T) Dim a As T [|a = t1|] End Sub End Class</text> Dim expected = <text>Class GenericMethod Sub Method(Of T)(t1 As T) Dim a As T a = NewMethod(t1) End Sub Private Shared Function NewMethod(Of T)(t1 As T) As T Return t1 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538980, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538980")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4757_2() As Task Dim code = <text>Class GenericMethod(Of T1) Sub Method(Of T)(t1 As T) Dim a As T Dim b As T1 [|a = t1 b = Nothing|] End Sub End Class</text> Dim expected = <text>Class GenericMethod(Of T1) Sub Method(Of T)(t1 As T) Dim a As T Dim b As T1 NewMethod(t1, a, b) End Sub Private Shared Sub NewMethod(Of T)(t1 As T, ByRef a As T, ByRef b As T1) a = t1 b = Nothing End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538980, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538980")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4757_3() As Task Dim code = <text>Class GenericMethod Sub Method(Of T, T1)(t1 As T) Dim a1 As T1 Dim a As T [|a = t1 a1 = Nothing|] End Sub End Class</text> Dim expected = <text>Class GenericMethod Sub Method(Of T, T1)(t1 As T) Dim a1 As T1 Dim a As T NewMethod(t1, a1, a) End Sub Private Shared Sub NewMethod(Of T, T1)(t1 As T, ByRef a1 As T1, ByRef a As T) a = t1 a1 = Nothing End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538422, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538422")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4758() As Task Dim code = <text>Imports System Class TestOutParameter Sub Method(ByRef x As Integer) x = 5 Console.Write([|x|]) End Sub End Class</text> Dim expected = <text>Imports System Class TestOutParameter Sub Method(ByRef x As Integer) x = 5 Console.Write(GetX(x)) End Sub Private Shared Function GetX(x As Integer) As Integer Return x End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538422, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538422")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4758_2() As Task Dim code = <text>Class TestOutParameter Sub Method(ByRef x As Integer) x = 5 Console.Write([|x|]) End Sub End Class</text> Dim expected = <text>Class TestOutParameter Sub Method(ByRef x As Integer) x = 5 Console.Write(GetX(x)) End Sub Private Shared Function GetX(x As Integer) As Integer Return x End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538984, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538984")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4761() As Task Dim code = <text>Class A Sub Method() Dim a As System.Func(Of Integer, Integer) = Function(x) [|x * x|] End Sub End Class</text> Dim expected = <text>Class A Sub Method() Dim a As System.Func(Of Integer, Integer) = Function(x) NewMethod(x) End Sub Private Shared Function NewMethod(x As Integer) As Integer Return x * x End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538997, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538997")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4779() As Task Dim code = <text>Imports System Class Program Shared Sub Main() Dim s As String = "" Dim f As Func(Of String) = [|s|].ToString End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main() Dim s As String = "" Dim f As Func(Of String) = GetS(s).ToString End Sub Private Shared Function GetS(s As String) As String Return s End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538997, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538997")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4779_2() As Task Dim code = <text>Imports System Class Program Shared Sub Main() Dim s As String = "" Dim f = [|s|].ToString() End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main() Dim s As String = "" Dim f = GetS(s).ToString() End Sub Private Shared Function GetS(s As String) As String Return s End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(4780, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4780() As Task Dim code = <text>Imports System Class Program Shared Sub Main() Dim s As String = "" Dim f As Object = DirectCast([|s.ToString|], Func(Of String)) End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main() Dim s As String = "" Dim f As Object = DirectCast(GetToString(s), Func(Of String)) End Sub Private Shared Function GetToString(s As String) As Func(Of String) Return s.ToString End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539201, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539201")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4780_2() As Task Dim code = <text>Imports System Class Program Shared Sub Main() Dim s As String = "" Dim f As Object = DirectCast([|s.ToString()|], String) End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main() Dim s As String = "" Dim f As Object = DirectCast(NewMethod(s), String) End Sub Private Shared Function NewMethod(s As String) As String Return s.ToString() End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539201, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539201")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4780_3() As Task Dim code = <text>Imports System Class Program Shared Sub Main() Dim s As String = "" Dim f As Object = TryCast([|s.ToString()|], String) End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main() Dim s As String = "" Dim f As Object = TryCast(NewMethod(s), String) End Sub Private Shared Function NewMethod(s As String) As String Return s.ToString() End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(4782, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function BugFix4782_2() As Task Dim code = <text>Class A(Of T) Class D Inherits A(Of T()) End Class Class B End Class Class C(Of T) Shared Sub Goo() Dim x As D.B = [|New D.B()|] End Sub End Class End Class</text> Await ExpectExtractMethodToFailAsync(code) End Function <WorkItem(4791, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4791() As Task Dim code = <text>Class Program Delegate Function Func(a As Integer) As Integer Shared Sub Main(args As String()) Dim v As Func = Function(a As Integer) [|a|] End Sub End Class</text> Dim expected = <text>Class Program Delegate Function Func(a As Integer) As Integer Shared Sub Main(args As String()) Dim v As Func = Function(a As Integer) GetA(a) End Sub Private Shared Function GetA(a As Integer) As Integer Return a End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539019, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539019")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4809() As Task Dim code = <text>Class Program Public Sub New() [|Dim x As Integer = 2|] End Sub End Class</text> Dim expected = <text>Class Program Public Sub New() NewMethod() End Sub Private Shared Sub NewMethod() Dim x As Integer = 2 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(551797, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/551797")> <WorkItem(539029, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539029")> <WpfFact(Skip:="551797"), Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4813() As Task Dim code = <text>Imports System Class Program Public Sub New() Dim o As [Object] = [|New Program()|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Public Sub New() Dim o As [Object] = GetO() End Sub Private Shared Function GetO() As Program Return New Program() End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538425, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538425")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4031() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Boolean = True, y As Boolean = True, z As Boolean = True If x While y End While Else [|While z End While|] End If End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Boolean = True, y As Boolean = True, z As Boolean = True If x While y End While Else NewMethod(z) End If End Sub Private Shared Sub NewMethod(z As Boolean) While z End While End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539029, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539029")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4823() As Task Dim code = <text>Class Program Private area As Double = 1.0 Public ReadOnly Property Area As Double Get Return area End Get End Property Public Overrides Function ToString() As String Return String.Format("{0:F2}", [|Area|]) End Function End Class</text> Dim expected = <text>Class Program Private area As Double = 1.0 Public ReadOnly Property Area As Double Get Return area End Get End Property Public Overrides Function ToString() As String Return String.Format("{0:F2}", GetArea()) End Function Private Function GetArea() As Double Return Area End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538985, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538985")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4762() As Task Dim code = <text>Class Program Shared Sub Main(args As String()) &apos;comments [|Dim x As Integer = 2|] End Sub End Class</text> Dim expected = <text>Class Program Shared Sub Main(args As String()) &apos;comments NewMethod() End Sub Private Shared Sub NewMethod() Dim x As Integer = 2 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538966, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538966")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4744() As Task Dim code = <text>Class Program Shared Sub Main(args As String()) [|Dim x As Integer = 2 &apos;comments|] End Sub End Class</text> Dim expected = <text>Class Program Shared Sub Main(args As String()) NewMethod() End Sub Private Shared Sub NewMethod() Dim x As Integer = 2 &apos;comments End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539049, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539049")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodInProperty1() As Task Dim code = <text>Class C2 Shared Public ReadOnly Property Area As Integer Get Return 1 End Get End Property End Class Class C3 Public Shared ReadOnly Property Area As Integer Get Return [|C2.Area|] End Get End Property End Class</text> Dim expected = <text>Class C2 Shared Public ReadOnly Property Area As Integer Get Return 1 End Get End Property End Class Class C3 Public Shared ReadOnly Property Area As Integer Get Return GetArea() End Get End Property Private Shared Function GetArea() As Integer Return C2.Area End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539049, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539049")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodInProperty2() As Task Dim code = <text>Class C3 Public Shared ReadOnly Property Area As Integer Get [|Dim i As Integer = 10 Return i|] End Get End Property End Class</text> Dim expected = <text>Class C3 Public Shared ReadOnly Property Area As Integer Get Return NewMethod() End Get End Property Private Shared Function NewMethod() As Integer Return 10 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539049, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539049")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodInProperty3() As Task Dim code = <text>Class C3 Public Shared WriteOnly Property Area As Integer Set(value As Integer) [|Dim i As Integer = value|] End Set End Property End Class</text> Dim expected = <text>Class C3 Public Shared WriteOnly Property Area As Integer Set(value As Integer) NewMethod(value) End Set End Property Private Shared Sub NewMethod(value As Integer) Dim i As Integer = value End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoNoNoYesNoNo() As Task Dim code = <text>Imports System Class Program Sub Test1() Dim i As Integer [|If Integer.Parse(1) &gt; 0 i = 10 End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test1() Dim i As Integer i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer If Integer.Parse(1) &gt; 0 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoNoNoYesNoYes() As Task Dim code = <text>Imports System Class Program Sub Test2() Dim i As Integer = 0 [|If Integer.Parse(1) &gt; 0 i = 10 End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test2() Dim i As Integer = 0 i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer If Integer.Parse(1) &gt; 0 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoNoNoYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test3() Dim i As Integer While i &gt; 10 End While [|If Integer.Parse(1) &gt; 0 i = 10 End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test3() Dim i As Integer While i &gt; 10 End While i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer If Integer.Parse(1) &gt; 0 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoNoNoYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test4() Dim i As Integer = 10 While i &gt; 10 End While [|If Integer.Parse(1) &gt; 0 i = 10 End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test4() Dim i As Integer = 10 While i > 10 End While i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer If Integer.Parse(1) > 0 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoNoYesYesNoNo() As Task Dim code = <text>Imports System Class Program Sub Test4_1() Dim i As Integer [|If Integer.Parse(1) &gt; 0 i = 10 Console.WriteLine(i) End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test4_1() Dim i As Integer i = NewMethod() End Sub Private Shared Function NewMethod() As Integer Dim i As Integer If Integer.Parse(1) > 0 i = 10 Console.WriteLine(i) End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoNoYesYesNoYes() As Task Dim code = <text>Imports System Class Program Sub Test4_2() Dim i As Integer = 10 [|If Integer.Parse(1) &gt; 0 i = 10 Console.WriteLine(i) End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test4_2() Dim i As Integer = 10 i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer If Integer.Parse(1) > 0 i = 10 Console.WriteLine(i) End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoNoYesYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test4_3() Dim i As Integer Console.WriteLine(i) [|If Integer.Parse(1) &gt; 0 i = 10 Console.WriteLine(i) End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test4_3() Dim i As Integer Console.WriteLine(i) i = NewMethod() End Sub Private Shared Function NewMethod() As Integer Dim i As Integer If Integer.Parse(1) > 0 i = 10 Console.WriteLine(i) End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoNoYesYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test4_4() Dim i As Integer = 10 Console.WriteLine(i) [|If Integer.Parse(1) &gt; 0 i = 10 Console.WriteLine(i) End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test4_4() Dim i As Integer = 10 Console.WriteLine(i) i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer If Integer.Parse(1) > 0 i = 10 Console.WriteLine(i) End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function MatrixCase_NoNoNoYesNoNoNoNo() As Task Dim code = <text>Imports System Class Program Sub Test5() [|Dim i As Integer|] End Sub End Class</text> Await ExpectExtractMethodToFailAsync(code) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function MatrixCase_NoNoNoYesNoNoNoYes() As Task Dim code = <text>Imports System Class Program Sub Test6() [|Dim i As Integer|] i = 1 End Sub End Class</text> Await ExpectExtractMethodToFailAsync(code) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoYesNoYesNoNo() As Task Dim code = <text>Imports System Class Program Sub Test7() [|Dim i As Integer If Integer.Parse(1) &gt; 0 i = 10 End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test7() NewMethod() End Sub Private Shared Sub NewMethod() Dim i As Integer If Integer.Parse(1) &gt; 0 i = 10 End If End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoYesNoYesNoYes() As Task Dim code = <text>Imports System Class Program Sub Test8() [|Dim i As Integer If Integer.Parse(1) &gt; 0 i = 10 End If|] i = 2 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test8() Dim i As Integer = NewMethod() i = 2 End Sub Private Shared Function NewMethod() As Integer Dim i As Integer If Integer.Parse(1) &gt; 0 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoYesYesNoNoNo() As Task Dim code = <text>Imports System Class Program Sub Test9() [|Dim i As Integer Console.WriteLine(i)|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test9() NewMethod() End Sub Private Shared Sub NewMethod() Dim i As Integer Console.WriteLine(i) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoYesYesNoNoYes() As Task Dim code = <text>Imports System Class Program Sub Test10() [|Dim i As Integer Console.WriteLine(i)|] i = 10 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test10() Dim i As Integer NewMethod() i = 10 End Sub Private Shared Sub NewMethod() Dim i As Integer Console.WriteLine(i) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoYesYesYesNoNo() As Task Dim code = <text>Imports System Class Program Sub Test11() [|Dim i As Integer If Integer.Parse(1) &gt; 0 i = 10 End If Console.WriteLine(i)|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test11() NewMethod() End Sub Private Shared Sub NewMethod() Dim i As Integer If Integer.Parse(1) &gt; 0 i = 10 End If Console.WriteLine(i) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoYesYesYesNoYes() As Task Dim code = <text>Imports System Class Program Sub Test12() [|Dim i As Integer If Integer.Parse(1) &gt; 0 i = 10 End If Console.WriteLine(i)|] i = 10 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test12() Dim i As Integer = NewMethod() i = 10 End Sub Private Shared Function NewMethod() As Integer Dim i As Integer If Integer.Parse(1) > 0 i = 10 End If Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesNoNoYesNoNo() As Task Dim code = <text>Imports System Class Program Sub Test13() Dim i As Integer [|i = 10|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test13() Dim i As Integer i = NewMethod() End Sub Private Shared Function NewMethod() As Integer Return 10 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesNoNoYesNoYes() As Task Dim code = <text>Imports System Class Program Sub Test14() Dim i As Integer [|i = 10|] i = 1 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test14() Dim i As Integer i = NewMethod() i = 1 End Sub Private Shared Function NewMethod() As Integer Return 10 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesNoNoYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test15() Dim i As Integer Console.WriteLine(i) [|i = 10|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test15() Dim i As Integer Console.WriteLine(i) i = NewMethod() End Sub Private Shared Function NewMethod() As Integer Return 10 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesNoNoYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test16() Dim i As Integer [|i = 10|] i = 10 Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test16() Dim i As Integer i = NewMethod() i = 10 Console.WriteLine(i) End Sub Private Shared Function NewMethod() As Integer Return 10 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesNoYesYesNoNo() As Task Dim code = <text>Imports System Class Program Sub Test16_1() Dim i As Integer [|i = 10 Console.WriteLine(i)|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test16_1() Dim i As Integer i = NewMethod() End Sub Private Shared Function NewMethod() As Integer Dim i As Integer = 10 Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesNoYesYesNoYes() As Task Dim code = <text>Imports System Class Program Sub Test16_2() Dim i As Integer = 10 [|i = 10 Console.WriteLine(i)|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test16_2() Dim i As Integer = 10 i = NewMethod() End Sub Private Shared Function NewMethod() As Integer Dim i As Integer = 10 Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesNoYesYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test16_3() Dim i As Integer Console.WriteLine(i) [|i = 10 Console.WriteLine(i)|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test16_3() Dim i As Integer Console.WriteLine(i) i = NewMethod() End Sub Private Shared Function NewMethod() As Integer Dim i As Integer = 10 Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesNoYesYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test16_4() Dim i As Integer = 10 Console.WriteLine(i) [|i = 10 Console.WriteLine(i)|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test16_4() Dim i As Integer = 10 Console.WriteLine(i) i = NewMethod() End Sub Private Shared Function NewMethod() As Integer Dim i As Integer = 10 Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesYesNoYesNoNo() As Task Dim code = <text>Imports System Class Program Sub Test17() [|Dim i As Integer = 10|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test17() NewMethod() End Sub Private Shared Sub NewMethod() Dim i As Integer = 10 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesYesNoYesNoYes() As Task Dim code = <text>Imports System Class Program Sub Test18() [|Dim i As Integer = 10|] i = 10 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test18() Dim i As Integer = NewMethod() i = 10 End Sub Private Shared Function NewMethod() As Integer Return 10 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesYesYesYesNoNo() As Task Dim code = <text>Imports System Class Program Sub Test19() [|Dim i As Integer = 10 Console.WriteLine(i)|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test19() NewMethod() End Sub Private Shared Sub NewMethod() Dim i As Integer = 10 Console.WriteLine(i) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesYesYesYesNoYes() As Task Dim code = <text>Imports System Class Program Sub Test20() [|Dim i As Integer = 10 Console.WriteLine(i)|] i = 10 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test20() Dim i As Integer NewMethod() i = 10 End Sub Private Shared Sub NewMethod() Dim i As Integer = 10 Console.WriteLine(i) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesNoNoNoYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test21() Dim i As Integer [|If Integer.Parse(1) &gt; 10 i = 1 End If|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test21() Dim i As Integer i = NewMethod(i) Console.WriteLine(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer If Integer.Parse(1) &gt; 10 i = 1 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesNoNoNoYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test22() Dim i As Integer = 10 [|If Integer.Parse(1) &gt; 10 i = 1 End If|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test22() Dim i As Integer = 10 i = NewMethod(i) Console.WriteLine(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer If Integer.Parse(1) &gt; 10 i = 1 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesNoNoYesYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test22_1() Dim i As Integer [|If Integer.Parse(1) &gt; 10 i = 1 Console.WriteLine(i) End If|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test22_1() Dim i As Integer i = NewMethod(i) Console.WriteLine(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer If Integer.Parse(1) &gt; 10 i = 1 Console.WriteLine(i) End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesNoNoYesYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test22_2() Dim i As Integer = 10 [|If Integer.Parse(1) &gt; 10 i = 1 Console.WriteLine(i) End If|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test22_2() Dim i As Integer = 10 i = NewMethod(i) Console.WriteLine(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer If Integer.Parse(1) &gt; 10 i = 1 Console.WriteLine(i) End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function MatrixCase_NoYesNoYesNoNoYesNo() As Task Dim code = <text>Imports System Class Program Sub Test23() [|Dim i As Integer|] Console.WriteLine(i) End Sub End Class</text> Await ExpectExtractMethodToFailAsync(code) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function MatrixCase_NoYesNoYesNoNoYesYes() As Task Dim code = <text>Imports System Class Program Sub Test24() [|Dim i As Integer|] Console.WriteLine(i) i = 10 End Sub End Class</text> Await ExpectExtractMethodToFailAsync(code) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesNoYesNoYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test25() [|Dim i As Integer If Integer.Parse(1) &gt; 9 i = 10 End If|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test25() Dim i As Integer = NewMethod() Console.WriteLine(i) End Sub Private Shared Function NewMethod() As Integer Dim i As Integer If Integer.Parse(1) &gt; 9 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesNoYesNoYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test26() [|Dim i As Integer If Integer.Parse(1) &gt; 9 i = 10 End If|] Console.WriteLine(i) i = 10 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test26() Dim i As Integer = NewMethod() Console.WriteLine(i) i = 10 End Sub Private Shared Function NewMethod() As Integer Dim i As Integer If Integer.Parse(1) &gt; 9 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesNoYesYesNoYesNo() As Task Dim code = <text>Imports System Class Program Sub Test27() [|Dim i As Integer Console.WriteLine(i)|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test27() Dim i As Integer = NewMethod() Console.WriteLine(i) End Sub Private Shared Function NewMethod() As Integer Dim i As Integer Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesNoYesYesNoYesYes() As Task Dim code = <text>Imports System Class Program Sub Test28() [|Dim i As Integer Console.WriteLine(i)|] Console.WriteLine(i) i = 10 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test28() Dim i As Integer = NewMethod() Console.WriteLine(i) i = 10 End Sub Private Shared Function NewMethod() As Integer Dim i As Integer Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesNoYesYesYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test29() [|Dim i As Integer If Integer.Parse(1) &gt; 0 i = 10 End If Console.WriteLine(i)|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test29() Dim i As Integer = NewMethod() Console.WriteLine(i) End Sub Private Shared Function NewMethod() As Integer Dim i As Integer If Integer.Parse(1) &gt; 0 i = 10 End If Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesNoYesYesYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test30() [|Dim i As Integer If Integer.Parse(1) &gt; 0 i = 10 End If Console.WriteLine(i)|] Console.WriteLine(i) i = 10 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test30() Dim i As Integer = NewMethod() Console.WriteLine(i) i = 10 End Sub Private Shared Function NewMethod() As Integer Dim i As Integer If Integer.Parse(1) &gt; 0 i = 10 End If Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesYesNoNoYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test31() Dim i As Integer [|i = 10|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test31() Dim i As Integer i = NewMethod() Console.WriteLine(i) End Sub Private Shared Function NewMethod() As Integer Return 10 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesYesNoNoYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test32() Dim i As Integer [|i = 10|] Console.WriteLine(i) i = 10 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test32() Dim i As Integer i = NewMethod() Console.WriteLine(i) i = 10 End Sub Private Shared Function NewMethod() As Integer Return 10 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesYesNoYesYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test32_1() Dim i As Integer [|i = 10 Console.WriteLine(i)|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test32_1() Dim i As Integer i = NewMethod() Console.WriteLine(i) End Sub Private Shared Function NewMethod() As Integer Dim i As Integer = 10 Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesYesNoYesYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test32_2() Dim i As Integer = 10 [|i = 10 Console.WriteLine(i)|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test32_2() Dim i As Integer = 10 i = NewMethod() Console.WriteLine(i) End Sub Private Shared Function NewMethod() As Integer Dim i As Integer = 10 Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesYesYesNoYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test33() [|Dim i As Integer = 10|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test33() Dim i As Integer = NewMethod() Console.WriteLine(i) End Sub Private Shared Function NewMethod() As Integer Return 10 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesYesYesNoYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test34() [|Dim i As Integer = 10|] Console.WriteLine(i) i = 10 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test34() Dim i As Integer = NewMethod() Console.WriteLine(i) i = 10 End Sub Private Shared Function NewMethod() As Integer Return 10 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesYesYesYesYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test35() [|Dim i As Integer = 10 Console.WriteLine(i)|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test35() Dim i As Integer = NewMethod() Console.WriteLine(i) End Sub Private Shared Function NewMethod() As Integer Dim i As Integer = 10 Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesYesYesYesYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test36() [|Dim i As Integer = 10 Console.WriteLine(i)|] Console.WriteLine(i) i = 10 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test36() Dim i As Integer = NewMethod() Console.WriteLine(i) i = 10 End Sub Private Shared Function NewMethod() As Integer Dim i As Integer = 10 Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoNoNoYesNoNoNo() As Task Dim code = <text>Imports System Class Program Sub Test37() Dim i As Integer [|Console.WriteLine(i)|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test37() Dim i As Integer NewMethod(i) End Sub Private Shared Sub NewMethod(i As Integer) Console.WriteLine(i) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoNoNoYesNoNoYes() As Task Dim code = <text>Imports System Class Program Sub Test38() Dim i As Integer = 10 [|Console.WriteLine(i)|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test38() Dim i As Integer = 10 NewMethod(i) End Sub Private Shared Sub NewMethod(i As Integer) Console.WriteLine(i) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoNoNoYesNoYesNo() As Task Dim code = <text>Imports System Class Program Sub Test39() Dim i As Integer [|Console.WriteLine(i)|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test39() Dim i As Integer NewMethod(i) Console.WriteLine(i) End Sub Private Shared Sub NewMethod(i As Integer) Console.WriteLine(i) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoNoNoYesNoYesYes() As Task Dim code = <text>Imports System Class Program Sub Test40() Dim i As Integer = 10 [|Console.WriteLine(i)|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test40() Dim i As Integer = 10 NewMethod(i) Console.WriteLine(i) End Sub Private Shared Sub NewMethod(i As Integer) Console.WriteLine(i) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoNoNoYesYesNoNo() As Task Dim code = <text>Imports System Class Program Sub Test41() Dim i As Integer [|Console.WriteLine(i) If Integer.Parse(1) &gt; 0 i = 10 End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test41() Dim i As Integer i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) If Integer.Parse(1) > 0 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoNoNoYesYesNoYes() As Task Dim code = <text>Imports System Class Program Sub Test42() Dim i As Integer = 10 [|Console.WriteLine(i) If Integer.Parse(1) &gt; 0 i = 10 End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test42() Dim i As Integer = 10 i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) If Integer.Parse(1) > 0 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoNoNoYesYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test43() Dim i As Integer Console.WriteLine(i) [|Console.WriteLine(i) If Integer.Parse(1) &gt; 0 i = 10 End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test43() Dim i As Integer Console.WriteLine(i) i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) If Integer.Parse(1) > 0 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoNoNoYesYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test44() Dim i As Integer = 10 Console.WriteLine(i) [|Console.WriteLine(i) If Integer.Parse(1) &gt; 0 i = 10 End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test44() Dim i As Integer = 10 Console.WriteLine(i) i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) If Integer.Parse(1) > 0 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoYesNoYesYesNoNo() As Task Dim code = <text>Imports System Class Program Sub Test45() Dim i As Integer [|Console.WriteLine(i) i = 10|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test45() Dim i As Integer i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) i = 10 Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoYesNoYesYesNoYes() As Task Dim code = <text>Imports System Class Program Sub Test46() Dim i As Integer = 10 [|Console.WriteLine(i) i = 10|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test46() Dim i As Integer = 10 i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) i = 10 Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoYesNoYesYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test47() Dim i As Integer Console.WriteLine(i) [|Console.WriteLine(i) i = 10|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test47() Dim i As Integer Console.WriteLine(i) i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) i = 10 Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoYesNoYesYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test48() Dim i As Integer = 10 Console.WriteLine(i) [|Console.WriteLine(i) i = 10|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test48() Dim i As Integer = 10 Console.WriteLine(i) i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) i = 10 Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesYesNoNoYesYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test49() Dim i As Integer [|Console.WriteLine(i) If Integer.Parse(1) &gt; 0 i = 10 End If|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test49() Dim i As Integer i = NewMethod(i) Console.WriteLine(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) If Integer.Parse(1) &gt; 0 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesYesNoNoYesYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test50() Dim i As Integer = 10 [|Console.WriteLine(i) If Integer.Parse(1) &gt; 0 i = 10 End If|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test50() Dim i As Integer = 10 i = NewMethod(i) Console.WriteLine(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) If Integer.Parse(1) &gt; 0 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesYesYesNoYesYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test51() Dim i As Integer [|Console.WriteLine(i) i = 10|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test51() Dim i As Integer i = NewMethod(i) Console.WriteLine(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) i = 10 Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesYesYesNoYesYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test52() Dim i As Integer = 10 [|Console.WriteLine(i) i = 10|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test52() Dim i As Integer = 10 i = NewMethod(i) Console.WriteLine(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) i = 10 Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540046, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540046")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestImplicitFunctionLocal1() As Task Dim code = <text>Imports System Class Program Function Test() as Integer [|Return 1|] End Function End Class</text> Dim expected = <text>Imports System Class Program Function Test() as Integer Return NewMethod() End Function Private Shared Function NewMethod() As Integer Return 1 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestImplicitFunctionLocal2() As Task Dim code = <text>Imports System Class Program Function Test() as Integer Test = 1 [|If Test > 10 Then Test = 2 End If|] Console.Write(Test) Return 1 End Function End Class</text> Dim expected = <text>Imports System Class Program Function Test() as Integer Test = 1 Test = NewMethod(Test) Console.Write(Test) Return 1 End Function Private Shared Function NewMethod(Test As Integer) As Integer If Test > 10 Then Test = 2 End If Return Test End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestImplicitFunctionLocal3() As Task Dim code = <text>Imports System Class Program Function Test() as Integer Test = 1 [|If Test > 10 Then Test = 2 End If|] Return 1 End Function End Class</text> Dim expected = <text>Imports System Class Program Function Test() as Integer Test = 1 Test = NewMethod(Test) Return 1 End Function Private Shared Function NewMethod(Test As Integer) As Integer If Test > 10 Then Test = 2 End If Return Test End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestImplicitFunctionLocal4() As Task Dim code = <text>Imports System Class Program Function Test() as Integer Test = 1 [|If Test > 10 Then Test = 2 End If|] Console.WriteLine(Test) End Function End Class</text> Dim expected = <text>Imports System Class Program Function Test() as Integer Test = 1 Test = NewMethod(Test) Console.WriteLine(Test) End Function Private Shared Function NewMethod(Test As Integer) As Integer If Test > 10 Then Test = 2 End If Return Test End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539295, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539295")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestImplicitFunctionLocal5() As Task Dim code = <text>Module Module1 Sub Main() Console.WriteLine(Goo(2)) End Sub Function Goo%(ByVal j As Integer) [|Goo = 3.87 * j|] Exit Function End Function End Module</text> Dim expected = <text>Module Module1 Sub Main() Console.WriteLine(Goo(2)) End Sub Function Goo%(ByVal j As Integer) Goo = NewMethod(j) Exit Function End Function Private Function NewMethod(j As Integer) As Integer Return 3.87 * j End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(527776, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/527776")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug5079() As Task Dim code = <text>Class C Function f() As Integer [|Dim x As Integer = 5|] Return x End Function End Class</text> Dim expected = <text>Class C Function f() As Integer Dim x As Integer = NewMethod() Return x End Function Private Shared Function NewMethod() As Integer Return 5 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539225, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539225"), Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function Bug5098() As Task Dim code = <code>Class Program Shared Sub Main() [|Return|] Console.Write(4) End Sub End Class</code> Await ExpectExtractMethodToFailAsync(code) End Function <WorkItem(5092, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix5092() As Task Dim code = <text>Imports System Module Module1 Sub Main() Dim d As Integer? d = [|New Integer?()|] End Sub End Module </text> Dim expected = <text>Imports System Module Module1 Sub Main() Dim d As Integer? d = NewMethod() End Sub Private Function NewMethod() As Integer? Return New Integer?() End Function End Module </text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539224, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539224")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix5096() As Task Dim code = <text>Module Program Sub Main(args As String()) [|Console.Write(4)|] 'comments End Sub End Module</text> Dim expected = <text>Module Program Sub Main(args As String()) NewMethod() 'comments End Sub Private Sub NewMethod() Console.Write(4) End Sub End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539251, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539251")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix5135() As Task Dim code = <text>Module Module1 Sub Main() End Sub Public Function Goo(ByVal params&amp;) Goo = [|params&amp;|] End Function End Module</text> Dim expected = <text>Module Module1 Sub Main() End Sub Public Function Goo(ByVal params&amp;) Goo = GetParams(params) End Function Private Function GetParams(params As Long) As Long Return params&amp; End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function ''' <summary> ''' Console.Write is not bound, as there is no Imports System ''' The flow analysis API in this case should still provide information about variable x (error tolerance) ''' </summary> ''' <remarks></remarks> <WorkItem(5220, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestErrorTolerance() As Task Dim code = <text>Class A Function Test1() As Integer Dim x As Integer = 5 [|Console.Write(x)|] Return x End Function Private Shared Sub NewMethod(x As Integer) End Sub End Class</text> Dim expected = <text>Class A Function Test1() As Integer Dim x As Integer = 5 NewMethod1(x) Return x End Function Private Shared Sub NewMethod1(x As Integer) Console.Write(x) End Sub Private Shared Sub NewMethod(x As Integer) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539298, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539298")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug5195() As Task Dim code = <text>Imports System Class A Function Test1() As Integer [|Dim i as Integer = 10 Dim j as Integer = 0 Console.Write("hello vb!")|] j = i + 42 Console.Write(j) End Function End Class</text> Dim expected = <text>Imports System Class A Function Test1() As Integer Dim i As Integer = Nothing Dim j As Integer = Nothing NewMethod(i, j) j = i + 42 Console.Write(j) End Function Private Shared Sub NewMethod(ByRef i As Integer, ByRef j As Integer) i = 10 j = 0 Console.Write("hello vb!") End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540003, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540003")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6138() As Task Dim code = <text>Class Test Private _goo As Integer Property Goo As Integer Get Return _goo End Get Set(ByVal value As Integer) [|_goo = value|] End Set End Property End Class </text> Dim expected = <text>Class Test Private _goo As Integer Property Goo As Integer Get Return _goo End Get Set(ByVal value As Integer) NewMethod(value) End Set End Property Private Sub NewMethod(value As Integer) _goo = value End Sub End Class </text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540068, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540068")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6215() As Task Dim code = <text>Module Program Sub Main() [|Dim i As Integer = 1|] i = 2 Console.WriteLine(i) End Sub End Module</text> Dim expected = <text>Module Program Sub Main() Dim i As Integer = NewMethod() i = 2 Console.WriteLine(i) End Sub Private Function NewMethod() As Integer Return 1 End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540072, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540072")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6220() As Task Dim code = <text>Module Program Sub Main() [| Dim i As Integer = 1 |] Console.WriteLine(i) End Sub End Module</text> Dim expected = <text>Module Program Sub Main() Dim i As Integer = NewMethod() Console.WriteLine(i) End Sub Private Function NewMethod() As Integer Return 1 End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540072, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540072")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6220_1() As Task Dim code = <text>Module Program Sub Main() [| Dim i As Integer = 1 ' test |] Console.WriteLine(i) End Sub End Module</text> Dim expected = <text>Module Program Sub Main() Dim i As Integer = NewMethod() Console.WriteLine(i) End Sub Private Function NewMethod() As Integer Return 1 ' test End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540080, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540080")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6230() As Task Dim code = <text>Module Program Sub Main() Dim y As Integer =[| 1 + 1|] End Sub End Module</text> Dim expected = <text>Module Program Sub Main() Dim y As Integer = GetY() End Sub Private Function GetY() As Integer Return 1 + 1 End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540080, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540080")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6230_1() As Task Dim code = <text>Module Program Sub Main() Dim i As Integer [|= 1 + 1|] End Sub End Module</text> Dim expected = <text>Module Program Sub Main() NewMethod() End Sub Private Sub NewMethod() Dim i As Integer = 1 + 1 End Sub End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540063, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540063")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6208() As Task Dim code = <text>Module Program Sub Main() [|'selection Console.Write(4) 'end selection|] End Sub End Module</text> Dim expected = <text>Module Program Sub Main() NewMethod() End Sub Private Sub NewMethod() 'selection Console.Write(4) 'end selection End Sub End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540063, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540063")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6208_1() As Task Dim code = <text>Module Program Sub Main() [|'selection Console.Write(4) 'end selection |] End Sub End Module</text> Dim expected = <text>Module Program Sub Main() NewMethod() End Sub Private Sub NewMethod() 'selection Console.Write(4) 'end selection End Sub End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539915, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539915")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6022() As Task Dim code = <text>Imports System Module Module1 Delegate Function Del(ByVal v As String) As String Sub Main(args As String()) Dim r As Del = [|AddressOf Goo|] Console.WriteLine(r.Invoke("test")) End Sub Function Goo(ByVal value As String) As String Return value End Function End Module</text> Dim expected = <text>Imports System Module Module1 Delegate Function Del(ByVal v As String) As String Sub Main(args As String()) Dim r As Del = GetR() Console.WriteLine(r.Invoke("test")) End Sub Private Function GetR() As Del Return AddressOf Goo End Function Function Goo(ByVal value As String) As String Return value End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539915, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539915")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6022_1() As Task Dim code = <text>Imports System Module Module1 Delegate Function Del(ByVal v As String) As String Sub Main(args As String()) Dim r As Del = AddressOf [|Goo|] Console.WriteLine(r.Invoke("test")) End Sub Function Goo(ByVal value As String) As String Return value End Function End Module</text> Dim expected = <text>Imports System Module Module1 Delegate Function Del(ByVal v As String) As String Sub Main(args As String()) Dim r As Del = GetR() Console.WriteLine(r.Invoke("test")) End Sub Private Function GetR() As Del Return AddressOf Goo End Function Function Goo(ByVal value As String) As String Return value End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(8285, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6310() As Task Dim code = <text>Imports System Module Module1 Sub Main(args As String()) [|If True Then Return|] Console.WriteLine(1) End Sub End Module</text> Dim expected = <text>Imports System Module Module1 Sub Main(args As String()) NewMethod() Return Console.WriteLine(1) End Sub Private Sub NewMethod() If True Then Return End Sub End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(8285, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6310_1() As Task Dim code = <text>Imports System Module Module1 Sub Main(args As String()) If True Then [|If True Then Return|] Console.WriteLine(1) End Sub End Module</text> Dim expected = <text>Imports System Module Module1 Sub Main(args As String()) If True Then NewMethod() : Return Console.WriteLine(1) End Sub Private Sub NewMethod() If True Then Return End Sub End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540151, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540151")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6310_2() As Task Dim code = <text>Imports System Module Module1 Sub Main(args As String()) [|If True Then Return|] End Sub End Module</text> Dim expected = <text>Imports System Module Module1 Sub Main(args As String()) NewMethod() End Sub Private Sub NewMethod() If True Then Return End Sub End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(8285, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6310_3() As Task Dim code = <text>Imports System Module Module1 Sub Main(args As String()) If True Then [|If True Then Return|] End Sub End Module</text> Dim expected = <text>Imports System Module Module1 Sub Main(args As String()) If True Then NewMethod() : Return End Sub Private Sub NewMethod() If True Then Return End Sub End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540338, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540338")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6566() As Task Dim code = <text>Imports System Module Module1 Sub Main(args As String()) Dim s as String = [|Nothing|] End Sub End Module</text> Dim expected = <text>Imports System Module Module1 Sub Main(args As String()) Dim s as String = GetS() End Sub Private Function GetS() As String Return Nothing End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540361, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540361")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix6598() As Task Dim code = <text>Imports System Class C Sub Test() [|Program|] End Sub End Class</text> Dim expected = <text>Imports System Class C Sub Test() NewMethod() End Sub Private Shared Sub NewMethod() Program End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(541671, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541671")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestUnreachableCodeWithReturnStatement() As Task Dim code = <text>Class Test Sub Test() Return [|Dim i As Integer = 1 Dim j As Integer = i|] Return End Sub End Class</text> Dim expected = <text>Class Test Sub Test() Return NewMethod() Return End Sub Private Shared Sub NewMethod() Dim i As Integer = 1 Dim j As Integer = i End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(541671, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541671")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestUnreachableCodeWithExitSub() As Task Dim code = <text>Class Test Sub Test() Return [|Dim i As Integer = 1 Dim j As Integer = i|] Exit Sub End Sub End Class</text> Dim expected = <text>Class Test Sub Test() Return NewMethod() Exit Sub End Sub Private Shared Sub NewMethod() Dim i As Integer = 1 Dim j As Integer = i End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(541671, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541671")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestEmbededStatementWithoutStatementEndToken() As Task Dim code = <text>Module Program Sub Main(args As String()) If True Then Dim i As Integer = 10 : [|i|] = i + 10 Else Dim j As Integer = 45 : j = j + 10 End Sub End Module</text> Dim expected = <text>Module Program Sub Main(args As String()) If True Then Dim i As Integer = 10 : i = NewMethod(i) Else Dim j As Integer = 45 : j = j + 10 End Sub Private Function NewMethod(i As Integer) As Integer i = i + 10 Return i End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(8075, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestFieldInitializer() As Task Dim code = <text>Module Program Dim x As Object = [|Nothing|] Sub Main(args As String()) End Sub End Module</text> Dim expected = <text>Module Program Dim x As Object = GetX() Private Function GetX() As Object Return Nothing End Function Sub Main(args As String()) End Sub End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(541409, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541409"), WorkItem(542687, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542687")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function DontCrashOnInvalidAddressOf() As Task Dim code = <text>Module Program Sub Main(args As String()) End Sub Sub UseThread() Dim t As New System.Threading.Thread(AddressOf [|goo|]) End Sub End Module</text> Await ExpectExtractMethodToFailAsync(code) End Function <WorkItem(541515, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541515")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestDontCrashWhenCanFindOutContainingScopeType() As Task Dim code = <text>Class Program Sub Main() Dim x As New List(Of Program) From {[|New Program|]} End Sub Public Property Name As String End Class</text> Dim expected = <text>Class Program Sub Main() Dim x As New List(Of Program) From {NewMethod()} End Sub Private Shared Function NewMethod() As Program Return New Program End Function Public Property Name As String End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(542512, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542512")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestQueryVariable1() As Task Dim code = <text>Option Infer On Imports System Imports System.Linq Module Program Sub Main(args As String()) Dim x = From [|y|] In "" End Sub End Module</text> Dim expected = <text>Option Infer On Imports System Imports System.Linq Module Program Sub Main(args As String()) Dim x = GetX() End Sub Private Function GetX() As Collections.Generic.IEnumerable(Of Char) Return From y In "" End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(542615, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542615")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestFixedNullExceptionCrash() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Module Program Sub Main(args As String()) Dim x As Integer = 5 If x &gt; 0 Then Else [|Console.Write|] End If End Sub End Module</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Module Program Sub Main(args As String()) Dim x As Integer = 5 If x &gt; 0 Then Else NewMethod() End If End Sub Private Sub NewMethod() Console.Write End Sub End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(542629, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542629")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestLambdaSymbol() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Module Program Sub Apply(a() As Integer, funct As Func(Of Integer, Integer)) For index As Integer = 0 To a.Length - 1 a(index) = funct(a(index)) Next index End Sub Sub Main() Dim a(3) As Integer Dim i As Integer For i = 0 To 3 a(i) = i + 1 Next Apply(a, Function(x As Integer) [|Return x * 2|] End Function) End Sub End Module</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Module Program Sub Apply(a() As Integer, funct As Func(Of Integer, Integer)) For index As Integer = 0 To a.Length - 1 a(index) = funct(a(index)) Next index End Sub Sub Main() Dim a(3) As Integer Dim i As Integer For i = 0 To 3 a(i) = i + 1 Next Apply(a, Function(x As Integer) Return NewMethod(x) End Function) End Sub Private Function NewMethod(x As Integer) As Integer Return x * 2 End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(542511, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542511")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function ExtractMethodOnVariableUsedInWhen() As Task Dim code = <text>Imports System Module Program Sub Main(args As String()) [|Dim s As color|] Try Catch ex As Exception When s = color.blue Console.Write("Exception") End Try End Sub End Module Enum color blue End Enum</text> Await ExpectExtractMethodToFailAsync(code) End Function <WorkItem(542512, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542512")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodOnVariableDeclaredInFrom() As Task Dim code = <text>Imports System Imports System.Linq Module Program Sub Main(args As String()) Dim x = From [|y|] In "" End Sub End Module</text> Dim expected = <text>Imports System Imports System.Linq Module Program Sub Main(args As String()) Dim x = GetX() End Sub Private Function GetX() As Collections.Generic.IEnumerable(Of Char) Return From y In "" End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(542825, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542825")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function DanglingField() As Task Dim code = <text>Dim query1 = From i As Integer In New Integer() {4, 5} Where [|i > 5|] Select i</text> Await ExpectExtractMethodToFailAsync(code) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMultipleNamesLocalDecl() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Module Program Sub Main(args As String()) [|Dim i, i2, i3 As Object = New Object() Dim i4|] lab1: Console.Write(i) GoTo lab1 Console.Write(i2) Console.Write(i3) End Sub End Module</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Module Program Sub Main(args As String()) Dim i, i2 As Object Dim i3 As Object = NewMethod() lab1: Console.Write(i) GoTo lab1 Console.Write(i2) Console.Write(i3) End Sub Private Function NewMethod() As Object Dim i3 As Object = New Object() Dim i4 Return i3 End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(543244, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543244")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestUnreachableUninitialized() As Task Dim code = <text>Option Infer On Imports System Class Program Shared Sub Main() [|Dim x1 As Object SyncLock x1 Return End SyncLock|] System.Threading.Monitor.Exit(x1) End Sub End Class</text> Dim expected = <text>Option Infer On Imports System Class Program Shared Sub Main() Dim x1 As Object = Nothing NewMethod(x1) Return System.Threading.Monitor.Exit(x1) End Sub Private Shared Sub NewMethod(ByRef x1 As Object) SyncLock x1 Return End SyncLock End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(543053, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543053")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestAddBlankLineBetweenMethodAndType() As Task Dim code = <text>Class Program Private Shared Sub Main(args As String()) Dim i As Integer = 2 Dim c As New C(Of Integer)([|i|]) End Sub Private Class C(Of T) Private v As Integer Public Sub New(ByRef v As Integer) Me.v = v End Sub End Class End Class</text> Dim expected = <text>Class Program Private Shared Sub Main(args As String()) Dim i As Integer = 2 NewMethod(i) End Sub Private Shared Sub NewMethod(i As Integer) Dim c As New C(Of Integer)(i) End Sub Private Class C(Of T) Private v As Integer Public Sub New(ByRef v As Integer) Me.v = v End Sub End Class End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(543047, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543047")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestResourceDeclaredOutside() As Task Dim code = <text>Option Infer On Option Strict Off Class C1 Shared Sub main() [|Dim mnObj As MyManagedClass Using mnObj End Using|] End Sub End Class Structure MyManagedClass Implements IDisposable Sub Dispose() Implements System.IDisposable.Dispose Console.Write("Dispose") End Sub End Structure</text> Dim expected = <text>Option Infer On Option Strict Off Class C1 Shared Sub main() NewMethod() End Sub Private Shared Sub NewMethod() Dim mnObj As MyManagedClass Using mnObj End Using End Sub End Class Structure MyManagedClass Implements IDisposable Sub Dispose() Implements System.IDisposable.Dispose Console.Write("Dispose") End Sub End Structure</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(528962, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/528962")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestFunctionCallWithFunctionName() As Task Dim code = <text>Option Infer On Imports System Class Program Shared Sub Main(args As String()) factorial(4) End Sub Shared Function factorial(ByVal x As Integer) As Integer [| factorial = x * factorial(x - 1) * x|] End Function End Class </text> Dim expected = <text>Option Infer On Imports System Class Program Shared Sub Main(args As String()) factorial(4) End Sub Shared Function factorial(ByVal x As Integer) As Integer factorial = NewMethod(x) End Function Private Shared Function NewMethod(x As Integer) As Integer Return x * factorial(x - 1) * x End Function End Class </text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(543244, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543244")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function ExtractMethodForBadCode() As Task Dim code = <text>Module M1 WriteOnly Property Age() As Integer Set(ByVal Value As Integer) Dim a, b, c As [|Object =|] New Object() lab1: SyncLock a GoTo lab1 End SyncLock Console.WriteLine(b) Console.WriteLine(c) End Set End Property End Module </text> Await ExpectExtractMethodToFailAsync(code) End Function <WorkItem(10878, "DevDiv_Projects/Roslyn")> <WorkItem(544408, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544408")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function ExtractMethodForBranchOutFromSyncLock() As Task Dim code = <text>Imports System Class Program Shared Sub Main(args As String()) SyncLock Sub() [|Exit While|] End Function End SyncLock End Sub End Class</text> Await ExpectExtractMethodToFailAsync(code) End Function <WorkItem(543304, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543304")> <WorkItem(544408, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544408")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function ExtractMethodForLambdaInSyncLock() As Task Dim code = <text>Imports System Class Program Public Shared Sub Main(args As String()) SyncLock Function(ByRef int As [|Integer|]) SyncLock x End SyncLock End Function End SyncLock End Sub End Class</text> Await ExpectExtractMethodToFailAsync(code) End Function <WorkItem(543320, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543320")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodForBadRegion() As Task Dim code = <text>Imports System Class Test Public Shared Sub Main() Dim x(1, 2) As Integer = New Integer[|(,)|] {{1}, {2}} End Sub End Class </text> Dim expected = <text>Imports System Class Test Public Shared Sub Main() Dim x(1, 2) As Integer = GetX() End Sub Private Shared Function GetX() As Integer(,) Return New Integer(,) {{1}, {2}} End Function End Class </text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(543320, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543320")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodForBadRegion_1() As Task Dim code = <text>Imports System Class Test Public Shared Sub Main() Dim y(1, 2) = [|New Integer|] End Sub End Class </text> Dim expected = <text>Imports System Class Test Public Shared Sub Main() Dim y(1, 2) = GetY() End Sub Private Shared Function GetY() As Integer Return New Integer End Function End Class </text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(543362, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543362")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function ExtractMethodForBadRegion_2() As Task Dim code = <text>Imports System Class Test Public Shared Sub Main() Dim y(,) = New Integer(,) {{[|From|]}} End Function End Class </text> Await ExpectExtractMethodToFailAsync(code) End Function <WorkItem(543244, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543244")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodForSynclockBlockContainsReturn() As Task Dim code = <text>Option Infer On Imports System Class Program Shared Sub Main() [|Dim x1 As Object SyncLock x1 Return End SyncLock|] System.Threading.Monitor.Exit(x1) End Sub End Class </text> Dim expected = <text>Option Infer On Imports System Class Program Shared Sub Main() Dim x1 As Object = Nothing NewMethod(x1) Return System.Threading.Monitor.Exit(x1) End Sub Private Shared Sub NewMethod(ByRef x1 As Object) SyncLock x1 Return End SyncLock End Sub End Class </text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(543244, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543244")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodForUsingBlockContainsReturn() As Task Dim code = <text>Imports System Option Infer On Imports System Class Program Shared Sub Main() [|Dim x1 As C1 Using x1 Return End Using|] System.Threading.Monitor.Exit(x1) End Sub End Class Class C1 Implements IDisposable Public Sub Dispose Implements IDisposable.Dispose End Sub End Class</text> Dim expected = <text>Imports System Option Infer On Imports System Class Program Shared Sub Main() Dim x1 As C1 = Nothing NewMethod(x1) Return System.Threading.Monitor.Exit(x1) End Sub Private Shared Sub NewMethod(ByRef x1 As C1) Using x1 Return End Using End Sub End Class Class C1 Implements IDisposable Public Sub Dispose Implements IDisposable.Dispose End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(543244, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543244")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodExitInLambda() As Task Dim code = <text>Imports System Option Infer On Option Strict On Imports System Class Program Shared Sub Main() Dim myLock As Object [|SyncLock Sub() myLock = New Object() Exit Sub End Sub End SyncLock|] End Sub End Class</text> Dim expected = <text>Imports System Option Infer On Option Strict On Imports System Class Program Shared Sub Main() Dim myLock As Object myLock = NewMethod(myLock) End Sub Private Shared Function NewMethod(myLock As Object) As Object SyncLock Sub() myLock = New Object() Exit Sub End Sub End SyncLock Return myLock End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(543332, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543332")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodExitInLambda_2() As Task Dim code = <text>Imports System Option Infer On Option Strict On Imports System Class Program Shared Sub Main() Dim myLock As Object [|SyncLock Function() myLock = New Object() Exit Function Return Nothing End Function End SyncLock|] End Sub End Class</text> Dim expected = <text>Imports System Option Infer On Option Strict On Imports System Class Program Shared Sub Main() Dim myLock As Object myLock = NewMethod(myLock) End Sub Private Shared Function NewMethod(myLock As Object) As Object SyncLock Function() myLock = New Object() Exit Function Return Nothing End Function End SyncLock Return myLock End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(543334, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543334")> <WorkItem(11186, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function ExtractMethodExitInLambda_3() As Task Dim code = <text>Imports System Public Class Program Shared Sub goo() Dim syncroot As Object = New Object SyncLock syncroot SyncLock Sub x [|Exit Sub|] End Function End SyncLock End SyncLock End Sub End Class </text> Await ExpectExtractMethodToFailAsync(code) End Function <WorkItem(543096, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543096")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestSelectCaseExpr() As Task Dim code = <text> Module Program Sub Main(args As String()) Select Case [|5|] Case 5 Console.Write(5) End Select End Sub End Module</text> Dim expected = <text> Module Program Sub Main(args As String()) Select Case NewMethod() Case 5 Console.Write(5) End Select End Sub Private Function NewMethod() As Integer Return 5 End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(542800, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542800")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestOutmostXmlElement() As Task Dim code = <text>Imports System Imports System.Xml.Linq Module Program Sub Main(args As String()) Dim x = [|&lt;x&gt;&lt;/x&gt;|] End Sub End Module</text> Dim expected = <text>Imports System Imports System.Xml.Linq Module Program Sub Main(args As String()) Dim x = GetX() End Sub Private Function GetX() As XElement Return &lt;x&gt;&lt;/x&gt; End Function End Module</text> Await TestExtractMethodAsync(code, expected, metadataReference:=GetType(System.Xml.Linq.XElement).Assembly.Location) End Function <WorkItem(13658, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodForElementInitializers() As Task Dim code = <text> Module Module1 Property Prop As New List(Of String) From {[|"One"|], "two"} End Module</text> Dim expected = <text> Module Module1 Property Prop As New List(Of String) From {NewMethod(), "two"} Private Function NewMethod() As String Return "One" End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(529967, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/529967")> <Fact(), Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractObjectArray() As Task Dim code = <text>Imports System Module Program Sub Main(args As String()) Dim o3 As Object = "hi" Dim col1 = [|{o3, o3}|] End Sub End Module</text> Dim expected = <text>Imports System Module Program Sub Main(args As String()) Dim o3 As Object = "hi" Dim col1 = GetCol1(o3) End Sub Private Function GetCol1(o3 As Object) As Object() Return {o3, o3} End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(669341, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/669341")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestStructure1() As Task Dim code = <text>Structure XType Public Y As YType End Structure Structure YType Public Z As ZType End Structure Structure ZType Public Value As Integer End Structure Module Program Sub Main(args As String()) Dim x As XType Dim value = [|x.Y|].Z.Value With x .Y.Z.Value += 1 End With End Sub End Module</text> Dim expected = <text>Structure XType Public Y As YType End Structure Structure YType Public Z As ZType End Structure Structure ZType Public Value As Integer End Structure Module Program Sub Main(args As String()) Dim x As XType Dim value = GetY(x).Z.Value With x .Y.Z.Value += 1 End With End Sub Private Function GetY(ByRef x As XType) As YType Return x.Y End Function End Module</text> Await TestExtractMethodAsync(code, expected, dontPutOutOrRefOnStruct:=False) End Function <WorkItem(529266, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/529266")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestStructure2() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Structure SSSS3 Public A As String Public B As Integer End Structure Structure SSSS2 Public S3 As SSSS3 End Structure Structure SSSS Public S2 As SSSS2 End Structure Structure SSS Public S As SSSS End Structure Class Clazz Sub TEST() Dim x As New SSS() [|x.S|].S2.S3.A = "1" End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Structure SSSS3 Public A As String Public B As Integer End Structure Structure SSSS2 Public S3 As SSSS3 End Structure Structure SSSS Public S2 As SSSS2 End Structure Structure SSS Public S As SSSS End Structure Class Clazz Sub TEST() Dim x As New SSS() GetS(x).S2.S3.A = "1" End Sub Private Shared Function GetS(ByRef x As SSS) As SSSS Return x.S End Function End Class</text> Await TestExtractMethodAsync(code, expected, dontPutOutOrRefOnStruct:=False) End Function End Class End Class End Namespace
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.ExtractMethod Partial Public Class ExtractMethodTests ''' <summary> ''' This contains tests for Extract Method scenarios that depend on Data Flow Analysis API ''' Implements scenarios outlined in /Services/CSharp/Impl/Refactoring/ExtractMethod/ExtractMethodMatrix.xlsx ''' </summary> ''' <remarks></remarks> <[UseExportProvider]> Public Class DataFlowPass <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod1() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) [|Dim i As Integer i = 10|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) NewMethod() End Sub Private Shared Sub NewMethod() Dim i As Integer = 10 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod2() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) [|Dim i As Integer = 10 Dim i2 As Integer = 10|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) NewMethod() End Sub Private Shared Sub NewMethod() Dim i As Integer = 10 Dim i2 As Integer = 10 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod3() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer = 10 [|Dim i2 As Integer = i|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer = 10 NewMethod(i) End Sub Private Shared Sub NewMethod(i As Integer) Dim i2 As Integer = i End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod4() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer = 10 Dim i2 As Integer = i [|i2 += i|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer = 10 Dim i2 As Integer = i i2 = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer, i2 As Integer) As Integer i2 += i Return i2 End Function End Class</text> Await TestExtractMethodAsync(code, expected, temporaryFailing:=True) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod5() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer = 10 Dim i2 As Integer = i [|i2 = i|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer = 10 Dim i2 As Integer = i i2 = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod6() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Dim field As Integer Sub Test(args As String()) Dim i As Integer = 10 [|field = i|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Dim field As Integer Sub Test(args As String()) Dim i As Integer = 10 NewMethod(i) End Sub Private Sub NewMethod(i As Integer) field = i End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod7() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim a As String() = Nothing [|Test(a)|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim a As String() = Nothing NewMethod(a) End Sub Private Sub NewMethod(a() As String) Test(a) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod8() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Test(args As String()) Dim a As String() = Nothing [|Test(a)|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Test(args As String()) Dim a As String() = Nothing NewMethod(a) End Sub Private Shared Sub NewMethod(a() As String) Test(a) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod9() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer Dim s As String [|i = 10 s = args(0) + i.ToString()|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer Dim s As String NewMethod(args, i, s) End Sub Private Shared Sub NewMethod(args() As String, ByRef i As Integer, ByRef s As String) i = 10 s = args(0) + i.ToString() End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod10() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) [|Dim i As Integer i = 10 Dim s As String s = args(0) + i.ToString()|] Console.WriteLine(s) End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim s As String = NewMethod(args) Console.WriteLine(s) End Sub Private Shared Function NewMethod(args() As String) As String Dim i As Integer = 10 Dim s As String s = args(0) + i.ToString() Return s End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod11() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) [|Dim i As Integer Dim i2 As Integer = 10|] i = 10 End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer NewMethod() i = 10 End Sub Private Shared Sub NewMethod() Dim i2 As Integer = 10 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod11_1() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) [|Dim i As Integer Dim i2 As Integer = 10|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) NewMethod() End Sub Private Shared Sub NewMethod() Dim i As Integer Dim i2 As Integer = 10 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod12() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer = 10 [|i = i + 1|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer = 10 i = NewMethod(i) Console.WriteLine(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer i = i + 1 Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod13() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) For Each s In args [|Console.WriteLine(s)|] Next End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) For Each s In args NewMethod(s) Next End Sub Private Shared Sub NewMethod(s As String) Console.WriteLine(s) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod14() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) i = 1 While i &lt; 10 [|Console.WriteLine(i)|] i = i + 1 End While End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) i = 1 While i &lt; 10 NewMethod(i) i = i + 1 End While End Sub Private Shared Sub NewMethod(i As Integer) Console.WriteLine(i) End Sub End Class</text> Await TestExtractMethodAsync(code, expected, temporaryFailing:=True) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod15() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) [|Dim s As Integer = 10, i As Integer = 1 Dim b As Integer = s + i|] System.Console.WriteLine(s) System.Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim s As Integer = Nothing Dim i As Integer = Nothing NewMethod(s, i) System.Console.WriteLine(s) System.Console.WriteLine(i) End Sub Private Shared Sub NewMethod(ByRef s As Integer, ByRef i As Integer) s = 10 i = 1 Dim b As Integer = s + i End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod16() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) [|Dim i As Integer = 1|] System.Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(args As String()) Dim i As Integer = NewMethod() System.Console.WriteLine(i) End Sub Private Shared Function NewMethod() As Integer Return 1 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539197, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539197")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod17() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(Of T)(ByRef t2 As T) [|Dim t1 As T Test(t1) t2 = t1|] System.Console.WriteLine(t1.ToString()) End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(Of T)(ByRef t2 As T) Dim t1 As T = Nothing NewMethod(t2, t1) System.Console.WriteLine(t1.ToString()) End Sub Private Sub NewMethod(Of T)(ByRef t2 As T, ByRef t1 As T) Test(t1) t2 = t1 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(527775, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/527775")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod18() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(Of T)(ByRef t3 As T) [|Dim t1 As T = GetValue(t3)|] System.Console.WriteLine(t1.ToString()) End Sub Private Function GetValue(Of T)(ByRef t2 As T) As T Return t2 End Function End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(Of T)(ByRef t3 As T) Dim t1 As T = Nothing NewMethod(t3, t1) System.Console.WriteLine(t1.ToString()) End Sub Private Sub NewMethod(Of T)(ByRef t3 As T, ByRef t1 As T) t1 = GetValue(t3) End Sub Private Function GetValue(Of T)(ByRef t2 As T) As T Return t2 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod19() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test() [|Dim i As Integer = 1|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test() NewMethod() End Sub Private Shared Sub NewMethod() Dim i As Integer = 1 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod20() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Module Program Sub Test() [|Dim i As Integer = 1|] End Sub End Module</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Module Program Sub Test() NewMethod() End Sub Private Sub NewMethod() Dim i As Integer = 1 End Sub End Module</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod21() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test() [|Dim i As Integer = 1|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test() NewMethod() End Sub Private Shared Sub NewMethod() Dim i As Integer = 1 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod22() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test() Dim i As Integer [|Dim b As Integer = 10 If b &lt; 10 i = 5 End If|] i = 6 Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test() Dim i As Integer i = NewMethod(i) i = 6 Console.WriteLine(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Dim b As Integer = 10 If b &lt; 10 i = 5 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod23() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main(args As String()) If True [|Console.WriteLine(args(0).ToString())|] End If End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main(args As String()) If True NewMethod(args) End If End Sub Private Shared Sub NewMethod(args() As String) Console.WriteLine(args(0).ToString()) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod24() As Task Dim code = <text>Imports System Class Program Shared Sub Main(args As String()) Dim y As Integer = [|Integer.Parse(args(0).ToString())|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main(args As String()) Dim y As Integer = GetY(args) End Sub Private Shared Function GetY(args() As String) As Integer Return Integer.Parse(args(0).ToString()) End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod25() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main(args As String()) If([|New Integer(){ 1, 2, 3 }|]).Any() Then Return End If End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main(args As String()) If (NewMethod()).Any() Then Return End If End Sub Private Shared Function NewMethod() As Integer() Return New Integer() {1, 2, 3} End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod26() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main(args As String()) If [|(New Integer(){ 1, 2, 3 })|].Any() Return End If End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main(args As String()) If NewMethod().Any() Return End If End Sub Private Shared Function NewMethod() As Integer() Return (New Integer() {1, 2, 3}) End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod27() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test() Dim i As Integer = 1 [|Dim b As Integer = 10 If b &lt; 10 i = 5 End If|] i = 6 Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test() Dim i As Integer = 1 i = NewMethod(i) i = 6 Console.WriteLine(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Dim b As Integer = 10 If b &lt; 10 i = 5 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540046, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540046")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod28() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Function Test() As Integer [|Return 1|] End Function End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Function Test() As Integer Return NewMethod() End Function Private Shared Function NewMethod() As Integer Return 1 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540046, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540046")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod29() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Function Test() As Integer Dim i As Integer = 0 [|If i &lt; 0 Return 1 Else Return 0 End If|] End Function End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Function Test() As Integer Dim i As Integer = 0 Return NewMethod(i) End Function Private Shared Function NewMethod(i As Integer) As Integer If i &lt; 0 Return 1 Else Return 0 End If End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod30() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(ByRef i As Integer) [|i = 10|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Sub Test(ByRef i As Integer) i = NewMethod() End Sub Private Shared Function NewMethod() As Integer Return 10 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod31() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Text Class Program Sub Test() Dim builder As StringBuilder = New StringBuilder() [|builder.Append("Hello") builder.Append("From") builder.Append("Roslyn")|] Return builder.ToString() End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Text Class Program Sub Test() Dim builder As StringBuilder = New StringBuilder() NewMethod(builder) Return builder.ToString() End Sub Private Shared Sub NewMethod(builder As StringBuilder) builder.Append("Hello") builder.Append("From") builder.Append("Roslyn") End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod32() As Task Dim code = <text>Imports System Class Program Sub Test() Dim v As Integer = 0 Console.Write([|v|]) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test() Dim v As Integer = 0 Console.Write(GetV(v)) End Sub Private Shared Function GetV(v As Integer) As Integer Return v End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod34() As Task Dim code = <text>Imports System Class Program Shared Sub Main(args As String()) Dim x As Integer = 1 Dim y As Integer = 2 Dim z As Integer = [|x + y|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main(args As String()) Dim x As Integer = 1 Dim y As Integer = 2 Dim z As Integer = GetZ(x, y) End Sub Private Shared Function GetZ(x As Integer, y As Integer) As Integer Return x + y End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538239, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538239")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod35() As Task Dim code = <text>Imports System Class Program Shared Sub Main(args As String()) Dim r As Integer() = [|New Integer(){ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 }|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main(args As String()) Dim r As Integer() = GetR() End Sub Private Shared Function GetR() As Integer() Return New Integer() {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20} End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod36() As Task Dim code = <text>Imports System Class Program Shared Sub Main(ByRef i As Integer) [|i = 1|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main(ByRef i As Integer) i = NewMethod() End Sub Private Shared Function NewMethod() As Integer Return 1 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod37() As Task Dim code = <text>Imports System Class Program Shared Sub Main(ByRef i As Integer) [|i = 1|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main(ByRef i As Integer) i = NewMethod() End Sub Private Shared Function NewMethod() As Integer Return 1 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538231, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538231")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod38() As Task Dim code = <text>Imports System Class Program Shared Sub Main(args As String()) &apos; int v = 0; &apos; while (true) Dim unassigned As Integer &apos; { &apos; NewMethod(v++); [|unassigned = unassigned + 10|] &apos; NewMethod(ReturnVal(v++)); &apos; } End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main(args As String()) ' int v = 0; ' while (true) Dim unassigned As Integer ' { ' NewMethod(v++); unassigned = NewMethod(unassigned) ' NewMethod(ReturnVal(v++)); ' } End Sub Private Shared Function NewMethod(unassigned As Integer) As Integer unassigned = unassigned + 10 Return unassigned End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538231, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538231")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod39() As Task Dim code = <text>Imports System Class Program Shared Sub Main(args As String()) &apos; int v = 0; &apos; while (true) Dim unassigned As Integer &apos; { [|&apos; NewMethod(v++); unassigned = unassigned + 10 &apos; NewMethod(ReturnVal(v++));|] &apos; } End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main(args As String()) ' int v = 0; ' while (true) Dim unassigned As Integer ' { unassigned = NewMethod(unassigned) ' } End Sub Private Shared Function NewMethod(unassigned As Integer) As Integer ' NewMethod(v++); unassigned = unassigned + 10 ' NewMethod(ReturnVal(v++)); Return unassigned End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538303, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538303")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function ExtractMethod40() As Task Dim code = <text>Class Program Shared Sub Main(args As String()) [|Dim x As Integer|] End Sub End Class</text> Await ExpectExtractMethodToFailAsync(code) End Function <WorkItem(538314, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538314")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod41() As Task Dim code = <text>Class Program Shared Sub Main(args As String()) Dim x As Integer = 10 [|Dim y As Integer If x = 10 y = 5 End If|] Console.WriteLine(y) End Sub End Class</text> Dim expected = <text>Class Program Shared Sub Main(args As String()) Dim x As Integer = 10 Dim y As Integer = NewMethod(x) Console.WriteLine(y) End Sub Private Shared Function NewMethod(x As Integer) As Integer Dim y As Integer If x = 10 y = 5 End If Return y End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(527499, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/527499")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix3992() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Integer = 1 [|While False Console.WriteLine(x) End While|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Integer = 1 NewMethod(x) End Sub Private Shared Sub NewMethod(x As Integer) While False Console.WriteLine(x) End While End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538327, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538327")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod42() As Task Dim code = <text>Imports System Class Program Shared Sub Main(args As String()) Dim a As Integer, b As Integer [|a = 5 b = 7|] Console.Write(a + b) End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main(args As String()) Dim a As Integer, b As Integer NewMethod(a, b) Console.Write(a + b) End Sub Private Shared Sub NewMethod(ByRef a As Integer, ByRef b As Integer) a = 5 b = 7 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538327, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538327")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod43() As Task Dim code = <text>Imports System Class Program Shared Sub Main(args As String()) Dim a As Integer, b As Integer [|a = 5 b = 7 Dim c As Integer Dim d As Integer Dim e As Integer, f As Integer c = 1 d = 1 e = 1 f = 1|] Console.Write(a + b) End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main(args As String()) Dim a As Integer, b As Integer NewMethod(a, b) Console.Write(a + b) End Sub Private Shared Sub NewMethod(ByRef a As Integer, ByRef b As Integer) a = 5 b = 7 Dim c As Integer Dim d As Integer Dim e As Integer, f As Integer c = 1 d = 1 e = 1 f = 1 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538328, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538328")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod44() As Task Dim code = <text>Imports System Class Program Shared Sub Main(args As String()) Dim a As Integer &apos; comment [|a = 1|] &apos; comment Console.Write(a) End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main(args As String()) Dim a As Integer &apos; comment a = NewMethod() &apos; comment Console.Write(a) End Sub Private Shared Function NewMethod() As Integer Return 1 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538393, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538393")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod46() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Integer = 1 [|Goo(x)|] Console.WriteLine(x) End Sub Shared Sub Goo(ByRef x As Integer) x = x + 1 End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Integer = 1 x = NewMethod(x) Console.WriteLine(x) End Sub Private Shared Function NewMethod(x As Integer) As Integer Goo(x) Return x End Function Shared Sub Goo(ByRef x As Integer) x = x + 1 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538399, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538399")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod47() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Integer = 1 [|While True Console.WriteLine(x) End While|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Integer = 1 NewMethod(x) End Sub Private Shared Sub NewMethod(x As Integer) While True Console.WriteLine(x) End While End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538401, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538401")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod48() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Integer() = [|{ 1, 2, 3 }|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Integer() = GetX() End Sub Private Shared Function GetX() As Integer() Return {1, 2, 3} End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538405, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538405")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethod49() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Goo(GetX As Integer) Dim x As Integer = [|1|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Goo(GetX As Integer) Dim x As Integer = GetX1() End Sub Private Shared Function GetX1() As Integer Return 1 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodNormalProperty() As Task Dim code = <text>Class [Class] Private Shared name As String Public Shared Property Names As String Get Return 1 End Get Set name = value End Set End Property Shared Sub Goo(i As Integer) Dim str As String = [|[Class].Names|] End Sub End Class</text> Dim expected = <text>Class [Class] Private Shared name As String Public Shared Property Names As String Get Return 1 End Get Set name = value End Set End Property Shared Sub Goo(i As Integer) Dim str As String = GetStr() End Sub Private Shared Function GetStr() As String Return [Class].Names End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538932, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538932")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodAutoProperty() As Task Dim code = <text>Class [Class] Public Property Name As String Shared Sub Main() Dim str As String = New [Class]().[|Name|] End Sub End Class</text> Dim expected = <text>Class [Class] Public Property Name As String Shared Sub Main() Dim str As String = GetStr() End Sub Private Shared Function GetStr() As String Return New [Class]().Name End Function End Class</text> ' given span is not an expression, use suggestion Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538402, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538402")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix3994() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Byte = [|1|] End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Byte = GetX() End Sub Private Shared Function GetX() As Byte Return 1 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538404, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538404")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix3996() As Task Dim code = <text>Class A(Of T) Class D Inherits A(Of T) End Class Class B End Class Shared Function Goo() As D.B Return Nothing End Function Class C(Of T2) Shared Sub Bar() Dim x As D.B = [|Goo()|] End Sub End Class End Class</text> Dim expected = <text>Class A(Of T) Class D Inherits A(Of T) End Class Class B End Class Shared Function Goo() As D.B Return Nothing End Function Class C(Of T2) Shared Sub Bar() Dim x As D.B = GetX() End Sub Private Shared Function GetX() As B Return Goo() End Function End Class End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestInsertionPoint() As Task Dim code = <text>Class Test Sub Method(i As String) Dim y2 As Integer = [|1|] End Sub Sub Method(i As Integer) End Sub End Class</text> Dim expected = <text>Class Test Sub Method(i As String) Dim y2 As Integer = GetY2() End Sub Private Shared Function GetY2() As Integer Return 1 End Function Sub Method(i As Integer) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538980, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538980")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4757() As Task Dim code = <text>Class GenericMethod Sub Method(Of T)(t1 As T) Dim a As T [|a = t1|] End Sub End Class</text> Dim expected = <text>Class GenericMethod Sub Method(Of T)(t1 As T) Dim a As T a = NewMethod(t1) End Sub Private Shared Function NewMethod(Of T)(t1 As T) As T Return t1 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538980, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538980")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4757_2() As Task Dim code = <text>Class GenericMethod(Of T1) Sub Method(Of T)(t1 As T) Dim a As T Dim b As T1 [|a = t1 b = Nothing|] End Sub End Class</text> Dim expected = <text>Class GenericMethod(Of T1) Sub Method(Of T)(t1 As T) Dim a As T Dim b As T1 NewMethod(t1, a, b) End Sub Private Shared Sub NewMethod(Of T)(t1 As T, ByRef a As T, ByRef b As T1) a = t1 b = Nothing End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538980, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538980")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4757_3() As Task Dim code = <text>Class GenericMethod Sub Method(Of T, T1)(t1 As T) Dim a1 As T1 Dim a As T [|a = t1 a1 = Nothing|] End Sub End Class</text> Dim expected = <text>Class GenericMethod Sub Method(Of T, T1)(t1 As T) Dim a1 As T1 Dim a As T NewMethod(t1, a1, a) End Sub Private Shared Sub NewMethod(Of T, T1)(t1 As T, ByRef a1 As T1, ByRef a As T) a = t1 a1 = Nothing End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538422, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538422")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4758() As Task Dim code = <text>Imports System Class TestOutParameter Sub Method(ByRef x As Integer) x = 5 Console.Write([|x|]) End Sub End Class</text> Dim expected = <text>Imports System Class TestOutParameter Sub Method(ByRef x As Integer) x = 5 Console.Write(GetX(x)) End Sub Private Shared Function GetX(x As Integer) As Integer Return x End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538422, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538422")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4758_2() As Task Dim code = <text>Class TestOutParameter Sub Method(ByRef x As Integer) x = 5 Console.Write([|x|]) End Sub End Class</text> Dim expected = <text>Class TestOutParameter Sub Method(ByRef x As Integer) x = 5 Console.Write(GetX(x)) End Sub Private Shared Function GetX(x As Integer) As Integer Return x End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538984, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538984")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4761() As Task Dim code = <text>Class A Sub Method() Dim a As System.Func(Of Integer, Integer) = Function(x) [|x * x|] End Sub End Class</text> Dim expected = <text>Class A Sub Method() Dim a As System.Func(Of Integer, Integer) = Function(x) NewMethod(x) End Sub Private Shared Function NewMethod(x As Integer) As Integer Return x * x End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538997, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538997")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4779() As Task Dim code = <text>Imports System Class Program Shared Sub Main() Dim s As String = "" Dim f As Func(Of String) = [|s|].ToString End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main() Dim s As String = "" Dim f As Func(Of String) = GetS(s).ToString End Sub Private Shared Function GetS(s As String) As String Return s End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538997, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538997")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4779_2() As Task Dim code = <text>Imports System Class Program Shared Sub Main() Dim s As String = "" Dim f = [|s|].ToString() End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main() Dim s As String = "" Dim f = GetS(s).ToString() End Sub Private Shared Function GetS(s As String) As String Return s End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(4780, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4780() As Task Dim code = <text>Imports System Class Program Shared Sub Main() Dim s As String = "" Dim f As Object = DirectCast([|s.ToString|], Func(Of String)) End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main() Dim s As String = "" Dim f As Object = DirectCast(GetToString(s), Func(Of String)) End Sub Private Shared Function GetToString(s As String) As Func(Of String) Return s.ToString End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539201, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539201")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4780_2() As Task Dim code = <text>Imports System Class Program Shared Sub Main() Dim s As String = "" Dim f As Object = DirectCast([|s.ToString()|], String) End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main() Dim s As String = "" Dim f As Object = DirectCast(NewMethod(s), String) End Sub Private Shared Function NewMethod(s As String) As String Return s.ToString() End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539201, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539201")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4780_3() As Task Dim code = <text>Imports System Class Program Shared Sub Main() Dim s As String = "" Dim f As Object = TryCast([|s.ToString()|], String) End Sub End Class</text> Dim expected = <text>Imports System Class Program Shared Sub Main() Dim s As String = "" Dim f As Object = TryCast(NewMethod(s), String) End Sub Private Shared Function NewMethod(s As String) As String Return s.ToString() End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(4782, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function BugFix4782_2() As Task Dim code = <text>Class A(Of T) Class D Inherits A(Of T()) End Class Class B End Class Class C(Of T) Shared Sub Goo() Dim x As D.B = [|New D.B()|] End Sub End Class End Class</text> Await ExpectExtractMethodToFailAsync(code) End Function <WorkItem(4791, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4791() As Task Dim code = <text>Class Program Delegate Function Func(a As Integer) As Integer Shared Sub Main(args As String()) Dim v As Func = Function(a As Integer) [|a|] End Sub End Class</text> Dim expected = <text>Class Program Delegate Function Func(a As Integer) As Integer Shared Sub Main(args As String()) Dim v As Func = Function(a As Integer) GetA(a) End Sub Private Shared Function GetA(a As Integer) As Integer Return a End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539019, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539019")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4809() As Task Dim code = <text>Class Program Public Sub New() [|Dim x As Integer = 2|] End Sub End Class</text> Dim expected = <text>Class Program Public Sub New() NewMethod() End Sub Private Shared Sub NewMethod() Dim x As Integer = 2 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(551797, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/551797")> <WorkItem(539029, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539029")> <WpfFact(Skip:="551797"), Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4813() As Task Dim code = <text>Imports System Class Program Public Sub New() Dim o As [Object] = [|New Program()|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Public Sub New() Dim o As [Object] = GetO() End Sub Private Shared Function GetO() As Program Return New Program() End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538425, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538425")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4031() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Boolean = True, y As Boolean = True, z As Boolean = True If x While y End While Else [|While z End While|] End If End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Class Program Shared Sub Main() Dim x As Boolean = True, y As Boolean = True, z As Boolean = True If x While y End While Else NewMethod(z) End If End Sub Private Shared Sub NewMethod(z As Boolean) While z End While End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539029, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539029")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4823() As Task Dim code = <text>Class Program Private area As Double = 1.0 Public ReadOnly Property Area As Double Get Return area End Get End Property Public Overrides Function ToString() As String Return String.Format("{0:F2}", [|Area|]) End Function End Class</text> Dim expected = <text>Class Program Private area As Double = 1.0 Public ReadOnly Property Area As Double Get Return area End Get End Property Public Overrides Function ToString() As String Return String.Format("{0:F2}", GetArea()) End Function Private Function GetArea() As Double Return Area End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538985, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538985")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4762() As Task Dim code = <text>Class Program Shared Sub Main(args As String()) &apos;comments [|Dim x As Integer = 2|] End Sub End Class</text> Dim expected = <text>Class Program Shared Sub Main(args As String()) &apos;comments NewMethod() End Sub Private Shared Sub NewMethod() Dim x As Integer = 2 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(538966, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538966")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix4744() As Task Dim code = <text>Class Program Shared Sub Main(args As String()) [|Dim x As Integer = 2 &apos;comments|] End Sub End Class</text> Dim expected = <text>Class Program Shared Sub Main(args As String()) NewMethod() End Sub Private Shared Sub NewMethod() Dim x As Integer = 2 &apos;comments End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539049, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539049")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodInProperty1() As Task Dim code = <text>Class C2 Shared Public ReadOnly Property Area As Integer Get Return 1 End Get End Property End Class Class C3 Public Shared ReadOnly Property Area As Integer Get Return [|C2.Area|] End Get End Property End Class</text> Dim expected = <text>Class C2 Shared Public ReadOnly Property Area As Integer Get Return 1 End Get End Property End Class Class C3 Public Shared ReadOnly Property Area As Integer Get Return GetArea() End Get End Property Private Shared Function GetArea() As Integer Return C2.Area End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539049, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539049")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodInProperty2() As Task Dim code = <text>Class C3 Public Shared ReadOnly Property Area As Integer Get [|Dim i As Integer = 10 Return i|] End Get End Property End Class</text> Dim expected = <text>Class C3 Public Shared ReadOnly Property Area As Integer Get Return NewMethod() End Get End Property Private Shared Function NewMethod() As Integer Return 10 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539049, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539049")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodInProperty3() As Task Dim code = <text>Class C3 Public Shared WriteOnly Property Area As Integer Set(value As Integer) [|Dim i As Integer = value|] End Set End Property End Class</text> Dim expected = <text>Class C3 Public Shared WriteOnly Property Area As Integer Set(value As Integer) NewMethod(value) End Set End Property Private Shared Sub NewMethod(value As Integer) Dim i As Integer = value End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoNoNoYesNoNo() As Task Dim code = <text>Imports System Class Program Sub Test1() Dim i As Integer [|If Integer.Parse(1) &gt; 0 i = 10 End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test1() Dim i As Integer i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer If Integer.Parse(1) &gt; 0 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoNoNoYesNoYes() As Task Dim code = <text>Imports System Class Program Sub Test2() Dim i As Integer = 0 [|If Integer.Parse(1) &gt; 0 i = 10 End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test2() Dim i As Integer = 0 i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer If Integer.Parse(1) &gt; 0 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoNoNoYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test3() Dim i As Integer While i &gt; 10 End While [|If Integer.Parse(1) &gt; 0 i = 10 End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test3() Dim i As Integer While i &gt; 10 End While i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer If Integer.Parse(1) &gt; 0 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoNoNoYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test4() Dim i As Integer = 10 While i &gt; 10 End While [|If Integer.Parse(1) &gt; 0 i = 10 End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test4() Dim i As Integer = 10 While i > 10 End While i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer If Integer.Parse(1) > 0 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoNoYesYesNoNo() As Task Dim code = <text>Imports System Class Program Sub Test4_1() Dim i As Integer [|If Integer.Parse(1) &gt; 0 i = 10 Console.WriteLine(i) End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test4_1() Dim i As Integer i = NewMethod() End Sub Private Shared Function NewMethod() As Integer Dim i As Integer If Integer.Parse(1) > 0 i = 10 Console.WriteLine(i) End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoNoYesYesNoYes() As Task Dim code = <text>Imports System Class Program Sub Test4_2() Dim i As Integer = 10 [|If Integer.Parse(1) &gt; 0 i = 10 Console.WriteLine(i) End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test4_2() Dim i As Integer = 10 i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer If Integer.Parse(1) > 0 i = 10 Console.WriteLine(i) End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoNoYesYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test4_3() Dim i As Integer Console.WriteLine(i) [|If Integer.Parse(1) &gt; 0 i = 10 Console.WriteLine(i) End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test4_3() Dim i As Integer Console.WriteLine(i) i = NewMethod() End Sub Private Shared Function NewMethod() As Integer Dim i As Integer If Integer.Parse(1) > 0 i = 10 Console.WriteLine(i) End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoNoYesYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test4_4() Dim i As Integer = 10 Console.WriteLine(i) [|If Integer.Parse(1) &gt; 0 i = 10 Console.WriteLine(i) End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test4_4() Dim i As Integer = 10 Console.WriteLine(i) i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer If Integer.Parse(1) > 0 i = 10 Console.WriteLine(i) End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function MatrixCase_NoNoNoYesNoNoNoNo() As Task Dim code = <text>Imports System Class Program Sub Test5() [|Dim i As Integer|] End Sub End Class</text> Await ExpectExtractMethodToFailAsync(code) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function MatrixCase_NoNoNoYesNoNoNoYes() As Task Dim code = <text>Imports System Class Program Sub Test6() [|Dim i As Integer|] i = 1 End Sub End Class</text> Await ExpectExtractMethodToFailAsync(code) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoYesNoYesNoNo() As Task Dim code = <text>Imports System Class Program Sub Test7() [|Dim i As Integer If Integer.Parse(1) &gt; 0 i = 10 End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test7() NewMethod() End Sub Private Shared Sub NewMethod() Dim i As Integer If Integer.Parse(1) &gt; 0 i = 10 End If End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoYesNoYesNoYes() As Task Dim code = <text>Imports System Class Program Sub Test8() [|Dim i As Integer If Integer.Parse(1) &gt; 0 i = 10 End If|] i = 2 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test8() Dim i As Integer = NewMethod() i = 2 End Sub Private Shared Function NewMethod() As Integer Dim i As Integer If Integer.Parse(1) &gt; 0 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoYesYesNoNoNo() As Task Dim code = <text>Imports System Class Program Sub Test9() [|Dim i As Integer Console.WriteLine(i)|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test9() NewMethod() End Sub Private Shared Sub NewMethod() Dim i As Integer Console.WriteLine(i) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoYesYesNoNoYes() As Task Dim code = <text>Imports System Class Program Sub Test10() [|Dim i As Integer Console.WriteLine(i)|] i = 10 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test10() Dim i As Integer NewMethod() i = 10 End Sub Private Shared Sub NewMethod() Dim i As Integer Console.WriteLine(i) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoYesYesYesNoNo() As Task Dim code = <text>Imports System Class Program Sub Test11() [|Dim i As Integer If Integer.Parse(1) &gt; 0 i = 10 End If Console.WriteLine(i)|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test11() NewMethod() End Sub Private Shared Sub NewMethod() Dim i As Integer If Integer.Parse(1) &gt; 0 i = 10 End If Console.WriteLine(i) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoNoYesYesYesNoYes() As Task Dim code = <text>Imports System Class Program Sub Test12() [|Dim i As Integer If Integer.Parse(1) &gt; 0 i = 10 End If Console.WriteLine(i)|] i = 10 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test12() Dim i As Integer = NewMethod() i = 10 End Sub Private Shared Function NewMethod() As Integer Dim i As Integer If Integer.Parse(1) > 0 i = 10 End If Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesNoNoYesNoNo() As Task Dim code = <text>Imports System Class Program Sub Test13() Dim i As Integer [|i = 10|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test13() Dim i As Integer i = NewMethod() End Sub Private Shared Function NewMethod() As Integer Return 10 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesNoNoYesNoYes() As Task Dim code = <text>Imports System Class Program Sub Test14() Dim i As Integer [|i = 10|] i = 1 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test14() Dim i As Integer i = NewMethod() i = 1 End Sub Private Shared Function NewMethod() As Integer Return 10 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesNoNoYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test15() Dim i As Integer Console.WriteLine(i) [|i = 10|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test15() Dim i As Integer Console.WriteLine(i) i = NewMethod() End Sub Private Shared Function NewMethod() As Integer Return 10 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesNoNoYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test16() Dim i As Integer [|i = 10|] i = 10 Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test16() Dim i As Integer i = NewMethod() i = 10 Console.WriteLine(i) End Sub Private Shared Function NewMethod() As Integer Return 10 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesNoYesYesNoNo() As Task Dim code = <text>Imports System Class Program Sub Test16_1() Dim i As Integer [|i = 10 Console.WriteLine(i)|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test16_1() Dim i As Integer i = NewMethod() End Sub Private Shared Function NewMethod() As Integer Dim i As Integer = 10 Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesNoYesYesNoYes() As Task Dim code = <text>Imports System Class Program Sub Test16_2() Dim i As Integer = 10 [|i = 10 Console.WriteLine(i)|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test16_2() Dim i As Integer = 10 i = NewMethod() End Sub Private Shared Function NewMethod() As Integer Dim i As Integer = 10 Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesNoYesYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test16_3() Dim i As Integer Console.WriteLine(i) [|i = 10 Console.WriteLine(i)|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test16_3() Dim i As Integer Console.WriteLine(i) i = NewMethod() End Sub Private Shared Function NewMethod() As Integer Dim i As Integer = 10 Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesNoYesYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test16_4() Dim i As Integer = 10 Console.WriteLine(i) [|i = 10 Console.WriteLine(i)|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test16_4() Dim i As Integer = 10 Console.WriteLine(i) i = NewMethod() End Sub Private Shared Function NewMethod() As Integer Dim i As Integer = 10 Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesYesNoYesNoNo() As Task Dim code = <text>Imports System Class Program Sub Test17() [|Dim i As Integer = 10|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test17() NewMethod() End Sub Private Shared Sub NewMethod() Dim i As Integer = 10 End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesYesNoYesNoYes() As Task Dim code = <text>Imports System Class Program Sub Test18() [|Dim i As Integer = 10|] i = 10 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test18() Dim i As Integer = NewMethod() i = 10 End Sub Private Shared Function NewMethod() As Integer Return 10 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesYesYesYesNoNo() As Task Dim code = <text>Imports System Class Program Sub Test19() [|Dim i As Integer = 10 Console.WriteLine(i)|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test19() NewMethod() End Sub Private Shared Sub NewMethod() Dim i As Integer = 10 Console.WriteLine(i) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoNoYesYesYesYesNoYes() As Task Dim code = <text>Imports System Class Program Sub Test20() [|Dim i As Integer = 10 Console.WriteLine(i)|] i = 10 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test20() Dim i As Integer NewMethod() i = 10 End Sub Private Shared Sub NewMethod() Dim i As Integer = 10 Console.WriteLine(i) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesNoNoNoYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test21() Dim i As Integer [|If Integer.Parse(1) &gt; 10 i = 1 End If|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test21() Dim i As Integer i = NewMethod(i) Console.WriteLine(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer If Integer.Parse(1) &gt; 10 i = 1 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesNoNoNoYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test22() Dim i As Integer = 10 [|If Integer.Parse(1) &gt; 10 i = 1 End If|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test22() Dim i As Integer = 10 i = NewMethod(i) Console.WriteLine(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer If Integer.Parse(1) &gt; 10 i = 1 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesNoNoYesYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test22_1() Dim i As Integer [|If Integer.Parse(1) &gt; 10 i = 1 Console.WriteLine(i) End If|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test22_1() Dim i As Integer i = NewMethod(i) Console.WriteLine(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer If Integer.Parse(1) &gt; 10 i = 1 Console.WriteLine(i) End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesNoNoYesYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test22_2() Dim i As Integer = 10 [|If Integer.Parse(1) &gt; 10 i = 1 Console.WriteLine(i) End If|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test22_2() Dim i As Integer = 10 i = NewMethod(i) Console.WriteLine(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer If Integer.Parse(1) &gt; 10 i = 1 Console.WriteLine(i) End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function MatrixCase_NoYesNoYesNoNoYesNo() As Task Dim code = <text>Imports System Class Program Sub Test23() [|Dim i As Integer|] Console.WriteLine(i) End Sub End Class</text> Await ExpectExtractMethodToFailAsync(code) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function MatrixCase_NoYesNoYesNoNoYesYes() As Task Dim code = <text>Imports System Class Program Sub Test24() [|Dim i As Integer|] Console.WriteLine(i) i = 10 End Sub End Class</text> Await ExpectExtractMethodToFailAsync(code) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesNoYesNoYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test25() [|Dim i As Integer If Integer.Parse(1) &gt; 9 i = 10 End If|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test25() Dim i As Integer = NewMethod() Console.WriteLine(i) End Sub Private Shared Function NewMethod() As Integer Dim i As Integer If Integer.Parse(1) &gt; 9 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesNoYesNoYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test26() [|Dim i As Integer If Integer.Parse(1) &gt; 9 i = 10 End If|] Console.WriteLine(i) i = 10 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test26() Dim i As Integer = NewMethod() Console.WriteLine(i) i = 10 End Sub Private Shared Function NewMethod() As Integer Dim i As Integer If Integer.Parse(1) &gt; 9 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesNoYesYesNoYesNo() As Task Dim code = <text>Imports System Class Program Sub Test27() [|Dim i As Integer Console.WriteLine(i)|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test27() Dim i As Integer = NewMethod() Console.WriteLine(i) End Sub Private Shared Function NewMethod() As Integer Dim i As Integer Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesNoYesYesNoYesYes() As Task Dim code = <text>Imports System Class Program Sub Test28() [|Dim i As Integer Console.WriteLine(i)|] Console.WriteLine(i) i = 10 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test28() Dim i As Integer = NewMethod() Console.WriteLine(i) i = 10 End Sub Private Shared Function NewMethod() As Integer Dim i As Integer Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesNoYesYesYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test29() [|Dim i As Integer If Integer.Parse(1) &gt; 0 i = 10 End If Console.WriteLine(i)|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test29() Dim i As Integer = NewMethod() Console.WriteLine(i) End Sub Private Shared Function NewMethod() As Integer Dim i As Integer If Integer.Parse(1) &gt; 0 i = 10 End If Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesNoYesYesYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test30() [|Dim i As Integer If Integer.Parse(1) &gt; 0 i = 10 End If Console.WriteLine(i)|] Console.WriteLine(i) i = 10 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test30() Dim i As Integer = NewMethod() Console.WriteLine(i) i = 10 End Sub Private Shared Function NewMethod() As Integer Dim i As Integer If Integer.Parse(1) &gt; 0 i = 10 End If Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesYesNoNoYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test31() Dim i As Integer [|i = 10|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test31() Dim i As Integer i = NewMethod() Console.WriteLine(i) End Sub Private Shared Function NewMethod() As Integer Return 10 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesYesNoNoYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test32() Dim i As Integer [|i = 10|] Console.WriteLine(i) i = 10 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test32() Dim i As Integer i = NewMethod() Console.WriteLine(i) i = 10 End Sub Private Shared Function NewMethod() As Integer Return 10 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesYesNoYesYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test32_1() Dim i As Integer [|i = 10 Console.WriteLine(i)|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test32_1() Dim i As Integer i = NewMethod() Console.WriteLine(i) End Sub Private Shared Function NewMethod() As Integer Dim i As Integer = 10 Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesYesNoYesYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test32_2() Dim i As Integer = 10 [|i = 10 Console.WriteLine(i)|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test32_2() Dim i As Integer = 10 i = NewMethod() Console.WriteLine(i) End Sub Private Shared Function NewMethod() As Integer Dim i As Integer = 10 Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesYesYesNoYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test33() [|Dim i As Integer = 10|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test33() Dim i As Integer = NewMethod() Console.WriteLine(i) End Sub Private Shared Function NewMethod() As Integer Return 10 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesYesYesNoYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test34() [|Dim i As Integer = 10|] Console.WriteLine(i) i = 10 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test34() Dim i As Integer = NewMethod() Console.WriteLine(i) i = 10 End Sub Private Shared Function NewMethod() As Integer Return 10 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesYesYesYesYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test35() [|Dim i As Integer = 10 Console.WriteLine(i)|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test35() Dim i As Integer = NewMethod() Console.WriteLine(i) End Sub Private Shared Function NewMethod() As Integer Dim i As Integer = 10 Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_NoYesYesYesYesYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test36() [|Dim i As Integer = 10 Console.WriteLine(i)|] Console.WriteLine(i) i = 10 End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test36() Dim i As Integer = NewMethod() Console.WriteLine(i) i = 10 End Sub Private Shared Function NewMethod() As Integer Dim i As Integer = 10 Console.WriteLine(i) Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoNoNoYesNoNoNo() As Task Dim code = <text>Imports System Class Program Sub Test37() Dim i As Integer [|Console.WriteLine(i)|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test37() Dim i As Integer NewMethod(i) End Sub Private Shared Sub NewMethod(i As Integer) Console.WriteLine(i) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoNoNoYesNoNoYes() As Task Dim code = <text>Imports System Class Program Sub Test38() Dim i As Integer = 10 [|Console.WriteLine(i)|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test38() Dim i As Integer = 10 NewMethod(i) End Sub Private Shared Sub NewMethod(i As Integer) Console.WriteLine(i) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoNoNoYesNoYesNo() As Task Dim code = <text>Imports System Class Program Sub Test39() Dim i As Integer [|Console.WriteLine(i)|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test39() Dim i As Integer NewMethod(i) Console.WriteLine(i) End Sub Private Shared Sub NewMethod(i As Integer) Console.WriteLine(i) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoNoNoYesNoYesYes() As Task Dim code = <text>Imports System Class Program Sub Test40() Dim i As Integer = 10 [|Console.WriteLine(i)|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test40() Dim i As Integer = 10 NewMethod(i) Console.WriteLine(i) End Sub Private Shared Sub NewMethod(i As Integer) Console.WriteLine(i) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoNoNoYesYesNoNo() As Task Dim code = <text>Imports System Class Program Sub Test41() Dim i As Integer [|Console.WriteLine(i) If Integer.Parse(1) &gt; 0 i = 10 End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test41() Dim i As Integer i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) If Integer.Parse(1) > 0 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoNoNoYesYesNoYes() As Task Dim code = <text>Imports System Class Program Sub Test42() Dim i As Integer = 10 [|Console.WriteLine(i) If Integer.Parse(1) &gt; 0 i = 10 End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test42() Dim i As Integer = 10 i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) If Integer.Parse(1) > 0 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoNoNoYesYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test43() Dim i As Integer Console.WriteLine(i) [|Console.WriteLine(i) If Integer.Parse(1) &gt; 0 i = 10 End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test43() Dim i As Integer Console.WriteLine(i) i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) If Integer.Parse(1) > 0 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoNoNoYesYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test44() Dim i As Integer = 10 Console.WriteLine(i) [|Console.WriteLine(i) If Integer.Parse(1) &gt; 0 i = 10 End If|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test44() Dim i As Integer = 10 Console.WriteLine(i) i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) If Integer.Parse(1) > 0 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoYesNoYesYesNoNo() As Task Dim code = <text>Imports System Class Program Sub Test45() Dim i As Integer [|Console.WriteLine(i) i = 10|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test45() Dim i As Integer i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) i = 10 Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoYesNoYesYesNoYes() As Task Dim code = <text>Imports System Class Program Sub Test46() Dim i As Integer = 10 [|Console.WriteLine(i) i = 10|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test46() Dim i As Integer = 10 i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) i = 10 Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoYesNoYesYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test47() Dim i As Integer Console.WriteLine(i) [|Console.WriteLine(i) i = 10|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test47() Dim i As Integer Console.WriteLine(i) i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) i = 10 Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesNoYesNoYesYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test48() Dim i As Integer = 10 Console.WriteLine(i) [|Console.WriteLine(i) i = 10|] End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test48() Dim i As Integer = 10 Console.WriteLine(i) i = NewMethod(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) i = 10 Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesYesNoNoYesYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test49() Dim i As Integer [|Console.WriteLine(i) If Integer.Parse(1) &gt; 0 i = 10 End If|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test49() Dim i As Integer i = NewMethod(i) Console.WriteLine(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) If Integer.Parse(1) &gt; 0 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesYesNoNoYesYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test50() Dim i As Integer = 10 [|Console.WriteLine(i) If Integer.Parse(1) &gt; 0 i = 10 End If|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test50() Dim i As Integer = 10 i = NewMethod(i) Console.WriteLine(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) If Integer.Parse(1) &gt; 0 i = 10 End If Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesYesYesNoYesYesYesNo() As Task Dim code = <text>Imports System Class Program Sub Test51() Dim i As Integer [|Console.WriteLine(i) i = 10|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test51() Dim i As Integer i = NewMethod(i) Console.WriteLine(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) i = 10 Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMatrixCase_YesYesYesNoYesYesYesYes() As Task Dim code = <text>Imports System Class Program Sub Test52() Dim i As Integer = 10 [|Console.WriteLine(i) i = 10|] Console.WriteLine(i) End Sub End Class</text> Dim expected = <text>Imports System Class Program Sub Test52() Dim i As Integer = 10 i = NewMethod(i) Console.WriteLine(i) End Sub Private Shared Function NewMethod(i As Integer) As Integer Console.WriteLine(i) i = 10 Return i End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540046, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540046")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestImplicitFunctionLocal1() As Task Dim code = <text>Imports System Class Program Function Test() as Integer [|Return 1|] End Function End Class</text> Dim expected = <text>Imports System Class Program Function Test() as Integer Return NewMethod() End Function Private Shared Function NewMethod() As Integer Return 1 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestImplicitFunctionLocal2() As Task Dim code = <text>Imports System Class Program Function Test() as Integer Test = 1 [|If Test > 10 Then Test = 2 End If|] Console.Write(Test) Return 1 End Function End Class</text> Dim expected = <text>Imports System Class Program Function Test() as Integer Test = 1 Test = NewMethod(Test) Console.Write(Test) Return 1 End Function Private Shared Function NewMethod(Test As Integer) As Integer If Test > 10 Then Test = 2 End If Return Test End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestImplicitFunctionLocal3() As Task Dim code = <text>Imports System Class Program Function Test() as Integer Test = 1 [|If Test > 10 Then Test = 2 End If|] Return 1 End Function End Class</text> Dim expected = <text>Imports System Class Program Function Test() as Integer Test = 1 Test = NewMethod(Test) Return 1 End Function Private Shared Function NewMethod(Test As Integer) As Integer If Test > 10 Then Test = 2 End If Return Test End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestImplicitFunctionLocal4() As Task Dim code = <text>Imports System Class Program Function Test() as Integer Test = 1 [|If Test > 10 Then Test = 2 End If|] Console.WriteLine(Test) End Function End Class</text> Dim expected = <text>Imports System Class Program Function Test() as Integer Test = 1 Test = NewMethod(Test) Console.WriteLine(Test) End Function Private Shared Function NewMethod(Test As Integer) As Integer If Test > 10 Then Test = 2 End If Return Test End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539295, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539295")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestImplicitFunctionLocal5() As Task Dim code = <text>Module Module1 Sub Main() Console.WriteLine(Goo(2)) End Sub Function Goo%(ByVal j As Integer) [|Goo = 3.87 * j|] Exit Function End Function End Module</text> Dim expected = <text>Module Module1 Sub Main() Console.WriteLine(Goo(2)) End Sub Function Goo%(ByVal j As Integer) Goo = NewMethod(j) Exit Function End Function Private Function NewMethod(j As Integer) As Integer Return 3.87 * j End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(527776, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/527776")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug5079() As Task Dim code = <text>Class C Function f() As Integer [|Dim x As Integer = 5|] Return x End Function End Class</text> Dim expected = <text>Class C Function f() As Integer Dim x As Integer = NewMethod() Return x End Function Private Shared Function NewMethod() As Integer Return 5 End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539225, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539225"), Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function Bug5098() As Task Dim code = <code>Class Program Shared Sub Main() [|Return|] Console.Write(4) End Sub End Class</code> Await ExpectExtractMethodToFailAsync(code) End Function <WorkItem(5092, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix5092() As Task Dim code = <text>Imports System Module Module1 Sub Main() Dim d As Integer? d = [|New Integer?()|] End Sub End Module </text> Dim expected = <text>Imports System Module Module1 Sub Main() Dim d As Integer? d = NewMethod() End Sub Private Function NewMethod() As Integer? Return New Integer?() End Function End Module </text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539224, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539224")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix5096() As Task Dim code = <text>Module Program Sub Main(args As String()) [|Console.Write(4)|] 'comments End Sub End Module</text> Dim expected = <text>Module Program Sub Main(args As String()) NewMethod() 'comments End Sub Private Sub NewMethod() Console.Write(4) End Sub End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539251, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539251")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix5135() As Task Dim code = <text>Module Module1 Sub Main() End Sub Public Function Goo(ByVal params&amp;) Goo = [|params&amp;|] End Function End Module</text> Dim expected = <text>Module Module1 Sub Main() End Sub Public Function Goo(ByVal params&amp;) Goo = GetParams(params) End Function Private Function GetParams(params As Long) As Long Return params&amp; End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function ''' <summary> ''' Console.Write is not bound, as there is no Imports System ''' The flow analysis API in this case should still provide information about variable x (error tolerance) ''' </summary> ''' <remarks></remarks> <WorkItem(5220, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestErrorTolerance() As Task Dim code = <text>Class A Function Test1() As Integer Dim x As Integer = 5 [|Console.Write(x)|] Return x End Function Private Shared Sub NewMethod(x As Integer) End Sub End Class</text> Dim expected = <text>Class A Function Test1() As Integer Dim x As Integer = 5 NewMethod1(x) Return x End Function Private Shared Sub NewMethod1(x As Integer) Console.Write(x) End Sub Private Shared Sub NewMethod(x As Integer) End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539298, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539298")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug5195() As Task Dim code = <text>Imports System Class A Function Test1() As Integer [|Dim i as Integer = 10 Dim j as Integer = 0 Console.Write("hello vb!")|] j = i + 42 Console.Write(j) End Function End Class</text> Dim expected = <text>Imports System Class A Function Test1() As Integer Dim i As Integer = Nothing Dim j As Integer = Nothing NewMethod(i, j) j = i + 42 Console.Write(j) End Function Private Shared Sub NewMethod(ByRef i As Integer, ByRef j As Integer) i = 10 j = 0 Console.Write("hello vb!") End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540003, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540003")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6138() As Task Dim code = <text>Class Test Private _goo As Integer Property Goo As Integer Get Return _goo End Get Set(ByVal value As Integer) [|_goo = value|] End Set End Property End Class </text> Dim expected = <text>Class Test Private _goo As Integer Property Goo As Integer Get Return _goo End Get Set(ByVal value As Integer) NewMethod(value) End Set End Property Private Sub NewMethod(value As Integer) _goo = value End Sub End Class </text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540068, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540068")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6215() As Task Dim code = <text>Module Program Sub Main() [|Dim i As Integer = 1|] i = 2 Console.WriteLine(i) End Sub End Module</text> Dim expected = <text>Module Program Sub Main() Dim i As Integer = NewMethod() i = 2 Console.WriteLine(i) End Sub Private Function NewMethod() As Integer Return 1 End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540072, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540072")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6220() As Task Dim code = <text>Module Program Sub Main() [| Dim i As Integer = 1 |] Console.WriteLine(i) End Sub End Module</text> Dim expected = <text>Module Program Sub Main() Dim i As Integer = NewMethod() Console.WriteLine(i) End Sub Private Function NewMethod() As Integer Return 1 End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540072, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540072")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6220_1() As Task Dim code = <text>Module Program Sub Main() [| Dim i As Integer = 1 ' test |] Console.WriteLine(i) End Sub End Module</text> Dim expected = <text>Module Program Sub Main() Dim i As Integer = NewMethod() Console.WriteLine(i) End Sub Private Function NewMethod() As Integer Return 1 ' test End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540080, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540080")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6230() As Task Dim code = <text>Module Program Sub Main() Dim y As Integer =[| 1 + 1|] End Sub End Module</text> Dim expected = <text>Module Program Sub Main() Dim y As Integer = GetY() End Sub Private Function GetY() As Integer Return 1 + 1 End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540080, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540080")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6230_1() As Task Dim code = <text>Module Program Sub Main() Dim i As Integer [|= 1 + 1|] End Sub End Module</text> Dim expected = <text>Module Program Sub Main() NewMethod() End Sub Private Sub NewMethod() Dim i As Integer = 1 + 1 End Sub End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540063, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540063")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6208() As Task Dim code = <text>Module Program Sub Main() [|'selection Console.Write(4) 'end selection|] End Sub End Module</text> Dim expected = <text>Module Program Sub Main() NewMethod() End Sub Private Sub NewMethod() 'selection Console.Write(4) 'end selection End Sub End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540063, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540063")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6208_1() As Task Dim code = <text>Module Program Sub Main() [|'selection Console.Write(4) 'end selection |] End Sub End Module</text> Dim expected = <text>Module Program Sub Main() NewMethod() End Sub Private Sub NewMethod() 'selection Console.Write(4) 'end selection End Sub End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539915, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539915")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6022() As Task Dim code = <text>Imports System Module Module1 Delegate Function Del(ByVal v As String) As String Sub Main(args As String()) Dim r As Del = [|AddressOf Goo|] Console.WriteLine(r.Invoke("test")) End Sub Function Goo(ByVal value As String) As String Return value End Function End Module</text> Dim expected = <text>Imports System Module Module1 Delegate Function Del(ByVal v As String) As String Sub Main(args As String()) Dim r As Del = GetR() Console.WriteLine(r.Invoke("test")) End Sub Private Function GetR() As Del Return AddressOf Goo End Function Function Goo(ByVal value As String) As String Return value End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(539915, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539915")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6022_1() As Task Dim code = <text>Imports System Module Module1 Delegate Function Del(ByVal v As String) As String Sub Main(args As String()) Dim r As Del = AddressOf [|Goo|] Console.WriteLine(r.Invoke("test")) End Sub Function Goo(ByVal value As String) As String Return value End Function End Module</text> Dim expected = <text>Imports System Module Module1 Delegate Function Del(ByVal v As String) As String Sub Main(args As String()) Dim r As Del = GetR() Console.WriteLine(r.Invoke("test")) End Sub Private Function GetR() As Del Return AddressOf Goo End Function Function Goo(ByVal value As String) As String Return value End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(8285, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6310() As Task Dim code = <text>Imports System Module Module1 Sub Main(args As String()) [|If True Then Return|] Console.WriteLine(1) End Sub End Module</text> Dim expected = <text>Imports System Module Module1 Sub Main(args As String()) NewMethod() Return Console.WriteLine(1) End Sub Private Sub NewMethod() If True Then Return End Sub End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(8285, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6310_1() As Task Dim code = <text>Imports System Module Module1 Sub Main(args As String()) If True Then [|If True Then Return|] Console.WriteLine(1) End Sub End Module</text> Dim expected = <text>Imports System Module Module1 Sub Main(args As String()) If True Then NewMethod() : Return Console.WriteLine(1) End Sub Private Sub NewMethod() If True Then Return End Sub End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540151, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540151")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6310_2() As Task Dim code = <text>Imports System Module Module1 Sub Main(args As String()) [|If True Then Return|] End Sub End Module</text> Dim expected = <text>Imports System Module Module1 Sub Main(args As String()) NewMethod() End Sub Private Sub NewMethod() If True Then Return End Sub End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(8285, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6310_3() As Task Dim code = <text>Imports System Module Module1 Sub Main(args As String()) If True Then [|If True Then Return|] End Sub End Module</text> Dim expected = <text>Imports System Module Module1 Sub Main(args As String()) If True Then NewMethod() : Return End Sub Private Sub NewMethod() If True Then Return End Sub End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540338, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540338")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBug6566() As Task Dim code = <text>Imports System Module Module1 Sub Main(args As String()) Dim s as String = [|Nothing|] End Sub End Module</text> Dim expected = <text>Imports System Module Module1 Sub Main(args As String()) Dim s as String = GetS() End Sub Private Function GetS() As String Return Nothing End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(540361, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540361")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestBugFix6598() As Task Dim code = <text>Imports System Class C Sub Test() [|Program|] End Sub End Class</text> Dim expected = <text>Imports System Class C Sub Test() NewMethod() End Sub Private Shared Sub NewMethod() Program End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(541671, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541671")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestUnreachableCodeWithReturnStatement() As Task Dim code = <text>Class Test Sub Test() Return [|Dim i As Integer = 1 Dim j As Integer = i|] Return End Sub End Class</text> Dim expected = <text>Class Test Sub Test() Return NewMethod() Return End Sub Private Shared Sub NewMethod() Dim i As Integer = 1 Dim j As Integer = i End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(541671, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541671")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestUnreachableCodeWithExitSub() As Task Dim code = <text>Class Test Sub Test() Return [|Dim i As Integer = 1 Dim j As Integer = i|] Exit Sub End Sub End Class</text> Dim expected = <text>Class Test Sub Test() Return NewMethod() Exit Sub End Sub Private Shared Sub NewMethod() Dim i As Integer = 1 Dim j As Integer = i End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(541671, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541671")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestEmbededStatementWithoutStatementEndToken() As Task Dim code = <text>Module Program Sub Main(args As String()) If True Then Dim i As Integer = 10 : [|i|] = i + 10 Else Dim j As Integer = 45 : j = j + 10 End Sub End Module</text> Dim expected = <text>Module Program Sub Main(args As String()) If True Then Dim i As Integer = 10 : i = NewMethod(i) Else Dim j As Integer = 45 : j = j + 10 End Sub Private Function NewMethod(i As Integer) As Integer i = i + 10 Return i End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(8075, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestFieldInitializer() As Task Dim code = <text>Module Program Dim x As Object = [|Nothing|] Sub Main(args As String()) End Sub End Module</text> Dim expected = <text>Module Program Dim x As Object = GetX() Private Function GetX() As Object Return Nothing End Function Sub Main(args As String()) End Sub End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(541409, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541409"), WorkItem(542687, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542687")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function DontCrashOnInvalidAddressOf() As Task Dim code = <text>Module Program Sub Main(args As String()) End Sub Sub UseThread() Dim t As New System.Threading.Thread(AddressOf [|goo|]) End Sub End Module</text> Await ExpectExtractMethodToFailAsync(code) End Function <WorkItem(541515, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541515")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestDontCrashWhenCanFindOutContainingScopeType() As Task Dim code = <text>Class Program Sub Main() Dim x As New List(Of Program) From {[|New Program|]} End Sub Public Property Name As String End Class</text> Dim expected = <text>Class Program Sub Main() Dim x As New List(Of Program) From {NewMethod()} End Sub Private Shared Function NewMethod() As Program Return New Program End Function Public Property Name As String End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(542512, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542512")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestQueryVariable1() As Task Dim code = <text>Option Infer On Imports System Imports System.Linq Module Program Sub Main(args As String()) Dim x = From [|y|] In "" End Sub End Module</text> Dim expected = <text>Option Infer On Imports System Imports System.Linq Module Program Sub Main(args As String()) Dim x = GetX() End Sub Private Function GetX() As Collections.Generic.IEnumerable(Of Char) Return From y In "" End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(542615, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542615")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestFixedNullExceptionCrash() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Module Program Sub Main(args As String()) Dim x As Integer = 5 If x &gt; 0 Then Else [|Console.Write|] End If End Sub End Module</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Module Program Sub Main(args As String()) Dim x As Integer = 5 If x &gt; 0 Then Else NewMethod() End If End Sub Private Sub NewMethod() Console.Write End Sub End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(542629, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542629")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestLambdaSymbol() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Module Program Sub Apply(a() As Integer, funct As Func(Of Integer, Integer)) For index As Integer = 0 To a.Length - 1 a(index) = funct(a(index)) Next index End Sub Sub Main() Dim a(3) As Integer Dim i As Integer For i = 0 To 3 a(i) = i + 1 Next Apply(a, Function(x As Integer) [|Return x * 2|] End Function) End Sub End Module</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Module Program Sub Apply(a() As Integer, funct As Func(Of Integer, Integer)) For index As Integer = 0 To a.Length - 1 a(index) = funct(a(index)) Next index End Sub Sub Main() Dim a(3) As Integer Dim i As Integer For i = 0 To 3 a(i) = i + 1 Next Apply(a, Function(x As Integer) Return NewMethod(x) End Function) End Sub Private Function NewMethod(x As Integer) As Integer Return x * 2 End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(542511, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542511")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function ExtractMethodOnVariableUsedInWhen() As Task Dim code = <text>Imports System Module Program Sub Main(args As String()) [|Dim s As color|] Try Catch ex As Exception When s = color.blue Console.Write("Exception") End Try End Sub End Module Enum color blue End Enum</text> Await ExpectExtractMethodToFailAsync(code) End Function <WorkItem(542512, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542512")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodOnVariableDeclaredInFrom() As Task Dim code = <text>Imports System Imports System.Linq Module Program Sub Main(args As String()) Dim x = From [|y|] In "" End Sub End Module</text> Dim expected = <text>Imports System Imports System.Linq Module Program Sub Main(args As String()) Dim x = GetX() End Sub Private Function GetX() As Collections.Generic.IEnumerable(Of Char) Return From y In "" End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(542825, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542825")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function DanglingField() As Task Dim code = <text>Dim query1 = From i As Integer In New Integer() {4, 5} Where [|i > 5|] Select i</text> Await ExpectExtractMethodToFailAsync(code) End Function <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestMultipleNamesLocalDecl() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Module Program Sub Main(args As String()) [|Dim i, i2, i3 As Object = New Object() Dim i4|] lab1: Console.Write(i) GoTo lab1 Console.Write(i2) Console.Write(i3) End Sub End Module</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Module Program Sub Main(args As String()) Dim i, i2 As Object Dim i3 As Object = NewMethod() lab1: Console.Write(i) GoTo lab1 Console.Write(i2) Console.Write(i3) End Sub Private Function NewMethod() As Object Dim i3 As Object = New Object() Dim i4 Return i3 End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(543244, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543244")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestUnreachableUninitialized() As Task Dim code = <text>Option Infer On Imports System Class Program Shared Sub Main() [|Dim x1 As Object SyncLock x1 Return End SyncLock|] System.Threading.Monitor.Exit(x1) End Sub End Class</text> Dim expected = <text>Option Infer On Imports System Class Program Shared Sub Main() Dim x1 As Object = Nothing NewMethod(x1) Return System.Threading.Monitor.Exit(x1) End Sub Private Shared Sub NewMethod(ByRef x1 As Object) SyncLock x1 Return End SyncLock End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(543053, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543053")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestAddBlankLineBetweenMethodAndType() As Task Dim code = <text>Class Program Private Shared Sub Main(args As String()) Dim i As Integer = 2 Dim c As New C(Of Integer)([|i|]) End Sub Private Class C(Of T) Private v As Integer Public Sub New(ByRef v As Integer) Me.v = v End Sub End Class End Class</text> Dim expected = <text>Class Program Private Shared Sub Main(args As String()) Dim i As Integer = 2 NewMethod(i) End Sub Private Shared Sub NewMethod(i As Integer) Dim c As New C(Of Integer)(i) End Sub Private Class C(Of T) Private v As Integer Public Sub New(ByRef v As Integer) Me.v = v End Sub End Class End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(543047, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543047")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestResourceDeclaredOutside() As Task Dim code = <text>Option Infer On Option Strict Off Class C1 Shared Sub main() [|Dim mnObj As MyManagedClass Using mnObj End Using|] End Sub End Class Structure MyManagedClass Implements IDisposable Sub Dispose() Implements System.IDisposable.Dispose Console.Write("Dispose") End Sub End Structure</text> Dim expected = <text>Option Infer On Option Strict Off Class C1 Shared Sub main() NewMethod() End Sub Private Shared Sub NewMethod() Dim mnObj As MyManagedClass Using mnObj End Using End Sub End Class Structure MyManagedClass Implements IDisposable Sub Dispose() Implements System.IDisposable.Dispose Console.Write("Dispose") End Sub End Structure</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(528962, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/528962")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestFunctionCallWithFunctionName() As Task Dim code = <text>Option Infer On Imports System Class Program Shared Sub Main(args As String()) factorial(4) End Sub Shared Function factorial(ByVal x As Integer) As Integer [| factorial = x * factorial(x - 1) * x|] End Function End Class </text> Dim expected = <text>Option Infer On Imports System Class Program Shared Sub Main(args As String()) factorial(4) End Sub Shared Function factorial(ByVal x As Integer) As Integer factorial = NewMethod(x) End Function Private Shared Function NewMethod(x As Integer) As Integer Return x * factorial(x - 1) * x End Function End Class </text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(543244, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543244")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function ExtractMethodForBadCode() As Task Dim code = <text>Module M1 WriteOnly Property Age() As Integer Set(ByVal Value As Integer) Dim a, b, c As [|Object =|] New Object() lab1: SyncLock a GoTo lab1 End SyncLock Console.WriteLine(b) Console.WriteLine(c) End Set End Property End Module </text> Await ExpectExtractMethodToFailAsync(code) End Function <WorkItem(10878, "DevDiv_Projects/Roslyn")> <WorkItem(544408, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544408")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function ExtractMethodForBranchOutFromSyncLock() As Task Dim code = <text>Imports System Class Program Shared Sub Main(args As String()) SyncLock Sub() [|Exit While|] End Function End SyncLock End Sub End Class</text> Await ExpectExtractMethodToFailAsync(code) End Function <WorkItem(543304, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543304")> <WorkItem(544408, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544408")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function ExtractMethodForLambdaInSyncLock() As Task Dim code = <text>Imports System Class Program Public Shared Sub Main(args As String()) SyncLock Function(ByRef int As [|Integer|]) SyncLock x End SyncLock End Function End SyncLock End Sub End Class</text> Await ExpectExtractMethodToFailAsync(code) End Function <WorkItem(543320, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543320")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodForBadRegion() As Task Dim code = <text>Imports System Class Test Public Shared Sub Main() Dim x(1, 2) As Integer = New Integer[|(,)|] {{1}, {2}} End Sub End Class </text> Dim expected = <text>Imports System Class Test Public Shared Sub Main() Dim x(1, 2) As Integer = GetX() End Sub Private Shared Function GetX() As Integer(,) Return New Integer(,) {{1}, {2}} End Function End Class </text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(543320, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543320")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodForBadRegion_1() As Task Dim code = <text>Imports System Class Test Public Shared Sub Main() Dim y(1, 2) = [|New Integer|] End Sub End Class </text> Dim expected = <text>Imports System Class Test Public Shared Sub Main() Dim y(1, 2) = GetY() End Sub Private Shared Function GetY() As Integer Return New Integer End Function End Class </text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(543362, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543362")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function ExtractMethodForBadRegion_2() As Task Dim code = <text>Imports System Class Test Public Shared Sub Main() Dim y(,) = New Integer(,) {{[|From|]}} End Function End Class </text> Await ExpectExtractMethodToFailAsync(code) End Function <WorkItem(543244, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543244")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodForSynclockBlockContainsReturn() As Task Dim code = <text>Option Infer On Imports System Class Program Shared Sub Main() [|Dim x1 As Object SyncLock x1 Return End SyncLock|] System.Threading.Monitor.Exit(x1) End Sub End Class </text> Dim expected = <text>Option Infer On Imports System Class Program Shared Sub Main() Dim x1 As Object = Nothing NewMethod(x1) Return System.Threading.Monitor.Exit(x1) End Sub Private Shared Sub NewMethod(ByRef x1 As Object) SyncLock x1 Return End SyncLock End Sub End Class </text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(543244, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543244")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodForUsingBlockContainsReturn() As Task Dim code = <text>Imports System Option Infer On Imports System Class Program Shared Sub Main() [|Dim x1 As C1 Using x1 Return End Using|] System.Threading.Monitor.Exit(x1) End Sub End Class Class C1 Implements IDisposable Public Sub Dispose Implements IDisposable.Dispose End Sub End Class</text> Dim expected = <text>Imports System Option Infer On Imports System Class Program Shared Sub Main() Dim x1 As C1 = Nothing NewMethod(x1) Return System.Threading.Monitor.Exit(x1) End Sub Private Shared Sub NewMethod(ByRef x1 As C1) Using x1 Return End Using End Sub End Class Class C1 Implements IDisposable Public Sub Dispose Implements IDisposable.Dispose End Sub End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(543244, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543244")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodExitInLambda() As Task Dim code = <text>Imports System Option Infer On Option Strict On Imports System Class Program Shared Sub Main() Dim myLock As Object [|SyncLock Sub() myLock = New Object() Exit Sub End Sub End SyncLock|] End Sub End Class</text> Dim expected = <text>Imports System Option Infer On Option Strict On Imports System Class Program Shared Sub Main() Dim myLock As Object myLock = NewMethod(myLock) End Sub Private Shared Function NewMethod(myLock As Object) As Object SyncLock Sub() myLock = New Object() Exit Sub End Sub End SyncLock Return myLock End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(543332, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543332")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodExitInLambda_2() As Task Dim code = <text>Imports System Option Infer On Option Strict On Imports System Class Program Shared Sub Main() Dim myLock As Object [|SyncLock Function() myLock = New Object() Exit Function Return Nothing End Function End SyncLock|] End Sub End Class</text> Dim expected = <text>Imports System Option Infer On Option Strict On Imports System Class Program Shared Sub Main() Dim myLock As Object myLock = NewMethod(myLock) End Sub Private Shared Function NewMethod(myLock As Object) As Object SyncLock Function() myLock = New Object() Exit Function Return Nothing End Function End SyncLock Return myLock End Function End Class</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(543334, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543334")> <WorkItem(11186, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function ExtractMethodExitInLambda_3() As Task Dim code = <text>Imports System Public Class Program Shared Sub goo() Dim syncroot As Object = New Object SyncLock syncroot SyncLock Sub x [|Exit Sub|] End Function End SyncLock End SyncLock End Sub End Class </text> Await ExpectExtractMethodToFailAsync(code) End Function <WorkItem(543096, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543096")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestSelectCaseExpr() As Task Dim code = <text> Module Program Sub Main(args As String()) Select Case [|5|] Case 5 Console.Write(5) End Select End Sub End Module</text> Dim expected = <text> Module Program Sub Main(args As String()) Select Case NewMethod() Case 5 Console.Write(5) End Select End Sub Private Function NewMethod() As Integer Return 5 End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(542800, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542800")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestOutmostXmlElement() As Task Dim code = <text>Imports System Imports System.Xml.Linq Module Program Sub Main(args As String()) Dim x = [|&lt;x&gt;&lt;/x&gt;|] End Sub End Module</text> Dim expected = <text>Imports System Imports System.Xml.Linq Module Program Sub Main(args As String()) Dim x = GetX() End Sub Private Function GetX() As XElement Return &lt;x&gt;&lt;/x&gt; End Function End Module</text> Await TestExtractMethodAsync(code, expected, metadataReference:=GetType(System.Xml.Linq.XElement).Assembly.Location) End Function <WorkItem(13658, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractMethodForElementInitializers() As Task Dim code = <text> Module Module1 Property Prop As New List(Of String) From {[|"One"|], "two"} End Module</text> Dim expected = <text> Module Module1 Property Prop As New List(Of String) From {NewMethod(), "two"} Private Function NewMethod() As String Return "One" End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(529967, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/529967")> <Fact(), Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestExtractObjectArray() As Task Dim code = <text>Imports System Module Program Sub Main(args As String()) Dim o3 As Object = "hi" Dim col1 = [|{o3, o3}|] End Sub End Module</text> Dim expected = <text>Imports System Module Program Sub Main(args As String()) Dim o3 As Object = "hi" Dim col1 = GetCol1(o3) End Sub Private Function GetCol1(o3 As Object) As Object() Return {o3, o3} End Function End Module</text> Await TestExtractMethodAsync(code, expected) End Function <WorkItem(669341, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/669341")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestStructure1() As Task Dim code = <text>Structure XType Public Y As YType End Structure Structure YType Public Z As ZType End Structure Structure ZType Public Value As Integer End Structure Module Program Sub Main(args As String()) Dim x As XType Dim value = [|x.Y|].Z.Value With x .Y.Z.Value += 1 End With End Sub End Module</text> Dim expected = <text>Structure XType Public Y As YType End Structure Structure YType Public Z As ZType End Structure Structure ZType Public Value As Integer End Structure Module Program Sub Main(args As String()) Dim x As XType Dim value = GetY(x).Z.Value With x .Y.Z.Value += 1 End With End Sub Private Function GetY(ByRef x As XType) As YType Return x.Y End Function End Module</text> Await TestExtractMethodAsync(code, expected, dontPutOutOrRefOnStruct:=False) End Function <WorkItem(529266, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/529266")> <Fact, Trait(Traits.Feature, Traits.Features.ExtractMethod)> Public Async Function TestStructure2() As Task Dim code = <text>Imports System Imports System.Collections.Generic Imports System.Linq Structure SSSS3 Public A As String Public B As Integer End Structure Structure SSSS2 Public S3 As SSSS3 End Structure Structure SSSS Public S2 As SSSS2 End Structure Structure SSS Public S As SSSS End Structure Class Clazz Sub TEST() Dim x As New SSS() [|x.S|].S2.S3.A = "1" End Sub End Class</text> Dim expected = <text>Imports System Imports System.Collections.Generic Imports System.Linq Structure SSSS3 Public A As String Public B As Integer End Structure Structure SSSS2 Public S3 As SSSS3 End Structure Structure SSSS Public S2 As SSSS2 End Structure Structure SSS Public S As SSSS End Structure Class Clazz Sub TEST() Dim x As New SSS() GetS(x).S2.S3.A = "1" End Sub Private Shared Function GetS(ByRef x As SSS) As SSSS Return x.S End Function End Class</text> Await TestExtractMethodAsync(code, expected, dontPutOutOrRefOnStruct:=False) End Function End Class End Class End Namespace
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Compilers/CSharp/Portable/Emitter/Model/CustomModifierAdapter.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using Microsoft.CodeAnalysis.CSharp.Emit; using System.Diagnostics; using Microsoft.CodeAnalysis.Emit; namespace Microsoft.CodeAnalysis.CSharp.Symbols { internal partial class CSharpCustomModifier : Cci.ICustomModifier { bool Cci.ICustomModifier.IsOptional { get { return this.IsOptional; } } Cci.ITypeReference Cci.ICustomModifier.GetModifier(EmitContext context) { return ((PEModuleBuilder)context.Module).Translate(this.ModifierSymbol, (CSharpSyntaxNode)context.SyntaxNode, context.Diagnostics); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using Microsoft.CodeAnalysis.CSharp.Emit; using System.Diagnostics; using Microsoft.CodeAnalysis.Emit; namespace Microsoft.CodeAnalysis.CSharp.Symbols { internal partial class CSharpCustomModifier : Cci.ICustomModifier { bool Cci.ICustomModifier.IsOptional { get { return this.IsOptional; } } Cci.ITypeReference Cci.ICustomModifier.GetModifier(EmitContext context) { return ((PEModuleBuilder)context.Module).Translate(this.ModifierSymbol, (CSharpSyntaxNode)context.SyntaxNode, context.Diagnostics); } } }
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Compilers/VisualBasic/Test/Semantic/Compilation/CompilationAPITests.vb
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports System.Collections.Immutable Imports System.IO Imports System.Linq Imports System.Reflection.PortableExecutable Imports System.Runtime.InteropServices Imports System.Security.Cryptography Imports System.Text Imports System.Threading Imports System.Xml.Linq Imports Microsoft.CodeAnalysis Imports Microsoft.CodeAnalysis.Emit Imports Microsoft.CodeAnalysis.Test.Utilities Imports Microsoft.CodeAnalysis.Text Imports Microsoft.CodeAnalysis.VisualBasic Imports Microsoft.CodeAnalysis.VisualBasic.Symbols Imports Microsoft.CodeAnalysis.VisualBasic.UnitTests Imports Roslyn.Test.Utilities Imports CS = Microsoft.CodeAnalysis.CSharp Imports Roslyn.Test.Utilities.TestHelpers Imports Roslyn.Test.Utilities.TestMetadata Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests Public Class CompilationAPITests Inherits BasicTestBase Private Function WithDiagnosticOptions( tree As SyntaxTree, ParamArray options As (string, ReportDiagnostic)()) As VisualBasicCompilationOptions Return TestOptions.DebugDll. WithSyntaxTreeOptionsProvider(new TestSyntaxTreeOptionsProvider(tree, options)) End Function <Fact> Public Sub PerTreeVsGlobalSuppress() Dim tree = SyntaxFactory.ParseSyntaxTree(" Class C Sub M() Dim x As Integer End Sub End Class") Dim options = New VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary). WithGeneralDiagnosticOption(ReportDiagnostic.Suppress) Dim comp = CreateCompilationWithMscorlib45({tree}, options:=options) comp.AssertNoDiagnostics() options = options.WithSyntaxTreeOptionsProvider( new TestSyntaxTreeOptionsProvider(tree, ("BC42024", ReportDiagnostic.Warn))) comp = CreateCompilationWithMscorlib45({tree}, options:=options) ' Global options override syntax tree options. This is the opposite of C# behavior comp.AssertNoDiagnostics() End Sub <Fact> Public Sub PerTreeDiagnosticOptionsParseWarnings() Dim tree = SyntaxFactory.ParseSyntaxTree(" Class C Sub M() Dim x As Integer End Sub End Class") Dim comp = CreateCompilation({tree}, options:=TestOptions.DebugDll) comp.AssertTheseDiagnostics( <errors> BC42024: Unused local variable: 'x'. Dim x As Integer ~ </errors>) Dim options = WithDiagnosticOptions(tree, ("BC42024", ReportDiagnostic.Suppress)) Dim comp2 = CreateCompilation({tree}, options:=options) comp2.AssertNoDiagnostics() End Sub <Fact> Public Sub PerTreeDiagnosticOptionsVsPragma() Dim tree = SyntaxFactory.ParseSyntaxTree(" Class C Sub M() #Disable Warning BC42024 Dim x As Integer #Enable Warning BC42024 End Sub End Class") Dim comp = CreateCompilation({tree}, options:=TestOptions.DebugDll) comp.AssertNoDiagnostics() Dim options = WithDiagnosticOptions(tree, ("BC42024", ReportDiagnostic.Warn)) Dim comp2 = CreateCompilation({tree}, options:=options) ' Pragma should have precedence over per-tree options comp2.AssertNoDiagnostics() End Sub <Fact> Public Sub PerTreeDiagnosticOptionsVsSpecificOptions() Dim tree = SyntaxFactory.ParseSyntaxTree(" Class C Sub M() Dim x As Integer End Sub End Class") Dim options = TestOptions.DebugDll.WithSpecificDiagnosticOptions( CreateImmutableDictionary(("BC42024", ReportDiagnostic.Suppress))) Dim comp = CreateCompilationWithMscorlib45({tree}, options:=options) comp.AssertNoDiagnostics() options = options.WithSyntaxTreeOptionsProvider( new TestSyntaxTreeOptionsProvider(tree, ("BC42024", ReportDiagnostic.Error))) Dim comp2 = CreateCompilationWithMscorlib45({tree}, options:=options) ' Specific diagnostic options should have precedence over tree options comp2.AssertNoDiagnostics() End Sub <Fact> Public Sub DifferentDiagnosticOptionsForTrees() Dim tree = SyntaxFactory.ParseSyntaxTree(" Class C Sub M() Dim x As Integer End Sub End Class") Dim newTree = SyntaxFactory.ParseSyntaxTree(" Class D Sub M() Dim y As Integer End Sub End Class") Dim options = TestOptions.DebugDll.WithSyntaxTreeOptionsProvider( New TestSyntaxTreeOptionsProvider( (tree, {("BC42024", ReportDiagnostic.Suppress)}), (newTree, {("BC4024", ReportDiagnostic.Error)}))) Dim comp = CreateCompilationWithMscorlib45({tree, newTree}, options:=options) comp.AssertTheseDiagnostics( <errors> BC42024: Unused local variable: 'y'. Dim y As Integer ~ </errors>) End Sub <Fact> Public Sub TreeOptionsComparerRespected() Dim tree = SyntaxFactory.ParseSyntaxTree(" Class C Sub M() Dim x As Integer End Sub End Class") ' Default provider is case insensitive Dim options = WithDiagnosticOptions(tree, ("bc42024", ReportDiagnostic.Suppress)) Dim comp = CreateCompilation(tree, options:=options) comp.AssertNoDiagnostics() options = options.WithSyntaxTreeOptionsProvider( New TestSyntaxTreeOptionsProvider( StringComparer.Ordinal, Nothing, (tree, {("bc42024", ReportDiagnostic.Suppress)})) ) comp = CreateCompilation(tree, options:=options) comp.AssertTheseDiagnostics( <errors> BC42024: Unused local variable: 'x'. Dim x As Integer ~ </errors>) End Sub <WorkItem(8360, "https://github.com/dotnet/roslyn/issues/8360")> <WorkItem(9153, "https://github.com/dotnet/roslyn/issues/9153")> <Fact> Public Sub PublicSignWithRelativeKeyPath() Dim options = New VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary). WithPublicSign(True).WithCryptoKeyFile("test.snk") AssertTheseDiagnostics(VisualBasicCompilation.Create("test", options:=options), <errors> BC37254: Public sign was specified and requires a public key, but no public key was specified BC37257: Option 'CryptoKeyFile' must be an absolute path. </errors>) End Sub <WorkItem(11497, "https://github.com/dotnet/roslyn/issues/11497")> <Fact> Public Sub PublicSignWithEmptyKeyPath() Dim options = New VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary). WithPublicSign(True).WithCryptoKeyFile("") AssertTheseDiagnostics(VisualBasicCompilation.Create("test", options:=options), <errors> BC37254: Public sign was specified and requires a public key, but no public key was specified </errors>) End Sub <WorkItem(11497, "https://github.com/dotnet/roslyn/issues/11497")> <Fact> Public Sub PublicSignWithEmptyKeyPath2() Dim options = New VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary). WithPublicSign(True).WithCryptoKeyFile("""""") AssertTheseDiagnostics(VisualBasicCompilation.Create("test", options:=options), <errors> BC37254: Public sign was specified and requires a public key, but no public key was specified BC37257: Option 'CryptoKeyFile' must be an absolute path. </errors>) End Sub <Fact> Public Sub LocalizableErrorArgumentToStringDoesntStackOverflow() ' Error ID is arbitrary Dim arg = New LocalizableErrorArgument(ERRID.IDS_ProjectSettingsLocationName) Assert.NotNull(arg.ToString()) End Sub <WorkItem(538778, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538778")> <WorkItem(537623, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537623")> <WorkItem(233669, "https://devdiv.visualstudio.com/DevDiv/_workitems?id=233669")> <Fact> Public Sub CompilationName() ' report an error, rather then silently ignoring the directory ' (see cli partition II 22.30) VisualBasicCompilation.Create("C:/goo/Test.exe").AssertTheseEmitDiagnostics( <expected> BC30420: 'Sub Main' was not found in 'C:/goo/Test.exe'. BC37283: Invalid assembly name: Name contains invalid characters. </expected>) VisualBasicCompilation.Create("C:\goo\Test.exe", options:=TestOptions.ReleaseDll).AssertTheseDeclarationDiagnostics( <expected> BC37283: Invalid assembly name: Name contains invalid characters. </expected>) VisualBasicCompilation.Create("\goo/Test.exe", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics( <expected> BC37283: Invalid assembly name: Name contains invalid characters. </expected>) VisualBasicCompilation.Create("C:Test.exe", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics( <expected> BC37283: Invalid assembly name: Name contains invalid characters. </expected>) VisualBasicCompilation.Create("Te" & ChrW(0) & "st.exe", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics( <expected> BC37283: Invalid assembly name: Name contains invalid characters. </expected>) VisualBasicCompilation.Create(" " & vbTab & " ", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics( <expected> BC37283: Invalid assembly name: Name cannot start with whitespace. </expected>) VisualBasicCompilation.Create(ChrW(&HD800), options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics( <expected> BC37283: Invalid assembly name: Name contains invalid characters. </expected>) VisualBasicCompilation.Create("", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics( <expected> BC37283: Invalid assembly name: Name cannot be empty. </expected>) VisualBasicCompilation.Create(" a", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics( <expected> BC37283: Invalid assembly name: Name cannot start with whitespace. </expected>) VisualBasicCompilation.Create("\u2000a", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics( ' // U+2000 is whitespace <expected> BC37283: Invalid assembly name: Name contains invalid characters. </expected>) ' other characters than directory separators are ok: VisualBasicCompilation.Create(";,*?<>#!@&", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics() VisualBasicCompilation.Create("goo", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics() VisualBasicCompilation.Create(".goo", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics() VisualBasicCompilation.Create("goo ", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics() ' can end with whitespace VisualBasicCompilation.Create("....", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics() VisualBasicCompilation.Create(Nothing, options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics() End Sub <Fact> Public Sub CreateAPITest() Dim listSyntaxTree = New List(Of SyntaxTree) Dim listRef = New List(Of MetadataReference) Dim s1 = "using Goo" Dim t1 As SyntaxTree = VisualBasicSyntaxTree.ParseText(s1) listSyntaxTree.Add(t1) ' System.dll listRef.Add(Net451.System) Dim ops = TestOptions.ReleaseExe ' Create Compilation with Option is not Nothing Dim comp = VisualBasicCompilation.Create("Compilation", listSyntaxTree, listRef, ops) Assert.Equal(ops, comp.Options) Assert.NotNull(comp.SyntaxTrees) Assert.NotNull(comp.References) Assert.Equal(1, comp.SyntaxTrees.Count) Assert.Equal(1, comp.References.Count) ' Create Compilation with PreProcessorSymbols of Option is empty Dim ops1 = TestOptions.ReleaseExe.WithGlobalImports(GlobalImport.Parse({"System", "Microsoft.VisualBasic"})).WithRootNamespace("") ' Create Compilation with Assembly name contains invalid char Dim asmname = "楽聖いち にÅÅ€" comp = VisualBasicCompilation.Create(asmname, listSyntaxTree, listRef, ops1) Assert.Equal(asmname, comp.Assembly.Name) Assert.Equal(asmname + ".exe", comp.SourceModule.Name) Dim compOpt = VisualBasicCompilation.Create("Compilation", Nothing, Nothing, Nothing) Assert.NotNull(compOpt.Options) ' Not Implemented code ' comp = comp.ChangeOptions(options:=null) ' Assert.Equal(CompilationOptions.Default, comp.Options) ' comp = comp.ChangeOptions(ops1) ' Assert.Equal(ops1, comp.Options) ' comp = comp.ChangeOptions(comp1.Options) ' ssert.Equal(comp1.Options, comp.Options) ' comp = comp.ChangeOptions(CompilationOptions.Default) ' Assert.Equal(CompilationOptions.Default, comp.Options) End Sub <Fact> Public Sub GetSpecialType() Dim comp = VisualBasicCompilation.Create("compilation", Nothing, Nothing, Nothing) ' Get Special Type by enum Dim ntSmb = comp.GetSpecialType(typeId:=SpecialType.Count) Assert.Equal(SpecialType.Count, ntSmb.SpecialType) ' Get Special Type by integer ntSmb = comp.GetSpecialType(CType(31, SpecialType)) Assert.Equal(31, CType(ntSmb.SpecialType, Integer)) End Sub <Fact> Public Sub GetTypeByMetadataName() Dim comp = VisualBasicCompilation.Create("compilation", Nothing, Nothing, Nothing) ' Get Type Name And Arity Assert.Null(comp.GetTypeByMetadataName("`1")) Assert.Null(comp.GetTypeByMetadataName("中文`1")) ' Throw exception when the parameter of GetTypeByNameAndArity is NULL 'Assert.Throws(Of Exception)( ' Sub() ' comp.GetTypeByNameAndArity(fullName:=Nothing, arity:=1) ' End Sub) ' Throw exception when the parameter of GetTypeByNameAndArity is less than 0 'Assert.Throws(Of Exception)( ' Sub() ' comp.GetTypeByNameAndArity(String.Empty, -4) ' End Sub) Dim compilationDef = <compilation name="compilation"> <file name="a.vb"> Namespace A.B Class C Class D Class E End Class End Class End Class Class G(Of T) Class Q(Of S1,S2) ENd Class End Class Class G(Of T1,T2) End Class End Namespace Class C Class D Class E End Class End Class End Class </file> </compilation> comp = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(compilationDef) 'IsCaseSensitive Assert.Equal(Of Boolean)(False, comp.IsCaseSensitive) Assert.Equal("D", comp.GetTypeByMetadataName("C+D").Name) Assert.Equal("E", comp.GetTypeByMetadataName("C+D+E").Name) Assert.Null(comp.GetTypeByMetadataName("")) Assert.Null(comp.GetTypeByMetadataName("+")) Assert.Null(comp.GetTypeByMetadataName("++")) Assert.Equal("C", comp.GetTypeByMetadataName("A.B.C").Name) Assert.Equal("D", comp.GetTypeByMetadataName("A.B.C+D").Name) Assert.Null(comp.GetTypeByMetadataName("A.B.C+F")) Assert.Equal("E", comp.GetTypeByMetadataName("A.B.C+D+E").Name) Assert.Null(comp.GetTypeByMetadataName("A.B.C+D+E+F")) Assert.Equal(1, comp.GetTypeByMetadataName("A.B.G`1").Arity) Assert.Equal(2, comp.GetTypeByMetadataName("A.B.G`1+Q`2").Arity) Assert.Equal(2, comp.GetTypeByMetadataName("A.B.G`2").Arity) Assert.Null(comp.GetTypeByMetadataName("c")) Assert.Null(comp.GetTypeByMetadataName("A.b.C")) Assert.Null(comp.GetTypeByMetadataName("C+d")) Assert.Equal(SpecialType.System_Array, comp.GetTypeByMetadataName("System.Array").SpecialType) Assert.Null(comp.Assembly.GetTypeByMetadataName("System.Array")) Assert.Equal("E", comp.Assembly.GetTypeByMetadataName("A.B.C+D+E").Name) End Sub <Fact> Public Sub EmitToMemoryStreams() Dim comp = VisualBasicCompilation.Create("Compilation", options:=TestOptions.ReleaseDll) Using output = New MemoryStream() Using outputPdb = New MemoryStream() Using outputxml = New MemoryStream() Dim result = comp.Emit(output, outputPdb, Nothing) Assert.True(result.Success) result = comp.Emit(output, outputPdb) Assert.True(result.Success) result = comp.Emit(peStream:=output, pdbStream:=outputPdb, xmlDocumentationStream:=Nothing, cancellationToken:=Nothing) Assert.True(result.Success) result = comp.Emit(peStream:=output, pdbStream:=outputPdb, cancellationToken:=Nothing) Assert.True(result.Success) result = comp.Emit(output, outputPdb) Assert.True(result.Success) result = comp.Emit(output, outputPdb) Assert.True(result.Success) result = comp.Emit(output, outputPdb, outputxml) Assert.True(result.Success) result = comp.Emit(output, Nothing, Nothing, Nothing) Assert.True(result.Success) result = comp.Emit(output) Assert.True(result.Success) result = comp.Emit(output, Nothing, outputxml) Assert.True(result.Success) result = comp.Emit(output, xmlDocumentationStream:=outputxml) Assert.True(result.Success) result = comp.Emit(output, Nothing, outputxml) Assert.True(result.Success) result = comp.Emit(output, xmlDocumentationStream:=outputxml) Assert.True(result.Success) End Using End Using End Using End Sub <Fact> Public Sub Emit_BadArgs() Dim comp = VisualBasicCompilation.Create("Compilation", options:=TestOptions.ReleaseDll) Assert.Throws(Of ArgumentNullException)("peStream", Sub() comp.Emit(peStream:=Nothing)) Assert.Throws(Of ArgumentException)("peStream", Sub() comp.Emit(peStream:=New TestStream(canRead:=True, canWrite:=False, canSeek:=True))) Assert.Throws(Of ArgumentException)("pdbStream", Sub() comp.Emit(peStream:=New MemoryStream(), pdbStream:=New TestStream(canRead:=True, canWrite:=False, canSeek:=True))) Assert.Throws(Of ArgumentException)("pdbStream", Sub() comp.Emit(peStream:=New MemoryStream(), pdbStream:=New MemoryStream(), options:=EmitOptions.Default.WithDebugInformationFormat(DebugInformationFormat.Embedded))) Assert.Throws(Of ArgumentException)("sourceLinkStream", Sub() comp.Emit( peStream:=New MemoryStream(), pdbStream:=New MemoryStream(), options:=EmitOptions.Default.WithDebugInformationFormat(DebugInformationFormat.PortablePdb), sourceLinkStream:=New TestStream(canRead:=False, canWrite:=True, canSeek:=True))) Assert.Throws(Of ArgumentException)("embeddedTexts", Sub() comp.Emit( peStream:=New MemoryStream(), pdbStream:=Nothing, options:=Nothing, embeddedTexts:={EmbeddedText.FromStream("_", New MemoryStream())})) Assert.Throws(Of ArgumentException)("embeddedTexts", Sub() comp.Emit( peStream:=New MemoryStream(), pdbStream:=Nothing, options:=EmitOptions.Default.WithDebugInformationFormat(DebugInformationFormat.PortablePdb), embeddedTexts:={EmbeddedText.FromStream("_", New MemoryStream())})) Assert.Throws(Of ArgumentException)("win32Resources", Sub() comp.Emit( peStream:=New MemoryStream(), win32Resources:=New TestStream(canRead:=True, canWrite:=False, canSeek:=False))) Assert.Throws(Of ArgumentException)("win32Resources", Sub() comp.Emit( peStream:=New MemoryStream(), win32Resources:=New TestStream(canRead:=False, canWrite:=False, canSeek:=True))) ' we don't report an error when we can't write to the XML doc stream: Assert.True(comp.Emit( peStream:=New MemoryStream(), pdbStream:=New MemoryStream(), xmlDocumentationStream:=New TestStream(canRead:=True, canWrite:=False, canSeek:=True)).Success) End Sub <Fact> Public Sub EmitOptionsDiagnostics() Dim c = CreateCompilationWithMscorlib40({"class C {}"}) Dim stream = New MemoryStream() Dim options = New EmitOptions( debugInformationFormat:=CType(-1, DebugInformationFormat), outputNameOverride:=" ", fileAlignment:=513, subsystemVersion:=SubsystemVersion.Create(1000000, -1000000), pdbChecksumAlgorithm:=New HashAlgorithmName("invalid hash algorithm name")) Dim result = c.Emit(stream, options:=options) result.Diagnostics.Verify( Diagnostic(ERRID.ERR_InvalidDebugInformationFormat).WithArguments("-1"), Diagnostic(ERRID.ERR_InvalidOutputName).WithArguments("Name cannot start with whitespace."), Diagnostic(ERRID.ERR_InvalidFileAlignment).WithArguments("513"), Diagnostic(ERRID.ERR_InvalidSubsystemVersion).WithArguments("1000000.-1000000"), Diagnostic(ERRID.ERR_InvalidHashAlgorithmName).WithArguments("invalid hash algorithm name")) Assert.False(result.Success) End Sub <Fact> Sub EmitOptions_PdbChecksumAndDeterminism() Dim options = New EmitOptions(pdbChecksumAlgorithm:=New HashAlgorithmName()) Dim diagnosticBag = New DiagnosticBag() options.ValidateOptions(diagnosticBag, MessageProvider.Instance, isDeterministic:=True) diagnosticBag.Verify( Diagnostic(ERRID.ERR_InvalidHashAlgorithmName).WithArguments("")) diagnosticBag.Clear() options.ValidateOptions(diagnosticBag, MessageProvider.Instance, isDeterministic:=False) diagnosticBag.Verify() End Sub <Fact> Public Sub ReferenceAPITest() ' Create Compilation takes two args Dim comp = VisualBasicCompilation.Create("Compilation") Dim ref1 = Net451.mscorlib Dim ref2 = Net451.System Dim ref3 = New TestMetadataReference(fullPath:="c:\xml.bms") Dim ref4 = New TestMetadataReference(fullPath:="c:\aaa.dll") ' Add a new empty item comp = comp.AddReferences(Enumerable.Empty(Of MetadataReference)()) Assert.Equal(0, comp.References.Count) ' Add a new valid item comp = comp.AddReferences(ref1) Dim assemblySmb = comp.GetReferencedAssemblySymbol(ref1) Assert.NotNull(assemblySmb) Assert.Equal("mscorlib", assemblySmb.Name, StringComparer.OrdinalIgnoreCase) Assert.Equal(1, comp.References.Count) Assert.Equal(MetadataImageKind.Assembly, comp.References(0).Properties.Kind) Assert.Same(ref1, comp.References(0)) ' Replace an existing item with another valid item comp = comp.ReplaceReference(ref1, ref2) Assert.Equal(1, comp.References.Count) Assert.Equal(MetadataImageKind.Assembly, comp.References(0).Properties.Kind) Assert.Equal(ref2, comp.References(0)) ' Remove an existing item comp = comp.RemoveReferences(ref2) Assert.Equal(0, comp.References.Count) 'WithReferences Dim hs1 As New HashSet(Of MetadataReference) From {ref1, ref2, ref3} Dim compCollection1 = VisualBasicCompilation.Create("Compilation") Assert.Equal(Of Integer)(0, Enumerable.Count(Of MetadataReference)(compCollection1.References)) Dim c2 As Compilation = compCollection1.WithReferences(hs1) Assert.Equal(Of Integer)(3, Enumerable.Count(Of MetadataReference)(c2.References)) 'WithReferences Dim compCollection2 = VisualBasicCompilation.Create("Compilation") Assert.Equal(Of Integer)(0, Enumerable.Count(Of MetadataReference)(compCollection2.References)) Dim c3 As Compilation = compCollection1.WithReferences(ref1, ref2, ref3) Assert.Equal(Of Integer)(3, Enumerable.Count(Of MetadataReference)(c3.References)) 'ReferencedAssemblyNames Dim RefAsm_Names As IEnumerable(Of AssemblyIdentity) = c2.ReferencedAssemblyNames Assert.Equal(Of Integer)(2, Enumerable.Count(Of AssemblyIdentity)(RefAsm_Names)) Dim ListNames As New List(Of String) Dim I As AssemblyIdentity For Each I In RefAsm_Names ListNames.Add(I.Name) Next Assert.Contains(Of String)("mscorlib", ListNames) Assert.Contains(Of String)("System", ListNames) 'RemoveAllReferences c2 = c2.RemoveAllReferences Assert.Equal(Of Integer)(0, Enumerable.Count(Of MetadataReference)(c2.References)) ' Overload with Hashset Dim hs = New HashSet(Of MetadataReference)() From {ref1, ref2, ref3} Dim compCollection = VisualBasicCompilation.Create("Compilation", references:=hs) compCollection = compCollection.AddReferences(ref1, ref2, ref3, ref4).RemoveReferences(hs) Assert.Equal(1, compCollection.References.Count) compCollection = compCollection.AddReferences(hs).RemoveReferences(ref1, ref2, ref3, ref4) Assert.Equal(0, compCollection.References.Count) ' Overload with Collection Dim col = New ObjectModel.Collection(Of MetadataReference)() From {ref1, ref2, ref3} compCollection = VisualBasicCompilation.Create("Compilation", references:=col) compCollection = compCollection.AddReferences(col).RemoveReferences(ref1, ref2, ref3) Assert.Equal(0, compCollection.References.Count) compCollection = compCollection.AddReferences(ref1, ref2, ref3).RemoveReferences(col) Assert.Equal(0, comp.References.Count) ' Overload with ConcurrentStack Dim stack = New Concurrent.ConcurrentStack(Of MetadataReference) stack.Push(ref1) stack.Push(ref2) stack.Push(ref3) compCollection = VisualBasicCompilation.Create("Compilation", references:=stack) compCollection = compCollection.AddReferences(stack).RemoveReferences(ref1, ref3, ref2) Assert.Equal(0, compCollection.References.Count) compCollection = compCollection.AddReferences(ref2, ref1, ref3).RemoveReferences(stack) Assert.Equal(0, compCollection.References.Count) ' Overload with ConcurrentQueue Dim queue = New Concurrent.ConcurrentQueue(Of MetadataReference) queue.Enqueue(ref1) queue.Enqueue(ref2) queue.Enqueue(ref3) compCollection = VisualBasicCompilation.Create("Compilation", references:=queue) compCollection = compCollection.AddReferences(queue).RemoveReferences(ref3, ref2, ref1) Assert.Equal(0, compCollection.References.Count) compCollection = compCollection.AddReferences(ref2, ref1, ref3).RemoveReferences(queue) Assert.Equal(0, compCollection.References.Count) End Sub <WorkItem(537826, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537826")> <Fact> Public Sub SyntreeAPITest() Dim s1 = "using System.Linq;" Dim s2 = <![CDATA[Class goo sub main Public Operator End Operator End Class ]]>.Value Dim s3 = "Imports s$ = System.Text" Dim s4 = <text> Module Module1 Sub Goo() for i = 0 to 100 next end sub End Module </text>.Value Dim t1 = VisualBasicSyntaxTree.ParseText(s4) Dim withErrorTree = VisualBasicSyntaxTree.ParseText(s2) Dim withErrorTree1 = VisualBasicSyntaxTree.ParseText(s3) Dim withErrorTreeCS = VisualBasicSyntaxTree.ParseText(s1) Dim withExpressionRootTree = SyntaxFactory.ParseExpression("0").SyntaxTree ' Create compilation takes three args Dim comp = VisualBasicCompilation.Create("Compilation", {t1}, {MscorlibRef, MsvbRef}, TestOptions.ReleaseDll) Dim tree = comp.SyntaxTrees.AsEnumerable() comp.VerifyDiagnostics() ' Add syntaxtree with error comp = comp.AddSyntaxTrees(withErrorTreeCS) Assert.Equal(2, comp.GetDiagnostics().Length()) ' Remove syntaxtree without error comp = comp.RemoveSyntaxTrees(tree) Assert.Equal(2, comp.GetDiagnostics(cancellationToken:=CancellationToken.None).Length()) ' Remove syntaxtree with error comp = comp.RemoveSyntaxTrees(withErrorTreeCS) Assert.Equal(0, comp.GetDiagnostics().Length()) Assert.Equal(0, comp.GetDeclarationDiagnostics().Length()) ' Get valid binding Dim bind = comp.GetSemanticModel(syntaxTree:=t1) Assert.NotNull(bind) ' Get Binding with tree is not exist bind = comp.GetSemanticModel(withErrorTree) Assert.NotNull(bind) ' Add syntaxtree which is CS language comp = comp.AddSyntaxTrees(withErrorTreeCS) Assert.Equal(2, comp.GetDiagnostics().Length()) comp = comp.RemoveSyntaxTrees(withErrorTreeCS) Assert.Equal(0, comp.GetDiagnostics().Length()) comp = comp.AddSyntaxTrees(t1, withErrorTree, withErrorTree1, withErrorTreeCS) comp = comp.RemoveSyntaxTrees(t1, withErrorTree, withErrorTree1, withErrorTreeCS) ' Add a new empty item comp = comp.AddSyntaxTrees(Enumerable.Empty(Of SyntaxTree)) Assert.Equal(0, comp.SyntaxTrees.Length) ' Add a new valid item comp = comp.AddSyntaxTrees(t1) Assert.Equal(1, comp.SyntaxTrees.Length) comp = comp.AddSyntaxTrees(VisualBasicSyntaxTree.ParseText(s4)) Assert.Equal(2, comp.SyntaxTrees.Length) ' Replace an existing item with another valid item comp = comp.ReplaceSyntaxTree(t1, VisualBasicSyntaxTree.ParseText(s4)) Assert.Equal(2, comp.SyntaxTrees.Length) ' Replace an existing item with same item comp = comp.AddSyntaxTrees(t1).ReplaceSyntaxTree(t1, t1) Assert.Equal(3, comp.SyntaxTrees.Length) ' Replace with existing and verify that it throws Assert.Throws(Of ArgumentException)(Sub() comp.ReplaceSyntaxTree(t1, comp.SyntaxTrees(0))) Assert.Throws(Of ArgumentException)(Sub() comp.AddSyntaxTrees(t1)) ' SyntaxTrees have reference equality. This removal should fail. Assert.Throws(Of ArgumentException)(Sub() comp = comp.RemoveSyntaxTrees(VisualBasicSyntaxTree.ParseText(s4))) Assert.Equal(3, comp.SyntaxTrees.Length) ' Remove non-existing item Assert.Throws(Of ArgumentException)(Sub() comp = comp.RemoveSyntaxTrees(withErrorTree)) Assert.Equal(3, comp.SyntaxTrees.Length) Dim t4 = VisualBasicSyntaxTree.ParseText("Using System;") Dim t5 = VisualBasicSyntaxTree.ParseText("Usingsssssssssssss System;") Dim t6 = VisualBasicSyntaxTree.ParseText("Import System") ' Overload with Hashset Dim hs = New HashSet(Of SyntaxTree) From {t4, t5, t6} Dim compCollection = VisualBasicCompilation.Create("Compilation", syntaxTrees:=hs) compCollection = compCollection.RemoveSyntaxTrees(hs) Assert.Equal(0, compCollection.SyntaxTrees.Length) compCollection = compCollection.AddSyntaxTrees(hs).RemoveSyntaxTrees(t4, t5, t6) Assert.Equal(0, compCollection.SyntaxTrees.Length) ' Overload with Collection Dim col = New ObjectModel.Collection(Of SyntaxTree) From {t4, t5, t6} compCollection = VisualBasicCompilation.Create("Compilation", syntaxTrees:=col) compCollection = compCollection.RemoveSyntaxTrees(t4, t5, t6) Assert.Equal(0, compCollection.SyntaxTrees.Length) Assert.Throws(Of ArgumentException)(Sub() compCollection = compCollection.AddSyntaxTrees(t4, t5).RemoveSyntaxTrees(col)) Assert.Equal(0, compCollection.SyntaxTrees.Length) ' Overload with ConcurrentStack Dim stack = New Concurrent.ConcurrentStack(Of SyntaxTree) stack.Push(t4) stack.Push(t5) stack.Push(t6) compCollection = VisualBasicCompilation.Create("Compilation", syntaxTrees:=stack) compCollection = compCollection.RemoveSyntaxTrees(t4, t6, t5) Assert.Equal(0, compCollection.SyntaxTrees.Length) Assert.Throws(Of ArgumentException)(Sub() compCollection = compCollection.AddSyntaxTrees(t4, t6).RemoveSyntaxTrees(stack)) Assert.Equal(0, compCollection.SyntaxTrees.Length) ' Overload with ConcurrentQueue Dim queue = New Concurrent.ConcurrentQueue(Of SyntaxTree) queue.Enqueue(t4) queue.Enqueue(t5) queue.Enqueue(t6) compCollection = VisualBasicCompilation.Create("Compilation", syntaxTrees:=queue) compCollection = compCollection.RemoveSyntaxTrees(t4, t6, t5) Assert.Equal(0, compCollection.SyntaxTrees.Length) Assert.Throws(Of ArgumentException)(Sub() compCollection = compCollection.AddSyntaxTrees(t4, t6).RemoveSyntaxTrees(queue)) Assert.Equal(0, compCollection.SyntaxTrees.Length) ' VisualBasicCompilation.Create with syntaxtree with a non-CompilationUnit root node: should throw an ArgumentException. Assert.False(withExpressionRootTree.HasCompilationUnitRoot, "how did we get a CompilationUnit root?") Assert.Throws(Of ArgumentException)(Sub() VisualBasicCompilation.Create("Compilation", syntaxTrees:={withExpressionRootTree})) ' AddSyntaxTrees with a non-CompilationUnit root node: should throw an ArgumentException. Assert.Throws(Of ArgumentException)(Sub() comp.AddSyntaxTrees(withExpressionRootTree)) ' ReplaceSyntaxTrees syntaxtree with a non-CompilationUnit root node: should throw an ArgumentException. Assert.Throws(Of ArgumentException)(Sub() comp.ReplaceSyntaxTree(comp.SyntaxTrees(0), withExpressionRootTree)) End Sub <Fact> Public Sub ChainedOperations() Dim s1 = "using System.Linq;" Dim s2 = "" Dim s3 = "Import System" Dim t1 = VisualBasicSyntaxTree.ParseText(s1) Dim t2 = VisualBasicSyntaxTree.ParseText(s2) Dim t3 = VisualBasicSyntaxTree.ParseText(s3) Dim listSyntaxTree = New List(Of SyntaxTree) listSyntaxTree.Add(t1) listSyntaxTree.Add(t2) ' Remove second SyntaxTree Dim comp = VisualBasicCompilation.Create("Compilation") comp = comp.AddSyntaxTrees(listSyntaxTree).RemoveSyntaxTrees(t2) Assert.Equal(1, comp.SyntaxTrees.Length) 'ContainsSyntaxTree Dim b1 As Boolean = comp.ContainsSyntaxTree(t2) Assert.Equal(Of Boolean)(False, b1) comp = comp.AddSyntaxTrees({t2}) b1 = comp.ContainsSyntaxTree(t2) Assert.Equal(Of Boolean)(True, b1) Dim xt As SyntaxTree = Nothing Assert.Equal(Of Boolean)(False, comp.ContainsSyntaxTree(xt)) comp = comp.RemoveSyntaxTrees({t2}) Assert.Equal(1, comp.SyntaxTrees.Length) comp = comp.AddSyntaxTrees({t2}) Assert.Equal(2, comp.SyntaxTrees.Length) 'RemoveAllSyntaxTrees comp = comp.RemoveAllSyntaxTrees Assert.Equal(0, comp.SyntaxTrees.Length) comp = VisualBasicCompilation.Create("Compilation").AddSyntaxTrees(listSyntaxTree).RemoveSyntaxTrees({t2}) Assert.Equal(Of Integer)(1, comp.SyntaxTrees.Length) Assert.Equal(Of String)("Object", comp.ObjectType.Name) ' Remove mid SyntaxTree listSyntaxTree.Add(t3) comp = comp.RemoveSyntaxTrees(t1).AddSyntaxTrees(listSyntaxTree).RemoveSyntaxTrees(t2) Assert.Equal(2, comp.SyntaxTrees.Length) ' remove list listSyntaxTree.Remove(t2) comp = comp.AddSyntaxTrees().RemoveSyntaxTrees(listSyntaxTree) comp = comp.AddSyntaxTrees(listSyntaxTree).RemoveSyntaxTrees(listSyntaxTree) Assert.Equal(0, comp.SyntaxTrees.Length) listSyntaxTree.Clear() listSyntaxTree.Add(t1) ' Chained operation count > 2 comp = comp.AddSyntaxTrees(listSyntaxTree).AddReferences().ReplaceSyntaxTree(t1, t2) Assert.Equal(1, comp.SyntaxTrees.Length) Assert.Equal(0, comp.References.Count) ' Create compilation with args is disordered Dim comp1 = VisualBasicCompilation.Create("Compilation") Dim Err = "c:\file_that_does_not_exist" Dim ref1 = Net451.mscorlib Dim listRef = New List(Of MetadataReference) ' this is NOT testing Roslyn listRef.Add(ref1) listRef.Add(ref1) ' Remove with no args comp1 = comp1.AddReferences(listRef).AddSyntaxTrees(listSyntaxTree).RemoveReferences().RemoveSyntaxTrees() 'should have only added one reference since ref1.Equals(ref1) and Equal references are added only once. Assert.Equal(1, comp1.References.Count) Assert.Equal(1, comp1.SyntaxTrees.Length) End Sub <WorkItem(713356, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/713356")> <Fact()> Public Sub MissedModuleA() Dim netModule1 = CreateCompilationWithMscorlib40AndVBRuntime( <compilation name="missing1"> <file name="a.vb"> Class C1 End Class </file> </compilation>, options:=TestOptions.ReleaseModule) netModule1.VerifyDiagnostics() Dim netModule2 = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="missing2"> <file name="a.vb"> Class C2 Public Shared Sub M() Dim a As New C1() End Sub End Class </file> </compilation>, references:={netModule1.EmitToImageReference()}, options:=TestOptions.ReleaseModule) netModule2.VerifyDiagnostics() Dim assembly = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="missing"> <file name="a.vb"> Class C3 Public Shared Sub Main(args() As String) Dim a As New C2() End Sub End Class </file> </compilation>, references:={netModule2.EmitToImageReference()}) assembly.VerifyDiagnostics(Diagnostic(ERRID.ERR_MissingNetModuleReference).WithArguments("missing1.netmodule")) assembly = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="MissedModuleA"> <file name="a.vb"> Class C3 Public Shared Sub Main(args() As String) Dim a As New C2() End Sub End Class </file> </compilation>, references:={netModule1.EmitToImageReference(), netModule2.EmitToImageReference()}) assembly.VerifyDiagnostics() CompileAndVerify(assembly) End Sub <WorkItem(713356, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/713356")> <Fact()> Public Sub MissedModuleB_OneError() Dim netModule1 = CreateCompilationWithMscorlib40AndVBRuntime( <compilation name="a1"> <file name="a.vb"> Class C1 End Class </file> </compilation>, options:=TestOptions.ReleaseModule) CompilationUtils.AssertNoDiagnostics(netModule1) Dim netModule2 = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="a2"> <file name="a.vb"> Class C2 Public Shared Sub M() Dim a As New C1() End Sub End Class </file> </compilation>, references:={netModule1.EmitToImageReference()}, options:=TestOptions.ReleaseModule) CompilationUtils.AssertNoDiagnostics(netModule2) Dim netModule3 = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="a3"> <file name="a.vb"> Class C22 Public Shared Sub M() Dim a As New C1() End Sub End Class </file> </compilation>, references:={netModule1.EmitToImageReference()}, options:=TestOptions.ReleaseModule) CompilationUtils.AssertNoDiagnostics(netModule3) Dim assembly = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="a"> <file name="a.vb"> Class C3 Public Shared Sub Main(args() As String) Dim a As New C2() Dim b As New C22() End Sub End Class </file> </compilation>, references:={netModule2.EmitToImageReference(), netModule3.EmitToImageReference()}) CompilationUtils.AssertTheseDiagnostics(assembly, <errors> BC37221: Reference to 'a1.netmodule' netmodule missing. </errors>) End Sub <WorkItem(718500, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/718500")> <WorkItem(716762, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/716762")> <Fact()> Public Sub MissedModuleB_NoErrorForUnmanagedModules() Dim netModule1 = CreateCompilationWithMscorlib40AndVBRuntime( <compilation name="a1"> <file name="a.vb"> Imports System.Runtime.InteropServices Public Class ClassDLLImports Declare Function getUserName Lib "advapi32.dll" Alias "GetUserNameA" ( ByVal lpBuffer As String, ByRef nSize As Integer) As Integer End Class </file> </compilation>, options:=TestOptions.ReleaseModule) CompilationUtils.AssertNoDiagnostics(netModule1) Dim assembly = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="a"> <file name="a.vb"> Class C3 Public Shared Sub Main(args() As String) End Sub End Class </file> </compilation>, references:={netModule1.EmitToImageReference(expectedWarnings:={ Diagnostic(ERRID.HDN_UnusedImportStatement, "Imports System.Runtime.InteropServices")})}) assembly.AssertNoDiagnostics() End Sub <WorkItem(715872, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/715872")> <Fact()> Public Sub MissedModuleC() Dim netModule1 = CreateCompilationWithMscorlib40AndVBRuntime( <compilation name="a1"> <file name="a.vb"> Class C1 End Class </file> </compilation>, options:=TestOptions.ReleaseModule) CompilationUtils.AssertNoDiagnostics(netModule1) Dim netModule2 = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="a1"> <file name="a.vb"> Class C2 Public Shared Sub M() End Sub End Class </file> </compilation>, references:={netModule1.EmitToImageReference()}, options:=TestOptions.ReleaseModule) CompilationUtils.AssertNoDiagnostics(netModule2) Dim assembly = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="a"> <file name="a.vb"> Class C3 Public Shared Sub Main(args() As String) Dim a As New C2() End Sub End Class </file> </compilation>, references:={netModule1.EmitToImageReference(), netModule2.EmitToImageReference()}) CompilationUtils.AssertTheseDiagnostics(assembly, <errors> BC37224: Module 'a1.netmodule' is already defined in this assembly. Each module must have a unique filename. </errors>) End Sub <Fact> Public Sub MixedRefType() ' Create compilation takes three args Dim csComp = CS.CSharpCompilation.Create("CompilationVB") Dim comp = VisualBasicCompilation.Create("Compilation") ' this is NOT right path, ' please don't use VB dll (there is a change to the location in Dev11; you test will fail then) csComp = csComp.AddReferences(SystemRef) ' Add VB reference to C# compilation For Each item In csComp.References comp = comp.AddReferences(item) comp = comp.ReplaceReference(item, item) Next Assert.Equal(1, comp.References.Count) Dim text1 = "Imports System" Dim comp1 = VisualBasicCompilation.Create("Test1", {VisualBasicSyntaxTree.ParseText(text1)}) Dim comp2 = VisualBasicCompilation.Create("Test2", {VisualBasicSyntaxTree.ParseText(text1)}) Dim compRef1 = comp1.ToMetadataReference() Dim compRef2 = comp2.ToMetadataReference() Dim csCompRef = csComp.ToMetadataReference(embedInteropTypes:=True) Dim ref1 = Net451.mscorlib Dim ref2 = Net451.System ' Add VisualBasicCompilationReference comp = VisualBasicCompilation.Create("Test1", {VisualBasicSyntaxTree.ParseText(text1)}, {compRef1, compRef2}) Assert.Equal(2, comp.References.Count) Assert.Equal(MetadataImageKind.Assembly, comp.References(0).Properties.Kind) Assert.Contains(compRef1, comp.References) Assert.Contains(compRef2, comp.References) Dim smb = comp.GetReferencedAssemblySymbol(compRef1) Assert.Equal(smb.Kind, SymbolKind.Assembly) Assert.Equal("Test1", smb.Identity.Name, StringComparer.OrdinalIgnoreCase) ' Mixed reference type comp = comp.AddReferences(ref1) Assert.Equal(3, comp.References.Count) Assert.Contains(ref1, comp.References) ' Replace Compilation reference with Assembly file reference comp = comp.ReplaceReference(compRef2, ref2) Assert.Equal(3, comp.References.Count) Assert.Contains(ref2, comp.References) ' Replace Assembly file reference with Compilation reference comp = comp.ReplaceReference(ref1, compRef2) Assert.Equal(3, comp.References.Count) Assert.Contains(compRef2, comp.References) Dim modRef1 = ModuleMetadata.CreateFromImage(TestResources.MetadataTests.NetModule01.ModuleCS00).GetReference() ' Add Module file reference comp = comp.AddReferences(modRef1) ' Not Implemented 'Dim modSmb = comp.GetReferencedModuleSymbol(modRef1) 'Assert.Equal("ModuleCS00.mod", modSmb.Name) 'Assert.Equal(4, comp.References.Count) 'Assert.True(comp.References.Contains(modRef1)) ' Get Referenced Assembly Symbol 'smb = comp.GetReferencedAssemblySymbol(reference:=modRef1) 'Assert.Equal(smb.Kind, SymbolKind.Assembly) 'Assert.True(String.Equals(smb.AssemblyName.Name, "Test1", StringComparison.OrdinalIgnoreCase)) ' Get Referenced Module Symbol 'Dim moduleSmb = comp.GetReferencedModuleSymbol(reference:=modRef1) 'Assert.Equal(moduleSmb.Kind, SymbolKind.NetModule) 'Assert.True(String.Equals(moduleSmb.Name, "ModuleCS00.mod", StringComparison.OrdinalIgnoreCase)) ' Not implemented ' Get Compilation Namespace 'Dim nsSmb = comp.GlobalNamespace 'Dim ns = comp.GetCompilationNamespace(ns:=nsSmb) 'Assert.Equal(ns.Kind, SymbolKind.Namespace) 'Assert.True(String.Equals(ns.Name, "Compilation", StringComparison.OrdinalIgnoreCase)) ' Not implemented ' GetCompilationNamespace (Derived Class MergedNamespaceSymbol) 'Dim merged As NamespaceSymbol = MergedNamespaceSymbol.Create(New NamespaceExtent(New MockAssemblySymbol("Merged")), Nothing, Nothing) 'ns = comp.GetCompilationNamespace(ns:=merged) 'Assert.Equal(ns.Kind, SymbolKind.Namespace) 'Assert.True(String.Equals(ns.Name, "Compilation", StringComparison.OrdinalIgnoreCase)) ' Not implemented ' GetCompilationNamespace (Derived Class PENamespaceSymbol) 'Dim pensSmb As Metadata.PE.PENamespaceSymbol = CType(nsSmb, Metadata.PE.PENamespaceSymbol) 'ns = comp.GetCompilationNamespace(ns:=pensSmb) 'Assert.Equal(ns.Kind, SymbolKind.Namespace) 'Assert.True(String.Equals(ns.Name, "Compilation", StringComparison.OrdinalIgnoreCase)) ' Replace Module file reference with compilation reference comp = comp.RemoveReferences(compRef1).ReplaceReference(modRef1, compRef1) Assert.Equal(3, comp.References.Count) ' Check the reference order after replace Assert.Equal(MetadataImageKind.Assembly, comp.References(2).Properties.Kind) Assert.Equal(compRef1, comp.References(2)) ' Replace compilation Module file reference with Module file reference comp = comp.ReplaceReference(compRef1, modRef1) ' Check the reference order after replace Assert.Equal(3, comp.References.Count) Assert.Equal(MetadataImageKind.Module, comp.References(2).Properties.Kind) Assert.Equal(modRef1, comp.References(2)) ' Add CS compilation ref Assert.Throws(Of ArgumentException)(Function() comp.AddReferences(csCompRef)) For Each item In comp.References comp = comp.RemoveReferences(item) Next Assert.Equal(0, comp.References.Count) ' Not Implemented ' Dim asmByteRef = MetadataReference.CreateFromImage(New Byte(4) {}, "AssemblyBytesRef1", embedInteropTypes:=True) 'Dim asmObjectRef = New AssemblyObjectReference(assembly:=System.Reflection.Assembly.GetAssembly(GetType(Object)), embedInteropTypes:=True) 'comp = comp.AddReferences(asmByteRef, asmObjectRef) 'Assert.Equal(2, comp.References.Count) 'Assert.Equal(ReferenceKind.AssemblyBytes, comp.References(0).Kind) 'Assert.Equal(ReferenceKind.AssemblyObject, comp.References(1).Kind) 'Assert.Equal(asmByteRef, comp.References(0)) 'Assert.Equal(asmObjectRef, comp.References(1)) 'Assert.True(comp.References(0).EmbedInteropTypes) 'Assert.True(comp.References(1).EmbedInteropTypes) End Sub <Fact> Public Sub ModuleSuppliedAsAssembly() Dim comp = VisualBasicCompilation.Create("Compilation", references:={AssemblyMetadata.CreateFromImage(TestResources.MetadataTests.NetModule01.ModuleVB01).GetReference()}) Assert.Equal(comp.GetDiagnostics().First().Code, ERRID.ERR_MetaDataIsNotAssembly) End Sub <Fact> Public Sub AssemblySuppliedAsModule() Dim comp = VisualBasicCompilation.Create("Compilation", references:={ModuleMetadata.CreateFromImage(ResourcesNet451.System).GetReference()}) Assert.Equal(comp.GetDiagnostics().First().Code, ERRID.ERR_MetaDataIsNotModule) End Sub '' Get nonexistent Referenced Assembly Symbol <WorkItem(537637, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537637")> <Fact> Public Sub NegReference1() Dim comp = VisualBasicCompilation.Create("Compilation") Assert.Null(comp.GetReferencedAssemblySymbol(Net451.System)) Dim modRef1 = ModuleMetadata.CreateFromImage(TestResources.MetadataTests.NetModule01.ModuleVB01).GetReference() Assert.Null(comp.GetReferencedModuleSymbol(modRef1)) End Sub '' Add already existing item <WorkItem(537617, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537617")> <Fact> Public Sub NegReference2() Dim comp = VisualBasicCompilation.Create("Compilation") Dim ref1 = Net451.System Dim ref2 = New TestMetadataReference(fullPath:="c:\a\xml.bms") Dim ref3 = ref2 Dim ref4 = New TestMetadataReference(fullPath:="c:\aaa.dll") comp = comp.AddReferences(ref1, ref1) Assert.Equal(1, comp.References.Count) Assert.Equal(ref1, comp.References(0)) ' Remove non-existing item Assert.Throws(Of ArgumentException)(Function() comp.RemoveReferences(ref2)) Dim listRef = New List(Of MetadataReference) From {ref1, ref2, ref3, ref4} comp = comp.AddReferences(listRef).AddReferences(ref2).ReplaceReference(ref2, ref2) Assert.Equal(3, comp.References.Count) comp = comp.RemoveReferences(listRef).AddReferences(ref1) Assert.Equal(1, comp.References.Count) Assert.Equal(ref1, comp.References(0)) End Sub '' Add a new invalid item <WorkItem(537575, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537575")> <Fact> Public Sub NegReference3() Dim comp = VisualBasicCompilation.Create("Compilation") Dim ref1 = New TestMetadataReference(fullPath:="c:\xml.bms") Dim ref2 = Net451.System comp = comp.AddReferences(ref1) Assert.Equal(1, comp.References.Count) ' Replace a non-existing item with another invalid item Assert.Throws(Of ArgumentException)(Sub() comp = comp.ReplaceReference(ref2, ref1) End Sub) Assert.Equal(1, comp.References.Count) End Sub '' Replace a non-existing item with null <WorkItem(537567, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537567")> <Fact> Public Sub NegReference4() Dim opt = TestOptions.ReleaseExe Dim comp = VisualBasicCompilation.Create("Compilation") Dim ref1 = New TestMetadataReference(fullPath:="c:\xml.bms") Assert.Throws(Of ArgumentException)( Sub() comp.ReplaceReference(ref1, Nothing) End Sub) ' Replace null and the arg order of replace is vise Assert.Throws(Of ArgumentNullException)( Sub() comp.ReplaceReference(newReference:=ref1, oldReference:=Nothing) End Sub) End Sub '' Replace a non-existing item with another valid item <WorkItem(537566, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537566")> <Fact> Public Sub NegReference5() Dim comp = VisualBasicCompilation.Create("Compilation") Dim ref1 = Net451.mscorlib Dim ref2 = Net451.System Assert.Throws(Of ArgumentException)( Sub() comp = comp.ReplaceReference(ref1, ref2) End Sub) Dim s1 = "Imports System.Text" Dim t1 = Parse(s1) ' Replace a non-existing item with another valid item and disorder the args Assert.Throws(Of ArgumentException)(Sub() comp.ReplaceSyntaxTree(newTree:=VisualBasicSyntaxTree.ParseText("Imports System"), oldTree:=t1) End Sub) Assert.Equal(0, comp.References.Count) End Sub '' Throw exception when add Nothing references <WorkItem(537618, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537618")> <Fact> Public Sub NegReference6() Dim opt = TestOptions.ReleaseExe Dim comp = VisualBasicCompilation.Create("Compilation") Assert.Throws(Of ArgumentNullException)(Sub() comp = comp.AddReferences(Nothing)) End Sub '' Throw exception when remove Nothing references <WorkItem(537621, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537621")> <Fact> Public Sub NegReference7() Dim opt = TestOptions.ReleaseExe Dim comp = VisualBasicCompilation.Create("Compilation") Dim RemoveNothingRefEx = Assert.Throws(Of ArgumentNullException)(Sub() comp = comp.RemoveReferences(Nothing)) End Sub '' Add already existing item <WorkItem(537576, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537576")> <Fact> Public Sub NegSyntaxTree1() Dim opt = TestOptions.ReleaseExe Dim comp = VisualBasicCompilation.Create("Compilation") Dim t1 = VisualBasicSyntaxTree.ParseText("Using System;") Assert.Throws(Of ArgumentException)(Sub() comp.AddSyntaxTrees(t1, t1)) Assert.Equal(0, comp.SyntaxTrees.Length) End Sub ' Throw exception when the parameter of ContainsSyntaxTrees is null <WorkItem(527256, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/527256")> <Fact> Public Sub NegContainsSyntaxTrees() Dim opt = TestOptions.ReleaseExe Dim comp = VisualBasicCompilation.Create("Compilation") Assert.False(comp.SyntaxTrees.Contains(Nothing)) End Sub ' Throw exception when the parameter of AddReferences is CSharpCompilationReference <WorkItem(537778, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537778")> <Fact> Public Sub NegGetSymbol() Dim opt = TestOptions.ReleaseExe Dim comp = VisualBasicCompilation.Create("Compilation") Dim csComp = CS.CSharpCompilation.Create("CompilationCS") Dim compRef = csComp.ToMetadataReference() Assert.Throws(Of ArgumentException)(Function() comp.AddReferences(compRef)) '' Throw exception when the parameter of GetReferencedAssemblySymbol is null 'Assert.Throws(Of ArgumentNullException)(Sub() comp.GetReferencedAssemblySymbol(Nothing)) '' Throw exception when the parameter of GetReferencedModuleSymbol is null 'Assert.Throws(Of ArgumentNullException)( ' Sub() ' comp.GetReferencedModuleSymbol(Nothing) ' End Sub) End Sub '' Throw exception when the parameter of GetSpecialType is 'SpecialType.None' <WorkItem(537784, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537784")> <Fact> Public Sub NegGetSpecialType() Dim comp = VisualBasicCompilation.Create("Compilation") Assert.Throws(Of ArgumentOutOfRangeException)( Sub() comp.GetSpecialType((SpecialType.None)) End Sub) ' Throw exception when the parameter of GetSpecialType is '0' Assert.Throws(Of ArgumentOutOfRangeException)( Sub() comp.GetSpecialType(CType(0, SpecialType)) End Sub) ' Throw exception when the parameter of GetBinding is out of range Assert.Throws(Of ArgumentOutOfRangeException)( Sub() comp.GetSpecialType(CType(100, SpecialType)) End Sub) ' Throw exception when the parameter of GetCompilationNamespace is null Assert.Throws(Of ArgumentNullException)( Sub() comp.GetCompilationNamespace(namespaceSymbol:=Nothing) End Sub) Dim bind = comp.GetSemanticModel(Nothing) Assert.NotNull(bind) End Sub <Fact> Public Sub NegSynTree() Dim comp = VisualBasicCompilation.Create("Compilation") Dim s1 = "Imports System.Text" Dim tree = VisualBasicSyntaxTree.ParseText(s1) ' Throw exception when add Nothing SyntaxTree Assert.Throws(Of ArgumentNullException)(Sub() comp.AddSyntaxTrees(Nothing)) ' Throw exception when Remove Nothing SyntaxTree Assert.Throws(Of ArgumentNullException)(Sub() comp.RemoveSyntaxTrees(Nothing)) ' Replace a tree with nothing (aka removing it) comp = comp.AddSyntaxTrees(tree).ReplaceSyntaxTree(tree, Nothing) Assert.Equal(0, comp.SyntaxTrees.Count) ' Throw exception when remove Nothing SyntaxTree Assert.Throws(Of ArgumentNullException)(Sub() comp = comp.ReplaceSyntaxTree(Nothing, tree)) Dim t1 = CS.SyntaxFactory.ParseSyntaxTree(s1) Dim t2 As SyntaxTree = t1 Dim t3 = t2 Dim csComp = CS.CSharpCompilation.Create("CompilationVB") csComp = csComp.AddSyntaxTrees(t1, CS.SyntaxFactory.ParseSyntaxTree("Imports Goo")) ' Throw exception when cast SyntaxTree For Each item In csComp.SyntaxTrees t3 = item Dim invalidCastSynTreeEx = Assert.Throws(Of InvalidCastException)(Sub() comp = comp.AddSyntaxTrees(CType(t3, VisualBasicSyntaxTree))) invalidCastSynTreeEx = Assert.Throws(Of InvalidCastException)(Sub() comp = comp.RemoveSyntaxTrees(CType(t3, VisualBasicSyntaxTree))) invalidCastSynTreeEx = Assert.Throws(Of InvalidCastException)(Sub() comp = comp.ReplaceSyntaxTree(CType(t3, VisualBasicSyntaxTree), CType(t3, VisualBasicSyntaxTree))) Next End Sub <Fact> Public Sub RootNSIllegalIdentifiers() AssertTheseDiagnostics(TestOptions.ReleaseExe.WithRootNamespace("[[Global]]").Errors, <expected> BC2014: the value '[[Global]]' is invalid for option 'RootNamespace' </expected>) AssertTheseDiagnostics(TestOptions.ReleaseExe.WithRootNamespace("From()").Errors, <expected> BC2014: the value 'From()' is invalid for option 'RootNamespace' </expected>) AssertTheseDiagnostics(TestOptions.ReleaseExe.WithRootNamespace("x$").Errors, <expected> BC2014: the value 'x$' is invalid for option 'RootNamespace' </expected>) AssertTheseDiagnostics(TestOptions.ReleaseExe.WithRootNamespace("Goo.").Errors, <expected> BC2014: the value 'Goo.' is invalid for option 'RootNamespace' </expected>) AssertTheseDiagnostics(TestOptions.ReleaseExe.WithRootNamespace("_").Errors, <expected> BC2014: the value '_' is invalid for option 'RootNamespace' </expected>) End Sub <Fact> Public Sub AmbiguousNestedTypeSymbolFromMetadata() Dim code = "Class A : Class B : End Class : End Class" Dim c1 = VisualBasicCompilation.Create("Asm1", syntaxTrees:={VisualBasicSyntaxTree.ParseText(code)}) Dim c2 = VisualBasicCompilation.Create("Asm2", syntaxTrees:={VisualBasicSyntaxTree.ParseText(code)}) Dim c3 = VisualBasicCompilation.Create("Asm3", references:={c1.ToMetadataReference(), c2.ToMetadataReference()}) Assert.Null(c3.GetTypeByMetadataName("A+B")) End Sub <Fact> Public Sub DuplicateNestedTypeSymbol() Dim code = "Class A : Class B : End Class : Class B : End Class : End Class" Dim c1 = VisualBasicCompilation.Create("Asm1", syntaxTrees:={VisualBasicSyntaxTree.ParseText(code)}) Assert.Equal("A.B", c1.GetTypeByMetadataName("A+B").ToDisplayString()) End Sub <Fact()> <WorkItem(543211, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543211")> Public Sub TreeDiagnosticsShouldNotIncludeEntryPointDiagnostics() Dim code1 = "Module M : Sub Main : End Sub : End Module" Dim code2 = " " Dim tree1 = VisualBasicSyntaxTree.ParseText(code1) Dim tree2 = VisualBasicSyntaxTree.ParseText(code2) Dim comp = VisualBasicCompilation.Create( "Test", syntaxTrees:={tree1, tree2}) Dim semanticModel2 = comp.GetSemanticModel(tree2) Dim diagnostics2 = semanticModel2.GetDiagnostics() Assert.Equal(0, diagnostics2.Length()) End Sub <Fact()> <WorkItem(543292, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543292")> Public Sub CompilationNotSupported() Dim compilation = VisualBasicCompilation.Create("HelloWorld") Assert.Throws(Of NotSupportedException)(Function() compilation.DynamicType) Assert.Throws(Of NotSupportedException)(Function() compilation.CreatePointerTypeSymbol(Nothing)) Assert.Throws(Of NotSupportedException)(Function() compilation.CreateFunctionPointerTypeSymbol(Nothing, Nothing, Nothing, Nothing, Nothing, Nothing)) End Sub <Fact> Public Sub CreateTupleTypeSymbol_NoNames() Dim comp = VisualBasicCompilation.Create("test", references:={MscorlibRef}) ' no ValueTuple Dim intType As TypeSymbol = comp.GetSpecialType(SpecialType.System_Int32) Dim stringType As TypeSymbol = comp.GetSpecialType(SpecialType.System_String) Dim vt2 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).Construct(intType, stringType) Dim tupleWithoutNames = comp.CreateTupleTypeSymbol(vt2, Nothing) Assert.True(tupleWithoutNames.IsTupleType) Assert.Equal("(System.Int32, System.String)", tupleWithoutNames.ToTestDisplayString()) Assert.True(tupleWithoutNames.TupleElements.All(Function(e) e.IsImplicitlyDeclared)) Assert.Equal({"System.Int32", "System.String"}, tupleWithoutNames.TupleElements.Select(Function(t) t.Type.ToTestDisplayString())) Assert.Equal(CInt(SymbolKind.NamedType), CInt(tupleWithoutNames.Kind)) End Sub <Fact> Public Sub CreateTupleTypeSymbol_WithNames() Dim comp = VisualBasicCompilation.Create("test", references:={MscorlibRef}) ' no ValueTuple Dim intType As TypeSymbol = comp.GetSpecialType(SpecialType.System_Int32) Dim stringType As TypeSymbol = comp.GetSpecialType(SpecialType.System_String) Dim vt2 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).Construct(intType, stringType) Dim tupleWithNames = comp.CreateTupleTypeSymbol(vt2, ImmutableArray.Create("Alice", "Bob")) Assert.True(tupleWithNames.IsTupleType) Assert.Equal("(Alice As System.Int32, Bob As System.String)", tupleWithNames.ToTestDisplayString()) Assert.Equal({"Alice", "Bob"}, tupleWithNames.TupleElements.SelectAsArray(Function(e) e.Name)) Assert.Equal({"System.Int32", "System.String"}, tupleWithNames.TupleElements.Select(Function(t) t.Type.ToTestDisplayString())) Assert.Equal(SymbolKind.NamedType, tupleWithNames.Kind) End Sub <Fact()> <WorkItem(36047, "https://github.com/dotnet/roslyn/issues/36047")> Public Sub CreateArrayType_DefaultArgs() Dim comp = DirectCast(VisualBasicCompilation.Create(""), Compilation) Dim elementType = comp.GetSpecialType(SpecialType.System_Object) Dim arrayType = comp.CreateArrayTypeSymbol(elementType) Assert.Equal(1, arrayType.Rank) Assert.Equal(CodeAnalysis.NullableAnnotation.None, arrayType.ElementNullableAnnotation) Assert.Throws(Of ArgumentException)(Function() comp.CreateArrayTypeSymbol(elementType, Nothing)) Assert.Throws(Of ArgumentException)(Function() comp.CreateArrayTypeSymbol(elementType, 0)) arrayType = comp.CreateArrayTypeSymbol(elementType, 1, Nothing) Assert.Equal(1, arrayType.Rank) Assert.Equal(CodeAnalysis.NullableAnnotation.None, arrayType.ElementNullableAnnotation) Assert.Throws(Of ArgumentException)(Function() comp.CreateArrayTypeSymbol(elementType, rank:=Nothing)) Assert.Throws(Of ArgumentException)(Function() comp.CreateArrayTypeSymbol(elementType, rank:=0)) arrayType = comp.CreateArrayTypeSymbol(elementType, elementNullableAnnotation:=Nothing) Assert.Equal(1, arrayType.Rank) Assert.Equal(CodeAnalysis.NullableAnnotation.None, arrayType.ElementNullableAnnotation) End Sub <Fact()> <WorkItem(36047, "https://github.com/dotnet/roslyn/issues/36047")> Public Sub CreateArrayType_ElementNullableAnnotation() Dim comp = DirectCast(VisualBasicCompilation.Create(""), Compilation) Dim elementType = comp.GetSpecialType(SpecialType.System_Object) Assert.Equal(CodeAnalysis.NullableAnnotation.None, comp.CreateArrayTypeSymbol(elementType).ElementNullableAnnotation) Assert.Equal(CodeAnalysis.NullableAnnotation.None, comp.CreateArrayTypeSymbol(elementType, elementNullableAnnotation:=Nothing).ElementNullableAnnotation) Assert.Equal(CodeAnalysis.NullableAnnotation.None, comp.CreateArrayTypeSymbol(elementType, elementNullableAnnotation:=CodeAnalysis.NullableAnnotation.None).ElementNullableAnnotation) Assert.Equal(CodeAnalysis.NullableAnnotation.None, comp.CreateArrayTypeSymbol(elementType, elementNullableAnnotation:=CodeAnalysis.NullableAnnotation.NotAnnotated).ElementNullableAnnotation) Assert.Equal(CodeAnalysis.NullableAnnotation.None, comp.CreateArrayTypeSymbol(elementType, elementNullableAnnotation:=CodeAnalysis.NullableAnnotation.Annotated).ElementNullableAnnotation) End Sub <Fact()> Public Sub CreateAnonymousType_IncorrectLengths() Dim compilation = VisualBasicCompilation.Create("HelloWorld") Assert.Throws(Of ArgumentException)( Function() Return compilation.CreateAnonymousTypeSymbol( ImmutableArray.Create(DirectCast(Nothing, ITypeSymbol)), ImmutableArray.Create("m1", "m2")) End Function) End Sub <Fact> Public Sub CreateAnonymousType_IncorrectLengths_IsReadOnly() Dim compilation = VisualBasicCompilation.Create("HelloWorld") Assert.Throws(Of ArgumentException)( Sub() compilation.CreateAnonymousTypeSymbol( ImmutableArray.Create(DirectCast(compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol), DirectCast(compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol)), ImmutableArray.Create("m1", "m2"), ImmutableArray.Create(True)) End Sub) End Sub <Fact> Public Sub CreateAnonymousType_IncorrectLengths_Locations() Dim Compilation = VisualBasicCompilation.Create("HelloWorld") Assert.Throws(Of ArgumentException)( Sub() Compilation.CreateAnonymousTypeSymbol( ImmutableArray.Create(DirectCast(Compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol), DirectCast(Compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol)), ImmutableArray.Create("m1", "m2"), memberLocations:=ImmutableArray.Create(Location.None)) End Sub) End Sub <Fact> Public Sub CreateAnonymousType_WritableProperty() Dim compilation = VisualBasicCompilation.Create("HelloWorld") Dim type = compilation.CreateAnonymousTypeSymbol( ImmutableArray.Create(DirectCast(compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol), DirectCast(compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol)), ImmutableArray.Create("m1", "m2"), ImmutableArray.Create(False, False)) Assert.True(type.IsAnonymousType) Assert.Equal(2, type.GetMembers().OfType(Of IPropertySymbol).Count()) Assert.Equal("<anonymous type: m1 As Integer, m2 As Integer>", type.ToDisplayString()) Assert.All(type.GetMembers().OfType(Of IPropertySymbol)().Select(Function(p) p.Locations.FirstOrDefault()), Sub(loc) Assert.Equal(loc, Location.None)) End Sub <Fact> Public Sub CreateAnonymousType_Locations() Dim compilation = VisualBasicCompilation.Create("HelloWorld") Dim tree = VisualBasicSyntaxTree.ParseText("Class X") compilation = compilation.AddSyntaxTrees(tree) Dim loc1 = Location.Create(tree, New TextSpan(0, 1)) Dim loc2 = Location.Create(tree, New TextSpan(1, 1)) Dim type = compilation.CreateAnonymousTypeSymbol( ImmutableArray.Create(DirectCast(compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol), DirectCast(compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol)), ImmutableArray.Create("m1", "m2"), ImmutableArray.Create(False, False), ImmutableArray.Create(loc1, loc2)) Assert.True(type.IsAnonymousType) Assert.Equal(2, type.GetMembers().OfType(Of IPropertySymbol).Count()) Assert.Equal(loc1, type.GetMembers("m1").Single().Locations.Single()) Assert.Equal(loc2, type.GetMembers("m2").Single().Locations.Single()) Assert.Equal("<anonymous type: m1 As Integer, m2 As Integer>", type.ToDisplayString()) End Sub <Fact()> Public Sub CreateAnonymousType_NothingArgument() Dim compilation = VisualBasicCompilation.Create("HelloWorld") Assert.Throws(Of ArgumentNullException)( Function() Return compilation.CreateAnonymousTypeSymbol( ImmutableArray.Create(DirectCast(Nothing, ITypeSymbol)), ImmutableArray.Create("m1")) End Function) End Sub <Fact()> Public Sub CreateAnonymousType1() Dim compilation = VisualBasicCompilation.Create("HelloWorld") Dim type = compilation.CreateAnonymousTypeSymbol( ImmutableArray.Create(Of ITypeSymbol)(compilation.GetSpecialType(SpecialType.System_Int32)), ImmutableArray.Create("m1")) Assert.True(type.IsAnonymousType) Assert.Equal(1, type.GetMembers().OfType(Of IPropertySymbol).Count()) Assert.Equal("<anonymous type: Key m1 As Integer>", type.ToDisplayString()) Assert.All(type.GetMembers().OfType(Of IPropertySymbol)().Select(Function(p) p.Locations.FirstOrDefault()), Sub(loc) Assert.Equal(loc, Location.None)) End Sub <Fact()> Public Sub CreateMutableAnonymousType1() Dim compilation = VisualBasicCompilation.Create("HelloWorld") Dim type = compilation.CreateAnonymousTypeSymbol( ImmutableArray.Create(Of ITypeSymbol)(compilation.GetSpecialType(SpecialType.System_Int32)), ImmutableArray.Create("m1"), ImmutableArray.Create(False)) Assert.True(type.IsAnonymousType) Assert.Equal(1, type.GetMembers().OfType(Of IPropertySymbol).Count()) Assert.Equal("<anonymous type: m1 As Integer>", type.ToDisplayString()) Assert.All(type.GetMembers().OfType(Of IPropertySymbol)().Select(Function(p) p.Locations.FirstOrDefault()), Sub(loc) Assert.Equal(loc, Location.None)) End Sub <Fact()> Public Sub CreateAnonymousType2() Dim compilation = VisualBasicCompilation.Create("HelloWorld") Dim type = compilation.CreateAnonymousTypeSymbol( ImmutableArray.Create(Of ITypeSymbol)(compilation.GetSpecialType(SpecialType.System_Int32), compilation.GetSpecialType(SpecialType.System_Boolean)), ImmutableArray.Create("m1", "m2")) Assert.True(type.IsAnonymousType) Assert.Equal(2, type.GetMembers().OfType(Of IPropertySymbol).Count()) Assert.Equal("<anonymous type: Key m1 As Integer, Key m2 As Boolean>", type.ToDisplayString()) Assert.All(type.GetMembers().OfType(Of IPropertySymbol)().Select(Function(p) p.Locations.FirstOrDefault()), Sub(loc) Assert.Equal(loc, Location.None)) End Sub <Fact()> <WorkItem(36047, "https://github.com/dotnet/roslyn/issues/36047")> Public Sub CreateAnonymousType_DefaultArgs() Dim comp = DirectCast(CreateCompilation(""), Compilation) Dim memberTypes = ImmutableArray.Create(Of ITypeSymbol)(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String)) Dim memberNames = ImmutableArray.Create("P", "Q") Dim type = comp.CreateAnonymousTypeSymbol(memberTypes, memberNames) Assert.Equal("<anonymous type: Key P As System.Object, Key Q As System.String>", type.ToTestDisplayString()) type = comp.CreateAnonymousTypeSymbol(memberTypes, memberNames, Nothing) Assert.Equal("<anonymous type: Key P As System.Object, Key Q As System.String>", type.ToTestDisplayString()) type = comp.CreateAnonymousTypeSymbol(memberTypes, memberNames, Nothing, Nothing) Assert.Equal("<anonymous type: Key P As System.Object, Key Q As System.String>", type.ToTestDisplayString()) type = comp.CreateAnonymousTypeSymbol(memberTypes, memberNames, Nothing, Nothing, Nothing) Assert.Equal("<anonymous type: Key P As System.Object, Key Q As System.String>", type.ToTestDisplayString()) type = comp.CreateAnonymousTypeSymbol(memberTypes, memberNames, memberIsReadOnly:=Nothing) Assert.Equal("<anonymous type: Key P As System.Object, Key Q As System.String>", type.ToTestDisplayString()) type = comp.CreateAnonymousTypeSymbol(memberTypes, memberNames, memberLocations:=Nothing) Assert.Equal("<anonymous type: Key P As System.Object, Key Q As System.String>", type.ToTestDisplayString()) type = comp.CreateAnonymousTypeSymbol(memberTypes, memberNames, memberNullableAnnotations:=Nothing) Assert.Equal("<anonymous type: Key P As System.Object, Key Q As System.String>", type.ToTestDisplayString()) End Sub <Fact()> <WorkItem(36047, "https://github.com/dotnet/roslyn/issues/36047")> Public Sub CreateAnonymousType_MemberNullableAnnotations_Empty() Dim comp = DirectCast(VisualBasicCompilation.Create(""), Compilation) Dim type = comp.CreateAnonymousTypeSymbol(ImmutableArray(Of ITypeSymbol).Empty, ImmutableArray(Of String).Empty, memberNullableAnnotations:=ImmutableArray(Of CodeAnalysis.NullableAnnotation).Empty) Assert.Equal("<empty anonymous type>", type.ToTestDisplayString()) AssertEx.Equal(Array.Empty(Of CodeAnalysis.NullableAnnotation)(), GetAnonymousTypeNullableAnnotations(type)) End Sub <Fact()> <WorkItem(36047, "https://github.com/dotnet/roslyn/issues/36047")> Public Sub CreateAnonymousType_MemberNullableAnnotations() Dim comp = DirectCast(CreateCompilation(""), Compilation) Dim memberTypes = ImmutableArray.Create(Of ITypeSymbol)(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String)) Dim memberNames = ImmutableArray.Create("P", "Q") Dim type = comp.CreateAnonymousTypeSymbol(memberTypes, memberNames) Assert.Equal("<anonymous type: Key P As System.Object, Key Q As System.String>", type.ToTestDisplayString()) AssertEx.Equal({CodeAnalysis.NullableAnnotation.None, CodeAnalysis.NullableAnnotation.None}, GetAnonymousTypeNullableAnnotations(type)) Assert.Throws(Of ArgumentException)(Function() comp.CreateAnonymousTypeSymbol(memberTypes, memberNames, memberNullableAnnotations:=ImmutableArray.Create(CodeAnalysis.NullableAnnotation.NotAnnotated))) type = comp.CreateAnonymousTypeSymbol(memberTypes, memberNames, memberNullableAnnotations:=ImmutableArray.Create(CodeAnalysis.NullableAnnotation.NotAnnotated, CodeAnalysis.NullableAnnotation.Annotated)) Assert.Equal("<anonymous type: Key P As System.Object, Key Q As System.String>", type.ToTestDisplayString()) AssertEx.Equal({CodeAnalysis.NullableAnnotation.None, CodeAnalysis.NullableAnnotation.None}, GetAnonymousTypeNullableAnnotations(type)) End Sub Private Shared Function GetAnonymousTypeNullableAnnotations(type As ITypeSymbol) As ImmutableArray(Of CodeAnalysis.NullableAnnotation) Return type.GetMembers().OfType(Of IPropertySymbol)().SelectAsArray(Function(p) p.NullableAnnotation) End Function <Fact()> <WorkItem(36046, "https://github.com/dotnet/roslyn/issues/36046")> Public Sub ConstructTypeWithNullability() Dim source = "Class Pair(Of T, U) End Class" Dim comp = DirectCast(CreateCompilation(source), Compilation) Dim genericType = DirectCast(comp.GetMember("Pair"), INamedTypeSymbol) Dim typeArguments = ImmutableArray.Create(Of ITypeSymbol)(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String)) Assert.Throws(Of ArgumentException)(Function() genericType.Construct(New ImmutableArray(Of ITypeSymbol), New ImmutableArray(Of CodeAnalysis.NullableAnnotation))) Assert.Throws(Of ArgumentException)(Function() genericType.Construct(typeArguments:=Nothing, typeArgumentNullableAnnotations:=Nothing)) Dim type = genericType.Construct(typeArguments, Nothing) Assert.Equal("Pair(Of System.Object, System.String)", type.ToTestDisplayString()) AssertEx.Equal({CodeAnalysis.NullableAnnotation.None, CodeAnalysis.NullableAnnotation.None}, type.TypeArgumentNullableAnnotations) Assert.Throws(Of ArgumentException)(Function() genericType.Construct(typeArguments, ImmutableArray(Of CodeAnalysis.NullableAnnotation).Empty)) Assert.Throws(Of ArgumentException)(Function() genericType.Construct(ImmutableArray.Create(Of ITypeSymbol)(Nothing, Nothing), Nothing)) type = genericType.Construct(typeArguments, ImmutableArray.Create(CodeAnalysis.NullableAnnotation.Annotated, CodeAnalysis.NullableAnnotation.NotAnnotated)) Assert.Equal("Pair(Of System.Object, System.String)", type.ToTestDisplayString()) AssertEx.Equal({CodeAnalysis.NullableAnnotation.None, CodeAnalysis.NullableAnnotation.None}, type.TypeArgumentNullableAnnotations) ' Type arguments from C#. comp = CreateCSharpCompilation("") typeArguments = ImmutableArray.Create(Of ITypeSymbol)(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String)) Assert.Throws(Of ArgumentException)(Function() genericType.Construct(typeArguments, Nothing)) End Sub <Fact()> <WorkItem(37310, "https://github.com/dotnet/roslyn/issues/37310")> Public Sub ConstructMethodWithNullability() Dim source = "Class Program Shared Sub M(Of T, U) End Sub End Class" Dim comp = DirectCast(CreateCompilation(source), Compilation) Dim genericMethod = DirectCast(comp.GetMember("Program.M"), IMethodSymbol) Dim typeArguments = ImmutableArray.Create(Of ITypeSymbol)(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String)) Assert.Throws(Of ArgumentException)(Function() genericMethod.Construct(New ImmutableArray(Of ITypeSymbol), New ImmutableArray(Of CodeAnalysis.NullableAnnotation))) Assert.Throws(Of ArgumentException)(Function() genericMethod.Construct(typeArguments:=Nothing, typeArgumentNullableAnnotations:=Nothing)) Dim type = genericMethod.Construct(typeArguments, Nothing) Assert.Equal("Sub Program.M(Of System.Object, System.String)()", type.ToTestDisplayString()) AssertEx.Equal({CodeAnalysis.NullableAnnotation.None, CodeAnalysis.NullableAnnotation.None}, type.TypeArgumentNullableAnnotations) Assert.Throws(Of ArgumentException)(Function() genericMethod.Construct(typeArguments, ImmutableArray(Of CodeAnalysis.NullableAnnotation).Empty)) Assert.Throws(Of ArgumentException)(Function() genericMethod.Construct(ImmutableArray.Create(Of ITypeSymbol)(Nothing, Nothing), Nothing)) type = genericMethod.Construct(typeArguments, ImmutableArray.Create(CodeAnalysis.NullableAnnotation.Annotated, CodeAnalysis.NullableAnnotation.NotAnnotated)) Assert.Equal("Sub Program.M(Of System.Object, System.String)()", type.ToTestDisplayString()) AssertEx.Equal({CodeAnalysis.NullableAnnotation.None, CodeAnalysis.NullableAnnotation.None}, type.TypeArgumentNullableAnnotations) ' Type arguments from C#. comp = CreateCSharpCompilation("") typeArguments = ImmutableArray.Create(Of ITypeSymbol)(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String)) Assert.Throws(Of ArgumentException)(Function() genericMethod.Construct(typeArguments, Nothing)) End Sub <Fact()> Public Sub GetEntryPoint_Exe() Dim source = <compilation name="Name1"> <file name="a.vb"><![CDATA[ Class A Shared Sub Main() End Sub End Class ]]> </file> </compilation> Dim compilation = CreateCompilationWithMscorlib40(source, OutputKind.ConsoleApplication) compilation.VerifyDiagnostics() Dim mainMethod = compilation.GlobalNamespace.GetMember(Of NamedTypeSymbol)("A").GetMember(Of MethodSymbol)("Main") Assert.Equal(mainMethod, compilation.GetEntryPoint(Nothing)) Dim entryPointAndDiagnostics = compilation.GetEntryPointAndDiagnostics(Nothing) Assert.Equal(mainMethod, entryPointAndDiagnostics.MethodSymbol) entryPointAndDiagnostics.Diagnostics.Verify() End Sub <Fact()> Public Sub GetEntryPoint_Dll() Dim source = <compilation name="Name1"> <file name="a.vb"><![CDATA[ Class A Shared Sub Main() End Sub End Class ]]> </file> </compilation> Dim compilation = CreateCompilationWithMscorlib40(source, OutputKind.DynamicallyLinkedLibrary) compilation.VerifyDiagnostics() Assert.Null(compilation.GetEntryPoint(Nothing)) Assert.Null(compilation.GetEntryPointAndDiagnostics(Nothing)) End Sub <Fact()> Public Sub GetEntryPoint_Module() Dim source = <compilation name="Name1"> <file name="a.vb"><![CDATA[ Class A Shared Sub Main() End Sub End Class ]]> </file> </compilation> Dim compilation = CreateCompilationWithMscorlib40(source, OutputKind.NetModule) compilation.VerifyDiagnostics() Assert.Null(compilation.GetEntryPoint(Nothing)) Assert.Null(compilation.GetEntryPointAndDiagnostics(Nothing)) End Sub <Fact> Public Sub CreateCompilationForModule() Dim source = <text> Class A Shared Sub Main() End Sub End Class </text>.Value ' equivalent of vbc with no /moduleassemblyname specified: Dim c = VisualBasicCompilation.Create(assemblyName:=Nothing, options:=TestOptions.ReleaseModule, syntaxTrees:={Parse(source)}, references:={MscorlibRef}) c.VerifyEmitDiagnostics() Assert.Null(c.AssemblyName) Assert.Equal("?", c.Assembly.Name) Assert.Equal("?", c.Assembly.Identity.Name) ' no name is allowed for assembly as well, although it isn't useful: c = VisualBasicCompilation.Create(assemblyName:=Nothing, options:=TestOptions.ReleaseModule, syntaxTrees:={Parse(source)}, references:={MscorlibRef}) c.VerifyEmitDiagnostics() Assert.Null(c.AssemblyName) Assert.Equal("?", c.Assembly.Name) Assert.Equal("?", c.Assembly.Identity.Name) ' equivalent of vbc with /moduleassemblyname specified: c = VisualBasicCompilation.Create(assemblyName:="ModuleAssemblyName", options:=TestOptions.ReleaseModule, syntaxTrees:={Parse(source)}, references:={MscorlibRef}) c.VerifyDiagnostics() Assert.Equal("ModuleAssemblyName", c.AssemblyName) Assert.Equal("ModuleAssemblyName", c.Assembly.Name) Assert.Equal("ModuleAssemblyName", c.Assembly.Identity.Name) End Sub <WorkItem(8506, "https://github.com/dotnet/roslyn/issues/8506")> <WorkItem(17403, "https://github.com/dotnet/roslyn/issues/17403")> <Fact()> Public Sub CrossCorlibSystemObjectReturnType_Script() ' MinAsyncCorlibRef corlib Is used since it provides just enough corlib type definitions ' And Task APIs necessary for script hosting are provided by MinAsyncRef. This ensures that ' `System.Object, mscorlib, Version=4.0.0.0` will Not be provided (since it's unversioned). ' ' In the original bug, Xamarin iOS, Android, And Mac Mobile profile corlibs were ' realistic cross-compilation targets. Dim AssertCompilationCorlib As Action(Of VisualBasicCompilation) = Sub(compilation As VisualBasicCompilation) Assert.True(compilation.IsSubmission) Dim taskOfT = compilation.GetWellKnownType(WellKnownType.System_Threading_Tasks_Task_T) Dim taskOfObject = taskOfT.Construct(compilation.ObjectType) Dim entryPoint = compilation.GetEntryPoint(Nothing) Assert.Same(compilation.ObjectType.ContainingAssembly, taskOfT.ContainingAssembly) Assert.Same(compilation.ObjectType.ContainingAssembly, taskOfObject.ContainingAssembly) Assert.Equal(taskOfObject, entryPoint.ReturnType) End Sub Dim firstCompilation = VisualBasicCompilation.CreateScriptCompilation( "submission-assembly-1", references:={MinAsyncCorlibRef}, syntaxTree:=Parse("? True", options:=TestOptions.Script) ).VerifyDiagnostics() AssertCompilationCorlib(firstCompilation) Dim secondCompilation = VisualBasicCompilation.CreateScriptCompilation( "submission-assembly-2", previousScriptCompilation:=firstCompilation, syntaxTree:=Parse("? False", options:=TestOptions.Script) ).WithScriptCompilationInfo(New VisualBasicScriptCompilationInfo(firstCompilation, Nothing, Nothing) ).VerifyDiagnostics() AssertCompilationCorlib(secondCompilation) Assert.Same(firstCompilation.ObjectType, secondCompilation.ObjectType) Assert.Null(New VisualBasicScriptCompilationInfo(Nothing, Nothing, Nothing).WithPreviousScriptCompilation(firstCompilation).ReturnTypeOpt) End Sub <WorkItem(3719, "https://github.com/dotnet/roslyn/issues/3719")> <Fact()> Public Sub GetEntryPoint_Script() Dim source = <![CDATA[System.Console.WriteLine(1)]]> Dim compilation = CreateCompilationWithMscorlib45({VisualBasicSyntaxTree.ParseText(source.Value, options:=TestOptions.Script)}, options:=TestOptions.ReleaseDll) compilation.VerifyDiagnostics() Dim scriptMethod = compilation.GetMember("Script.<Main>") Assert.NotNull(scriptMethod) Dim method = compilation.GetEntryPoint(Nothing) Assert.Equal(method, scriptMethod) Dim entryPoint = compilation.GetEntryPointAndDiagnostics(Nothing) Assert.Equal(entryPoint.MethodSymbol, scriptMethod) End Sub <Fact()> Public Sub GetEntryPoint_Script_MainIgnored() Dim source = <![CDATA[ Class A Shared Sub Main() End Sub End Class ]]> Dim compilation = CreateCompilationWithMscorlib45({VisualBasicSyntaxTree.ParseText(source.Value, options:=TestOptions.Script)}, options:=TestOptions.ReleaseDll) compilation.VerifyDiagnostics(Diagnostic(ERRID.WRN_MainIgnored, "Main").WithArguments("Public Shared Sub Main()").WithLocation(3, 20)) Dim scriptMethod = compilation.GetMember("Script.<Main>") Assert.NotNull(scriptMethod) Dim entryPoint = compilation.GetEntryPointAndDiagnostics(Nothing) Assert.Equal(entryPoint.MethodSymbol, scriptMethod) entryPoint.Diagnostics.Verify(Diagnostic(ERRID.WRN_MainIgnored, "Main").WithArguments("Public Shared Sub Main()").WithLocation(3, 20)) End Sub <Fact()> Public Sub GetEntryPoint_Submission() Dim source = "? 1 + 1" Dim compilation = VisualBasicCompilation.CreateScriptCompilation( "sub", references:={MscorlibRef}, syntaxTree:=Parse(source, options:=TestOptions.Script)) compilation.VerifyDiagnostics() Dim scriptMethod = compilation.GetMember("Script.<Factory>") Assert.NotNull(scriptMethod) Dim method = compilation.GetEntryPoint(Nothing) Assert.Equal(method, scriptMethod) Dim entryPoint = compilation.GetEntryPointAndDiagnostics(Nothing) Assert.Equal(entryPoint.MethodSymbol, scriptMethod) entryPoint.Diagnostics.Verify() End Sub <Fact()> Public Sub GetEntryPoint_Submission_MainIgnored() Dim source = " Class A Shared Sub Main() End Sub End Class " Dim compilation = VisualBasicCompilation.CreateScriptCompilation( "Sub", references:={MscorlibRef}, syntaxTree:=Parse(source, options:=TestOptions.Script)) compilation.VerifyDiagnostics(Diagnostic(ERRID.WRN_MainIgnored, "Main").WithArguments("Public Shared Sub Main()").WithLocation(3, 20)) Dim scriptMethod = compilation.GetMember("Script.<Factory>") Assert.NotNull(scriptMethod) Dim entryPoint = compilation.GetEntryPointAndDiagnostics(Nothing) Assert.Equal(entryPoint.MethodSymbol, scriptMethod) entryPoint.Diagnostics.Verify(Diagnostic(ERRID.WRN_MainIgnored, "Main").WithArguments("Public Shared Sub Main()").WithLocation(3, 20)) End Sub <Fact()> Public Sub GetEntryPoint_MainType() Dim source = <compilation name="Name1"> <file name="a.vb"><![CDATA[ Class A Shared Sub Main() End Sub End Class Class B Shared Sub Main() End Sub End Class ]]> </file> </compilation> Dim compilation = CreateCompilationWithMscorlib40(source, options:=TestOptions.ReleaseExe.WithMainTypeName("B")) compilation.VerifyDiagnostics() Dim mainMethod = compilation.GlobalNamespace.GetMember(Of NamedTypeSymbol)("B").GetMember(Of MethodSymbol)("Main") Assert.Equal(mainMethod, compilation.GetEntryPoint(Nothing)) Dim entryPointAndDiagnostics = compilation.GetEntryPointAndDiagnostics(Nothing) Assert.Equal(mainMethod, entryPointAndDiagnostics.MethodSymbol) entryPointAndDiagnostics.Diagnostics.Verify() End Sub <Fact> Public Sub ReferenceManagerReuse_WithOptions() Dim c1 = VisualBasicCompilation.Create("c", options:=TestOptions.ReleaseDll) Dim c2 = c1.WithOptions(TestOptions.ReleaseExe) Assert.True(c1.ReferenceManagerEquals(c2)) c2 = c1.WithOptions(New VisualBasicCompilationOptions(OutputKind.WindowsApplication)) Assert.True(c1.ReferenceManagerEquals(c2)) c2 = c1.WithOptions(TestOptions.ReleaseModule) Assert.False(c1.ReferenceManagerEquals(c2)) c1 = VisualBasicCompilation.Create("c", options:=TestOptions.ReleaseModule) c2 = c1.WithOptions(TestOptions.ReleaseExe) Assert.False(c1.ReferenceManagerEquals(c2)) c2 = c1.WithOptions(TestOptions.ReleaseDll) Assert.False(c1.ReferenceManagerEquals(c2)) c2 = c1.WithOptions(New VisualBasicCompilationOptions(OutputKind.WindowsApplication)) Assert.False(c1.ReferenceManagerEquals(c2)) End Sub <Fact> Public Sub ReferenceManagerReuse_WithXmlFileResolver() Dim c1 = VisualBasicCompilation.Create("c", options:=TestOptions.ReleaseDll) Dim c2 = c1.WithOptions(TestOptions.ReleaseDll.WithXmlReferenceResolver(New XmlFileResolver(Nothing))) Assert.False(c1.ReferenceManagerEquals(c2)) Dim c3 = c1.WithOptions(TestOptions.ReleaseDll.WithXmlReferenceResolver(c1.Options.XmlReferenceResolver)) Assert.True(c1.ReferenceManagerEquals(c3)) End Sub <Fact> Public Sub ReferenceManagerReuse_WithMetadataReferenceResolver() Dim c1 = VisualBasicCompilation.Create("c", options:=TestOptions.ReleaseDll) Dim c2 = c1.WithOptions(TestOptions.ReleaseDll.WithMetadataReferenceResolver(New TestMetadataReferenceResolver())) Assert.False(c1.ReferenceManagerEquals(c2)) Dim c3 = c1.WithOptions(TestOptions.ReleaseDll.WithMetadataReferenceResolver(c1.Options.MetadataReferenceResolver)) Assert.True(c1.ReferenceManagerEquals(c3)) End Sub <Fact> Public Sub ReferenceManagerReuse_WithName() Dim c1 = VisualBasicCompilation.Create("c1") Dim c2 = c1.WithAssemblyName("c2") Assert.False(c1.ReferenceManagerEquals(c2)) Dim c3 = c1.WithAssemblyName("c1") Assert.True(c1.ReferenceManagerEquals(c3)) Dim c4 = c1.WithAssemblyName(Nothing) Assert.False(c1.ReferenceManagerEquals(c4)) Dim c5 = c4.WithAssemblyName(Nothing) Assert.True(c4.ReferenceManagerEquals(c5)) End Sub <Fact> Public Sub ReferenceManagerReuse_WithReferences() Dim c1 = VisualBasicCompilation.Create("c1") Dim c2 = c1.WithReferences({MscorlibRef}) Assert.False(c1.ReferenceManagerEquals(c2)) Dim c3 = c2.WithReferences({MscorlibRef, SystemCoreRef}) Assert.False(c3.ReferenceManagerEquals(c2)) c3 = c2.AddReferences(SystemCoreRef) Assert.False(c3.ReferenceManagerEquals(c2)) c3 = c2.RemoveAllReferences() Assert.False(c3.ReferenceManagerEquals(c2)) c3 = c2.ReplaceReference(MscorlibRef, SystemCoreRef) Assert.False(c3.ReferenceManagerEquals(c2)) c3 = c2.RemoveReferences(MscorlibRef) Assert.False(c3.ReferenceManagerEquals(c2)) End Sub <Fact> Public Sub ReferenceManagerReuse_WithSyntaxTrees() Dim ta = Parse("Imports System") Dim tb = Parse("Imports System", options:=TestOptions.Script) Dim tc = Parse("#r ""bar"" ' error: #r in regular code") Dim tr = Parse("#r ""goo""", options:=TestOptions.Script) Dim ts = Parse("#r ""bar""", options:=TestOptions.Script) Dim a = VisualBasicCompilation.Create("c", syntaxTrees:={ta}) ' add: Dim ab = a.AddSyntaxTrees(tb) Assert.True(a.ReferenceManagerEquals(ab)) Dim ac = a.AddSyntaxTrees(tc) Assert.True(a.ReferenceManagerEquals(ac)) Dim ar = a.AddSyntaxTrees(tr) Assert.False(a.ReferenceManagerEquals(ar)) Dim arc = ar.AddSyntaxTrees(tc) Assert.True(ar.ReferenceManagerEquals(arc)) ' remove: Dim ar2 = arc.RemoveSyntaxTrees(tc) Assert.True(arc.ReferenceManagerEquals(ar2)) Dim c = arc.RemoveSyntaxTrees(ta, tr) Assert.False(arc.ReferenceManagerEquals(c)) Dim none1 = c.RemoveSyntaxTrees(tc) Assert.True(c.ReferenceManagerEquals(none1)) Dim none2 = arc.RemoveAllSyntaxTrees() Assert.False(arc.ReferenceManagerEquals(none2)) Dim none3 = ac.RemoveAllSyntaxTrees() Assert.True(ac.ReferenceManagerEquals(none3)) ' replace: Dim asc = arc.ReplaceSyntaxTree(tr, ts) Assert.False(arc.ReferenceManagerEquals(asc)) Dim brc = arc.ReplaceSyntaxTree(ta, tb) Assert.True(arc.ReferenceManagerEquals(brc)) Dim abc = arc.ReplaceSyntaxTree(tr, tb) Assert.False(arc.ReferenceManagerEquals(abc)) Dim ars = arc.ReplaceSyntaxTree(tc, ts) Assert.False(arc.ReferenceManagerEquals(ars)) End Sub <Fact> Public Sub ReferenceManagerReuse_WithScriptCompilationInfo() ' Note The following results would change if we optimized sharing more: https://github.com/dotnet/roslyn/issues/43397 Dim c1 = VisualBasicCompilation.CreateScriptCompilation("c1") Assert.NotNull(c1.ScriptCompilationInfo) Assert.Null(c1.ScriptCompilationInfo.PreviousScriptCompilation) Dim c2 = c1.WithScriptCompilationInfo(Nothing) Assert.Null(c2.ScriptCompilationInfo) Assert.True(c2.ReferenceManagerEquals(c1)) Dim c3 = c2.WithScriptCompilationInfo(New VisualBasicScriptCompilationInfo(previousCompilationOpt:=Nothing, returnType:=GetType(Integer), globalsType:=Nothing)) Assert.NotNull(c3.ScriptCompilationInfo) Assert.Null(c3.ScriptCompilationInfo.PreviousScriptCompilation) Assert.True(c3.ReferenceManagerEquals(c2)) Dim c4 = c3.WithScriptCompilationInfo(Nothing) Assert.Null(c4.ScriptCompilationInfo) Assert.True(c4.ReferenceManagerEquals(c3)) Dim c5 = c4.WithScriptCompilationInfo(New VisualBasicScriptCompilationInfo(previousCompilationOpt:=c1, returnType:=GetType(Integer), globalsType:=Nothing)) Assert.False(c5.ReferenceManagerEquals(c4)) Dim c6 = c5.WithScriptCompilationInfo(New VisualBasicScriptCompilationInfo(previousCompilationOpt:=c1, returnType:=GetType(Boolean), globalsType:=Nothing)) Assert.True(c6.ReferenceManagerEquals(c5)) Dim c7 = c6.WithScriptCompilationInfo(New VisualBasicScriptCompilationInfo(previousCompilationOpt:=c2, returnType:=GetType(Boolean), globalsType:=Nothing)) Assert.False(c7.ReferenceManagerEquals(c6)) Dim c8 = c7.WithScriptCompilationInfo(New VisualBasicScriptCompilationInfo(previousCompilationOpt:=Nothing, returnType:=GetType(Boolean), globalsType:=Nothing)) Assert.False(c8.ReferenceManagerEquals(c7)) Dim c9 = c8.WithScriptCompilationInfo(Nothing) Assert.True(c9.ReferenceManagerEquals(c8)) End Sub Private Class EvolvingTestReference Inherits PortableExecutableReference Private ReadOnly _metadataSequence As IEnumerator(Of Metadata) Public QueryCount As Integer Public Sub New(metadataSequence As IEnumerable(Of Metadata)) MyBase.New(MetadataReferenceProperties.Assembly) Me._metadataSequence = metadataSequence.GetEnumerator() End Sub Protected Overrides Function CreateDocumentationProvider() As DocumentationProvider Return DocumentationProvider.Default End Function Protected Overrides Function GetMetadataImpl() As Metadata QueryCount = QueryCount + 1 _metadataSequence.MoveNext() Return _metadataSequence.Current End Function Protected Overrides Function WithPropertiesImpl(properties As MetadataReferenceProperties) As PortableExecutableReference Throw New NotImplementedException() End Function End Class <ConditionalFact(GetType(NoIOperationValidation), GetType(NoUsedAssembliesValidation))> Public Sub MetadataConsistencyWhileEvolvingCompilation() Dim md1 = AssemblyMetadata.CreateFromImage(CreateCompilationWithMscorlib40({"Public Class C : End Class"}, options:=TestOptions.ReleaseDll).EmitToArray()) Dim md2 = AssemblyMetadata.CreateFromImage(CreateCompilationWithMscorlib40({"Public Class D : End Class"}, options:=TestOptions.ReleaseDll).EmitToArray()) Dim reference = New EvolvingTestReference({md1, md2}) Dim references = TargetFrameworkUtil.Mscorlib40References.AddRange({reference, reference}) Dim c1 = CreateEmptyCompilation({"Public Class Main : Public Shared C As C : End Class"}, references:=references, options:=TestOptions.ReleaseDll) Dim c2 = c1.WithAssemblyName("c2") Dim c3 = c2.AddSyntaxTrees(Parse("Public Class Main2 : Public Shared A As Integer : End Class")) Dim c4 = c3.WithOptions(New VisualBasicCompilationOptions(OutputKind.NetModule)) Dim c5 = c4.WithReferences({MscorlibRef, reference}) c3.VerifyDiagnostics() c1.VerifyDiagnostics() c4.VerifyDiagnostics() c2.VerifyDiagnostics() Assert.Equal(1, reference.QueryCount) c5.VerifyDiagnostics(Diagnostic(ERRID.ERR_UndefinedType1, "C").WithArguments("C").WithLocation(1, 40)) Assert.Equal(2, reference.QueryCount) End Sub <Fact> Public Sub LinkedNetmoduleMetadataMustProvideFullPEImage() Dim moduleBytes = TestResources.MetadataTests.NetModule01.ModuleCS00 Dim headers = New PEHeaders(New MemoryStream(moduleBytes)) Dim pinnedPEImage = GCHandle.Alloc(moduleBytes.ToArray(), GCHandleType.Pinned) Try Using mdModule = ModuleMetadata.CreateFromMetadata(pinnedPEImage.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize) Dim c = VisualBasicCompilation.Create("Goo", references:={MscorlibRef, mdModule.GetReference(display:="ModuleCS00")}, options:=TestOptions.ReleaseDll) c.VerifyDiagnostics(Diagnostic(ERRID.ERR_LinkedNetmoduleMetadataMustProvideFullPEImage).WithArguments("ModuleCS00").WithLocation(1, 1)) End Using Finally pinnedPEImage.Free() End Try End Sub <Fact> <WorkItem(797640, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/797640")> Public Sub GetMetadataReferenceAPITest() Dim comp = VisualBasicCompilation.Create("Compilation") Dim metadata = Net451.mscorlib comp = comp.AddReferences(metadata) Dim assemblySmb = comp.GetReferencedAssemblySymbol(metadata) Dim reference = comp.GetMetadataReference(assemblySmb) Assert.NotNull(reference) Dim comp2 = VisualBasicCompilation.Create("Compilation") comp2 = comp.AddReferences(metadata) Dim reference2 = comp2.GetMetadataReference(assemblySmb) Assert.NotNull(reference2) End Sub <WorkItem(40466, "https://github.com/dotnet/roslyn/issues/40466")> <Fact> Public Sub GetMetadataReference_CSharpSymbols() Dim comp As Compilation = CreateCompilation("") Dim csComp = CreateCSharpCompilation("", referencedAssemblies:=TargetFrameworkUtil.GetReferences(TargetFramework.Standard)) Dim assembly = csComp.GetBoundReferenceManager().GetReferencedAssemblies().First().Value Assert.Null(comp.GetMetadataReference(DirectCast(assembly.GetISymbol(), IAssemblySymbol))) Assert.Null(comp.GetMetadataReference(csComp.Assembly)) Assert.Null(comp.GetMetadataReference(Nothing)) End Sub <Fact()> Public Sub EqualityOfMergedNamespaces() Dim moduleComp = CompilationUtils.CreateEmptyCompilation( <compilation> <file name="a.vb"> Namespace NS1 Namespace NS3 Interface T1 End Interface End Namespace End Namespace Namespace NS2 Namespace NS3 Interface T2 End Interface End Namespace End Namespace </file> </compilation>, options:=TestOptions.ReleaseModule) Dim compilation = CompilationUtils.CreateEmptyCompilationWithReferences( <compilation> <file name="a.vb"> Namespace NS1 Namespace NS3 Interface T3 End Interface End Namespace End Namespace Namespace NS2 Namespace NS3 Interface T4 End Interface End Namespace End Namespace </file> </compilation>, {moduleComp.EmitToImageReference()}) TestEqualityRecursive(compilation.GlobalNamespace, compilation.GlobalNamespace, NamespaceKind.Compilation, Function(ns) compilation.GetCompilationNamespace(ns)) TestEqualityRecursive(compilation.Assembly.GlobalNamespace, compilation.Assembly.GlobalNamespace, NamespaceKind.Assembly, Function(ns) compilation.Assembly.GetAssemblyNamespace(ns)) End Sub Private Shared Sub TestEqualityRecursive(testNs1 As NamespaceSymbol, testNs2 As NamespaceSymbol, kind As NamespaceKind, factory As Func(Of NamespaceSymbol, NamespaceSymbol)) Assert.Equal(kind, testNs1.NamespaceKind) Assert.Same(testNs1, testNs2) Dim children1 = testNs1.GetMembers().OrderBy(Function(m) m.Name).ToArray() Dim children2 = testNs2.GetMembers().OrderBy(Function(m) m.Name).ToArray() For i = 0 To children1.Count - 1 Assert.Same(children1(i), children2(i)) If children1(i).Kind = SymbolKind.Namespace Then TestEqualityRecursive(DirectCast(testNs1.GetMembers(children1(i).Name).Single(), NamespaceSymbol), DirectCast(testNs1.GetMembers(children1(i).Name).Single(), NamespaceSymbol), kind, factory) End If Next Assert.Same(testNs1, factory(testNs1)) For Each constituent In testNs1.ConstituentNamespaces Assert.Same(testNs1, factory(constituent)) Next End Sub <Fact> Public Sub ConsistentParseOptions() Dim tree1 = SyntaxFactory.ParseSyntaxTree("", VisualBasicParseOptions.Default.WithLanguageVersion(LanguageVersion.VisualBasic12)) Dim tree2 = SyntaxFactory.ParseSyntaxTree("", VisualBasicParseOptions.Default.WithLanguageVersion(LanguageVersion.VisualBasic12)) Dim tree3 = SyntaxFactory.ParseSyntaxTree("", VisualBasicParseOptions.Default.WithLanguageVersion(LanguageVersion.VisualBasic11)) Dim assemblyName = GetUniqueName() Dim CompilationOptions = New VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary) VisualBasicCompilation.Create(assemblyName, {tree1, tree2}, {MscorlibRef}, CompilationOptions) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.Create(assemblyName, {tree1, tree3}, {MscorlibRef}, CompilationOptions)) End Sub <Fact> Public Sub SubmissionCompilation_Errors() Dim genericParameter = GetType(List(Of)).GetGenericArguments()(0) Dim open = GetType(Dictionary(Of,)).MakeGenericType(GetType(Integer), genericParameter) Dim ptr = GetType(Integer).MakePointerType() Dim byRefType = GetType(Integer).MakeByRefType() Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", returnType:=genericParameter)) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", returnType:=open)) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", returnType:=GetType(Void))) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", returnType:=byRefType)) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", globalsType:=genericParameter)) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", globalsType:=open)) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", globalsType:=GetType(Void))) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", globalsType:=GetType(Integer))) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", globalsType:=ptr)) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", globalsType:=byRefType)) Dim s0 = VisualBasicCompilation.CreateScriptCompilation("a0", globalsType:=GetType(List(Of Integer))) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a1", previousScriptCompilation:=s0, globalsType:=GetType(List(Of Boolean)))) ' invalid options Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", options:=TestOptions.ReleaseExe)) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", options:=TestOptions.ReleaseDll.WithOutputKind(OutputKind.NetModule))) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", options:=TestOptions.ReleaseDll.WithOutputKind(OutputKind.WindowsRuntimeMetadata))) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", options:=TestOptions.ReleaseDll.WithOutputKind(OutputKind.WindowsRuntimeApplication))) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", options:=TestOptions.ReleaseDll.WithOutputKind(OutputKind.WindowsApplication))) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", options:=TestOptions.ReleaseDll.WithCryptoKeyContainer("goo"))) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", options:=TestOptions.ReleaseDll.WithCryptoKeyFile("goo.snk"))) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", options:=TestOptions.ReleaseDll.WithDelaySign(True))) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", options:=TestOptions.ReleaseDll.WithDelaySign(False))) End Sub <Fact> Public Sub HasSubmissionResult() Assert.False(VisualBasicCompilation.CreateScriptCompilation("sub").HasSubmissionResult()) Assert.True(CreateSubmission("?1", parseOptions:=TestOptions.Script).HasSubmissionResult()) Assert.False(CreateSubmission("1", parseOptions:=TestOptions.Script).HasSubmissionResult()) ' TODO (https://github.com/dotnet/roslyn/issues/4763): '?' should be optional ' TestSubmissionResult(CreateSubmission("1", parseOptions:=TestOptions.Interactive), expectedType:=SpecialType.System_Int32, expectedHasValue:=True) ' TODO (https://github.com/dotnet/roslyn/issues/4766): ReturnType should not be ignored ' TestSubmissionResult(CreateSubmission("?1", parseOptions:=TestOptions.Interactive, returnType:=GetType(Double)), expectedType:=SpecialType.System_Double, expectedHasValue:=True) Assert.False(CreateSubmission(" Sub Goo() End Sub ").HasSubmissionResult()) Assert.False(CreateSubmission("Imports System", parseOptions:=TestOptions.Script).HasSubmissionResult()) Assert.False(CreateSubmission("Dim i As Integer", parseOptions:=TestOptions.Script).HasSubmissionResult()) Assert.False(CreateSubmission("System.Console.WriteLine()", parseOptions:=TestOptions.Script).HasSubmissionResult()) Assert.True(CreateSubmission("?System.Console.WriteLine()", parseOptions:=TestOptions.Script).HasSubmissionResult()) Assert.True(CreateSubmission("System.Console.ReadLine()", parseOptions:=TestOptions.Script).HasSubmissionResult()) Assert.True(CreateSubmission("?System.Console.ReadLine()", parseOptions:=TestOptions.Script).HasSubmissionResult()) Assert.True(CreateSubmission("?Nothing", parseOptions:=TestOptions.Script).HasSubmissionResult()) Assert.True(CreateSubmission("?AddressOf System.Console.WriteLine", parseOptions:=TestOptions.Script).HasSubmissionResult()) Assert.True(CreateSubmission("?Function(x) x", parseOptions:=TestOptions.Script).HasSubmissionResult()) End Sub ''' <summary> ''' Previous submission has to have no errors. ''' </summary> <Fact> Public Sub PreviousSubmissionWithError() Dim s0 = CreateSubmission("Dim a As X = 1") s0.VerifyDiagnostics( Diagnostic(ERRID.ERR_UndefinedType1, "X").WithArguments("X")) Assert.Throws(Of InvalidOperationException)(Function() CreateSubmission("?a + 1", previous:=s0)) End Sub <Fact> <WorkItem(13925, "https://github.com/dotnet/roslyn/issues/13925")> Public Sub RemoveAllSyntaxTreesAndEmbeddedTrees_01() Dim compilation1 = CreateCompilationWithMscorlib40( <compilation> <file name="a.vb"> Public Module C Sub Main() System.Console.WriteLine(1) End Sub End Module </file> </compilation>, options:=TestOptions.ReleaseExe.WithEmbedVbCoreRuntime(True), references:={SystemRef}) compilation1.VerifyDiagnostics() Dim compilation2 = compilation1.RemoveAllSyntaxTrees() compilation2 = compilation2.AddSyntaxTrees(compilation1.SyntaxTrees) compilation2.VerifyDiagnostics() CompileAndVerify(compilation2, expectedOutput:="1") End Sub <Fact> <WorkItem(13925, "https://github.com/dotnet/roslyn/issues/13925")> Public Sub RemoveAllSyntaxTreesAndEmbeddedTrees_02() Dim compilation1 = CreateCompilationWithMscorlib40AndVBRuntime( <compilation> <file name="a.vb"> Public Module C Sub Main() System.Console.WriteLine(1) End Sub End Module </file> </compilation>, options:=TestOptions.ReleaseExe.WithEmbedVbCoreRuntime(True)) compilation1.VerifyDiagnostics() Dim compilation2 = compilation1.RemoveAllSyntaxTrees() compilation2 = compilation2.AddSyntaxTrees(compilation1.SyntaxTrees) compilation2.VerifyDiagnostics() CompileAndVerify(compilation2, expectedOutput:="1") End Sub <Fact, WorkItem(50696, "https://github.com/dotnet/roslyn/issues/50696")> Public Sub GetWellKnownType() Dim corlib = " Namespace System Public Class [Object] End Class Public Class ValueType End Class Public Structure Void End Structure End Namespace " Dim tuple = " Namespace System Public Structure ValueTuple(Of T1, T2) Public Dim Item1 As T1 Public Dim Item2 As T2 Public Sub New(item1 As T1, item2 As T2) me.Item1 = item1 me.Item2 = item2 End Sub End Structure End Namespace " Dim corlibWithoutValueTupleRef = CreateEmptyCompilation(corlib, assemblyName:="corlibWithoutValueTupleRef").EmitToImageReference() Dim corlibWithValueTupleRef = CreateEmptyCompilation(corlib + tuple, assemblyName:="corlibWithValueTupleRef").EmitToImageReference() Dim libWithIsExternalInitRef = CreateEmptyCompilation(tuple, references:={corlibWithoutValueTupleRef}, assemblyName:="libWithIsExternalInit").EmitToImageReference() Dim libWithIsExternalInitRef2 = CreateEmptyCompilation(tuple, references:={corlibWithoutValueTupleRef}, assemblyName:="libWithIsExternalInit2").EmitToImageReference() If True Then ' type in source Dim comp = CreateEmptyCompilation(tuple, references:={corlibWithoutValueTupleRef}, assemblyName:="source") AssertNoDeclarationDiagnostics(comp) GetWellKnownType_Verify(comp, "source") End If If True Then ' type in library Dim comp = CreateEmptyCompilation("", references:={corlibWithoutValueTupleRef, libWithIsExternalInitRef}, assemblyName:="source") AssertNoDeclarationDiagnostics(comp) GetWellKnownType_Verify(comp, "libWithIsExternalInit") End If If True Then ' type in corlib and in source Dim comp = CreateEmptyCompilation(tuple, references:={corlibWithValueTupleRef}, assemblyName:="source") AssertNoDeclarationDiagnostics(comp) GetWellKnownType_Verify(comp, "source") End If If True Then ' type in corlib, in library and in source Dim comp = CreateEmptyCompilation(tuple, references:={corlibWithValueTupleRef, libWithIsExternalInitRef}, assemblyName:="source") AssertNoDeclarationDiagnostics(comp) GetWellKnownType_Verify(comp, "source") End If If True Then ' type in corlib and in two libraries Dim comp = CreateEmptyCompilation("", references:={corlibWithValueTupleRef, libWithIsExternalInitRef, libWithIsExternalInitRef2}) AssertNoDeclarationDiagnostics(comp) GetWellKnownType_Verify(comp, "corlibWithValueTupleRef") End If If True Then ' type in corlib and in two libraries (corlib in middle) Dim comp = CreateEmptyCompilation("", references:={libWithIsExternalInitRef, corlibWithValueTupleRef, libWithIsExternalInitRef2}) AssertNoDeclarationDiagnostics(comp) GetWellKnownType_Verify(comp, "corlibWithValueTupleRef") End If If True Then ' type in corlib and in two libraries (corlib last) Dim comp = CreateEmptyCompilation("", references:={libWithIsExternalInitRef, libWithIsExternalInitRef2, corlibWithValueTupleRef}) AssertNoDeclarationDiagnostics(comp) GetWellKnownType_Verify(comp, "corlibWithValueTupleRef") End If If True Then ' type in corlib and in two libraries, but flag is set Dim comp = CreateEmptyCompilation("", references:={corlibWithValueTupleRef, libWithIsExternalInitRef, libWithIsExternalInitRef2}, options:=TestOptions.DebugDll.WithIgnoreCorLibraryDuplicatedTypes(True)) AssertNoDeclarationDiagnostics(comp) Assert.True(comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).IsErrorType) End If If True Then ' type in two libraries Dim comp = CreateEmptyCompilation("", references:={libWithIsExternalInitRef, libWithIsExternalInitRef2}) AssertNoDeclarationDiagnostics(comp) Assert.True(comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).IsErrorType) End If If True Then ' type in two libraries, but flag is set Dim comp = CreateEmptyCompilation("", references:={libWithIsExternalInitRef, libWithIsExternalInitRef2}, options:=TestOptions.DebugDll.WithIgnoreCorLibraryDuplicatedTypes(True)) AssertNoDeclarationDiagnostics(comp) Assert.True(comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).IsErrorType) End If If True Then ' type in corlib and in a library Dim comp = CreateEmptyCompilation("", references:={corlibWithValueTupleRef, libWithIsExternalInitRef}) AssertNoDeclarationDiagnostics(comp) GetWellKnownType_Verify(comp, "corlibWithValueTupleRef") End If If True Then ' type in corlib and in a library (reverse order) Dim comp = CreateEmptyCompilation("", references:={corlibWithValueTupleRef, libWithIsExternalInitRef}) AssertNoDeclarationDiagnostics(comp) GetWellKnownType_Verify(comp, "corlibWithValueTupleRef") End If If True Then ' type in corlib and in a library, but flag is set Dim comp = CreateEmptyCompilation("", references:={corlibWithValueTupleRef, libWithIsExternalInitRef}, options:=TestOptions.DebugDll.WithIgnoreCorLibraryDuplicatedTypes(True)) AssertNoDeclarationDiagnostics(comp) Assert.Equal("libWithIsExternalInit", comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).ContainingAssembly.Name) Assert.Equal("corlibWithValueTupleRef", comp.GetTypeByMetadataName("System.ValueTuple`2").ContainingAssembly.Name) End If End Sub Private Shared Sub GetWellKnownType_Verify(comp As VisualBasicCompilation, expectedAssemblyName As String) Assert.Equal(expectedAssemblyName, comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).ContainingAssembly.Name) Assert.Equal(expectedAssemblyName, comp.GetTypeByMetadataName("System.ValueTuple`2").ContainingAssembly.Name) End Sub End Class End Namespace
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports System.Collections.Immutable Imports System.IO Imports System.Linq Imports System.Reflection.PortableExecutable Imports System.Runtime.InteropServices Imports System.Security.Cryptography Imports System.Text Imports System.Threading Imports System.Xml.Linq Imports Microsoft.CodeAnalysis Imports Microsoft.CodeAnalysis.Emit Imports Microsoft.CodeAnalysis.Test.Utilities Imports Microsoft.CodeAnalysis.Text Imports Microsoft.CodeAnalysis.VisualBasic Imports Microsoft.CodeAnalysis.VisualBasic.Symbols Imports Microsoft.CodeAnalysis.VisualBasic.UnitTests Imports Roslyn.Test.Utilities Imports CS = Microsoft.CodeAnalysis.CSharp Imports Roslyn.Test.Utilities.TestHelpers Imports Roslyn.Test.Utilities.TestMetadata Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests Public Class CompilationAPITests Inherits BasicTestBase Private Function WithDiagnosticOptions( tree As SyntaxTree, ParamArray options As (string, ReportDiagnostic)()) As VisualBasicCompilationOptions Return TestOptions.DebugDll. WithSyntaxTreeOptionsProvider(new TestSyntaxTreeOptionsProvider(tree, options)) End Function <Fact> Public Sub PerTreeVsGlobalSuppress() Dim tree = SyntaxFactory.ParseSyntaxTree(" Class C Sub M() Dim x As Integer End Sub End Class") Dim options = New VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary). WithGeneralDiagnosticOption(ReportDiagnostic.Suppress) Dim comp = CreateCompilationWithMscorlib45({tree}, options:=options) comp.AssertNoDiagnostics() options = options.WithSyntaxTreeOptionsProvider( new TestSyntaxTreeOptionsProvider(tree, ("BC42024", ReportDiagnostic.Warn))) comp = CreateCompilationWithMscorlib45({tree}, options:=options) ' Global options override syntax tree options. This is the opposite of C# behavior comp.AssertNoDiagnostics() End Sub <Fact> Public Sub PerTreeDiagnosticOptionsParseWarnings() Dim tree = SyntaxFactory.ParseSyntaxTree(" Class C Sub M() Dim x As Integer End Sub End Class") Dim comp = CreateCompilation({tree}, options:=TestOptions.DebugDll) comp.AssertTheseDiagnostics( <errors> BC42024: Unused local variable: 'x'. Dim x As Integer ~ </errors>) Dim options = WithDiagnosticOptions(tree, ("BC42024", ReportDiagnostic.Suppress)) Dim comp2 = CreateCompilation({tree}, options:=options) comp2.AssertNoDiagnostics() End Sub <Fact> Public Sub PerTreeDiagnosticOptionsVsPragma() Dim tree = SyntaxFactory.ParseSyntaxTree(" Class C Sub M() #Disable Warning BC42024 Dim x As Integer #Enable Warning BC42024 End Sub End Class") Dim comp = CreateCompilation({tree}, options:=TestOptions.DebugDll) comp.AssertNoDiagnostics() Dim options = WithDiagnosticOptions(tree, ("BC42024", ReportDiagnostic.Warn)) Dim comp2 = CreateCompilation({tree}, options:=options) ' Pragma should have precedence over per-tree options comp2.AssertNoDiagnostics() End Sub <Fact> Public Sub PerTreeDiagnosticOptionsVsSpecificOptions() Dim tree = SyntaxFactory.ParseSyntaxTree(" Class C Sub M() Dim x As Integer End Sub End Class") Dim options = TestOptions.DebugDll.WithSpecificDiagnosticOptions( CreateImmutableDictionary(("BC42024", ReportDiagnostic.Suppress))) Dim comp = CreateCompilationWithMscorlib45({tree}, options:=options) comp.AssertNoDiagnostics() options = options.WithSyntaxTreeOptionsProvider( new TestSyntaxTreeOptionsProvider(tree, ("BC42024", ReportDiagnostic.Error))) Dim comp2 = CreateCompilationWithMscorlib45({tree}, options:=options) ' Specific diagnostic options should have precedence over tree options comp2.AssertNoDiagnostics() End Sub <Fact> Public Sub DifferentDiagnosticOptionsForTrees() Dim tree = SyntaxFactory.ParseSyntaxTree(" Class C Sub M() Dim x As Integer End Sub End Class") Dim newTree = SyntaxFactory.ParseSyntaxTree(" Class D Sub M() Dim y As Integer End Sub End Class") Dim options = TestOptions.DebugDll.WithSyntaxTreeOptionsProvider( New TestSyntaxTreeOptionsProvider( (tree, {("BC42024", ReportDiagnostic.Suppress)}), (newTree, {("BC4024", ReportDiagnostic.Error)}))) Dim comp = CreateCompilationWithMscorlib45({tree, newTree}, options:=options) comp.AssertTheseDiagnostics( <errors> BC42024: Unused local variable: 'y'. Dim y As Integer ~ </errors>) End Sub <Fact> Public Sub TreeOptionsComparerRespected() Dim tree = SyntaxFactory.ParseSyntaxTree(" Class C Sub M() Dim x As Integer End Sub End Class") ' Default provider is case insensitive Dim options = WithDiagnosticOptions(tree, ("bc42024", ReportDiagnostic.Suppress)) Dim comp = CreateCompilation(tree, options:=options) comp.AssertNoDiagnostics() options = options.WithSyntaxTreeOptionsProvider( New TestSyntaxTreeOptionsProvider( StringComparer.Ordinal, Nothing, (tree, {("bc42024", ReportDiagnostic.Suppress)})) ) comp = CreateCompilation(tree, options:=options) comp.AssertTheseDiagnostics( <errors> BC42024: Unused local variable: 'x'. Dim x As Integer ~ </errors>) End Sub <WorkItem(8360, "https://github.com/dotnet/roslyn/issues/8360")> <WorkItem(9153, "https://github.com/dotnet/roslyn/issues/9153")> <Fact> Public Sub PublicSignWithRelativeKeyPath() Dim options = New VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary). WithPublicSign(True).WithCryptoKeyFile("test.snk") AssertTheseDiagnostics(VisualBasicCompilation.Create("test", options:=options), <errors> BC37254: Public sign was specified and requires a public key, but no public key was specified BC37257: Option 'CryptoKeyFile' must be an absolute path. </errors>) End Sub <WorkItem(11497, "https://github.com/dotnet/roslyn/issues/11497")> <Fact> Public Sub PublicSignWithEmptyKeyPath() Dim options = New VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary). WithPublicSign(True).WithCryptoKeyFile("") AssertTheseDiagnostics(VisualBasicCompilation.Create("test", options:=options), <errors> BC37254: Public sign was specified and requires a public key, but no public key was specified </errors>) End Sub <WorkItem(11497, "https://github.com/dotnet/roslyn/issues/11497")> <Fact> Public Sub PublicSignWithEmptyKeyPath2() Dim options = New VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary). WithPublicSign(True).WithCryptoKeyFile("""""") AssertTheseDiagnostics(VisualBasicCompilation.Create("test", options:=options), <errors> BC37254: Public sign was specified and requires a public key, but no public key was specified BC37257: Option 'CryptoKeyFile' must be an absolute path. </errors>) End Sub <Fact> Public Sub LocalizableErrorArgumentToStringDoesntStackOverflow() ' Error ID is arbitrary Dim arg = New LocalizableErrorArgument(ERRID.IDS_ProjectSettingsLocationName) Assert.NotNull(arg.ToString()) End Sub <WorkItem(538778, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538778")> <WorkItem(537623, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537623")> <WorkItem(233669, "https://devdiv.visualstudio.com/DevDiv/_workitems?id=233669")> <Fact> Public Sub CompilationName() ' report an error, rather then silently ignoring the directory ' (see cli partition II 22.30) VisualBasicCompilation.Create("C:/goo/Test.exe").AssertTheseEmitDiagnostics( <expected> BC30420: 'Sub Main' was not found in 'C:/goo/Test.exe'. BC37283: Invalid assembly name: Name contains invalid characters. </expected>) VisualBasicCompilation.Create("C:\goo\Test.exe", options:=TestOptions.ReleaseDll).AssertTheseDeclarationDiagnostics( <expected> BC37283: Invalid assembly name: Name contains invalid characters. </expected>) VisualBasicCompilation.Create("\goo/Test.exe", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics( <expected> BC37283: Invalid assembly name: Name contains invalid characters. </expected>) VisualBasicCompilation.Create("C:Test.exe", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics( <expected> BC37283: Invalid assembly name: Name contains invalid characters. </expected>) VisualBasicCompilation.Create("Te" & ChrW(0) & "st.exe", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics( <expected> BC37283: Invalid assembly name: Name contains invalid characters. </expected>) VisualBasicCompilation.Create(" " & vbTab & " ", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics( <expected> BC37283: Invalid assembly name: Name cannot start with whitespace. </expected>) VisualBasicCompilation.Create(ChrW(&HD800), options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics( <expected> BC37283: Invalid assembly name: Name contains invalid characters. </expected>) VisualBasicCompilation.Create("", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics( <expected> BC37283: Invalid assembly name: Name cannot be empty. </expected>) VisualBasicCompilation.Create(" a", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics( <expected> BC37283: Invalid assembly name: Name cannot start with whitespace. </expected>) VisualBasicCompilation.Create("\u2000a", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics( ' // U+2000 is whitespace <expected> BC37283: Invalid assembly name: Name contains invalid characters. </expected>) ' other characters than directory separators are ok: VisualBasicCompilation.Create(";,*?<>#!@&", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics() VisualBasicCompilation.Create("goo", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics() VisualBasicCompilation.Create(".goo", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics() VisualBasicCompilation.Create("goo ", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics() ' can end with whitespace VisualBasicCompilation.Create("....", options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics() VisualBasicCompilation.Create(Nothing, options:=TestOptions.ReleaseDll).AssertTheseEmitDiagnostics() End Sub <Fact> Public Sub CreateAPITest() Dim listSyntaxTree = New List(Of SyntaxTree) Dim listRef = New List(Of MetadataReference) Dim s1 = "using Goo" Dim t1 As SyntaxTree = VisualBasicSyntaxTree.ParseText(s1) listSyntaxTree.Add(t1) ' System.dll listRef.Add(Net451.System) Dim ops = TestOptions.ReleaseExe ' Create Compilation with Option is not Nothing Dim comp = VisualBasicCompilation.Create("Compilation", listSyntaxTree, listRef, ops) Assert.Equal(ops, comp.Options) Assert.NotNull(comp.SyntaxTrees) Assert.NotNull(comp.References) Assert.Equal(1, comp.SyntaxTrees.Count) Assert.Equal(1, comp.References.Count) ' Create Compilation with PreProcessorSymbols of Option is empty Dim ops1 = TestOptions.ReleaseExe.WithGlobalImports(GlobalImport.Parse({"System", "Microsoft.VisualBasic"})).WithRootNamespace("") ' Create Compilation with Assembly name contains invalid char Dim asmname = "楽聖いち にÅÅ€" comp = VisualBasicCompilation.Create(asmname, listSyntaxTree, listRef, ops1) Assert.Equal(asmname, comp.Assembly.Name) Assert.Equal(asmname + ".exe", comp.SourceModule.Name) Dim compOpt = VisualBasicCompilation.Create("Compilation", Nothing, Nothing, Nothing) Assert.NotNull(compOpt.Options) ' Not Implemented code ' comp = comp.ChangeOptions(options:=null) ' Assert.Equal(CompilationOptions.Default, comp.Options) ' comp = comp.ChangeOptions(ops1) ' Assert.Equal(ops1, comp.Options) ' comp = comp.ChangeOptions(comp1.Options) ' ssert.Equal(comp1.Options, comp.Options) ' comp = comp.ChangeOptions(CompilationOptions.Default) ' Assert.Equal(CompilationOptions.Default, comp.Options) End Sub <Fact> Public Sub GetSpecialType() Dim comp = VisualBasicCompilation.Create("compilation", Nothing, Nothing, Nothing) ' Get Special Type by enum Dim ntSmb = comp.GetSpecialType(typeId:=SpecialType.Count) Assert.Equal(SpecialType.Count, ntSmb.SpecialType) ' Get Special Type by integer ntSmb = comp.GetSpecialType(CType(31, SpecialType)) Assert.Equal(31, CType(ntSmb.SpecialType, Integer)) End Sub <Fact> Public Sub GetTypeByMetadataName() Dim comp = VisualBasicCompilation.Create("compilation", Nothing, Nothing, Nothing) ' Get Type Name And Arity Assert.Null(comp.GetTypeByMetadataName("`1")) Assert.Null(comp.GetTypeByMetadataName("中文`1")) ' Throw exception when the parameter of GetTypeByNameAndArity is NULL 'Assert.Throws(Of Exception)( ' Sub() ' comp.GetTypeByNameAndArity(fullName:=Nothing, arity:=1) ' End Sub) ' Throw exception when the parameter of GetTypeByNameAndArity is less than 0 'Assert.Throws(Of Exception)( ' Sub() ' comp.GetTypeByNameAndArity(String.Empty, -4) ' End Sub) Dim compilationDef = <compilation name="compilation"> <file name="a.vb"> Namespace A.B Class C Class D Class E End Class End Class End Class Class G(Of T) Class Q(Of S1,S2) ENd Class End Class Class G(Of T1,T2) End Class End Namespace Class C Class D Class E End Class End Class End Class </file> </compilation> comp = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(compilationDef) 'IsCaseSensitive Assert.Equal(Of Boolean)(False, comp.IsCaseSensitive) Assert.Equal("D", comp.GetTypeByMetadataName("C+D").Name) Assert.Equal("E", comp.GetTypeByMetadataName("C+D+E").Name) Assert.Null(comp.GetTypeByMetadataName("")) Assert.Null(comp.GetTypeByMetadataName("+")) Assert.Null(comp.GetTypeByMetadataName("++")) Assert.Equal("C", comp.GetTypeByMetadataName("A.B.C").Name) Assert.Equal("D", comp.GetTypeByMetadataName("A.B.C+D").Name) Assert.Null(comp.GetTypeByMetadataName("A.B.C+F")) Assert.Equal("E", comp.GetTypeByMetadataName("A.B.C+D+E").Name) Assert.Null(comp.GetTypeByMetadataName("A.B.C+D+E+F")) Assert.Equal(1, comp.GetTypeByMetadataName("A.B.G`1").Arity) Assert.Equal(2, comp.GetTypeByMetadataName("A.B.G`1+Q`2").Arity) Assert.Equal(2, comp.GetTypeByMetadataName("A.B.G`2").Arity) Assert.Null(comp.GetTypeByMetadataName("c")) Assert.Null(comp.GetTypeByMetadataName("A.b.C")) Assert.Null(comp.GetTypeByMetadataName("C+d")) Assert.Equal(SpecialType.System_Array, comp.GetTypeByMetadataName("System.Array").SpecialType) Assert.Null(comp.Assembly.GetTypeByMetadataName("System.Array")) Assert.Equal("E", comp.Assembly.GetTypeByMetadataName("A.B.C+D+E").Name) End Sub <Fact> Public Sub EmitToMemoryStreams() Dim comp = VisualBasicCompilation.Create("Compilation", options:=TestOptions.ReleaseDll) Using output = New MemoryStream() Using outputPdb = New MemoryStream() Using outputxml = New MemoryStream() Dim result = comp.Emit(output, outputPdb, Nothing) Assert.True(result.Success) result = comp.Emit(output, outputPdb) Assert.True(result.Success) result = comp.Emit(peStream:=output, pdbStream:=outputPdb, xmlDocumentationStream:=Nothing, cancellationToken:=Nothing) Assert.True(result.Success) result = comp.Emit(peStream:=output, pdbStream:=outputPdb, cancellationToken:=Nothing) Assert.True(result.Success) result = comp.Emit(output, outputPdb) Assert.True(result.Success) result = comp.Emit(output, outputPdb) Assert.True(result.Success) result = comp.Emit(output, outputPdb, outputxml) Assert.True(result.Success) result = comp.Emit(output, Nothing, Nothing, Nothing) Assert.True(result.Success) result = comp.Emit(output) Assert.True(result.Success) result = comp.Emit(output, Nothing, outputxml) Assert.True(result.Success) result = comp.Emit(output, xmlDocumentationStream:=outputxml) Assert.True(result.Success) result = comp.Emit(output, Nothing, outputxml) Assert.True(result.Success) result = comp.Emit(output, xmlDocumentationStream:=outputxml) Assert.True(result.Success) End Using End Using End Using End Sub <Fact> Public Sub Emit_BadArgs() Dim comp = VisualBasicCompilation.Create("Compilation", options:=TestOptions.ReleaseDll) Assert.Throws(Of ArgumentNullException)("peStream", Sub() comp.Emit(peStream:=Nothing)) Assert.Throws(Of ArgumentException)("peStream", Sub() comp.Emit(peStream:=New TestStream(canRead:=True, canWrite:=False, canSeek:=True))) Assert.Throws(Of ArgumentException)("pdbStream", Sub() comp.Emit(peStream:=New MemoryStream(), pdbStream:=New TestStream(canRead:=True, canWrite:=False, canSeek:=True))) Assert.Throws(Of ArgumentException)("pdbStream", Sub() comp.Emit(peStream:=New MemoryStream(), pdbStream:=New MemoryStream(), options:=EmitOptions.Default.WithDebugInformationFormat(DebugInformationFormat.Embedded))) Assert.Throws(Of ArgumentException)("sourceLinkStream", Sub() comp.Emit( peStream:=New MemoryStream(), pdbStream:=New MemoryStream(), options:=EmitOptions.Default.WithDebugInformationFormat(DebugInformationFormat.PortablePdb), sourceLinkStream:=New TestStream(canRead:=False, canWrite:=True, canSeek:=True))) Assert.Throws(Of ArgumentException)("embeddedTexts", Sub() comp.Emit( peStream:=New MemoryStream(), pdbStream:=Nothing, options:=Nothing, embeddedTexts:={EmbeddedText.FromStream("_", New MemoryStream())})) Assert.Throws(Of ArgumentException)("embeddedTexts", Sub() comp.Emit( peStream:=New MemoryStream(), pdbStream:=Nothing, options:=EmitOptions.Default.WithDebugInformationFormat(DebugInformationFormat.PortablePdb), embeddedTexts:={EmbeddedText.FromStream("_", New MemoryStream())})) Assert.Throws(Of ArgumentException)("win32Resources", Sub() comp.Emit( peStream:=New MemoryStream(), win32Resources:=New TestStream(canRead:=True, canWrite:=False, canSeek:=False))) Assert.Throws(Of ArgumentException)("win32Resources", Sub() comp.Emit( peStream:=New MemoryStream(), win32Resources:=New TestStream(canRead:=False, canWrite:=False, canSeek:=True))) ' we don't report an error when we can't write to the XML doc stream: Assert.True(comp.Emit( peStream:=New MemoryStream(), pdbStream:=New MemoryStream(), xmlDocumentationStream:=New TestStream(canRead:=True, canWrite:=False, canSeek:=True)).Success) End Sub <Fact> Public Sub EmitOptionsDiagnostics() Dim c = CreateCompilationWithMscorlib40({"class C {}"}) Dim stream = New MemoryStream() Dim options = New EmitOptions( debugInformationFormat:=CType(-1, DebugInformationFormat), outputNameOverride:=" ", fileAlignment:=513, subsystemVersion:=SubsystemVersion.Create(1000000, -1000000), pdbChecksumAlgorithm:=New HashAlgorithmName("invalid hash algorithm name")) Dim result = c.Emit(stream, options:=options) result.Diagnostics.Verify( Diagnostic(ERRID.ERR_InvalidDebugInformationFormat).WithArguments("-1"), Diagnostic(ERRID.ERR_InvalidOutputName).WithArguments("Name cannot start with whitespace."), Diagnostic(ERRID.ERR_InvalidFileAlignment).WithArguments("513"), Diagnostic(ERRID.ERR_InvalidSubsystemVersion).WithArguments("1000000.-1000000"), Diagnostic(ERRID.ERR_InvalidHashAlgorithmName).WithArguments("invalid hash algorithm name")) Assert.False(result.Success) End Sub <Fact> Sub EmitOptions_PdbChecksumAndDeterminism() Dim options = New EmitOptions(pdbChecksumAlgorithm:=New HashAlgorithmName()) Dim diagnosticBag = New DiagnosticBag() options.ValidateOptions(diagnosticBag, MessageProvider.Instance, isDeterministic:=True) diagnosticBag.Verify( Diagnostic(ERRID.ERR_InvalidHashAlgorithmName).WithArguments("")) diagnosticBag.Clear() options.ValidateOptions(diagnosticBag, MessageProvider.Instance, isDeterministic:=False) diagnosticBag.Verify() End Sub <Fact> Public Sub ReferenceAPITest() ' Create Compilation takes two args Dim comp = VisualBasicCompilation.Create("Compilation") Dim ref1 = Net451.mscorlib Dim ref2 = Net451.System Dim ref3 = New TestMetadataReference(fullPath:="c:\xml.bms") Dim ref4 = New TestMetadataReference(fullPath:="c:\aaa.dll") ' Add a new empty item comp = comp.AddReferences(Enumerable.Empty(Of MetadataReference)()) Assert.Equal(0, comp.References.Count) ' Add a new valid item comp = comp.AddReferences(ref1) Dim assemblySmb = comp.GetReferencedAssemblySymbol(ref1) Assert.NotNull(assemblySmb) Assert.Equal("mscorlib", assemblySmb.Name, StringComparer.OrdinalIgnoreCase) Assert.Equal(1, comp.References.Count) Assert.Equal(MetadataImageKind.Assembly, comp.References(0).Properties.Kind) Assert.Same(ref1, comp.References(0)) ' Replace an existing item with another valid item comp = comp.ReplaceReference(ref1, ref2) Assert.Equal(1, comp.References.Count) Assert.Equal(MetadataImageKind.Assembly, comp.References(0).Properties.Kind) Assert.Equal(ref2, comp.References(0)) ' Remove an existing item comp = comp.RemoveReferences(ref2) Assert.Equal(0, comp.References.Count) 'WithReferences Dim hs1 As New HashSet(Of MetadataReference) From {ref1, ref2, ref3} Dim compCollection1 = VisualBasicCompilation.Create("Compilation") Assert.Equal(Of Integer)(0, Enumerable.Count(Of MetadataReference)(compCollection1.References)) Dim c2 As Compilation = compCollection1.WithReferences(hs1) Assert.Equal(Of Integer)(3, Enumerable.Count(Of MetadataReference)(c2.References)) 'WithReferences Dim compCollection2 = VisualBasicCompilation.Create("Compilation") Assert.Equal(Of Integer)(0, Enumerable.Count(Of MetadataReference)(compCollection2.References)) Dim c3 As Compilation = compCollection1.WithReferences(ref1, ref2, ref3) Assert.Equal(Of Integer)(3, Enumerable.Count(Of MetadataReference)(c3.References)) 'ReferencedAssemblyNames Dim RefAsm_Names As IEnumerable(Of AssemblyIdentity) = c2.ReferencedAssemblyNames Assert.Equal(Of Integer)(2, Enumerable.Count(Of AssemblyIdentity)(RefAsm_Names)) Dim ListNames As New List(Of String) Dim I As AssemblyIdentity For Each I In RefAsm_Names ListNames.Add(I.Name) Next Assert.Contains(Of String)("mscorlib", ListNames) Assert.Contains(Of String)("System", ListNames) 'RemoveAllReferences c2 = c2.RemoveAllReferences Assert.Equal(Of Integer)(0, Enumerable.Count(Of MetadataReference)(c2.References)) ' Overload with Hashset Dim hs = New HashSet(Of MetadataReference)() From {ref1, ref2, ref3} Dim compCollection = VisualBasicCompilation.Create("Compilation", references:=hs) compCollection = compCollection.AddReferences(ref1, ref2, ref3, ref4).RemoveReferences(hs) Assert.Equal(1, compCollection.References.Count) compCollection = compCollection.AddReferences(hs).RemoveReferences(ref1, ref2, ref3, ref4) Assert.Equal(0, compCollection.References.Count) ' Overload with Collection Dim col = New ObjectModel.Collection(Of MetadataReference)() From {ref1, ref2, ref3} compCollection = VisualBasicCompilation.Create("Compilation", references:=col) compCollection = compCollection.AddReferences(col).RemoveReferences(ref1, ref2, ref3) Assert.Equal(0, compCollection.References.Count) compCollection = compCollection.AddReferences(ref1, ref2, ref3).RemoveReferences(col) Assert.Equal(0, comp.References.Count) ' Overload with ConcurrentStack Dim stack = New Concurrent.ConcurrentStack(Of MetadataReference) stack.Push(ref1) stack.Push(ref2) stack.Push(ref3) compCollection = VisualBasicCompilation.Create("Compilation", references:=stack) compCollection = compCollection.AddReferences(stack).RemoveReferences(ref1, ref3, ref2) Assert.Equal(0, compCollection.References.Count) compCollection = compCollection.AddReferences(ref2, ref1, ref3).RemoveReferences(stack) Assert.Equal(0, compCollection.References.Count) ' Overload with ConcurrentQueue Dim queue = New Concurrent.ConcurrentQueue(Of MetadataReference) queue.Enqueue(ref1) queue.Enqueue(ref2) queue.Enqueue(ref3) compCollection = VisualBasicCompilation.Create("Compilation", references:=queue) compCollection = compCollection.AddReferences(queue).RemoveReferences(ref3, ref2, ref1) Assert.Equal(0, compCollection.References.Count) compCollection = compCollection.AddReferences(ref2, ref1, ref3).RemoveReferences(queue) Assert.Equal(0, compCollection.References.Count) End Sub <WorkItem(537826, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537826")> <Fact> Public Sub SyntreeAPITest() Dim s1 = "using System.Linq;" Dim s2 = <![CDATA[Class goo sub main Public Operator End Operator End Class ]]>.Value Dim s3 = "Imports s$ = System.Text" Dim s4 = <text> Module Module1 Sub Goo() for i = 0 to 100 next end sub End Module </text>.Value Dim t1 = VisualBasicSyntaxTree.ParseText(s4) Dim withErrorTree = VisualBasicSyntaxTree.ParseText(s2) Dim withErrorTree1 = VisualBasicSyntaxTree.ParseText(s3) Dim withErrorTreeCS = VisualBasicSyntaxTree.ParseText(s1) Dim withExpressionRootTree = SyntaxFactory.ParseExpression("0").SyntaxTree ' Create compilation takes three args Dim comp = VisualBasicCompilation.Create("Compilation", {t1}, {MscorlibRef, MsvbRef}, TestOptions.ReleaseDll) Dim tree = comp.SyntaxTrees.AsEnumerable() comp.VerifyDiagnostics() ' Add syntaxtree with error comp = comp.AddSyntaxTrees(withErrorTreeCS) Assert.Equal(2, comp.GetDiagnostics().Length()) ' Remove syntaxtree without error comp = comp.RemoveSyntaxTrees(tree) Assert.Equal(2, comp.GetDiagnostics(cancellationToken:=CancellationToken.None).Length()) ' Remove syntaxtree with error comp = comp.RemoveSyntaxTrees(withErrorTreeCS) Assert.Equal(0, comp.GetDiagnostics().Length()) Assert.Equal(0, comp.GetDeclarationDiagnostics().Length()) ' Get valid binding Dim bind = comp.GetSemanticModel(syntaxTree:=t1) Assert.NotNull(bind) ' Get Binding with tree is not exist bind = comp.GetSemanticModel(withErrorTree) Assert.NotNull(bind) ' Add syntaxtree which is CS language comp = comp.AddSyntaxTrees(withErrorTreeCS) Assert.Equal(2, comp.GetDiagnostics().Length()) comp = comp.RemoveSyntaxTrees(withErrorTreeCS) Assert.Equal(0, comp.GetDiagnostics().Length()) comp = comp.AddSyntaxTrees(t1, withErrorTree, withErrorTree1, withErrorTreeCS) comp = comp.RemoveSyntaxTrees(t1, withErrorTree, withErrorTree1, withErrorTreeCS) ' Add a new empty item comp = comp.AddSyntaxTrees(Enumerable.Empty(Of SyntaxTree)) Assert.Equal(0, comp.SyntaxTrees.Length) ' Add a new valid item comp = comp.AddSyntaxTrees(t1) Assert.Equal(1, comp.SyntaxTrees.Length) comp = comp.AddSyntaxTrees(VisualBasicSyntaxTree.ParseText(s4)) Assert.Equal(2, comp.SyntaxTrees.Length) ' Replace an existing item with another valid item comp = comp.ReplaceSyntaxTree(t1, VisualBasicSyntaxTree.ParseText(s4)) Assert.Equal(2, comp.SyntaxTrees.Length) ' Replace an existing item with same item comp = comp.AddSyntaxTrees(t1).ReplaceSyntaxTree(t1, t1) Assert.Equal(3, comp.SyntaxTrees.Length) ' Replace with existing and verify that it throws Assert.Throws(Of ArgumentException)(Sub() comp.ReplaceSyntaxTree(t1, comp.SyntaxTrees(0))) Assert.Throws(Of ArgumentException)(Sub() comp.AddSyntaxTrees(t1)) ' SyntaxTrees have reference equality. This removal should fail. Assert.Throws(Of ArgumentException)(Sub() comp = comp.RemoveSyntaxTrees(VisualBasicSyntaxTree.ParseText(s4))) Assert.Equal(3, comp.SyntaxTrees.Length) ' Remove non-existing item Assert.Throws(Of ArgumentException)(Sub() comp = comp.RemoveSyntaxTrees(withErrorTree)) Assert.Equal(3, comp.SyntaxTrees.Length) Dim t4 = VisualBasicSyntaxTree.ParseText("Using System;") Dim t5 = VisualBasicSyntaxTree.ParseText("Usingsssssssssssss System;") Dim t6 = VisualBasicSyntaxTree.ParseText("Import System") ' Overload with Hashset Dim hs = New HashSet(Of SyntaxTree) From {t4, t5, t6} Dim compCollection = VisualBasicCompilation.Create("Compilation", syntaxTrees:=hs) compCollection = compCollection.RemoveSyntaxTrees(hs) Assert.Equal(0, compCollection.SyntaxTrees.Length) compCollection = compCollection.AddSyntaxTrees(hs).RemoveSyntaxTrees(t4, t5, t6) Assert.Equal(0, compCollection.SyntaxTrees.Length) ' Overload with Collection Dim col = New ObjectModel.Collection(Of SyntaxTree) From {t4, t5, t6} compCollection = VisualBasicCompilation.Create("Compilation", syntaxTrees:=col) compCollection = compCollection.RemoveSyntaxTrees(t4, t5, t6) Assert.Equal(0, compCollection.SyntaxTrees.Length) Assert.Throws(Of ArgumentException)(Sub() compCollection = compCollection.AddSyntaxTrees(t4, t5).RemoveSyntaxTrees(col)) Assert.Equal(0, compCollection.SyntaxTrees.Length) ' Overload with ConcurrentStack Dim stack = New Concurrent.ConcurrentStack(Of SyntaxTree) stack.Push(t4) stack.Push(t5) stack.Push(t6) compCollection = VisualBasicCompilation.Create("Compilation", syntaxTrees:=stack) compCollection = compCollection.RemoveSyntaxTrees(t4, t6, t5) Assert.Equal(0, compCollection.SyntaxTrees.Length) Assert.Throws(Of ArgumentException)(Sub() compCollection = compCollection.AddSyntaxTrees(t4, t6).RemoveSyntaxTrees(stack)) Assert.Equal(0, compCollection.SyntaxTrees.Length) ' Overload with ConcurrentQueue Dim queue = New Concurrent.ConcurrentQueue(Of SyntaxTree) queue.Enqueue(t4) queue.Enqueue(t5) queue.Enqueue(t6) compCollection = VisualBasicCompilation.Create("Compilation", syntaxTrees:=queue) compCollection = compCollection.RemoveSyntaxTrees(t4, t6, t5) Assert.Equal(0, compCollection.SyntaxTrees.Length) Assert.Throws(Of ArgumentException)(Sub() compCollection = compCollection.AddSyntaxTrees(t4, t6).RemoveSyntaxTrees(queue)) Assert.Equal(0, compCollection.SyntaxTrees.Length) ' VisualBasicCompilation.Create with syntaxtree with a non-CompilationUnit root node: should throw an ArgumentException. Assert.False(withExpressionRootTree.HasCompilationUnitRoot, "how did we get a CompilationUnit root?") Assert.Throws(Of ArgumentException)(Sub() VisualBasicCompilation.Create("Compilation", syntaxTrees:={withExpressionRootTree})) ' AddSyntaxTrees with a non-CompilationUnit root node: should throw an ArgumentException. Assert.Throws(Of ArgumentException)(Sub() comp.AddSyntaxTrees(withExpressionRootTree)) ' ReplaceSyntaxTrees syntaxtree with a non-CompilationUnit root node: should throw an ArgumentException. Assert.Throws(Of ArgumentException)(Sub() comp.ReplaceSyntaxTree(comp.SyntaxTrees(0), withExpressionRootTree)) End Sub <Fact> Public Sub ChainedOperations() Dim s1 = "using System.Linq;" Dim s2 = "" Dim s3 = "Import System" Dim t1 = VisualBasicSyntaxTree.ParseText(s1) Dim t2 = VisualBasicSyntaxTree.ParseText(s2) Dim t3 = VisualBasicSyntaxTree.ParseText(s3) Dim listSyntaxTree = New List(Of SyntaxTree) listSyntaxTree.Add(t1) listSyntaxTree.Add(t2) ' Remove second SyntaxTree Dim comp = VisualBasicCompilation.Create("Compilation") comp = comp.AddSyntaxTrees(listSyntaxTree).RemoveSyntaxTrees(t2) Assert.Equal(1, comp.SyntaxTrees.Length) 'ContainsSyntaxTree Dim b1 As Boolean = comp.ContainsSyntaxTree(t2) Assert.Equal(Of Boolean)(False, b1) comp = comp.AddSyntaxTrees({t2}) b1 = comp.ContainsSyntaxTree(t2) Assert.Equal(Of Boolean)(True, b1) Dim xt As SyntaxTree = Nothing Assert.Equal(Of Boolean)(False, comp.ContainsSyntaxTree(xt)) comp = comp.RemoveSyntaxTrees({t2}) Assert.Equal(1, comp.SyntaxTrees.Length) comp = comp.AddSyntaxTrees({t2}) Assert.Equal(2, comp.SyntaxTrees.Length) 'RemoveAllSyntaxTrees comp = comp.RemoveAllSyntaxTrees Assert.Equal(0, comp.SyntaxTrees.Length) comp = VisualBasicCompilation.Create("Compilation").AddSyntaxTrees(listSyntaxTree).RemoveSyntaxTrees({t2}) Assert.Equal(Of Integer)(1, comp.SyntaxTrees.Length) Assert.Equal(Of String)("Object", comp.ObjectType.Name) ' Remove mid SyntaxTree listSyntaxTree.Add(t3) comp = comp.RemoveSyntaxTrees(t1).AddSyntaxTrees(listSyntaxTree).RemoveSyntaxTrees(t2) Assert.Equal(2, comp.SyntaxTrees.Length) ' remove list listSyntaxTree.Remove(t2) comp = comp.AddSyntaxTrees().RemoveSyntaxTrees(listSyntaxTree) comp = comp.AddSyntaxTrees(listSyntaxTree).RemoveSyntaxTrees(listSyntaxTree) Assert.Equal(0, comp.SyntaxTrees.Length) listSyntaxTree.Clear() listSyntaxTree.Add(t1) ' Chained operation count > 2 comp = comp.AddSyntaxTrees(listSyntaxTree).AddReferences().ReplaceSyntaxTree(t1, t2) Assert.Equal(1, comp.SyntaxTrees.Length) Assert.Equal(0, comp.References.Count) ' Create compilation with args is disordered Dim comp1 = VisualBasicCompilation.Create("Compilation") Dim Err = "c:\file_that_does_not_exist" Dim ref1 = Net451.mscorlib Dim listRef = New List(Of MetadataReference) ' this is NOT testing Roslyn listRef.Add(ref1) listRef.Add(ref1) ' Remove with no args comp1 = comp1.AddReferences(listRef).AddSyntaxTrees(listSyntaxTree).RemoveReferences().RemoveSyntaxTrees() 'should have only added one reference since ref1.Equals(ref1) and Equal references are added only once. Assert.Equal(1, comp1.References.Count) Assert.Equal(1, comp1.SyntaxTrees.Length) End Sub <WorkItem(713356, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/713356")> <Fact()> Public Sub MissedModuleA() Dim netModule1 = CreateCompilationWithMscorlib40AndVBRuntime( <compilation name="missing1"> <file name="a.vb"> Class C1 End Class </file> </compilation>, options:=TestOptions.ReleaseModule) netModule1.VerifyDiagnostics() Dim netModule2 = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="missing2"> <file name="a.vb"> Class C2 Public Shared Sub M() Dim a As New C1() End Sub End Class </file> </compilation>, references:={netModule1.EmitToImageReference()}, options:=TestOptions.ReleaseModule) netModule2.VerifyDiagnostics() Dim assembly = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="missing"> <file name="a.vb"> Class C3 Public Shared Sub Main(args() As String) Dim a As New C2() End Sub End Class </file> </compilation>, references:={netModule2.EmitToImageReference()}) assembly.VerifyDiagnostics(Diagnostic(ERRID.ERR_MissingNetModuleReference).WithArguments("missing1.netmodule")) assembly = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="MissedModuleA"> <file name="a.vb"> Class C3 Public Shared Sub Main(args() As String) Dim a As New C2() End Sub End Class </file> </compilation>, references:={netModule1.EmitToImageReference(), netModule2.EmitToImageReference()}) assembly.VerifyDiagnostics() CompileAndVerify(assembly) End Sub <WorkItem(713356, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/713356")> <Fact()> Public Sub MissedModuleB_OneError() Dim netModule1 = CreateCompilationWithMscorlib40AndVBRuntime( <compilation name="a1"> <file name="a.vb"> Class C1 End Class </file> </compilation>, options:=TestOptions.ReleaseModule) CompilationUtils.AssertNoDiagnostics(netModule1) Dim netModule2 = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="a2"> <file name="a.vb"> Class C2 Public Shared Sub M() Dim a As New C1() End Sub End Class </file> </compilation>, references:={netModule1.EmitToImageReference()}, options:=TestOptions.ReleaseModule) CompilationUtils.AssertNoDiagnostics(netModule2) Dim netModule3 = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="a3"> <file name="a.vb"> Class C22 Public Shared Sub M() Dim a As New C1() End Sub End Class </file> </compilation>, references:={netModule1.EmitToImageReference()}, options:=TestOptions.ReleaseModule) CompilationUtils.AssertNoDiagnostics(netModule3) Dim assembly = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="a"> <file name="a.vb"> Class C3 Public Shared Sub Main(args() As String) Dim a As New C2() Dim b As New C22() End Sub End Class </file> </compilation>, references:={netModule2.EmitToImageReference(), netModule3.EmitToImageReference()}) CompilationUtils.AssertTheseDiagnostics(assembly, <errors> BC37221: Reference to 'a1.netmodule' netmodule missing. </errors>) End Sub <WorkItem(718500, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/718500")> <WorkItem(716762, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/716762")> <Fact()> Public Sub MissedModuleB_NoErrorForUnmanagedModules() Dim netModule1 = CreateCompilationWithMscorlib40AndVBRuntime( <compilation name="a1"> <file name="a.vb"> Imports System.Runtime.InteropServices Public Class ClassDLLImports Declare Function getUserName Lib "advapi32.dll" Alias "GetUserNameA" ( ByVal lpBuffer As String, ByRef nSize As Integer) As Integer End Class </file> </compilation>, options:=TestOptions.ReleaseModule) CompilationUtils.AssertNoDiagnostics(netModule1) Dim assembly = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="a"> <file name="a.vb"> Class C3 Public Shared Sub Main(args() As String) End Sub End Class </file> </compilation>, references:={netModule1.EmitToImageReference(expectedWarnings:={ Diagnostic(ERRID.HDN_UnusedImportStatement, "Imports System.Runtime.InteropServices")})}) assembly.AssertNoDiagnostics() End Sub <WorkItem(715872, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/715872")> <Fact()> Public Sub MissedModuleC() Dim netModule1 = CreateCompilationWithMscorlib40AndVBRuntime( <compilation name="a1"> <file name="a.vb"> Class C1 End Class </file> </compilation>, options:=TestOptions.ReleaseModule) CompilationUtils.AssertNoDiagnostics(netModule1) Dim netModule2 = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="a1"> <file name="a.vb"> Class C2 Public Shared Sub M() End Sub End Class </file> </compilation>, references:={netModule1.EmitToImageReference()}, options:=TestOptions.ReleaseModule) CompilationUtils.AssertNoDiagnostics(netModule2) Dim assembly = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences( <compilation name="a"> <file name="a.vb"> Class C3 Public Shared Sub Main(args() As String) Dim a As New C2() End Sub End Class </file> </compilation>, references:={netModule1.EmitToImageReference(), netModule2.EmitToImageReference()}) CompilationUtils.AssertTheseDiagnostics(assembly, <errors> BC37224: Module 'a1.netmodule' is already defined in this assembly. Each module must have a unique filename. </errors>) End Sub <Fact> Public Sub MixedRefType() ' Create compilation takes three args Dim csComp = CS.CSharpCompilation.Create("CompilationVB") Dim comp = VisualBasicCompilation.Create("Compilation") ' this is NOT right path, ' please don't use VB dll (there is a change to the location in Dev11; you test will fail then) csComp = csComp.AddReferences(SystemRef) ' Add VB reference to C# compilation For Each item In csComp.References comp = comp.AddReferences(item) comp = comp.ReplaceReference(item, item) Next Assert.Equal(1, comp.References.Count) Dim text1 = "Imports System" Dim comp1 = VisualBasicCompilation.Create("Test1", {VisualBasicSyntaxTree.ParseText(text1)}) Dim comp2 = VisualBasicCompilation.Create("Test2", {VisualBasicSyntaxTree.ParseText(text1)}) Dim compRef1 = comp1.ToMetadataReference() Dim compRef2 = comp2.ToMetadataReference() Dim csCompRef = csComp.ToMetadataReference(embedInteropTypes:=True) Dim ref1 = Net451.mscorlib Dim ref2 = Net451.System ' Add VisualBasicCompilationReference comp = VisualBasicCompilation.Create("Test1", {VisualBasicSyntaxTree.ParseText(text1)}, {compRef1, compRef2}) Assert.Equal(2, comp.References.Count) Assert.Equal(MetadataImageKind.Assembly, comp.References(0).Properties.Kind) Assert.Contains(compRef1, comp.References) Assert.Contains(compRef2, comp.References) Dim smb = comp.GetReferencedAssemblySymbol(compRef1) Assert.Equal(smb.Kind, SymbolKind.Assembly) Assert.Equal("Test1", smb.Identity.Name, StringComparer.OrdinalIgnoreCase) ' Mixed reference type comp = comp.AddReferences(ref1) Assert.Equal(3, comp.References.Count) Assert.Contains(ref1, comp.References) ' Replace Compilation reference with Assembly file reference comp = comp.ReplaceReference(compRef2, ref2) Assert.Equal(3, comp.References.Count) Assert.Contains(ref2, comp.References) ' Replace Assembly file reference with Compilation reference comp = comp.ReplaceReference(ref1, compRef2) Assert.Equal(3, comp.References.Count) Assert.Contains(compRef2, comp.References) Dim modRef1 = ModuleMetadata.CreateFromImage(TestResources.MetadataTests.NetModule01.ModuleCS00).GetReference() ' Add Module file reference comp = comp.AddReferences(modRef1) ' Not Implemented 'Dim modSmb = comp.GetReferencedModuleSymbol(modRef1) 'Assert.Equal("ModuleCS00.mod", modSmb.Name) 'Assert.Equal(4, comp.References.Count) 'Assert.True(comp.References.Contains(modRef1)) ' Get Referenced Assembly Symbol 'smb = comp.GetReferencedAssemblySymbol(reference:=modRef1) 'Assert.Equal(smb.Kind, SymbolKind.Assembly) 'Assert.True(String.Equals(smb.AssemblyName.Name, "Test1", StringComparison.OrdinalIgnoreCase)) ' Get Referenced Module Symbol 'Dim moduleSmb = comp.GetReferencedModuleSymbol(reference:=modRef1) 'Assert.Equal(moduleSmb.Kind, SymbolKind.NetModule) 'Assert.True(String.Equals(moduleSmb.Name, "ModuleCS00.mod", StringComparison.OrdinalIgnoreCase)) ' Not implemented ' Get Compilation Namespace 'Dim nsSmb = comp.GlobalNamespace 'Dim ns = comp.GetCompilationNamespace(ns:=nsSmb) 'Assert.Equal(ns.Kind, SymbolKind.Namespace) 'Assert.True(String.Equals(ns.Name, "Compilation", StringComparison.OrdinalIgnoreCase)) ' Not implemented ' GetCompilationNamespace (Derived Class MergedNamespaceSymbol) 'Dim merged As NamespaceSymbol = MergedNamespaceSymbol.Create(New NamespaceExtent(New MockAssemblySymbol("Merged")), Nothing, Nothing) 'ns = comp.GetCompilationNamespace(ns:=merged) 'Assert.Equal(ns.Kind, SymbolKind.Namespace) 'Assert.True(String.Equals(ns.Name, "Compilation", StringComparison.OrdinalIgnoreCase)) ' Not implemented ' GetCompilationNamespace (Derived Class PENamespaceSymbol) 'Dim pensSmb As Metadata.PE.PENamespaceSymbol = CType(nsSmb, Metadata.PE.PENamespaceSymbol) 'ns = comp.GetCompilationNamespace(ns:=pensSmb) 'Assert.Equal(ns.Kind, SymbolKind.Namespace) 'Assert.True(String.Equals(ns.Name, "Compilation", StringComparison.OrdinalIgnoreCase)) ' Replace Module file reference with compilation reference comp = comp.RemoveReferences(compRef1).ReplaceReference(modRef1, compRef1) Assert.Equal(3, comp.References.Count) ' Check the reference order after replace Assert.Equal(MetadataImageKind.Assembly, comp.References(2).Properties.Kind) Assert.Equal(compRef1, comp.References(2)) ' Replace compilation Module file reference with Module file reference comp = comp.ReplaceReference(compRef1, modRef1) ' Check the reference order after replace Assert.Equal(3, comp.References.Count) Assert.Equal(MetadataImageKind.Module, comp.References(2).Properties.Kind) Assert.Equal(modRef1, comp.References(2)) ' Add CS compilation ref Assert.Throws(Of ArgumentException)(Function() comp.AddReferences(csCompRef)) For Each item In comp.References comp = comp.RemoveReferences(item) Next Assert.Equal(0, comp.References.Count) ' Not Implemented ' Dim asmByteRef = MetadataReference.CreateFromImage(New Byte(4) {}, "AssemblyBytesRef1", embedInteropTypes:=True) 'Dim asmObjectRef = New AssemblyObjectReference(assembly:=System.Reflection.Assembly.GetAssembly(GetType(Object)), embedInteropTypes:=True) 'comp = comp.AddReferences(asmByteRef, asmObjectRef) 'Assert.Equal(2, comp.References.Count) 'Assert.Equal(ReferenceKind.AssemblyBytes, comp.References(0).Kind) 'Assert.Equal(ReferenceKind.AssemblyObject, comp.References(1).Kind) 'Assert.Equal(asmByteRef, comp.References(0)) 'Assert.Equal(asmObjectRef, comp.References(1)) 'Assert.True(comp.References(0).EmbedInteropTypes) 'Assert.True(comp.References(1).EmbedInteropTypes) End Sub <Fact> Public Sub ModuleSuppliedAsAssembly() Dim comp = VisualBasicCompilation.Create("Compilation", references:={AssemblyMetadata.CreateFromImage(TestResources.MetadataTests.NetModule01.ModuleVB01).GetReference()}) Assert.Equal(comp.GetDiagnostics().First().Code, ERRID.ERR_MetaDataIsNotAssembly) End Sub <Fact> Public Sub AssemblySuppliedAsModule() Dim comp = VisualBasicCompilation.Create("Compilation", references:={ModuleMetadata.CreateFromImage(ResourcesNet451.System).GetReference()}) Assert.Equal(comp.GetDiagnostics().First().Code, ERRID.ERR_MetaDataIsNotModule) End Sub '' Get nonexistent Referenced Assembly Symbol <WorkItem(537637, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537637")> <Fact> Public Sub NegReference1() Dim comp = VisualBasicCompilation.Create("Compilation") Assert.Null(comp.GetReferencedAssemblySymbol(Net451.System)) Dim modRef1 = ModuleMetadata.CreateFromImage(TestResources.MetadataTests.NetModule01.ModuleVB01).GetReference() Assert.Null(comp.GetReferencedModuleSymbol(modRef1)) End Sub '' Add already existing item <WorkItem(537617, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537617")> <Fact> Public Sub NegReference2() Dim comp = VisualBasicCompilation.Create("Compilation") Dim ref1 = Net451.System Dim ref2 = New TestMetadataReference(fullPath:="c:\a\xml.bms") Dim ref3 = ref2 Dim ref4 = New TestMetadataReference(fullPath:="c:\aaa.dll") comp = comp.AddReferences(ref1, ref1) Assert.Equal(1, comp.References.Count) Assert.Equal(ref1, comp.References(0)) ' Remove non-existing item Assert.Throws(Of ArgumentException)(Function() comp.RemoveReferences(ref2)) Dim listRef = New List(Of MetadataReference) From {ref1, ref2, ref3, ref4} comp = comp.AddReferences(listRef).AddReferences(ref2).ReplaceReference(ref2, ref2) Assert.Equal(3, comp.References.Count) comp = comp.RemoveReferences(listRef).AddReferences(ref1) Assert.Equal(1, comp.References.Count) Assert.Equal(ref1, comp.References(0)) End Sub '' Add a new invalid item <WorkItem(537575, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537575")> <Fact> Public Sub NegReference3() Dim comp = VisualBasicCompilation.Create("Compilation") Dim ref1 = New TestMetadataReference(fullPath:="c:\xml.bms") Dim ref2 = Net451.System comp = comp.AddReferences(ref1) Assert.Equal(1, comp.References.Count) ' Replace a non-existing item with another invalid item Assert.Throws(Of ArgumentException)(Sub() comp = comp.ReplaceReference(ref2, ref1) End Sub) Assert.Equal(1, comp.References.Count) End Sub '' Replace a non-existing item with null <WorkItem(537567, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537567")> <Fact> Public Sub NegReference4() Dim opt = TestOptions.ReleaseExe Dim comp = VisualBasicCompilation.Create("Compilation") Dim ref1 = New TestMetadataReference(fullPath:="c:\xml.bms") Assert.Throws(Of ArgumentException)( Sub() comp.ReplaceReference(ref1, Nothing) End Sub) ' Replace null and the arg order of replace is vise Assert.Throws(Of ArgumentNullException)( Sub() comp.ReplaceReference(newReference:=ref1, oldReference:=Nothing) End Sub) End Sub '' Replace a non-existing item with another valid item <WorkItem(537566, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537566")> <Fact> Public Sub NegReference5() Dim comp = VisualBasicCompilation.Create("Compilation") Dim ref1 = Net451.mscorlib Dim ref2 = Net451.System Assert.Throws(Of ArgumentException)( Sub() comp = comp.ReplaceReference(ref1, ref2) End Sub) Dim s1 = "Imports System.Text" Dim t1 = Parse(s1) ' Replace a non-existing item with another valid item and disorder the args Assert.Throws(Of ArgumentException)(Sub() comp.ReplaceSyntaxTree(newTree:=VisualBasicSyntaxTree.ParseText("Imports System"), oldTree:=t1) End Sub) Assert.Equal(0, comp.References.Count) End Sub '' Throw exception when add Nothing references <WorkItem(537618, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537618")> <Fact> Public Sub NegReference6() Dim opt = TestOptions.ReleaseExe Dim comp = VisualBasicCompilation.Create("Compilation") Assert.Throws(Of ArgumentNullException)(Sub() comp = comp.AddReferences(Nothing)) End Sub '' Throw exception when remove Nothing references <WorkItem(537621, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537621")> <Fact> Public Sub NegReference7() Dim opt = TestOptions.ReleaseExe Dim comp = VisualBasicCompilation.Create("Compilation") Dim RemoveNothingRefEx = Assert.Throws(Of ArgumentNullException)(Sub() comp = comp.RemoveReferences(Nothing)) End Sub '' Add already existing item <WorkItem(537576, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537576")> <Fact> Public Sub NegSyntaxTree1() Dim opt = TestOptions.ReleaseExe Dim comp = VisualBasicCompilation.Create("Compilation") Dim t1 = VisualBasicSyntaxTree.ParseText("Using System;") Assert.Throws(Of ArgumentException)(Sub() comp.AddSyntaxTrees(t1, t1)) Assert.Equal(0, comp.SyntaxTrees.Length) End Sub ' Throw exception when the parameter of ContainsSyntaxTrees is null <WorkItem(527256, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/527256")> <Fact> Public Sub NegContainsSyntaxTrees() Dim opt = TestOptions.ReleaseExe Dim comp = VisualBasicCompilation.Create("Compilation") Assert.False(comp.SyntaxTrees.Contains(Nothing)) End Sub ' Throw exception when the parameter of AddReferences is CSharpCompilationReference <WorkItem(537778, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537778")> <Fact> Public Sub NegGetSymbol() Dim opt = TestOptions.ReleaseExe Dim comp = VisualBasicCompilation.Create("Compilation") Dim csComp = CS.CSharpCompilation.Create("CompilationCS") Dim compRef = csComp.ToMetadataReference() Assert.Throws(Of ArgumentException)(Function() comp.AddReferences(compRef)) '' Throw exception when the parameter of GetReferencedAssemblySymbol is null 'Assert.Throws(Of ArgumentNullException)(Sub() comp.GetReferencedAssemblySymbol(Nothing)) '' Throw exception when the parameter of GetReferencedModuleSymbol is null 'Assert.Throws(Of ArgumentNullException)( ' Sub() ' comp.GetReferencedModuleSymbol(Nothing) ' End Sub) End Sub '' Throw exception when the parameter of GetSpecialType is 'SpecialType.None' <WorkItem(537784, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537784")> <Fact> Public Sub NegGetSpecialType() Dim comp = VisualBasicCompilation.Create("Compilation") Assert.Throws(Of ArgumentOutOfRangeException)( Sub() comp.GetSpecialType((SpecialType.None)) End Sub) ' Throw exception when the parameter of GetSpecialType is '0' Assert.Throws(Of ArgumentOutOfRangeException)( Sub() comp.GetSpecialType(CType(0, SpecialType)) End Sub) ' Throw exception when the parameter of GetBinding is out of range Assert.Throws(Of ArgumentOutOfRangeException)( Sub() comp.GetSpecialType(CType(100, SpecialType)) End Sub) ' Throw exception when the parameter of GetCompilationNamespace is null Assert.Throws(Of ArgumentNullException)( Sub() comp.GetCompilationNamespace(namespaceSymbol:=Nothing) End Sub) Dim bind = comp.GetSemanticModel(Nothing) Assert.NotNull(bind) End Sub <Fact> Public Sub NegSynTree() Dim comp = VisualBasicCompilation.Create("Compilation") Dim s1 = "Imports System.Text" Dim tree = VisualBasicSyntaxTree.ParseText(s1) ' Throw exception when add Nothing SyntaxTree Assert.Throws(Of ArgumentNullException)(Sub() comp.AddSyntaxTrees(Nothing)) ' Throw exception when Remove Nothing SyntaxTree Assert.Throws(Of ArgumentNullException)(Sub() comp.RemoveSyntaxTrees(Nothing)) ' Replace a tree with nothing (aka removing it) comp = comp.AddSyntaxTrees(tree).ReplaceSyntaxTree(tree, Nothing) Assert.Equal(0, comp.SyntaxTrees.Count) ' Throw exception when remove Nothing SyntaxTree Assert.Throws(Of ArgumentNullException)(Sub() comp = comp.ReplaceSyntaxTree(Nothing, tree)) Dim t1 = CS.SyntaxFactory.ParseSyntaxTree(s1) Dim t2 As SyntaxTree = t1 Dim t3 = t2 Dim csComp = CS.CSharpCompilation.Create("CompilationVB") csComp = csComp.AddSyntaxTrees(t1, CS.SyntaxFactory.ParseSyntaxTree("Imports Goo")) ' Throw exception when cast SyntaxTree For Each item In csComp.SyntaxTrees t3 = item Dim invalidCastSynTreeEx = Assert.Throws(Of InvalidCastException)(Sub() comp = comp.AddSyntaxTrees(CType(t3, VisualBasicSyntaxTree))) invalidCastSynTreeEx = Assert.Throws(Of InvalidCastException)(Sub() comp = comp.RemoveSyntaxTrees(CType(t3, VisualBasicSyntaxTree))) invalidCastSynTreeEx = Assert.Throws(Of InvalidCastException)(Sub() comp = comp.ReplaceSyntaxTree(CType(t3, VisualBasicSyntaxTree), CType(t3, VisualBasicSyntaxTree))) Next End Sub <Fact> Public Sub RootNSIllegalIdentifiers() AssertTheseDiagnostics(TestOptions.ReleaseExe.WithRootNamespace("[[Global]]").Errors, <expected> BC2014: the value '[[Global]]' is invalid for option 'RootNamespace' </expected>) AssertTheseDiagnostics(TestOptions.ReleaseExe.WithRootNamespace("From()").Errors, <expected> BC2014: the value 'From()' is invalid for option 'RootNamespace' </expected>) AssertTheseDiagnostics(TestOptions.ReleaseExe.WithRootNamespace("x$").Errors, <expected> BC2014: the value 'x$' is invalid for option 'RootNamespace' </expected>) AssertTheseDiagnostics(TestOptions.ReleaseExe.WithRootNamespace("Goo.").Errors, <expected> BC2014: the value 'Goo.' is invalid for option 'RootNamespace' </expected>) AssertTheseDiagnostics(TestOptions.ReleaseExe.WithRootNamespace("_").Errors, <expected> BC2014: the value '_' is invalid for option 'RootNamespace' </expected>) End Sub <Fact> Public Sub AmbiguousNestedTypeSymbolFromMetadata() Dim code = "Class A : Class B : End Class : End Class" Dim c1 = VisualBasicCompilation.Create("Asm1", syntaxTrees:={VisualBasicSyntaxTree.ParseText(code)}) Dim c2 = VisualBasicCompilation.Create("Asm2", syntaxTrees:={VisualBasicSyntaxTree.ParseText(code)}) Dim c3 = VisualBasicCompilation.Create("Asm3", references:={c1.ToMetadataReference(), c2.ToMetadataReference()}) Assert.Null(c3.GetTypeByMetadataName("A+B")) End Sub <Fact> Public Sub DuplicateNestedTypeSymbol() Dim code = "Class A : Class B : End Class : Class B : End Class : End Class" Dim c1 = VisualBasicCompilation.Create("Asm1", syntaxTrees:={VisualBasicSyntaxTree.ParseText(code)}) Assert.Equal("A.B", c1.GetTypeByMetadataName("A+B").ToDisplayString()) End Sub <Fact()> <WorkItem(543211, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543211")> Public Sub TreeDiagnosticsShouldNotIncludeEntryPointDiagnostics() Dim code1 = "Module M : Sub Main : End Sub : End Module" Dim code2 = " " Dim tree1 = VisualBasicSyntaxTree.ParseText(code1) Dim tree2 = VisualBasicSyntaxTree.ParseText(code2) Dim comp = VisualBasicCompilation.Create( "Test", syntaxTrees:={tree1, tree2}) Dim semanticModel2 = comp.GetSemanticModel(tree2) Dim diagnostics2 = semanticModel2.GetDiagnostics() Assert.Equal(0, diagnostics2.Length()) End Sub <Fact()> <WorkItem(543292, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543292")> Public Sub CompilationNotSupported() Dim compilation = VisualBasicCompilation.Create("HelloWorld") Assert.Throws(Of NotSupportedException)(Function() compilation.DynamicType) Assert.Throws(Of NotSupportedException)(Function() compilation.CreatePointerTypeSymbol(Nothing)) Assert.Throws(Of NotSupportedException)(Function() compilation.CreateFunctionPointerTypeSymbol(Nothing, Nothing, Nothing, Nothing, Nothing, Nothing)) End Sub <Fact> Public Sub CreateTupleTypeSymbol_NoNames() Dim comp = VisualBasicCompilation.Create("test", references:={MscorlibRef}) ' no ValueTuple Dim intType As TypeSymbol = comp.GetSpecialType(SpecialType.System_Int32) Dim stringType As TypeSymbol = comp.GetSpecialType(SpecialType.System_String) Dim vt2 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).Construct(intType, stringType) Dim tupleWithoutNames = comp.CreateTupleTypeSymbol(vt2, Nothing) Assert.True(tupleWithoutNames.IsTupleType) Assert.Equal("(System.Int32, System.String)", tupleWithoutNames.ToTestDisplayString()) Assert.True(tupleWithoutNames.TupleElements.All(Function(e) e.IsImplicitlyDeclared)) Assert.Equal({"System.Int32", "System.String"}, tupleWithoutNames.TupleElements.Select(Function(t) t.Type.ToTestDisplayString())) Assert.Equal(CInt(SymbolKind.NamedType), CInt(tupleWithoutNames.Kind)) End Sub <Fact> Public Sub CreateTupleTypeSymbol_WithNames() Dim comp = VisualBasicCompilation.Create("test", references:={MscorlibRef}) ' no ValueTuple Dim intType As TypeSymbol = comp.GetSpecialType(SpecialType.System_Int32) Dim stringType As TypeSymbol = comp.GetSpecialType(SpecialType.System_String) Dim vt2 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).Construct(intType, stringType) Dim tupleWithNames = comp.CreateTupleTypeSymbol(vt2, ImmutableArray.Create("Alice", "Bob")) Assert.True(tupleWithNames.IsTupleType) Assert.Equal("(Alice As System.Int32, Bob As System.String)", tupleWithNames.ToTestDisplayString()) Assert.Equal({"Alice", "Bob"}, tupleWithNames.TupleElements.SelectAsArray(Function(e) e.Name)) Assert.Equal({"System.Int32", "System.String"}, tupleWithNames.TupleElements.Select(Function(t) t.Type.ToTestDisplayString())) Assert.Equal(SymbolKind.NamedType, tupleWithNames.Kind) End Sub <Fact()> <WorkItem(36047, "https://github.com/dotnet/roslyn/issues/36047")> Public Sub CreateArrayType_DefaultArgs() Dim comp = DirectCast(VisualBasicCompilation.Create(""), Compilation) Dim elementType = comp.GetSpecialType(SpecialType.System_Object) Dim arrayType = comp.CreateArrayTypeSymbol(elementType) Assert.Equal(1, arrayType.Rank) Assert.Equal(CodeAnalysis.NullableAnnotation.None, arrayType.ElementNullableAnnotation) Assert.Throws(Of ArgumentException)(Function() comp.CreateArrayTypeSymbol(elementType, Nothing)) Assert.Throws(Of ArgumentException)(Function() comp.CreateArrayTypeSymbol(elementType, 0)) arrayType = comp.CreateArrayTypeSymbol(elementType, 1, Nothing) Assert.Equal(1, arrayType.Rank) Assert.Equal(CodeAnalysis.NullableAnnotation.None, arrayType.ElementNullableAnnotation) Assert.Throws(Of ArgumentException)(Function() comp.CreateArrayTypeSymbol(elementType, rank:=Nothing)) Assert.Throws(Of ArgumentException)(Function() comp.CreateArrayTypeSymbol(elementType, rank:=0)) arrayType = comp.CreateArrayTypeSymbol(elementType, elementNullableAnnotation:=Nothing) Assert.Equal(1, arrayType.Rank) Assert.Equal(CodeAnalysis.NullableAnnotation.None, arrayType.ElementNullableAnnotation) End Sub <Fact()> <WorkItem(36047, "https://github.com/dotnet/roslyn/issues/36047")> Public Sub CreateArrayType_ElementNullableAnnotation() Dim comp = DirectCast(VisualBasicCompilation.Create(""), Compilation) Dim elementType = comp.GetSpecialType(SpecialType.System_Object) Assert.Equal(CodeAnalysis.NullableAnnotation.None, comp.CreateArrayTypeSymbol(elementType).ElementNullableAnnotation) Assert.Equal(CodeAnalysis.NullableAnnotation.None, comp.CreateArrayTypeSymbol(elementType, elementNullableAnnotation:=Nothing).ElementNullableAnnotation) Assert.Equal(CodeAnalysis.NullableAnnotation.None, comp.CreateArrayTypeSymbol(elementType, elementNullableAnnotation:=CodeAnalysis.NullableAnnotation.None).ElementNullableAnnotation) Assert.Equal(CodeAnalysis.NullableAnnotation.None, comp.CreateArrayTypeSymbol(elementType, elementNullableAnnotation:=CodeAnalysis.NullableAnnotation.NotAnnotated).ElementNullableAnnotation) Assert.Equal(CodeAnalysis.NullableAnnotation.None, comp.CreateArrayTypeSymbol(elementType, elementNullableAnnotation:=CodeAnalysis.NullableAnnotation.Annotated).ElementNullableAnnotation) End Sub <Fact()> Public Sub CreateAnonymousType_IncorrectLengths() Dim compilation = VisualBasicCompilation.Create("HelloWorld") Assert.Throws(Of ArgumentException)( Function() Return compilation.CreateAnonymousTypeSymbol( ImmutableArray.Create(DirectCast(Nothing, ITypeSymbol)), ImmutableArray.Create("m1", "m2")) End Function) End Sub <Fact> Public Sub CreateAnonymousType_IncorrectLengths_IsReadOnly() Dim compilation = VisualBasicCompilation.Create("HelloWorld") Assert.Throws(Of ArgumentException)( Sub() compilation.CreateAnonymousTypeSymbol( ImmutableArray.Create(DirectCast(compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol), DirectCast(compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol)), ImmutableArray.Create("m1", "m2"), ImmutableArray.Create(True)) End Sub) End Sub <Fact> Public Sub CreateAnonymousType_IncorrectLengths_Locations() Dim Compilation = VisualBasicCompilation.Create("HelloWorld") Assert.Throws(Of ArgumentException)( Sub() Compilation.CreateAnonymousTypeSymbol( ImmutableArray.Create(DirectCast(Compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol), DirectCast(Compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol)), ImmutableArray.Create("m1", "m2"), memberLocations:=ImmutableArray.Create(Location.None)) End Sub) End Sub <Fact> Public Sub CreateAnonymousType_WritableProperty() Dim compilation = VisualBasicCompilation.Create("HelloWorld") Dim type = compilation.CreateAnonymousTypeSymbol( ImmutableArray.Create(DirectCast(compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol), DirectCast(compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol)), ImmutableArray.Create("m1", "m2"), ImmutableArray.Create(False, False)) Assert.True(type.IsAnonymousType) Assert.Equal(2, type.GetMembers().OfType(Of IPropertySymbol).Count()) Assert.Equal("<anonymous type: m1 As Integer, m2 As Integer>", type.ToDisplayString()) Assert.All(type.GetMembers().OfType(Of IPropertySymbol)().Select(Function(p) p.Locations.FirstOrDefault()), Sub(loc) Assert.Equal(loc, Location.None)) End Sub <Fact> Public Sub CreateAnonymousType_Locations() Dim compilation = VisualBasicCompilation.Create("HelloWorld") Dim tree = VisualBasicSyntaxTree.ParseText("Class X") compilation = compilation.AddSyntaxTrees(tree) Dim loc1 = Location.Create(tree, New TextSpan(0, 1)) Dim loc2 = Location.Create(tree, New TextSpan(1, 1)) Dim type = compilation.CreateAnonymousTypeSymbol( ImmutableArray.Create(DirectCast(compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol), DirectCast(compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol)), ImmutableArray.Create("m1", "m2"), ImmutableArray.Create(False, False), ImmutableArray.Create(loc1, loc2)) Assert.True(type.IsAnonymousType) Assert.Equal(2, type.GetMembers().OfType(Of IPropertySymbol).Count()) Assert.Equal(loc1, type.GetMembers("m1").Single().Locations.Single()) Assert.Equal(loc2, type.GetMembers("m2").Single().Locations.Single()) Assert.Equal("<anonymous type: m1 As Integer, m2 As Integer>", type.ToDisplayString()) End Sub <Fact()> Public Sub CreateAnonymousType_NothingArgument() Dim compilation = VisualBasicCompilation.Create("HelloWorld") Assert.Throws(Of ArgumentNullException)( Function() Return compilation.CreateAnonymousTypeSymbol( ImmutableArray.Create(DirectCast(Nothing, ITypeSymbol)), ImmutableArray.Create("m1")) End Function) End Sub <Fact()> Public Sub CreateAnonymousType1() Dim compilation = VisualBasicCompilation.Create("HelloWorld") Dim type = compilation.CreateAnonymousTypeSymbol( ImmutableArray.Create(Of ITypeSymbol)(compilation.GetSpecialType(SpecialType.System_Int32)), ImmutableArray.Create("m1")) Assert.True(type.IsAnonymousType) Assert.Equal(1, type.GetMembers().OfType(Of IPropertySymbol).Count()) Assert.Equal("<anonymous type: Key m1 As Integer>", type.ToDisplayString()) Assert.All(type.GetMembers().OfType(Of IPropertySymbol)().Select(Function(p) p.Locations.FirstOrDefault()), Sub(loc) Assert.Equal(loc, Location.None)) End Sub <Fact()> Public Sub CreateMutableAnonymousType1() Dim compilation = VisualBasicCompilation.Create("HelloWorld") Dim type = compilation.CreateAnonymousTypeSymbol( ImmutableArray.Create(Of ITypeSymbol)(compilation.GetSpecialType(SpecialType.System_Int32)), ImmutableArray.Create("m1"), ImmutableArray.Create(False)) Assert.True(type.IsAnonymousType) Assert.Equal(1, type.GetMembers().OfType(Of IPropertySymbol).Count()) Assert.Equal("<anonymous type: m1 As Integer>", type.ToDisplayString()) Assert.All(type.GetMembers().OfType(Of IPropertySymbol)().Select(Function(p) p.Locations.FirstOrDefault()), Sub(loc) Assert.Equal(loc, Location.None)) End Sub <Fact()> Public Sub CreateAnonymousType2() Dim compilation = VisualBasicCompilation.Create("HelloWorld") Dim type = compilation.CreateAnonymousTypeSymbol( ImmutableArray.Create(Of ITypeSymbol)(compilation.GetSpecialType(SpecialType.System_Int32), compilation.GetSpecialType(SpecialType.System_Boolean)), ImmutableArray.Create("m1", "m2")) Assert.True(type.IsAnonymousType) Assert.Equal(2, type.GetMembers().OfType(Of IPropertySymbol).Count()) Assert.Equal("<anonymous type: Key m1 As Integer, Key m2 As Boolean>", type.ToDisplayString()) Assert.All(type.GetMembers().OfType(Of IPropertySymbol)().Select(Function(p) p.Locations.FirstOrDefault()), Sub(loc) Assert.Equal(loc, Location.None)) End Sub <Fact()> <WorkItem(36047, "https://github.com/dotnet/roslyn/issues/36047")> Public Sub CreateAnonymousType_DefaultArgs() Dim comp = DirectCast(CreateCompilation(""), Compilation) Dim memberTypes = ImmutableArray.Create(Of ITypeSymbol)(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String)) Dim memberNames = ImmutableArray.Create("P", "Q") Dim type = comp.CreateAnonymousTypeSymbol(memberTypes, memberNames) Assert.Equal("<anonymous type: Key P As System.Object, Key Q As System.String>", type.ToTestDisplayString()) type = comp.CreateAnonymousTypeSymbol(memberTypes, memberNames, Nothing) Assert.Equal("<anonymous type: Key P As System.Object, Key Q As System.String>", type.ToTestDisplayString()) type = comp.CreateAnonymousTypeSymbol(memberTypes, memberNames, Nothing, Nothing) Assert.Equal("<anonymous type: Key P As System.Object, Key Q As System.String>", type.ToTestDisplayString()) type = comp.CreateAnonymousTypeSymbol(memberTypes, memberNames, Nothing, Nothing, Nothing) Assert.Equal("<anonymous type: Key P As System.Object, Key Q As System.String>", type.ToTestDisplayString()) type = comp.CreateAnonymousTypeSymbol(memberTypes, memberNames, memberIsReadOnly:=Nothing) Assert.Equal("<anonymous type: Key P As System.Object, Key Q As System.String>", type.ToTestDisplayString()) type = comp.CreateAnonymousTypeSymbol(memberTypes, memberNames, memberLocations:=Nothing) Assert.Equal("<anonymous type: Key P As System.Object, Key Q As System.String>", type.ToTestDisplayString()) type = comp.CreateAnonymousTypeSymbol(memberTypes, memberNames, memberNullableAnnotations:=Nothing) Assert.Equal("<anonymous type: Key P As System.Object, Key Q As System.String>", type.ToTestDisplayString()) End Sub <Fact()> <WorkItem(36047, "https://github.com/dotnet/roslyn/issues/36047")> Public Sub CreateAnonymousType_MemberNullableAnnotations_Empty() Dim comp = DirectCast(VisualBasicCompilation.Create(""), Compilation) Dim type = comp.CreateAnonymousTypeSymbol(ImmutableArray(Of ITypeSymbol).Empty, ImmutableArray(Of String).Empty, memberNullableAnnotations:=ImmutableArray(Of CodeAnalysis.NullableAnnotation).Empty) Assert.Equal("<empty anonymous type>", type.ToTestDisplayString()) AssertEx.Equal(Array.Empty(Of CodeAnalysis.NullableAnnotation)(), GetAnonymousTypeNullableAnnotations(type)) End Sub <Fact()> <WorkItem(36047, "https://github.com/dotnet/roslyn/issues/36047")> Public Sub CreateAnonymousType_MemberNullableAnnotations() Dim comp = DirectCast(CreateCompilation(""), Compilation) Dim memberTypes = ImmutableArray.Create(Of ITypeSymbol)(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String)) Dim memberNames = ImmutableArray.Create("P", "Q") Dim type = comp.CreateAnonymousTypeSymbol(memberTypes, memberNames) Assert.Equal("<anonymous type: Key P As System.Object, Key Q As System.String>", type.ToTestDisplayString()) AssertEx.Equal({CodeAnalysis.NullableAnnotation.None, CodeAnalysis.NullableAnnotation.None}, GetAnonymousTypeNullableAnnotations(type)) Assert.Throws(Of ArgumentException)(Function() comp.CreateAnonymousTypeSymbol(memberTypes, memberNames, memberNullableAnnotations:=ImmutableArray.Create(CodeAnalysis.NullableAnnotation.NotAnnotated))) type = comp.CreateAnonymousTypeSymbol(memberTypes, memberNames, memberNullableAnnotations:=ImmutableArray.Create(CodeAnalysis.NullableAnnotation.NotAnnotated, CodeAnalysis.NullableAnnotation.Annotated)) Assert.Equal("<anonymous type: Key P As System.Object, Key Q As System.String>", type.ToTestDisplayString()) AssertEx.Equal({CodeAnalysis.NullableAnnotation.None, CodeAnalysis.NullableAnnotation.None}, GetAnonymousTypeNullableAnnotations(type)) End Sub Private Shared Function GetAnonymousTypeNullableAnnotations(type As ITypeSymbol) As ImmutableArray(Of CodeAnalysis.NullableAnnotation) Return type.GetMembers().OfType(Of IPropertySymbol)().SelectAsArray(Function(p) p.NullableAnnotation) End Function <Fact()> <WorkItem(36046, "https://github.com/dotnet/roslyn/issues/36046")> Public Sub ConstructTypeWithNullability() Dim source = "Class Pair(Of T, U) End Class" Dim comp = DirectCast(CreateCompilation(source), Compilation) Dim genericType = DirectCast(comp.GetMember("Pair"), INamedTypeSymbol) Dim typeArguments = ImmutableArray.Create(Of ITypeSymbol)(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String)) Assert.Throws(Of ArgumentException)(Function() genericType.Construct(New ImmutableArray(Of ITypeSymbol), New ImmutableArray(Of CodeAnalysis.NullableAnnotation))) Assert.Throws(Of ArgumentException)(Function() genericType.Construct(typeArguments:=Nothing, typeArgumentNullableAnnotations:=Nothing)) Dim type = genericType.Construct(typeArguments, Nothing) Assert.Equal("Pair(Of System.Object, System.String)", type.ToTestDisplayString()) AssertEx.Equal({CodeAnalysis.NullableAnnotation.None, CodeAnalysis.NullableAnnotation.None}, type.TypeArgumentNullableAnnotations) Assert.Throws(Of ArgumentException)(Function() genericType.Construct(typeArguments, ImmutableArray(Of CodeAnalysis.NullableAnnotation).Empty)) Assert.Throws(Of ArgumentException)(Function() genericType.Construct(ImmutableArray.Create(Of ITypeSymbol)(Nothing, Nothing), Nothing)) type = genericType.Construct(typeArguments, ImmutableArray.Create(CodeAnalysis.NullableAnnotation.Annotated, CodeAnalysis.NullableAnnotation.NotAnnotated)) Assert.Equal("Pair(Of System.Object, System.String)", type.ToTestDisplayString()) AssertEx.Equal({CodeAnalysis.NullableAnnotation.None, CodeAnalysis.NullableAnnotation.None}, type.TypeArgumentNullableAnnotations) ' Type arguments from C#. comp = CreateCSharpCompilation("") typeArguments = ImmutableArray.Create(Of ITypeSymbol)(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String)) Assert.Throws(Of ArgumentException)(Function() genericType.Construct(typeArguments, Nothing)) End Sub <Fact()> <WorkItem(37310, "https://github.com/dotnet/roslyn/issues/37310")> Public Sub ConstructMethodWithNullability() Dim source = "Class Program Shared Sub M(Of T, U) End Sub End Class" Dim comp = DirectCast(CreateCompilation(source), Compilation) Dim genericMethod = DirectCast(comp.GetMember("Program.M"), IMethodSymbol) Dim typeArguments = ImmutableArray.Create(Of ITypeSymbol)(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String)) Assert.Throws(Of ArgumentException)(Function() genericMethod.Construct(New ImmutableArray(Of ITypeSymbol), New ImmutableArray(Of CodeAnalysis.NullableAnnotation))) Assert.Throws(Of ArgumentException)(Function() genericMethod.Construct(typeArguments:=Nothing, typeArgumentNullableAnnotations:=Nothing)) Dim type = genericMethod.Construct(typeArguments, Nothing) Assert.Equal("Sub Program.M(Of System.Object, System.String)()", type.ToTestDisplayString()) AssertEx.Equal({CodeAnalysis.NullableAnnotation.None, CodeAnalysis.NullableAnnotation.None}, type.TypeArgumentNullableAnnotations) Assert.Throws(Of ArgumentException)(Function() genericMethod.Construct(typeArguments, ImmutableArray(Of CodeAnalysis.NullableAnnotation).Empty)) Assert.Throws(Of ArgumentException)(Function() genericMethod.Construct(ImmutableArray.Create(Of ITypeSymbol)(Nothing, Nothing), Nothing)) type = genericMethod.Construct(typeArguments, ImmutableArray.Create(CodeAnalysis.NullableAnnotation.Annotated, CodeAnalysis.NullableAnnotation.NotAnnotated)) Assert.Equal("Sub Program.M(Of System.Object, System.String)()", type.ToTestDisplayString()) AssertEx.Equal({CodeAnalysis.NullableAnnotation.None, CodeAnalysis.NullableAnnotation.None}, type.TypeArgumentNullableAnnotations) ' Type arguments from C#. comp = CreateCSharpCompilation("") typeArguments = ImmutableArray.Create(Of ITypeSymbol)(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String)) Assert.Throws(Of ArgumentException)(Function() genericMethod.Construct(typeArguments, Nothing)) End Sub <Fact()> Public Sub GetEntryPoint_Exe() Dim source = <compilation name="Name1"> <file name="a.vb"><![CDATA[ Class A Shared Sub Main() End Sub End Class ]]> </file> </compilation> Dim compilation = CreateCompilationWithMscorlib40(source, OutputKind.ConsoleApplication) compilation.VerifyDiagnostics() Dim mainMethod = compilation.GlobalNamespace.GetMember(Of NamedTypeSymbol)("A").GetMember(Of MethodSymbol)("Main") Assert.Equal(mainMethod, compilation.GetEntryPoint(Nothing)) Dim entryPointAndDiagnostics = compilation.GetEntryPointAndDiagnostics(Nothing) Assert.Equal(mainMethod, entryPointAndDiagnostics.MethodSymbol) entryPointAndDiagnostics.Diagnostics.Verify() End Sub <Fact()> Public Sub GetEntryPoint_Dll() Dim source = <compilation name="Name1"> <file name="a.vb"><![CDATA[ Class A Shared Sub Main() End Sub End Class ]]> </file> </compilation> Dim compilation = CreateCompilationWithMscorlib40(source, OutputKind.DynamicallyLinkedLibrary) compilation.VerifyDiagnostics() Assert.Null(compilation.GetEntryPoint(Nothing)) Assert.Null(compilation.GetEntryPointAndDiagnostics(Nothing)) End Sub <Fact()> Public Sub GetEntryPoint_Module() Dim source = <compilation name="Name1"> <file name="a.vb"><![CDATA[ Class A Shared Sub Main() End Sub End Class ]]> </file> </compilation> Dim compilation = CreateCompilationWithMscorlib40(source, OutputKind.NetModule) compilation.VerifyDiagnostics() Assert.Null(compilation.GetEntryPoint(Nothing)) Assert.Null(compilation.GetEntryPointAndDiagnostics(Nothing)) End Sub <Fact> Public Sub CreateCompilationForModule() Dim source = <text> Class A Shared Sub Main() End Sub End Class </text>.Value ' equivalent of vbc with no /moduleassemblyname specified: Dim c = VisualBasicCompilation.Create(assemblyName:=Nothing, options:=TestOptions.ReleaseModule, syntaxTrees:={Parse(source)}, references:={MscorlibRef}) c.VerifyEmitDiagnostics() Assert.Null(c.AssemblyName) Assert.Equal("?", c.Assembly.Name) Assert.Equal("?", c.Assembly.Identity.Name) ' no name is allowed for assembly as well, although it isn't useful: c = VisualBasicCompilation.Create(assemblyName:=Nothing, options:=TestOptions.ReleaseModule, syntaxTrees:={Parse(source)}, references:={MscorlibRef}) c.VerifyEmitDiagnostics() Assert.Null(c.AssemblyName) Assert.Equal("?", c.Assembly.Name) Assert.Equal("?", c.Assembly.Identity.Name) ' equivalent of vbc with /moduleassemblyname specified: c = VisualBasicCompilation.Create(assemblyName:="ModuleAssemblyName", options:=TestOptions.ReleaseModule, syntaxTrees:={Parse(source)}, references:={MscorlibRef}) c.VerifyDiagnostics() Assert.Equal("ModuleAssemblyName", c.AssemblyName) Assert.Equal("ModuleAssemblyName", c.Assembly.Name) Assert.Equal("ModuleAssemblyName", c.Assembly.Identity.Name) End Sub <WorkItem(8506, "https://github.com/dotnet/roslyn/issues/8506")> <WorkItem(17403, "https://github.com/dotnet/roslyn/issues/17403")> <Fact()> Public Sub CrossCorlibSystemObjectReturnType_Script() ' MinAsyncCorlibRef corlib Is used since it provides just enough corlib type definitions ' And Task APIs necessary for script hosting are provided by MinAsyncRef. This ensures that ' `System.Object, mscorlib, Version=4.0.0.0` will Not be provided (since it's unversioned). ' ' In the original bug, Xamarin iOS, Android, And Mac Mobile profile corlibs were ' realistic cross-compilation targets. Dim AssertCompilationCorlib As Action(Of VisualBasicCompilation) = Sub(compilation As VisualBasicCompilation) Assert.True(compilation.IsSubmission) Dim taskOfT = compilation.GetWellKnownType(WellKnownType.System_Threading_Tasks_Task_T) Dim taskOfObject = taskOfT.Construct(compilation.ObjectType) Dim entryPoint = compilation.GetEntryPoint(Nothing) Assert.Same(compilation.ObjectType.ContainingAssembly, taskOfT.ContainingAssembly) Assert.Same(compilation.ObjectType.ContainingAssembly, taskOfObject.ContainingAssembly) Assert.Equal(taskOfObject, entryPoint.ReturnType) End Sub Dim firstCompilation = VisualBasicCompilation.CreateScriptCompilation( "submission-assembly-1", references:={MinAsyncCorlibRef}, syntaxTree:=Parse("? True", options:=TestOptions.Script) ).VerifyDiagnostics() AssertCompilationCorlib(firstCompilation) Dim secondCompilation = VisualBasicCompilation.CreateScriptCompilation( "submission-assembly-2", previousScriptCompilation:=firstCompilation, syntaxTree:=Parse("? False", options:=TestOptions.Script) ).WithScriptCompilationInfo(New VisualBasicScriptCompilationInfo(firstCompilation, Nothing, Nothing) ).VerifyDiagnostics() AssertCompilationCorlib(secondCompilation) Assert.Same(firstCompilation.ObjectType, secondCompilation.ObjectType) Assert.Null(New VisualBasicScriptCompilationInfo(Nothing, Nothing, Nothing).WithPreviousScriptCompilation(firstCompilation).ReturnTypeOpt) End Sub <WorkItem(3719, "https://github.com/dotnet/roslyn/issues/3719")> <Fact()> Public Sub GetEntryPoint_Script() Dim source = <![CDATA[System.Console.WriteLine(1)]]> Dim compilation = CreateCompilationWithMscorlib45({VisualBasicSyntaxTree.ParseText(source.Value, options:=TestOptions.Script)}, options:=TestOptions.ReleaseDll) compilation.VerifyDiagnostics() Dim scriptMethod = compilation.GetMember("Script.<Main>") Assert.NotNull(scriptMethod) Dim method = compilation.GetEntryPoint(Nothing) Assert.Equal(method, scriptMethod) Dim entryPoint = compilation.GetEntryPointAndDiagnostics(Nothing) Assert.Equal(entryPoint.MethodSymbol, scriptMethod) End Sub <Fact()> Public Sub GetEntryPoint_Script_MainIgnored() Dim source = <![CDATA[ Class A Shared Sub Main() End Sub End Class ]]> Dim compilation = CreateCompilationWithMscorlib45({VisualBasicSyntaxTree.ParseText(source.Value, options:=TestOptions.Script)}, options:=TestOptions.ReleaseDll) compilation.VerifyDiagnostics(Diagnostic(ERRID.WRN_MainIgnored, "Main").WithArguments("Public Shared Sub Main()").WithLocation(3, 20)) Dim scriptMethod = compilation.GetMember("Script.<Main>") Assert.NotNull(scriptMethod) Dim entryPoint = compilation.GetEntryPointAndDiagnostics(Nothing) Assert.Equal(entryPoint.MethodSymbol, scriptMethod) entryPoint.Diagnostics.Verify(Diagnostic(ERRID.WRN_MainIgnored, "Main").WithArguments("Public Shared Sub Main()").WithLocation(3, 20)) End Sub <Fact()> Public Sub GetEntryPoint_Submission() Dim source = "? 1 + 1" Dim compilation = VisualBasicCompilation.CreateScriptCompilation( "sub", references:={MscorlibRef}, syntaxTree:=Parse(source, options:=TestOptions.Script)) compilation.VerifyDiagnostics() Dim scriptMethod = compilation.GetMember("Script.<Factory>") Assert.NotNull(scriptMethod) Dim method = compilation.GetEntryPoint(Nothing) Assert.Equal(method, scriptMethod) Dim entryPoint = compilation.GetEntryPointAndDiagnostics(Nothing) Assert.Equal(entryPoint.MethodSymbol, scriptMethod) entryPoint.Diagnostics.Verify() End Sub <Fact()> Public Sub GetEntryPoint_Submission_MainIgnored() Dim source = " Class A Shared Sub Main() End Sub End Class " Dim compilation = VisualBasicCompilation.CreateScriptCompilation( "Sub", references:={MscorlibRef}, syntaxTree:=Parse(source, options:=TestOptions.Script)) compilation.VerifyDiagnostics(Diagnostic(ERRID.WRN_MainIgnored, "Main").WithArguments("Public Shared Sub Main()").WithLocation(3, 20)) Dim scriptMethod = compilation.GetMember("Script.<Factory>") Assert.NotNull(scriptMethod) Dim entryPoint = compilation.GetEntryPointAndDiagnostics(Nothing) Assert.Equal(entryPoint.MethodSymbol, scriptMethod) entryPoint.Diagnostics.Verify(Diagnostic(ERRID.WRN_MainIgnored, "Main").WithArguments("Public Shared Sub Main()").WithLocation(3, 20)) End Sub <Fact()> Public Sub GetEntryPoint_MainType() Dim source = <compilation name="Name1"> <file name="a.vb"><![CDATA[ Class A Shared Sub Main() End Sub End Class Class B Shared Sub Main() End Sub End Class ]]> </file> </compilation> Dim compilation = CreateCompilationWithMscorlib40(source, options:=TestOptions.ReleaseExe.WithMainTypeName("B")) compilation.VerifyDiagnostics() Dim mainMethod = compilation.GlobalNamespace.GetMember(Of NamedTypeSymbol)("B").GetMember(Of MethodSymbol)("Main") Assert.Equal(mainMethod, compilation.GetEntryPoint(Nothing)) Dim entryPointAndDiagnostics = compilation.GetEntryPointAndDiagnostics(Nothing) Assert.Equal(mainMethod, entryPointAndDiagnostics.MethodSymbol) entryPointAndDiagnostics.Diagnostics.Verify() End Sub <Fact> Public Sub ReferenceManagerReuse_WithOptions() Dim c1 = VisualBasicCompilation.Create("c", options:=TestOptions.ReleaseDll) Dim c2 = c1.WithOptions(TestOptions.ReleaseExe) Assert.True(c1.ReferenceManagerEquals(c2)) c2 = c1.WithOptions(New VisualBasicCompilationOptions(OutputKind.WindowsApplication)) Assert.True(c1.ReferenceManagerEquals(c2)) c2 = c1.WithOptions(TestOptions.ReleaseModule) Assert.False(c1.ReferenceManagerEquals(c2)) c1 = VisualBasicCompilation.Create("c", options:=TestOptions.ReleaseModule) c2 = c1.WithOptions(TestOptions.ReleaseExe) Assert.False(c1.ReferenceManagerEquals(c2)) c2 = c1.WithOptions(TestOptions.ReleaseDll) Assert.False(c1.ReferenceManagerEquals(c2)) c2 = c1.WithOptions(New VisualBasicCompilationOptions(OutputKind.WindowsApplication)) Assert.False(c1.ReferenceManagerEquals(c2)) End Sub <Fact> Public Sub ReferenceManagerReuse_WithXmlFileResolver() Dim c1 = VisualBasicCompilation.Create("c", options:=TestOptions.ReleaseDll) Dim c2 = c1.WithOptions(TestOptions.ReleaseDll.WithXmlReferenceResolver(New XmlFileResolver(Nothing))) Assert.False(c1.ReferenceManagerEquals(c2)) Dim c3 = c1.WithOptions(TestOptions.ReleaseDll.WithXmlReferenceResolver(c1.Options.XmlReferenceResolver)) Assert.True(c1.ReferenceManagerEquals(c3)) End Sub <Fact> Public Sub ReferenceManagerReuse_WithMetadataReferenceResolver() Dim c1 = VisualBasicCompilation.Create("c", options:=TestOptions.ReleaseDll) Dim c2 = c1.WithOptions(TestOptions.ReleaseDll.WithMetadataReferenceResolver(New TestMetadataReferenceResolver())) Assert.False(c1.ReferenceManagerEquals(c2)) Dim c3 = c1.WithOptions(TestOptions.ReleaseDll.WithMetadataReferenceResolver(c1.Options.MetadataReferenceResolver)) Assert.True(c1.ReferenceManagerEquals(c3)) End Sub <Fact> Public Sub ReferenceManagerReuse_WithName() Dim c1 = VisualBasicCompilation.Create("c1") Dim c2 = c1.WithAssemblyName("c2") Assert.False(c1.ReferenceManagerEquals(c2)) Dim c3 = c1.WithAssemblyName("c1") Assert.True(c1.ReferenceManagerEquals(c3)) Dim c4 = c1.WithAssemblyName(Nothing) Assert.False(c1.ReferenceManagerEquals(c4)) Dim c5 = c4.WithAssemblyName(Nothing) Assert.True(c4.ReferenceManagerEquals(c5)) End Sub <Fact> Public Sub ReferenceManagerReuse_WithReferences() Dim c1 = VisualBasicCompilation.Create("c1") Dim c2 = c1.WithReferences({MscorlibRef}) Assert.False(c1.ReferenceManagerEquals(c2)) Dim c3 = c2.WithReferences({MscorlibRef, SystemCoreRef}) Assert.False(c3.ReferenceManagerEquals(c2)) c3 = c2.AddReferences(SystemCoreRef) Assert.False(c3.ReferenceManagerEquals(c2)) c3 = c2.RemoveAllReferences() Assert.False(c3.ReferenceManagerEquals(c2)) c3 = c2.ReplaceReference(MscorlibRef, SystemCoreRef) Assert.False(c3.ReferenceManagerEquals(c2)) c3 = c2.RemoveReferences(MscorlibRef) Assert.False(c3.ReferenceManagerEquals(c2)) End Sub <Fact> Public Sub ReferenceManagerReuse_WithSyntaxTrees() Dim ta = Parse("Imports System") Dim tb = Parse("Imports System", options:=TestOptions.Script) Dim tc = Parse("#r ""bar"" ' error: #r in regular code") Dim tr = Parse("#r ""goo""", options:=TestOptions.Script) Dim ts = Parse("#r ""bar""", options:=TestOptions.Script) Dim a = VisualBasicCompilation.Create("c", syntaxTrees:={ta}) ' add: Dim ab = a.AddSyntaxTrees(tb) Assert.True(a.ReferenceManagerEquals(ab)) Dim ac = a.AddSyntaxTrees(tc) Assert.True(a.ReferenceManagerEquals(ac)) Dim ar = a.AddSyntaxTrees(tr) Assert.False(a.ReferenceManagerEquals(ar)) Dim arc = ar.AddSyntaxTrees(tc) Assert.True(ar.ReferenceManagerEquals(arc)) ' remove: Dim ar2 = arc.RemoveSyntaxTrees(tc) Assert.True(arc.ReferenceManagerEquals(ar2)) Dim c = arc.RemoveSyntaxTrees(ta, tr) Assert.False(arc.ReferenceManagerEquals(c)) Dim none1 = c.RemoveSyntaxTrees(tc) Assert.True(c.ReferenceManagerEquals(none1)) Dim none2 = arc.RemoveAllSyntaxTrees() Assert.False(arc.ReferenceManagerEquals(none2)) Dim none3 = ac.RemoveAllSyntaxTrees() Assert.True(ac.ReferenceManagerEquals(none3)) ' replace: Dim asc = arc.ReplaceSyntaxTree(tr, ts) Assert.False(arc.ReferenceManagerEquals(asc)) Dim brc = arc.ReplaceSyntaxTree(ta, tb) Assert.True(arc.ReferenceManagerEquals(brc)) Dim abc = arc.ReplaceSyntaxTree(tr, tb) Assert.False(arc.ReferenceManagerEquals(abc)) Dim ars = arc.ReplaceSyntaxTree(tc, ts) Assert.False(arc.ReferenceManagerEquals(ars)) End Sub <Fact> Public Sub ReferenceManagerReuse_WithScriptCompilationInfo() ' Note The following results would change if we optimized sharing more: https://github.com/dotnet/roslyn/issues/43397 Dim c1 = VisualBasicCompilation.CreateScriptCompilation("c1") Assert.NotNull(c1.ScriptCompilationInfo) Assert.Null(c1.ScriptCompilationInfo.PreviousScriptCompilation) Dim c2 = c1.WithScriptCompilationInfo(Nothing) Assert.Null(c2.ScriptCompilationInfo) Assert.True(c2.ReferenceManagerEquals(c1)) Dim c3 = c2.WithScriptCompilationInfo(New VisualBasicScriptCompilationInfo(previousCompilationOpt:=Nothing, returnType:=GetType(Integer), globalsType:=Nothing)) Assert.NotNull(c3.ScriptCompilationInfo) Assert.Null(c3.ScriptCompilationInfo.PreviousScriptCompilation) Assert.True(c3.ReferenceManagerEquals(c2)) Dim c4 = c3.WithScriptCompilationInfo(Nothing) Assert.Null(c4.ScriptCompilationInfo) Assert.True(c4.ReferenceManagerEquals(c3)) Dim c5 = c4.WithScriptCompilationInfo(New VisualBasicScriptCompilationInfo(previousCompilationOpt:=c1, returnType:=GetType(Integer), globalsType:=Nothing)) Assert.False(c5.ReferenceManagerEquals(c4)) Dim c6 = c5.WithScriptCompilationInfo(New VisualBasicScriptCompilationInfo(previousCompilationOpt:=c1, returnType:=GetType(Boolean), globalsType:=Nothing)) Assert.True(c6.ReferenceManagerEquals(c5)) Dim c7 = c6.WithScriptCompilationInfo(New VisualBasicScriptCompilationInfo(previousCompilationOpt:=c2, returnType:=GetType(Boolean), globalsType:=Nothing)) Assert.False(c7.ReferenceManagerEquals(c6)) Dim c8 = c7.WithScriptCompilationInfo(New VisualBasicScriptCompilationInfo(previousCompilationOpt:=Nothing, returnType:=GetType(Boolean), globalsType:=Nothing)) Assert.False(c8.ReferenceManagerEquals(c7)) Dim c9 = c8.WithScriptCompilationInfo(Nothing) Assert.True(c9.ReferenceManagerEquals(c8)) End Sub Private Class EvolvingTestReference Inherits PortableExecutableReference Private ReadOnly _metadataSequence As IEnumerator(Of Metadata) Public QueryCount As Integer Public Sub New(metadataSequence As IEnumerable(Of Metadata)) MyBase.New(MetadataReferenceProperties.Assembly) Me._metadataSequence = metadataSequence.GetEnumerator() End Sub Protected Overrides Function CreateDocumentationProvider() As DocumentationProvider Return DocumentationProvider.Default End Function Protected Overrides Function GetMetadataImpl() As Metadata QueryCount = QueryCount + 1 _metadataSequence.MoveNext() Return _metadataSequence.Current End Function Protected Overrides Function WithPropertiesImpl(properties As MetadataReferenceProperties) As PortableExecutableReference Throw New NotImplementedException() End Function End Class <ConditionalFact(GetType(NoIOperationValidation), GetType(NoUsedAssembliesValidation))> Public Sub MetadataConsistencyWhileEvolvingCompilation() Dim md1 = AssemblyMetadata.CreateFromImage(CreateCompilationWithMscorlib40({"Public Class C : End Class"}, options:=TestOptions.ReleaseDll).EmitToArray()) Dim md2 = AssemblyMetadata.CreateFromImage(CreateCompilationWithMscorlib40({"Public Class D : End Class"}, options:=TestOptions.ReleaseDll).EmitToArray()) Dim reference = New EvolvingTestReference({md1, md2}) Dim references = TargetFrameworkUtil.Mscorlib40References.AddRange({reference, reference}) Dim c1 = CreateEmptyCompilation({"Public Class Main : Public Shared C As C : End Class"}, references:=references, options:=TestOptions.ReleaseDll) Dim c2 = c1.WithAssemblyName("c2") Dim c3 = c2.AddSyntaxTrees(Parse("Public Class Main2 : Public Shared A As Integer : End Class")) Dim c4 = c3.WithOptions(New VisualBasicCompilationOptions(OutputKind.NetModule)) Dim c5 = c4.WithReferences({MscorlibRef, reference}) c3.VerifyDiagnostics() c1.VerifyDiagnostics() c4.VerifyDiagnostics() c2.VerifyDiagnostics() Assert.Equal(1, reference.QueryCount) c5.VerifyDiagnostics(Diagnostic(ERRID.ERR_UndefinedType1, "C").WithArguments("C").WithLocation(1, 40)) Assert.Equal(2, reference.QueryCount) End Sub <Fact> Public Sub LinkedNetmoduleMetadataMustProvideFullPEImage() Dim moduleBytes = TestResources.MetadataTests.NetModule01.ModuleCS00 Dim headers = New PEHeaders(New MemoryStream(moduleBytes)) Dim pinnedPEImage = GCHandle.Alloc(moduleBytes.ToArray(), GCHandleType.Pinned) Try Using mdModule = ModuleMetadata.CreateFromMetadata(pinnedPEImage.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize) Dim c = VisualBasicCompilation.Create("Goo", references:={MscorlibRef, mdModule.GetReference(display:="ModuleCS00")}, options:=TestOptions.ReleaseDll) c.VerifyDiagnostics(Diagnostic(ERRID.ERR_LinkedNetmoduleMetadataMustProvideFullPEImage).WithArguments("ModuleCS00").WithLocation(1, 1)) End Using Finally pinnedPEImage.Free() End Try End Sub <Fact> <WorkItem(797640, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/797640")> Public Sub GetMetadataReferenceAPITest() Dim comp = VisualBasicCompilation.Create("Compilation") Dim metadata = Net451.mscorlib comp = comp.AddReferences(metadata) Dim assemblySmb = comp.GetReferencedAssemblySymbol(metadata) Dim reference = comp.GetMetadataReference(assemblySmb) Assert.NotNull(reference) Dim comp2 = VisualBasicCompilation.Create("Compilation") comp2 = comp.AddReferences(metadata) Dim reference2 = comp2.GetMetadataReference(assemblySmb) Assert.NotNull(reference2) End Sub <WorkItem(40466, "https://github.com/dotnet/roslyn/issues/40466")> <Fact> Public Sub GetMetadataReference_CSharpSymbols() Dim comp As Compilation = CreateCompilation("") Dim csComp = CreateCSharpCompilation("", referencedAssemblies:=TargetFrameworkUtil.GetReferences(TargetFramework.Standard)) Dim assembly = csComp.GetBoundReferenceManager().GetReferencedAssemblies().First().Value Assert.Null(comp.GetMetadataReference(DirectCast(assembly.GetISymbol(), IAssemblySymbol))) Assert.Null(comp.GetMetadataReference(csComp.Assembly)) Assert.Null(comp.GetMetadataReference(Nothing)) End Sub <Fact()> Public Sub EqualityOfMergedNamespaces() Dim moduleComp = CompilationUtils.CreateEmptyCompilation( <compilation> <file name="a.vb"> Namespace NS1 Namespace NS3 Interface T1 End Interface End Namespace End Namespace Namespace NS2 Namespace NS3 Interface T2 End Interface End Namespace End Namespace </file> </compilation>, options:=TestOptions.ReleaseModule) Dim compilation = CompilationUtils.CreateEmptyCompilationWithReferences( <compilation> <file name="a.vb"> Namespace NS1 Namespace NS3 Interface T3 End Interface End Namespace End Namespace Namespace NS2 Namespace NS3 Interface T4 End Interface End Namespace End Namespace </file> </compilation>, {moduleComp.EmitToImageReference()}) TestEqualityRecursive(compilation.GlobalNamespace, compilation.GlobalNamespace, NamespaceKind.Compilation, Function(ns) compilation.GetCompilationNamespace(ns)) TestEqualityRecursive(compilation.Assembly.GlobalNamespace, compilation.Assembly.GlobalNamespace, NamespaceKind.Assembly, Function(ns) compilation.Assembly.GetAssemblyNamespace(ns)) End Sub Private Shared Sub TestEqualityRecursive(testNs1 As NamespaceSymbol, testNs2 As NamespaceSymbol, kind As NamespaceKind, factory As Func(Of NamespaceSymbol, NamespaceSymbol)) Assert.Equal(kind, testNs1.NamespaceKind) Assert.Same(testNs1, testNs2) Dim children1 = testNs1.GetMembers().OrderBy(Function(m) m.Name).ToArray() Dim children2 = testNs2.GetMembers().OrderBy(Function(m) m.Name).ToArray() For i = 0 To children1.Count - 1 Assert.Same(children1(i), children2(i)) If children1(i).Kind = SymbolKind.Namespace Then TestEqualityRecursive(DirectCast(testNs1.GetMembers(children1(i).Name).Single(), NamespaceSymbol), DirectCast(testNs1.GetMembers(children1(i).Name).Single(), NamespaceSymbol), kind, factory) End If Next Assert.Same(testNs1, factory(testNs1)) For Each constituent In testNs1.ConstituentNamespaces Assert.Same(testNs1, factory(constituent)) Next End Sub <Fact> Public Sub ConsistentParseOptions() Dim tree1 = SyntaxFactory.ParseSyntaxTree("", VisualBasicParseOptions.Default.WithLanguageVersion(LanguageVersion.VisualBasic12)) Dim tree2 = SyntaxFactory.ParseSyntaxTree("", VisualBasicParseOptions.Default.WithLanguageVersion(LanguageVersion.VisualBasic12)) Dim tree3 = SyntaxFactory.ParseSyntaxTree("", VisualBasicParseOptions.Default.WithLanguageVersion(LanguageVersion.VisualBasic11)) Dim assemblyName = GetUniqueName() Dim CompilationOptions = New VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary) VisualBasicCompilation.Create(assemblyName, {tree1, tree2}, {MscorlibRef}, CompilationOptions) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.Create(assemblyName, {tree1, tree3}, {MscorlibRef}, CompilationOptions)) End Sub <Fact> Public Sub SubmissionCompilation_Errors() Dim genericParameter = GetType(List(Of)).GetGenericArguments()(0) Dim open = GetType(Dictionary(Of,)).MakeGenericType(GetType(Integer), genericParameter) Dim ptr = GetType(Integer).MakePointerType() Dim byRefType = GetType(Integer).MakeByRefType() Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", returnType:=genericParameter)) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", returnType:=open)) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", returnType:=GetType(Void))) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", returnType:=byRefType)) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", globalsType:=genericParameter)) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", globalsType:=open)) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", globalsType:=GetType(Void))) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", globalsType:=GetType(Integer))) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", globalsType:=ptr)) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", globalsType:=byRefType)) Dim s0 = VisualBasicCompilation.CreateScriptCompilation("a0", globalsType:=GetType(List(Of Integer))) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a1", previousScriptCompilation:=s0, globalsType:=GetType(List(Of Boolean)))) ' invalid options Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", options:=TestOptions.ReleaseExe)) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", options:=TestOptions.ReleaseDll.WithOutputKind(OutputKind.NetModule))) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", options:=TestOptions.ReleaseDll.WithOutputKind(OutputKind.WindowsRuntimeMetadata))) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", options:=TestOptions.ReleaseDll.WithOutputKind(OutputKind.WindowsRuntimeApplication))) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", options:=TestOptions.ReleaseDll.WithOutputKind(OutputKind.WindowsApplication))) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", options:=TestOptions.ReleaseDll.WithCryptoKeyContainer("goo"))) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", options:=TestOptions.ReleaseDll.WithCryptoKeyFile("goo.snk"))) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", options:=TestOptions.ReleaseDll.WithDelaySign(True))) Assert.Throws(Of ArgumentException)(Function() VisualBasicCompilation.CreateScriptCompilation("a", options:=TestOptions.ReleaseDll.WithDelaySign(False))) End Sub <Fact> Public Sub HasSubmissionResult() Assert.False(VisualBasicCompilation.CreateScriptCompilation("sub").HasSubmissionResult()) Assert.True(CreateSubmission("?1", parseOptions:=TestOptions.Script).HasSubmissionResult()) Assert.False(CreateSubmission("1", parseOptions:=TestOptions.Script).HasSubmissionResult()) ' TODO (https://github.com/dotnet/roslyn/issues/4763): '?' should be optional ' TestSubmissionResult(CreateSubmission("1", parseOptions:=TestOptions.Interactive), expectedType:=SpecialType.System_Int32, expectedHasValue:=True) ' TODO (https://github.com/dotnet/roslyn/issues/4766): ReturnType should not be ignored ' TestSubmissionResult(CreateSubmission("?1", parseOptions:=TestOptions.Interactive, returnType:=GetType(Double)), expectedType:=SpecialType.System_Double, expectedHasValue:=True) Assert.False(CreateSubmission(" Sub Goo() End Sub ").HasSubmissionResult()) Assert.False(CreateSubmission("Imports System", parseOptions:=TestOptions.Script).HasSubmissionResult()) Assert.False(CreateSubmission("Dim i As Integer", parseOptions:=TestOptions.Script).HasSubmissionResult()) Assert.False(CreateSubmission("System.Console.WriteLine()", parseOptions:=TestOptions.Script).HasSubmissionResult()) Assert.True(CreateSubmission("?System.Console.WriteLine()", parseOptions:=TestOptions.Script).HasSubmissionResult()) Assert.True(CreateSubmission("System.Console.ReadLine()", parseOptions:=TestOptions.Script).HasSubmissionResult()) Assert.True(CreateSubmission("?System.Console.ReadLine()", parseOptions:=TestOptions.Script).HasSubmissionResult()) Assert.True(CreateSubmission("?Nothing", parseOptions:=TestOptions.Script).HasSubmissionResult()) Assert.True(CreateSubmission("?AddressOf System.Console.WriteLine", parseOptions:=TestOptions.Script).HasSubmissionResult()) Assert.True(CreateSubmission("?Function(x) x", parseOptions:=TestOptions.Script).HasSubmissionResult()) End Sub ''' <summary> ''' Previous submission has to have no errors. ''' </summary> <Fact> Public Sub PreviousSubmissionWithError() Dim s0 = CreateSubmission("Dim a As X = 1") s0.VerifyDiagnostics( Diagnostic(ERRID.ERR_UndefinedType1, "X").WithArguments("X")) Assert.Throws(Of InvalidOperationException)(Function() CreateSubmission("?a + 1", previous:=s0)) End Sub <Fact> <WorkItem(13925, "https://github.com/dotnet/roslyn/issues/13925")> Public Sub RemoveAllSyntaxTreesAndEmbeddedTrees_01() Dim compilation1 = CreateCompilationWithMscorlib40( <compilation> <file name="a.vb"> Public Module C Sub Main() System.Console.WriteLine(1) End Sub End Module </file> </compilation>, options:=TestOptions.ReleaseExe.WithEmbedVbCoreRuntime(True), references:={SystemRef}) compilation1.VerifyDiagnostics() Dim compilation2 = compilation1.RemoveAllSyntaxTrees() compilation2 = compilation2.AddSyntaxTrees(compilation1.SyntaxTrees) compilation2.VerifyDiagnostics() CompileAndVerify(compilation2, expectedOutput:="1") End Sub <Fact> <WorkItem(13925, "https://github.com/dotnet/roslyn/issues/13925")> Public Sub RemoveAllSyntaxTreesAndEmbeddedTrees_02() Dim compilation1 = CreateCompilationWithMscorlib40AndVBRuntime( <compilation> <file name="a.vb"> Public Module C Sub Main() System.Console.WriteLine(1) End Sub End Module </file> </compilation>, options:=TestOptions.ReleaseExe.WithEmbedVbCoreRuntime(True)) compilation1.VerifyDiagnostics() Dim compilation2 = compilation1.RemoveAllSyntaxTrees() compilation2 = compilation2.AddSyntaxTrees(compilation1.SyntaxTrees) compilation2.VerifyDiagnostics() CompileAndVerify(compilation2, expectedOutput:="1") End Sub <Fact, WorkItem(50696, "https://github.com/dotnet/roslyn/issues/50696")> Public Sub GetWellKnownType() Dim corlib = " Namespace System Public Class [Object] End Class Public Class ValueType End Class Public Structure Void End Structure End Namespace " Dim tuple = " Namespace System Public Structure ValueTuple(Of T1, T2) Public Dim Item1 As T1 Public Dim Item2 As T2 Public Sub New(item1 As T1, item2 As T2) me.Item1 = item1 me.Item2 = item2 End Sub End Structure End Namespace " Dim corlibWithoutValueTupleRef = CreateEmptyCompilation(corlib, assemblyName:="corlibWithoutValueTupleRef").EmitToImageReference() Dim corlibWithValueTupleRef = CreateEmptyCompilation(corlib + tuple, assemblyName:="corlibWithValueTupleRef").EmitToImageReference() Dim libWithIsExternalInitRef = CreateEmptyCompilation(tuple, references:={corlibWithoutValueTupleRef}, assemblyName:="libWithIsExternalInit").EmitToImageReference() Dim libWithIsExternalInitRef2 = CreateEmptyCompilation(tuple, references:={corlibWithoutValueTupleRef}, assemblyName:="libWithIsExternalInit2").EmitToImageReference() If True Then ' type in source Dim comp = CreateEmptyCompilation(tuple, references:={corlibWithoutValueTupleRef}, assemblyName:="source") AssertNoDeclarationDiagnostics(comp) GetWellKnownType_Verify(comp, "source") End If If True Then ' type in library Dim comp = CreateEmptyCompilation("", references:={corlibWithoutValueTupleRef, libWithIsExternalInitRef}, assemblyName:="source") AssertNoDeclarationDiagnostics(comp) GetWellKnownType_Verify(comp, "libWithIsExternalInit") End If If True Then ' type in corlib and in source Dim comp = CreateEmptyCompilation(tuple, references:={corlibWithValueTupleRef}, assemblyName:="source") AssertNoDeclarationDiagnostics(comp) GetWellKnownType_Verify(comp, "source") End If If True Then ' type in corlib, in library and in source Dim comp = CreateEmptyCompilation(tuple, references:={corlibWithValueTupleRef, libWithIsExternalInitRef}, assemblyName:="source") AssertNoDeclarationDiagnostics(comp) GetWellKnownType_Verify(comp, "source") End If If True Then ' type in corlib and in two libraries Dim comp = CreateEmptyCompilation("", references:={corlibWithValueTupleRef, libWithIsExternalInitRef, libWithIsExternalInitRef2}) AssertNoDeclarationDiagnostics(comp) GetWellKnownType_Verify(comp, "corlibWithValueTupleRef") End If If True Then ' type in corlib and in two libraries (corlib in middle) Dim comp = CreateEmptyCompilation("", references:={libWithIsExternalInitRef, corlibWithValueTupleRef, libWithIsExternalInitRef2}) AssertNoDeclarationDiagnostics(comp) GetWellKnownType_Verify(comp, "corlibWithValueTupleRef") End If If True Then ' type in corlib and in two libraries (corlib last) Dim comp = CreateEmptyCompilation("", references:={libWithIsExternalInitRef, libWithIsExternalInitRef2, corlibWithValueTupleRef}) AssertNoDeclarationDiagnostics(comp) GetWellKnownType_Verify(comp, "corlibWithValueTupleRef") End If If True Then ' type in corlib and in two libraries, but flag is set Dim comp = CreateEmptyCompilation("", references:={corlibWithValueTupleRef, libWithIsExternalInitRef, libWithIsExternalInitRef2}, options:=TestOptions.DebugDll.WithIgnoreCorLibraryDuplicatedTypes(True)) AssertNoDeclarationDiagnostics(comp) Assert.True(comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).IsErrorType) End If If True Then ' type in two libraries Dim comp = CreateEmptyCompilation("", references:={libWithIsExternalInitRef, libWithIsExternalInitRef2}) AssertNoDeclarationDiagnostics(comp) Assert.True(comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).IsErrorType) End If If True Then ' type in two libraries, but flag is set Dim comp = CreateEmptyCompilation("", references:={libWithIsExternalInitRef, libWithIsExternalInitRef2}, options:=TestOptions.DebugDll.WithIgnoreCorLibraryDuplicatedTypes(True)) AssertNoDeclarationDiagnostics(comp) Assert.True(comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).IsErrorType) End If If True Then ' type in corlib and in a library Dim comp = CreateEmptyCompilation("", references:={corlibWithValueTupleRef, libWithIsExternalInitRef}) AssertNoDeclarationDiagnostics(comp) GetWellKnownType_Verify(comp, "corlibWithValueTupleRef") End If If True Then ' type in corlib and in a library (reverse order) Dim comp = CreateEmptyCompilation("", references:={corlibWithValueTupleRef, libWithIsExternalInitRef}) AssertNoDeclarationDiagnostics(comp) GetWellKnownType_Verify(comp, "corlibWithValueTupleRef") End If If True Then ' type in corlib and in a library, but flag is set Dim comp = CreateEmptyCompilation("", references:={corlibWithValueTupleRef, libWithIsExternalInitRef}, options:=TestOptions.DebugDll.WithIgnoreCorLibraryDuplicatedTypes(True)) AssertNoDeclarationDiagnostics(comp) Assert.Equal("libWithIsExternalInit", comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).ContainingAssembly.Name) Assert.Equal("corlibWithValueTupleRef", comp.GetTypeByMetadataName("System.ValueTuple`2").ContainingAssembly.Name) End If End Sub Private Shared Sub GetWellKnownType_Verify(comp As VisualBasicCompilation, expectedAssemblyName As String) Assert.Equal(expectedAssemblyName, comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).ContainingAssembly.Name) Assert.Equal(expectedAssemblyName, comp.GetTypeByMetadataName("System.ValueTuple`2").ContainingAssembly.Name) End Sub End Class End Namespace
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./src/Features/VisualBasic/Portable/MakeMethodAsynchronous/VisualBasicMakeMethodAsynchronousCodeFixProvider.vb
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports System.Collections.Immutable Imports System.Composition Imports System.Diagnostics.CodeAnalysis Imports Microsoft.CodeAnalysis.CodeFixes Imports Microsoft.CodeAnalysis.MakeMethodAsynchronous Imports Microsoft.CodeAnalysis.Simplification Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Namespace Microsoft.CodeAnalysis.VisualBasic.MakeMethodAsynchronous <ExportCodeFixProvider(LanguageNames.VisualBasic, Name:=PredefinedCodeFixProviderNames.AddAsync), [Shared]> Friend Class VisualBasicMakeMethodAsynchronousCodeFixProvider Inherits AbstractMakeMethodAsynchronousCodeFixProvider Friend Const BC36937 As String = "BC36937" ' error BC36937: 'Await' can only be used when contained within a method or lambda expression marked with the 'Async' modifier. Friend Const BC37057 As String = "BC37057" ' error BC37057: 'Await' can only be used within an Async method. Consider marking this method with the 'Async' modifier and changing its return type to 'Task'. Friend Const BC37058 As String = "BC37058" ' error BC37058: 'Await' can only be used within an Async method. Consider marking this method with the 'Async' modifier and changing its return type to 'Task'. Friend Const BC37059 As String = "BC37059" ' error BC37059: 'Await' can only be used within an Async lambda expression. Consider marking this expression with the 'Async' modifier and changing its return type to 'Task'. Private Shared ReadOnly s_diagnosticIds As ImmutableArray(Of String) = ImmutableArray.Create( BC36937, BC37057, BC37058, BC37059) Private Shared ReadOnly s_asyncToken As SyntaxToken = SyntaxFactory.Token(SyntaxKind.AsyncKeyword) <ImportingConstructor> <SuppressMessage("RoslynDiagnosticsReliability", "RS0033:Importing constructor should be [Obsolete]", Justification:="Used in test code: https://github.com/dotnet/roslyn/issues/42814")> Public Sub New() End Sub Public Overrides ReadOnly Property FixableDiagnosticIds As ImmutableArray(Of String) Get Return s_diagnosticIds End Get End Property Protected Overrides Function GetMakeAsyncTaskFunctionResource() As String Return VBFeaturesResources.Make_Async_Function End Function Protected Overrides Function GetMakeAsyncVoidFunctionResource() As String Return VBFeaturesResources.Make_Async_Sub End Function Protected Overrides Function IsAsyncSupportingFunctionSyntax(node As SyntaxNode) As Boolean Return node.IsAsyncSupportedFunctionSyntax() End Function Protected Overrides Function IsAsyncReturnType(type As ITypeSymbol, knownTypes As KnownTypes) As Boolean Return IsTaskLike(type, knownTypes) End Function Protected Overrides Function AddAsyncTokenAndFixReturnType( keepVoid As Boolean, methodSymbolOpt As IMethodSymbol, node As SyntaxNode, knownTypes As KnownTypes) As SyntaxNode If node.IsKind(SyntaxKind.SingleLineSubLambdaExpression) OrElse node.IsKind(SyntaxKind.SingleLineFunctionLambdaExpression) Then Return FixSingleLineLambdaExpression(DirectCast(node, SingleLineLambdaExpressionSyntax)) ElseIf node.IsKind(SyntaxKind.MultiLineSubLambdaExpression) OrElse node.IsKind(SyntaxKind.MultiLineFunctionLambdaExpression) Then Return FixMultiLineLambdaExpression(DirectCast(node, MultiLineLambdaExpressionSyntax)) ElseIf node.IsKind(SyntaxKind.SubBlock) Then Return FixSubBlock(keepVoid, DirectCast(node, MethodBlockSyntax), knownTypes._taskType) Else Return FixFunctionBlock( methodSymbolOpt, DirectCast(node, MethodBlockSyntax), knownTypes) End If End Function Private Shared Function FixFunctionBlock(methodSymbol As IMethodSymbol, node As MethodBlockSyntax, knownTypes As KnownTypes) As SyntaxNode Dim functionStatement = node.SubOrFunctionStatement Dim newFunctionStatement = AddAsyncKeyword(functionStatement) If Not IsTaskLike(methodSymbol.ReturnType, knownTypes) Then ' if the current return type is not already task-list, then wrap it in Task(of ...) Dim returnType = knownTypes._taskOfTType.Construct(methodSymbol.ReturnType).GenerateTypeSyntax().WithAdditionalAnnotations(Simplifier.AddImportsAnnotation) newFunctionStatement = newFunctionStatement.WithAsClause( newFunctionStatement.AsClause.WithType(returnType)) End If Return node.WithSubOrFunctionStatement(newFunctionStatement) End Function Private Shared Function FixSubBlock( keepVoid As Boolean, node As MethodBlockSyntax, taskType As INamedTypeSymbol) As SyntaxNode If keepVoid Then ' User wants to keep this a void method, so keep this as a sub. Dim newSubStatement = AddAsyncKeyword(node.SubOrFunctionStatement) Return node.WithSubOrFunctionStatement(newSubStatement) End If ' Have to convert this sub into a func. Dim subStatement = node.SubOrFunctionStatement Dim asClause = SyntaxFactory.SimpleAsClause(taskType.GenerateTypeSyntax()). WithTrailingTrivia( If(subStatement.ParameterList?.GetTrailingTrivia(), subStatement.GetTrailingTrivia())) Dim functionStatement = SyntaxFactory.FunctionStatement( subStatement.AttributeLists, subStatement.Modifiers.Add(s_asyncToken), SyntaxFactory.Token(SyntaxKind.FunctionKeyword).WithTriviaFrom(subStatement.SubOrFunctionKeyword), subStatement.Identifier.WithTrailingTrivia(), subStatement.TypeParameterList?.WithoutTrailingTrivia(), subStatement.ParameterList?.WithoutTrailingTrivia(), asClause, subStatement.HandlesClause, subStatement.ImplementsClause) Dim endFunctionStatement = SyntaxFactory.EndFunctionStatement( node.EndSubOrFunctionStatement.EndKeyword, SyntaxFactory.Token(SyntaxKind.FunctionKeyword).WithTriviaFrom(node.EndSubOrFunctionStatement.BlockKeyword)) Dim block = SyntaxFactory.FunctionBlock( functionStatement, node.Statements, endFunctionStatement) Return block End Function Private Shared Function AddAsyncKeyword(subOrFunctionStatement As MethodStatementSyntax) As MethodStatementSyntax Dim modifiers = subOrFunctionStatement.Modifiers Dim newModifiers = modifiers.Add(s_asyncToken) Return subOrFunctionStatement.WithModifiers(newModifiers) End Function Private Shared Function FixMultiLineLambdaExpression(node As MultiLineLambdaExpressionSyntax) As SyntaxNode Dim header As LambdaHeaderSyntax = GetNewHeader(node) Return node.WithSubOrFunctionHeader(header).WithLeadingTrivia(node.GetLeadingTrivia()) End Function Private Shared Function FixSingleLineLambdaExpression(node As SingleLineLambdaExpressionSyntax) As SingleLineLambdaExpressionSyntax Dim header As LambdaHeaderSyntax = GetNewHeader(node) Return node.WithSubOrFunctionHeader(header).WithLeadingTrivia(node.GetLeadingTrivia()) End Function Private Shared Function GetNewHeader(node As LambdaExpressionSyntax) As LambdaHeaderSyntax Dim header = DirectCast(node.SubOrFunctionHeader, LambdaHeaderSyntax) Dim newModifiers = header.Modifiers.Add(s_asyncToken) Dim newHeader = header.WithModifiers(newModifiers) Return newHeader End Function End Class End Namespace
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports System.Collections.Immutable Imports System.Composition Imports System.Diagnostics.CodeAnalysis Imports Microsoft.CodeAnalysis.CodeFixes Imports Microsoft.CodeAnalysis.MakeMethodAsynchronous Imports Microsoft.CodeAnalysis.Simplification Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Namespace Microsoft.CodeAnalysis.VisualBasic.MakeMethodAsynchronous <ExportCodeFixProvider(LanguageNames.VisualBasic, Name:=PredefinedCodeFixProviderNames.AddAsync), [Shared]> Friend Class VisualBasicMakeMethodAsynchronousCodeFixProvider Inherits AbstractMakeMethodAsynchronousCodeFixProvider Friend Const BC36937 As String = "BC36937" ' error BC36937: 'Await' can only be used when contained within a method or lambda expression marked with the 'Async' modifier. Friend Const BC37057 As String = "BC37057" ' error BC37057: 'Await' can only be used within an Async method. Consider marking this method with the 'Async' modifier and changing its return type to 'Task'. Friend Const BC37058 As String = "BC37058" ' error BC37058: 'Await' can only be used within an Async method. Consider marking this method with the 'Async' modifier and changing its return type to 'Task'. Friend Const BC37059 As String = "BC37059" ' error BC37059: 'Await' can only be used within an Async lambda expression. Consider marking this expression with the 'Async' modifier and changing its return type to 'Task'. Private Shared ReadOnly s_diagnosticIds As ImmutableArray(Of String) = ImmutableArray.Create( BC36937, BC37057, BC37058, BC37059) Private Shared ReadOnly s_asyncToken As SyntaxToken = SyntaxFactory.Token(SyntaxKind.AsyncKeyword) <ImportingConstructor> <SuppressMessage("RoslynDiagnosticsReliability", "RS0033:Importing constructor should be [Obsolete]", Justification:="Used in test code: https://github.com/dotnet/roslyn/issues/42814")> Public Sub New() End Sub Public Overrides ReadOnly Property FixableDiagnosticIds As ImmutableArray(Of String) Get Return s_diagnosticIds End Get End Property Protected Overrides Function GetMakeAsyncTaskFunctionResource() As String Return VBFeaturesResources.Make_Async_Function End Function Protected Overrides Function GetMakeAsyncVoidFunctionResource() As String Return VBFeaturesResources.Make_Async_Sub End Function Protected Overrides Function IsAsyncSupportingFunctionSyntax(node As SyntaxNode) As Boolean Return node.IsAsyncSupportedFunctionSyntax() End Function Protected Overrides Function IsAsyncReturnType(type As ITypeSymbol, knownTypes As KnownTypes) As Boolean Return IsTaskLike(type, knownTypes) End Function Protected Overrides Function AddAsyncTokenAndFixReturnType( keepVoid As Boolean, methodSymbolOpt As IMethodSymbol, node As SyntaxNode, knownTypes As KnownTypes) As SyntaxNode If node.IsKind(SyntaxKind.SingleLineSubLambdaExpression) OrElse node.IsKind(SyntaxKind.SingleLineFunctionLambdaExpression) Then Return FixSingleLineLambdaExpression(DirectCast(node, SingleLineLambdaExpressionSyntax)) ElseIf node.IsKind(SyntaxKind.MultiLineSubLambdaExpression) OrElse node.IsKind(SyntaxKind.MultiLineFunctionLambdaExpression) Then Return FixMultiLineLambdaExpression(DirectCast(node, MultiLineLambdaExpressionSyntax)) ElseIf node.IsKind(SyntaxKind.SubBlock) Then Return FixSubBlock(keepVoid, DirectCast(node, MethodBlockSyntax), knownTypes._taskType) Else Return FixFunctionBlock( methodSymbolOpt, DirectCast(node, MethodBlockSyntax), knownTypes) End If End Function Private Shared Function FixFunctionBlock(methodSymbol As IMethodSymbol, node As MethodBlockSyntax, knownTypes As KnownTypes) As SyntaxNode Dim functionStatement = node.SubOrFunctionStatement Dim newFunctionStatement = AddAsyncKeyword(functionStatement) If Not IsTaskLike(methodSymbol.ReturnType, knownTypes) Then ' if the current return type is not already task-list, then wrap it in Task(of ...) Dim returnType = knownTypes._taskOfTType.Construct(methodSymbol.ReturnType).GenerateTypeSyntax().WithAdditionalAnnotations(Simplifier.AddImportsAnnotation) newFunctionStatement = newFunctionStatement.WithAsClause( newFunctionStatement.AsClause.WithType(returnType)) End If Return node.WithSubOrFunctionStatement(newFunctionStatement) End Function Private Shared Function FixSubBlock( keepVoid As Boolean, node As MethodBlockSyntax, taskType As INamedTypeSymbol) As SyntaxNode If keepVoid Then ' User wants to keep this a void method, so keep this as a sub. Dim newSubStatement = AddAsyncKeyword(node.SubOrFunctionStatement) Return node.WithSubOrFunctionStatement(newSubStatement) End If ' Have to convert this sub into a func. Dim subStatement = node.SubOrFunctionStatement Dim asClause = SyntaxFactory.SimpleAsClause(taskType.GenerateTypeSyntax()). WithTrailingTrivia( If(subStatement.ParameterList?.GetTrailingTrivia(), subStatement.GetTrailingTrivia())) Dim functionStatement = SyntaxFactory.FunctionStatement( subStatement.AttributeLists, subStatement.Modifiers.Add(s_asyncToken), SyntaxFactory.Token(SyntaxKind.FunctionKeyword).WithTriviaFrom(subStatement.SubOrFunctionKeyword), subStatement.Identifier.WithTrailingTrivia(), subStatement.TypeParameterList?.WithoutTrailingTrivia(), subStatement.ParameterList?.WithoutTrailingTrivia(), asClause, subStatement.HandlesClause, subStatement.ImplementsClause) Dim endFunctionStatement = SyntaxFactory.EndFunctionStatement( node.EndSubOrFunctionStatement.EndKeyword, SyntaxFactory.Token(SyntaxKind.FunctionKeyword).WithTriviaFrom(node.EndSubOrFunctionStatement.BlockKeyword)) Dim block = SyntaxFactory.FunctionBlock( functionStatement, node.Statements, endFunctionStatement) Return block End Function Private Shared Function AddAsyncKeyword(subOrFunctionStatement As MethodStatementSyntax) As MethodStatementSyntax Dim modifiers = subOrFunctionStatement.Modifiers Dim newModifiers = modifiers.Add(s_asyncToken) Return subOrFunctionStatement.WithModifiers(newModifiers) End Function Private Shared Function FixMultiLineLambdaExpression(node As MultiLineLambdaExpressionSyntax) As SyntaxNode Dim header As LambdaHeaderSyntax = GetNewHeader(node) Return node.WithSubOrFunctionHeader(header).WithLeadingTrivia(node.GetLeadingTrivia()) End Function Private Shared Function FixSingleLineLambdaExpression(node As SingleLineLambdaExpressionSyntax) As SingleLineLambdaExpressionSyntax Dim header As LambdaHeaderSyntax = GetNewHeader(node) Return node.WithSubOrFunctionHeader(header).WithLeadingTrivia(node.GetLeadingTrivia()) End Function Private Shared Function GetNewHeader(node As LambdaExpressionSyntax) As LambdaHeaderSyntax Dim header = DirectCast(node.SubOrFunctionHeader, LambdaHeaderSyntax) Dim newModifiers = header.Modifiers.Add(s_asyncToken) Dim newHeader = header.WithModifiers(newModifiers) Return newHeader End Function End Class End Namespace
-1
dotnet/roslyn
55,436
[main] Update dependencies from dotnet/arcade
This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
dotnet-maestro[bot]
2021-08-05T12:15:00Z
2021-09-15T22:23:32Z
637f10560a5db54783ddd0b9c8ec03eca1992611
fa907a9c608289f85b64ae9b3feadf720c8a5d5a
[main] Update dependencies from dotnet/arcade. This pull request updates the following dependencies [marker]: <> (Begin:7e4fe80a-482b-4a41-5b66-08d8d8feb47e) ## From https://github.com/dotnet/arcade - **Subscription**: 7e4fe80a-482b-4a41-5b66-08d8d8feb47e - **Build**: 20210913.4 - **Date Produced**: 9/13/2021 5:12 PM - **Commit**: 4b7c80f398fd3dcea03fdc4e454789b61181d300 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.DotNet.Arcade.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] - **Microsoft.DotNet.Helix.Sdk**: [from 6.0.0-beta.21413.4 to 7.0.0-beta.21463.4][1] [1]: https://github.com/dotnet/arcade/compare/9b7027b...4b7c80f [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates sdk.version to 6.0.100-rc.1.21430.12 - Updates tools.dotnet to 6.0.100-rc.1.21430.12 [marker]: <> (End:7e4fe80a-482b-4a41-5b66-08d8d8feb47e)
./docs/features/DefaultInterfaceImplementation.md
Default Interface Implementation ========================= The *Default Interface Implementation* feature enables a default implementation of an interface member to be provided as part of the interface declaration. Here is a link to the proposal https://github.com/dotnet/csharplang/blob/main/proposals/csharp-8.0/default-interface-methods.md. **What is supported:** - Supplying an implementation along with declaration of a regular interface method and recognizing that implementation as default implementation for the method when a type implements the interface. Here is an example: ``` public interface I1 { void M1() { System.Console.WriteLine("Default implementation of M1 is called!!!"); } } class Test1 : I1 { static void Main() { I1 x = new Test1(); x.M1(); } } ``` - Re-abstraction of interface implementation in derived interfaces. Types implementing the derived interface are required to supply implementation even when a base interface provides an implementation. Here is an example: ``` public interface I1 { void M1() { } int P1 { get => throw null; set => throw null; } event System.Action E1 { add => throw null; remove => throw null; } } public interface I2 : I1 { abstract void I1.M1(); abstract int I1.P1 {get;set;} abstract event System.Action I1.E1; } class Test1 : I2 // This type must implement all members of I1 { } ``` In metadata, methods representing re-abstraction have all three flags `abstract`, `virtual`, `sealed` set and do not have `newslot` flag set. - Supplying an implementation along with declaration of a property or an indexer and recognizing that implementation as default implementation for them when a type implements the interface. - Supplying an implementation along with declaration of an event and recognizing that implementation as default implementation for the event when a type implements the interface. - Using **partial**, **public**, **internal**, **private**, **protected**, **static**, **virtual**, **sealed**, **abstract**, **extern** and **async** modifiers with interface methods. - Using **public**, **internal**, **private**, **protected**, **static**, **virtual**, **sealed**, **abstract** and **extern** modifiers with interface properties. - Using **public**, **internal**, **private**, **protected**, **virtual**, **sealed**, **abstract** and **extern** modifiers with interface indexers. - Using **internal**, **private**, **protected** modifiers with interface property/indexer accessors. - Using **public**, **internal**, **private**, **protected**, **static**, **virtual**, **sealed**, **abstract** and **extern** modifiers with interface events. - Declaring types within interfaces. - Implementing interface methods in derived interfaces by using explicit implementation syntax, accessibility is **protected**, allowed modifiers: **extern** and **async**. - Implementing interface properties and indexers in derived interfaces by using explicit implementation syntax, accessibility **protected**, allowed modifiers: **extern**. - Implementing interface events in derived interfaces by using explicit implementation syntax, accessibility **protected**, no allowed modifiers. - Declaring static fields, auto-properties and field-like events. - Declaring operators ```+ - ! ~ ++ -- true false * / % & | ^ << >> > < >= <=``` in interfaces. - Base access The following forms of base-access are added (https://github.com/dotnet/csharplang/blob/main/meetings/2018/LDM-2018-11-14.md) ``` base ( <type-syntax> ) . identifier base ( <type-syntax> ) [ argument-list ] ``` The type-syntax can refer to one of the base classes of the containing type, or one of the interfaces implemented or inherited by the containing type. When the type-syntax refers to a class, the member lookup rules, overload resolution rules and IL emit match the rules for the 7.3 supported forms of base-access. The difference is that the specified base class is used instead of the immediate base class. The most derived implementation found must be a member of that class. When the type-syntax refers to an interface: 1. The member lookup is performed in that interface, using the regular member lookup rules within interfaces, with an exception that members of System.Object do not participate in the lookup. 2. Regular overload resolution is performed for members returned by the lookup process, virtual or abstract members are not replaced with most derived implementations at this step (unlike the case when the type-syntax refers to a class). If result of overload resolution is a virtual or abstract method, it must have an implementation within the specified interface type, an error is reported otherwise. That implementation must be accessible at the call site. If result of overload resolution is a non-virtual method, the method must be declared in the specified interface type. 3. During IL emit a **call** (non-virtual call) instruction is used to invoke methods. If result of overload resolution on the previous step is a virtual or abstract method, the implementation of the method from the specified interface is used as the target for the instruction. Given the accessibility requirements for the most specific interface implementation, accessibility of implementations provided in derived interfaces is changed to **protected**. **Open issues and work items** are tracked in https://github.com/dotnet/roslyn/issues/17952. **Parts of ECMA-335 that become obsolete/inaccurate/incomplete** >I.8.5.3.2 Accessibility of members and nested types Members (other than nested types) defined by an interface shall be public. I.8.9.4 Interface type definition Similarly, an interface type definition shall not provide implementations for any methods on the values of its type. Interfaces can have static or virtual methods, but shall not have instance methods. However, since accessibility attributes are relative to the implementing type rather than the interface itself, all members of an interface shall have public accessibility, ... I.8.11.1 Method definitions All non-static methods of an interface definition are abstract. All non-static method definitions in interface definitions shall be virtual methods. II.10.4 Method implementat ion requirements II.12 Semantics of interfaces Interfaces can have static fields and methods, but they shall not have instance fields or methods. Interfaces can define virtual methods, but only if those methods are abstract (see Partition I and §II.15.4.2.4). II.12.2 Implement ing virtual methods on interfaces If the class defines any public virtual methods whose name and signature match a virtual method on the interface, then add these to the list for that method, in type declaration order (see above). If there are any public virtual methods available on this class (directly or inherited) having the same name and signature as the interface method, and whose generic type parameters do not exactly match any methods in the existing list for that interface method for this class or any class in its inheritance chain, then add them (in type declaration order) to the list for the corresponding methods on the interface. II.15.2 Static, instance, and virtual methods It follows that instance methods shall only be defined in classes or value types, but not in interfaces or outside of a type (i.e., globally). II.22.27 MethodImpl : 0x19 The method indexed by MethodBody shall be a member of Class or some base class of Class (MethodImpls do not allow compilers to ‘hook’ arbitrary method bodies) II.22.37 TypeDef : 0x02 All of the methods owned by an Interface (Flags.Interface = 1) shall be abstract (Flags.Abstract = 1) IV.6 Implementation-specific modifications to the system libraries Interfaces and virtual methods shall not be added to an existing interface.
Default Interface Implementation ========================= The *Default Interface Implementation* feature enables a default implementation of an interface member to be provided as part of the interface declaration. Here is a link to the proposal https://github.com/dotnet/csharplang/blob/main/proposals/csharp-8.0/default-interface-methods.md. **What is supported:** - Supplying an implementation along with declaration of a regular interface method and recognizing that implementation as default implementation for the method when a type implements the interface. Here is an example: ``` public interface I1 { void M1() { System.Console.WriteLine("Default implementation of M1 is called!!!"); } } class Test1 : I1 { static void Main() { I1 x = new Test1(); x.M1(); } } ``` - Re-abstraction of interface implementation in derived interfaces. Types implementing the derived interface are required to supply implementation even when a base interface provides an implementation. Here is an example: ``` public interface I1 { void M1() { } int P1 { get => throw null; set => throw null; } event System.Action E1 { add => throw null; remove => throw null; } } public interface I2 : I1 { abstract void I1.M1(); abstract int I1.P1 {get;set;} abstract event System.Action I1.E1; } class Test1 : I2 // This type must implement all members of I1 { } ``` In metadata, methods representing re-abstraction have all three flags `abstract`, `virtual`, `sealed` set and do not have `newslot` flag set. - Supplying an implementation along with declaration of a property or an indexer and recognizing that implementation as default implementation for them when a type implements the interface. - Supplying an implementation along with declaration of an event and recognizing that implementation as default implementation for the event when a type implements the interface. - Using **partial**, **public**, **internal**, **private**, **protected**, **static**, **virtual**, **sealed**, **abstract**, **extern** and **async** modifiers with interface methods. - Using **public**, **internal**, **private**, **protected**, **static**, **virtual**, **sealed**, **abstract** and **extern** modifiers with interface properties. - Using **public**, **internal**, **private**, **protected**, **virtual**, **sealed**, **abstract** and **extern** modifiers with interface indexers. - Using **internal**, **private**, **protected** modifiers with interface property/indexer accessors. - Using **public**, **internal**, **private**, **protected**, **static**, **virtual**, **sealed**, **abstract** and **extern** modifiers with interface events. - Declaring types within interfaces. - Implementing interface methods in derived interfaces by using explicit implementation syntax, accessibility is **protected**, allowed modifiers: **extern** and **async**. - Implementing interface properties and indexers in derived interfaces by using explicit implementation syntax, accessibility **protected**, allowed modifiers: **extern**. - Implementing interface events in derived interfaces by using explicit implementation syntax, accessibility **protected**, no allowed modifiers. - Declaring static fields, auto-properties and field-like events. - Declaring operators ```+ - ! ~ ++ -- true false * / % & | ^ << >> > < >= <=``` in interfaces. - Base access The following forms of base-access are added (https://github.com/dotnet/csharplang/blob/main/meetings/2018/LDM-2018-11-14.md) ``` base ( <type-syntax> ) . identifier base ( <type-syntax> ) [ argument-list ] ``` The type-syntax can refer to one of the base classes of the containing type, or one of the interfaces implemented or inherited by the containing type. When the type-syntax refers to a class, the member lookup rules, overload resolution rules and IL emit match the rules for the 7.3 supported forms of base-access. The difference is that the specified base class is used instead of the immediate base class. The most derived implementation found must be a member of that class. When the type-syntax refers to an interface: 1. The member lookup is performed in that interface, using the regular member lookup rules within interfaces, with an exception that members of System.Object do not participate in the lookup. 2. Regular overload resolution is performed for members returned by the lookup process, virtual or abstract members are not replaced with most derived implementations at this step (unlike the case when the type-syntax refers to a class). If result of overload resolution is a virtual or abstract method, it must have an implementation within the specified interface type, an error is reported otherwise. That implementation must be accessible at the call site. If result of overload resolution is a non-virtual method, the method must be declared in the specified interface type. 3. During IL emit a **call** (non-virtual call) instruction is used to invoke methods. If result of overload resolution on the previous step is a virtual or abstract method, the implementation of the method from the specified interface is used as the target for the instruction. Given the accessibility requirements for the most specific interface implementation, accessibility of implementations provided in derived interfaces is changed to **protected**. **Open issues and work items** are tracked in https://github.com/dotnet/roslyn/issues/17952. **Parts of ECMA-335 that become obsolete/inaccurate/incomplete** >I.8.5.3.2 Accessibility of members and nested types Members (other than nested types) defined by an interface shall be public. I.8.9.4 Interface type definition Similarly, an interface type definition shall not provide implementations for any methods on the values of its type. Interfaces can have static or virtual methods, but shall not have instance methods. However, since accessibility attributes are relative to the implementing type rather than the interface itself, all members of an interface shall have public accessibility, ... I.8.11.1 Method definitions All non-static methods of an interface definition are abstract. All non-static method definitions in interface definitions shall be virtual methods. II.10.4 Method implementat ion requirements II.12 Semantics of interfaces Interfaces can have static fields and methods, but they shall not have instance fields or methods. Interfaces can define virtual methods, but only if those methods are abstract (see Partition I and §II.15.4.2.4). II.12.2 Implement ing virtual methods on interfaces If the class defines any public virtual methods whose name and signature match a virtual method on the interface, then add these to the list for that method, in type declaration order (see above). If there are any public virtual methods available on this class (directly or inherited) having the same name and signature as the interface method, and whose generic type parameters do not exactly match any methods in the existing list for that interface method for this class or any class in its inheritance chain, then add them (in type declaration order) to the list for the corresponding methods on the interface. II.15.2 Static, instance, and virtual methods It follows that instance methods shall only be defined in classes or value types, but not in interfaces or outside of a type (i.e., globally). II.22.27 MethodImpl : 0x19 The method indexed by MethodBody shall be a member of Class or some base class of Class (MethodImpls do not allow compilers to ‘hook’ arbitrary method bodies) II.22.37 TypeDef : 0x02 All of the methods owned by an Interface (Flags.Interface = 1) shall be abstract (Flags.Abstract = 1) IV.6 Implementation-specific modifications to the system libraries Interfaces and virtual methods shall not be added to an existing interface.
-1
dotnet/roslyn
55,430
Fix LSP semantic tokens algorithm
This PR primarily accomplishes two tasks: 1) Overhauls the existing LSP semantic tokens edits processing algorithm to align with [Razor's](https://github.com/dotnet/aspnetcore-tooling/blob/main/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/SemanticTokensEditsDiffer.cs) (shoutout to Ryan and the rest of the Razor team for writing the original 😄). The main change here is going from calculating edits per token (i.e. five ints) to per int. The updated algorithm is much more efficient than our previous algorithm, and returns less edits back to the LSP client. 2) The interpretation of Roslyn's LongestCommonSubstring algorithm, which we use to calculate raw edits, was missing a critical piece. Namely, for insertions, we need to keep track of _where_ we should be inserting into the original token set. We don't keep track of this in the existing implementation, resulting in bugs such as #54671. Resolves #54671
allisonchou
2021-08-05T06:06:43Z
2021-08-06T23:44:44Z
b9200d03a76c74d404040d44b9bbe12b1d0a8ef2
f300a818940ea1acef66c946cfa83756729d5e59
Fix LSP semantic tokens algorithm. This PR primarily accomplishes two tasks: 1) Overhauls the existing LSP semantic tokens edits processing algorithm to align with [Razor's](https://github.com/dotnet/aspnetcore-tooling/blob/main/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/SemanticTokensEditsDiffer.cs) (shoutout to Ryan and the rest of the Razor team for writing the original 😄). The main change here is going from calculating edits per token (i.e. five ints) to per int. The updated algorithm is much more efficient than our previous algorithm, and returns less edits back to the LSP client. 2) The interpretation of Roslyn's LongestCommonSubstring algorithm, which we use to calculate raw edits, was missing a critical piece. Namely, for insertions, we need to keep track of _where_ we should be inserting into the original token set. We don't keep track of this in the existing implementation, resulting in bugs such as #54671. Resolves #54671
./src/Features/LanguageServer/Protocol/Handler/SemanticTokens/SemanticTokensEditsHandler.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Differencing; using Microsoft.CodeAnalysis.ErrorReporting; using Microsoft.CodeAnalysis.PooledObjects; using Microsoft.VisualStudio.LanguageServer.Protocol; using Roslyn.Utilities; using LSP = Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.LanguageServer.Handler.SemanticTokens { /// <summary> /// Computes the semantic tokens edits for a file. An edit request is received every 500ms, /// or every time an edit is made by the user. /// </summary> internal class SemanticTokensEditsHandler : IRequestHandler<LSP.SemanticTokensEditsParams, SumType<LSP.SemanticTokens, LSP.SemanticTokensEdits>> { private readonly SemanticTokensCache _tokensCache; public string Method => LSP.SemanticTokensMethods.TextDocumentSemanticTokensEditsName; public bool MutatesSolutionState => false; public bool RequiresLSPSolution => true; public SemanticTokensEditsHandler(SemanticTokensCache tokensCache) { _tokensCache = tokensCache; } public TextDocumentIdentifier? GetTextDocumentIdentifier(LSP.SemanticTokensEditsParams request) { Contract.ThrowIfNull(request.TextDocument); return request.TextDocument; } public async Task<SumType<LSP.SemanticTokens, LSP.SemanticTokensEdits>> HandleRequestAsync( LSP.SemanticTokensEditsParams request, RequestContext context, CancellationToken cancellationToken) { Contract.ThrowIfNull(request.TextDocument, "TextDocument is null."); Contract.ThrowIfNull(request.PreviousResultId, "previousResultId is null."); Contract.ThrowIfNull(context.Document, "Document is null."); // Even though we want to ultimately pass edits back to LSP, we still need to compute all semantic tokens, // both for caching purposes and in order to have a baseline comparison when computing the edits. var newSemanticTokensData = await SemanticTokensHelpers.ComputeSemanticTokensDataAsync( context.Document, SemanticTokensCache.TokenTypeToIndex, range: null, cancellationToken).ConfigureAwait(false); Contract.ThrowIfNull(newSemanticTokensData, "newSemanticTokensData is null."); // Getting the cached tokens for the document. If we don't have an applicable cached token set, // we can't calculate edits, so we must return all semantic tokens instead. var oldSemanticTokensData = await _tokensCache.GetCachedTokensDataAsync( request.TextDocument.Uri, request.PreviousResultId, cancellationToken).ConfigureAwait(false); if (oldSemanticTokensData == null) { var newResultId = _tokensCache.GetNextResultId(); return new LSP.SemanticTokens { ResultId = newResultId, Data = newSemanticTokensData }; } var resultId = request.PreviousResultId; var editArray = ComputeSemanticTokensEdits(oldSemanticTokensData, newSemanticTokensData); // If we have edits, generate a new ResultId. Otherwise, re-use the previous one. if (editArray.Length != 0) { resultId = _tokensCache.GetNextResultId(); var updatedTokens = new LSP.SemanticTokens { ResultId = resultId, Data = newSemanticTokensData }; await _tokensCache.UpdateCacheAsync( request.TextDocument.Uri, updatedTokens, cancellationToken).ConfigureAwait(false); } var edits = new SemanticTokensEdits { Edits = editArray, ResultId = resultId }; return edits; } /// <summary> /// Compares two sets of SemanticTokens and returns the edits between them. /// </summary> private static LSP.SemanticTokensEdit[] ComputeSemanticTokensEdits( int[] oldSemanticTokens, int[] newSemanticTokens) { if (oldSemanticTokens.SequenceEqual(newSemanticTokens)) { return Array.Empty<SemanticTokensEdit>(); } // We use Roslyn's version of the Myers' Diff Algorithm to compute the minimal edits // between the old and new tokens. // Edits are computed by token (i.e. in sets of five integers), so if one value in the token // is changed, the entire token is replaced. We do this instead of directly comparing each // value in the token individually so that we can potentially save on computation costs, since // we can return early if we find that one value in the token doesn't match. However, there // are trade-offs since our insertions/deletions are usually larger. // Turning arrays into tuples of five ints, each representing one token var oldGroupedSemanticTokens = ConvertToGroupedSemanticTokens(oldSemanticTokens); var newGroupedSemanticTokens = ConvertToGroupedSemanticTokens(newSemanticTokens); var edits = LongestCommonSemanticTokensSubsequence.GetEdits(oldGroupedSemanticTokens, newGroupedSemanticTokens); return ConvertToSemanticTokenEdits(newGroupedSemanticTokens, edits); } private static SemanticTokensEdit[] ConvertToSemanticTokenEdits(SemanticToken[] newGroupedSemanticTokens, IEnumerable<SequenceEdit> edits) { // Our goal is to minimize the number of edits we return to LSP. It's possible an index // may have both an insertion and deletion, in which case we can combine the two into a // single update. We use the dictionary below to keep track of whether an index contains // an insertion, deletion, or both. using var _ = PooledDictionary<int, SemanticTokenEditKind>.GetInstance(out var indexToEditKinds); foreach (var edit in edits) { // We only care about EditKind.Insert and EditKind.Delete, since they encompass all // changes to the document. All other EditKinds are ignored. switch (edit.Kind) { case EditKind.Insert: indexToEditKinds.TryGetValue(edit.NewIndex, out var editKindWithoutInsert); Contract.ThrowIfTrue(editKindWithoutInsert == SemanticTokenEditKind.Insert, "There cannot be two inserts at the same position."); Contract.ThrowIfTrue(editKindWithoutInsert == SemanticTokenEditKind.Update, "There cannot be an insert and update at the same position."); indexToEditKinds[edit.NewIndex] = editKindWithoutInsert == SemanticTokenEditKind.None ? SemanticTokenEditKind.Insert : SemanticTokenEditKind.Update; break; case EditKind.Delete: indexToEditKinds.TryGetValue(edit.OldIndex, out var editKindWithoutDelete); Contract.ThrowIfTrue(editKindWithoutDelete == SemanticTokenEditKind.Delete, "There cannot be two deletions at the same position."); Contract.ThrowIfTrue(editKindWithoutDelete == SemanticTokenEditKind.Update, "There cannot be a deletion and update at the same position."); indexToEditKinds[edit.OldIndex] = editKindWithoutDelete == SemanticTokenEditKind.None ? SemanticTokenEditKind.Delete : SemanticTokenEditKind.Update; break; } } return CombineEditsIfPossible(newGroupedSemanticTokens, indexToEditKinds); } private static SemanticTokensEdit[] CombineEditsIfPossible( SemanticToken[] newGroupedSemanticTokens, Dictionary<int, SemanticTokenEditKind> indexToEditKinds) { // This method combines the edits into the minimal possible edits (for the most part). // For example, if an index contains both an insertion and deletion, we combine the two // edits into one. // We also combine edits if we have consecutive edits of the same types, i.e. // Delete->Delete, Insert->Insert, and Update->Update. // Technically, we could combine Update->Insert, and Update->Delete, but those cases have // special rules and would complicate the logic. They also generally do not result in a // huge reduction in the total number of edits, so we leave them out for now. using var _ = ArrayBuilder<LSP.SemanticTokensEdit>.GetInstance(out var semanticTokensEdits); var editIndices = indexToEditKinds.Keys.ToArray(); // The indices in indexToEdit kinds are not guaranteed to be in chronological order when we // extract them from the dictionary. We must sort the edit kinds by index since we need to // know what kind of edits surround a given index in order to potentially combine them into // one edit. Array.Sort(editIndices); // Example to give clarity to currentEditIndex and currentTokenIndex variables defined below: // Non-grouped semantic tokens: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 // currentEditIndex: 0 1 // currentTokenIndex: 0 1 2 for (var currentEditIndex = 0; currentEditIndex < editIndices.Length; currentEditIndex++) { var currentTokenIndex = editIndices[currentEditIndex]; var initialEditKind = indexToEditKinds[currentTokenIndex]; var editStartPosition = currentTokenIndex * 5; if (initialEditKind == SemanticTokenEditKind.Update) { currentEditIndex = AddUpdateEdit( newGroupedSemanticTokens, indexToEditKinds, semanticTokensEdits, editIndices, currentEditIndex, editStartPosition); } else if (initialEditKind == SemanticTokenEditKind.Insert) { currentEditIndex = AddInsertionEdit( newGroupedSemanticTokens, indexToEditKinds, semanticTokensEdits, editIndices, currentEditIndex, editStartPosition); } else { Contract.ThrowIfFalse(initialEditKind == SemanticTokenEditKind.Delete, "Expected initialEditKind to be SemanticTokenEditKind.Delete."); currentEditIndex = AddDeletionEdit( indexToEditKinds, semanticTokensEdits, editIndices, currentEditIndex, editStartPosition); } } return semanticTokensEdits.ToArray(); // Local functions static int AddUpdateEdit( SemanticToken[] newGroupedSemanticTokens, Dictionary<int, SemanticTokenEditKind> indexToEditKinds, ArrayBuilder<SemanticTokensEdit> semanticTokensEdits, int[] editIndices, int startEditIndex, int editStartPosition) { var _ = ArrayBuilder<int>.GetInstance(out var tokensToInsert); // For simplicitly, we only allow an "update" (i.e. a dual insertion/deletion) to be // combined with other updates. var endEditIndex = GetCombinedEditEndIndex( SemanticTokenEditKind.Update, indexToEditKinds, editIndices, startEditIndex); var deleteCount = 5 * (1 + (endEditIndex - startEditIndex)); for (var i = 0; i <= endEditIndex - startEditIndex; i++) { newGroupedSemanticTokens[editIndices[startEditIndex + i]].AddToEnd(tokensToInsert); } semanticTokensEdits.Add( GenerateEdit(start: editStartPosition, deleteCount: deleteCount, data: tokensToInsert.ToArray())); return endEditIndex; } static int AddInsertionEdit( SemanticToken[] newGroupedSemanticTokens, Dictionary<int, SemanticTokenEditKind> indexToEditKinds, ArrayBuilder<SemanticTokensEdit> semanticTokensEdits, int[] editIndices, int startEditIndex, int editStartPosition) { var _ = ArrayBuilder<int>.GetInstance(out var tokensToInsert); // An insert can only be combined with other inserts that directly follow it. var endEditIndex = GetCombinedEditEndIndex( SemanticTokenEditKind.Insert, indexToEditKinds, editIndices, startEditIndex); for (var i = 0; i <= endEditIndex - startEditIndex; i++) { newGroupedSemanticTokens[editIndices[startEditIndex + i]].AddToEnd(tokensToInsert); } semanticTokensEdits.Add( GenerateEdit(start: editStartPosition, deleteCount: 0, data: tokensToInsert.ToArray())); return endEditIndex; } static int AddDeletionEdit( Dictionary<int, SemanticTokenEditKind> indexToEditKinds, ArrayBuilder<SemanticTokensEdit> semanticTokensEdits, int[] editIndices, int startEditIndex, int editStartPosition) { // A deletion can only be combined with other deletions that directly follow it. var endEditNumber = GetCombinedEditEndIndex( SemanticTokenEditKind.Delete, indexToEditKinds, editIndices, startEditIndex); var deleteCount = 5 * (1 + (endEditNumber - startEditIndex)); semanticTokensEdits.Add( GenerateEdit(start: editStartPosition, deleteCount: deleteCount, data: Array.Empty<int>())); return endEditNumber; } // Returns the updated ordered edit number after we know how many edits we can combine. static int GetCombinedEditEndIndex( SemanticTokenEditKind editKind, Dictionary<int, SemanticTokenEditKind> indexToEditKinds, int[] editIndices, int currentEditIndex) { // To continue combining edits, we need to ensure: // 1) There is an edit following the current edit. // 2) The current and next edits involve tokens that are located right next to // each other in the file. // 3) The next edit is the same type as the current edit. while (currentEditIndex + 1 < editIndices.Length && indexToEditKinds[editIndices[currentEditIndex + 1]] == editKind && editIndices[currentEditIndex + 1] == editIndices[currentEditIndex] + 1) { currentEditIndex++; } return currentEditIndex; } } /// <summary> /// Converts an array of individual semantic token values to an array of values grouped /// together by semantic token. /// </summary> private static SemanticToken[] ConvertToGroupedSemanticTokens(int[] tokens) { Contract.ThrowIfTrue(tokens.Length % 5 != 0, $"Tokens length should be divisible by 5. Actual length: {tokens.Length}"); using var _ = ArrayBuilder<SemanticToken>.GetInstance(out var fullTokens); for (var i = 0; i < tokens.Length; i += 5) { fullTokens.Add(new SemanticToken(tokens[i], tokens[i + 1], tokens[i + 2], tokens[i + 3], tokens[i + 4])); } return fullTokens.ToArray(); } internal static LSP.SemanticTokensEdit GenerateEdit(int start, int deleteCount, int[] data) => new() { Start = start, DeleteCount = deleteCount, Data = data }; private sealed class LongestCommonSemanticTokensSubsequence : LongestCommonSubsequence<SemanticToken[]> { private static readonly LongestCommonSemanticTokensSubsequence s_instance = new(); protected override bool ItemsEqual( SemanticToken[] oldSemanticTokens, int oldIndex, SemanticToken[] newSemanticTokens, int newIndex) => oldSemanticTokens[oldIndex].Equals(newSemanticTokens[newIndex]); public static IEnumerable<SequenceEdit> GetEdits(SemanticToken[] oldSemanticTokens, SemanticToken[] newSemanticTokens) { try { return s_instance.GetEdits(oldSemanticTokens, oldSemanticTokens.Length, newSemanticTokens, newSemanticTokens.Length); } catch (OutOfMemoryException e) when (FatalError.ReportAndCatch(e)) { // The algorithm is superlinear in memory usage so we might potentially run out in rare cases. // Report telemetry and return no edits. return SpecializedCollections.EmptyEnumerable<SequenceEdit>(); } } } /// <summary> /// Stores the values that make up the LSP representation of an individual semantic token. /// </summary> #pragma warning disable CA1067 // Override Object.Equals(object) when implementing IEquatable<T> private readonly struct SemanticToken : IEquatable<SemanticToken> #pragma warning restore CA1067 // Override Object.Equals(object) when implementing IEquatable<T> { private readonly int _deltaLine; private readonly int _deltaStartCharacter; private readonly int _length; private readonly int _tokenType; private readonly int _tokenModifiers; public SemanticToken(int deltaLine, int deltaStartCharacter, int length, int tokenType, int tokenModifiers) { _deltaLine = deltaLine; _deltaStartCharacter = deltaStartCharacter; _length = length; _tokenType = tokenType; _tokenModifiers = tokenModifiers; } public void AddToEnd(ArrayBuilder<int> tokensToInsert) { tokensToInsert.Add(_deltaLine); tokensToInsert.Add(_deltaStartCharacter); tokensToInsert.Add(_length); tokensToInsert.Add(_tokenType); tokensToInsert.Add(_tokenModifiers); } public bool Equals(SemanticToken otherToken) { return _deltaLine == otherToken._deltaLine && _deltaStartCharacter == otherToken._deltaStartCharacter && _length == otherToken._length && _tokenType == otherToken._tokenType && _tokenModifiers == otherToken._tokenModifiers; } } private enum SemanticTokenEditKind { None = 0, Insert = 1, Delete = 2, Update = 3 } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Differencing; using Microsoft.CodeAnalysis.ErrorReporting; using Microsoft.CodeAnalysis.PooledObjects; using Microsoft.VisualStudio.LanguageServer.Protocol; using Roslyn.Utilities; using LSP = Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.LanguageServer.Handler.SemanticTokens { /// <summary> /// Computes the semantic tokens edits for a file. An edit request is received every 500ms, /// or every time an edit is made by the user. /// </summary> internal class SemanticTokensEditsHandler : IRequestHandler<LSP.SemanticTokensEditsParams, SumType<LSP.SemanticTokens, LSP.SemanticTokensEdits>> { private readonly SemanticTokensCache _tokensCache; public string Method => LSP.SemanticTokensMethods.TextDocumentSemanticTokensEditsName; public bool MutatesSolutionState => false; public bool RequiresLSPSolution => true; public SemanticTokensEditsHandler(SemanticTokensCache tokensCache) { _tokensCache = tokensCache; } public TextDocumentIdentifier? GetTextDocumentIdentifier(LSP.SemanticTokensEditsParams request) { Contract.ThrowIfNull(request.TextDocument); return request.TextDocument; } public async Task<SumType<LSP.SemanticTokens, LSP.SemanticTokensEdits>> HandleRequestAsync( LSP.SemanticTokensEditsParams request, RequestContext context, CancellationToken cancellationToken) { Contract.ThrowIfNull(request.TextDocument, "TextDocument is null."); Contract.ThrowIfNull(request.PreviousResultId, "previousResultId is null."); Contract.ThrowIfNull(context.Document, "Document is null."); // Even though we want to ultimately pass edits back to LSP, we still need to compute all semantic tokens, // both for caching purposes and in order to have a baseline comparison when computing the edits. var newSemanticTokensData = await SemanticTokensHelpers.ComputeSemanticTokensDataAsync( context.Document, SemanticTokensCache.TokenTypeToIndex, range: null, cancellationToken).ConfigureAwait(false); Contract.ThrowIfNull(newSemanticTokensData, "newSemanticTokensData is null."); // Getting the cached tokens for the document. If we don't have an applicable cached token set, // we can't calculate edits, so we must return all semantic tokens instead. var oldSemanticTokensData = await _tokensCache.GetCachedTokensDataAsync( request.TextDocument.Uri, request.PreviousResultId, cancellationToken).ConfigureAwait(false); if (oldSemanticTokensData == null) { var newResultId = _tokensCache.GetNextResultId(); return new LSP.SemanticTokens { ResultId = newResultId, Data = newSemanticTokensData }; } var resultId = request.PreviousResultId; var editArray = ComputeSemanticTokensEdits(oldSemanticTokensData, newSemanticTokensData); // If we have edits, generate a new ResultId. Otherwise, re-use the previous one. if (editArray.Length != 0) { resultId = _tokensCache.GetNextResultId(); var updatedTokens = new LSP.SemanticTokens { ResultId = resultId, Data = newSemanticTokensData }; await _tokensCache.UpdateCacheAsync( request.TextDocument.Uri, updatedTokens, cancellationToken).ConfigureAwait(false); } var edits = new SemanticTokensEdits { Edits = editArray, ResultId = resultId }; return edits; } /// <summary> /// Compares two sets of SemanticTokens and returns the edits between them. /// </summary> private static LSP.SemanticTokensEdit[] ComputeSemanticTokensEdits( int[] oldSemanticTokens, int[] newSemanticTokens) { if (oldSemanticTokens.SequenceEqual(newSemanticTokens)) { return Array.Empty<SemanticTokensEdit>(); } // We use Roslyn's version of the Myers' Diff Algorithm to compute the minimal edits between // the old and new tokens. Edits are computed on an int level, with five ints representing // one token. We compute on int level rather than token level to minimize the amount of // edits we send back to the client. var edits = LongestCommonSemanticTokensSubsequence.GetEdits(oldSemanticTokens, newSemanticTokens); var processedEdits = ProcessEdits(newSemanticTokens, edits); return processedEdits; } private static LSP.SemanticTokensEdit[] ProcessEdits( int[] newSemanticTokens, IEnumerable<SequenceEdit> edits) { using var _ = ArrayBuilder<RoslynSemanticTokensEdit>.GetInstance(out var results); var insertIndex = 0; // Go through and attempt to combine individual edits into larger edits. The edits // passed into this method have already been ordered from smallest original index -> // largest original index. foreach (var edit in edits) { // Retrieve the most recent edit to see if it can be expanded. var editInProgress = results.Count > 0 ? results[^1] : null; switch (edit.Kind) { case EditKind.Delete: // If we have a deletion edit, we should see if there's an edit in progress // we can combine with. If not, we'll generate a new edit. // // Note we've set up the logic such that deletion edits can be combined with // an insertion edit in progress, but not vice versa. This works out // because the edits list passed into this method always orders the // insertions for a given start index before deletions. if (editInProgress != null && editInProgress.Start + editInProgress.DeleteCount == edit.OldIndex) { editInProgress.DeleteCount++; } else { results.Add(new RoslynSemanticTokensEdit { Start = edit.OldIndex, DeleteCount = 1, }); } break; case EditKind.Insert: // If we have an insertion edit, we should see if there's an insertion edit // in progress we can combine with. If not, we'll generate a new edit. // // As mentioned above, we only combine insertion edits with in-progress // insertion edits. if (editInProgress != null && editInProgress.Data != null && editInProgress.Data.Count > 0 && editInProgress.Start == insertIndex) { editInProgress.Data.Add(newSemanticTokens[edit.NewIndex]); } else { var semanticTokensEdit = new RoslynSemanticTokensEdit { Start = insertIndex, Data = new List<int> { newSemanticTokens[edit.NewIndex], }, DeleteCount = 0, }; results.Add(semanticTokensEdit); } break; case EditKind.Update: // For EditKind.Inserts, we need to keep track of where in the old sequence we should be // inserting. This location is based off the location of the previous update. insertIndex = edit.OldIndex + 1; break; default: throw new InvalidOperationException("Only EditKind.Insert and EditKind.Delete are valid."); } } var processedResults = results.Select(e => e.ToSemanticTokensEdit()); return processedResults.ToArray(); } private sealed class LongestCommonSemanticTokensSubsequence : LongestCommonSubsequence<int[]> { private static readonly LongestCommonSemanticTokensSubsequence s_instance = new(); protected override bool ItemsEqual( int[] oldSemanticTokens, int oldIndex, int[] newSemanticTokens, int newIndex) => oldSemanticTokens[oldIndex] == newSemanticTokens[newIndex]; public static IEnumerable<SequenceEdit> GetEdits(int[] oldSemanticTokens, int[] newSemanticTokens) { try { var edits = s_instance.GetEdits( oldSemanticTokens, oldSemanticTokens.Length, newSemanticTokens, newSemanticTokens.Length); // By default, edits are returned largest -> smallest index. For computation purposes later on, // we can want to have the edits ordered smallest -> largest index. return edits.Reverse(); } catch (OutOfMemoryException e) when (FatalError.ReportAndCatch(e)) { // The algorithm is superlinear in memory usage so we might potentially run out in rare cases. // Report telemetry and return no edits. return SpecializedCollections.EmptyEnumerable<SequenceEdit>(); } } } // We need to have a shim class because SemanticTokensEdit.Data is an array type, so if we // operate on it directly then every time we append an element we're allocating a new array. private class RoslynSemanticTokensEdit { /// <summary> /// Index where edit begins in the original sequence. /// </summary> public int Start { get; set; } /// <summary> /// Number of values to delete from tokens array. /// </summary> public int DeleteCount { get; set; } /// <summary> /// Values to add to tokens array. /// </summary> public IList<int>? Data { get; set; } public SemanticTokensEdit ToSemanticTokensEdit() { return new SemanticTokensEdit { Data = Data?.ToArray(), Start = Start, DeleteCount = DeleteCount, }; } } } }
1
dotnet/roslyn
55,430
Fix LSP semantic tokens algorithm
This PR primarily accomplishes two tasks: 1) Overhauls the existing LSP semantic tokens edits processing algorithm to align with [Razor's](https://github.com/dotnet/aspnetcore-tooling/blob/main/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/SemanticTokensEditsDiffer.cs) (shoutout to Ryan and the rest of the Razor team for writing the original 😄). The main change here is going from calculating edits per token (i.e. five ints) to per int. The updated algorithm is much more efficient than our previous algorithm, and returns less edits back to the LSP client. 2) The interpretation of Roslyn's LongestCommonSubstring algorithm, which we use to calculate raw edits, was missing a critical piece. Namely, for insertions, we need to keep track of _where_ we should be inserting into the original token set. We don't keep track of this in the existing implementation, resulting in bugs such as #54671. Resolves #54671
allisonchou
2021-08-05T06:06:43Z
2021-08-06T23:44:44Z
b9200d03a76c74d404040d44b9bbe12b1d0a8ef2
f300a818940ea1acef66c946cfa83756729d5e59
Fix LSP semantic tokens algorithm. This PR primarily accomplishes two tasks: 1) Overhauls the existing LSP semantic tokens edits processing algorithm to align with [Razor's](https://github.com/dotnet/aspnetcore-tooling/blob/main/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/SemanticTokensEditsDiffer.cs) (shoutout to Ryan and the rest of the Razor team for writing the original 😄). The main change here is going from calculating edits per token (i.e. five ints) to per int. The updated algorithm is much more efficient than our previous algorithm, and returns less edits back to the LSP client. 2) The interpretation of Roslyn's LongestCommonSubstring algorithm, which we use to calculate raw edits, was missing a critical piece. Namely, for insertions, we need to keep track of _where_ we should be inserting into the original token set. We don't keep track of this in the existing implementation, resulting in bugs such as #54671. Resolves #54671
./src/Features/LanguageServer/ProtocolUnitTests/SemanticTokens/SemanticTokensEditsTests.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable enable using System.Linq; using System.Threading.Tasks; using Microsoft.CodeAnalysis.LanguageServer.Handler.SemanticTokens; using Xunit; using LSP = Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.LanguageServer.UnitTests.SemanticTokens { public class SemanticTokensEditsTests : AbstractSemanticTokensTests { /* * Markup for basic test case: * // Comment * static class C { } */ private static readonly string s_standardCase = @"{|caret:|}// Comment static class C { }"; /* * Markup for single line test case: * // Comment */ private static readonly string s_singleLineCase = @"{|caret:|}// Comment"; [Fact] public async Task TestInsertingNewLineInMiddleOfFile() { var updatedText = @"// Comment static class C { }"; using var testLspServer = CreateTestLspServer(s_standardCase, out var locations); var caretLocation = locations["caret"].First(); await RunGetSemanticTokensAsync(testLspServer, caretLocation); UpdateDocumentText(updatedText, testLspServer.TestWorkspace); var results = await RunGetSemanticTokensEditsAsync(testLspServer, caretLocation, previousResultId: "1"); var expectedEdit = SemanticTokensEditsHandler.GenerateEdit(start: 5, deleteCount: 1, data: new int[] { 2 }); Assert.Equal(expectedEdit, ((LSP.SemanticTokensEdits)results).Edits.First()); Assert.Equal("2", ((LSP.SemanticTokensEdits)results).ResultId); } /// <summary> /// Tests making a deletion from the end of the file. /// </summary> [Fact] public async Task TestGetSemanticTokensEdits_EndDeletionAsync() { var updatedText = @"// Comment"; using var testLspServer = CreateTestLspServer(s_standardCase, out var locations); var caretLocation = locations["caret"].First(); await RunGetSemanticTokensAsync(testLspServer, caretLocation); UpdateDocumentText(updatedText, testLspServer.TestWorkspace); var results = await RunGetSemanticTokensEditsAsync(testLspServer, caretLocation, previousResultId: "1"); var expectedEdit = SemanticTokensEditsHandler.GenerateEdit(start: 5, deleteCount: 25, data: System.Array.Empty<int>()); Assert.Equal(expectedEdit, ((LSP.SemanticTokensEdits)results).Edits.First()); Assert.Equal("2", ((LSP.SemanticTokensEdits)results).ResultId); } /// <summary> /// Tests making an insertion at the end of the file. /// </summary> [Fact] public async Task TestGetSemanticTokensEdits_EndInsertionAsync() { var updatedText = @"// Comment static class C { } // Comment"; using var testLspServer = CreateTestLspServer(s_standardCase, out var locations); var caretLocation = locations["caret"].First(); await RunGetSemanticTokensAsync(testLspServer, caretLocation); UpdateDocumentText(updatedText, testLspServer.TestWorkspace); var results = await RunGetSemanticTokensEditsAsync(testLspServer, caretLocation, previousResultId: "1"); var expectedEdit = SemanticTokensEditsHandler.GenerateEdit( start: 30, deleteCount: 0, data: new int[] { 1, 0, 10, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Comment], 0 }); Assert.Equal(expectedEdit, ((LSP.SemanticTokensEdits)results).Edits.First()); Assert.Equal("2", ((LSP.SemanticTokensEdits)results).ResultId); } /// <summary> /// Tests to make sure we return a minimal number of edits. /// </summary> [Fact] public async Task TestGetSemanticTokensEdits_ReturnMinimalEdits() { var updatedText = @"class // Comment"; using var testLspServer = CreateTestLspServer(s_singleLineCase, out var locations); var caretLocation = locations["caret"].First(); await RunGetSemanticTokensAsync(testLspServer, caretLocation); // Edit text UpdateDocumentText(updatedText, testLspServer.TestWorkspace); var results = await RunGetSemanticTokensEditsAsync(testLspServer, caretLocation, previousResultId: "1"); // 1. Replaces length of token (10 to 5) and replaces token type (comment to keyword) // 2. Creates new token for '// Comment' var expectedEdit = SemanticTokensEditsHandler.GenerateEdit( start: 0, deleteCount: 5, data: new int[] { 0, 0, 5, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, 1, 0, 10, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Comment], 0 }); Assert.Equal(expectedEdit, ((LSP.SemanticTokensEdits)results).Edits?[0]); Assert.Equal("2", ((LSP.SemanticTokensEdits)results).ResultId); } /// <summary> /// Tests to make sure that if we don't have a matching semantic token set for the document in the cache, /// we return the full set of semantic tokens. /// </summary> [Fact] public async Task TestGetSemanticTokensEditsNoCacheAsync() { var updatedText = @"// Comment static class C { }"; using var testLspServer = CreateTestLspServer(s_standardCase, out var locations); var caretLocation = locations["caret"].First(); await RunGetSemanticTokensAsync(testLspServer, caretLocation); UpdateDocumentText(updatedText, testLspServer.TestWorkspace); var results = await RunGetSemanticTokensEditsAsync(testLspServer, caretLocation, previousResultId: "10"); // Make sure we're returned SemanticTokens instead of SemanticTokensEdits. Assert.True(results.Value is LSP.SemanticTokens); } [Fact] public async Task TestConvertSemanticTokenEditsIntoSemanticTokens_InsertNewlineInMiddleOfFile() { var updatedText = @"// Comment static class C { }"; using var testLspServer = CreateTestLspServer(s_standardCase, out var locations); var caretLocation = locations["caret"].First(); var originalTokens = await RunGetSemanticTokensAsync(testLspServer, caretLocation); UpdateDocumentText(updatedText, testLspServer.TestWorkspace); // Edits to tokens conversion var edits = await RunGetSemanticTokensEditsAsync(testLspServer, caretLocation, previousResultId: "1"); var editsToTokens = ApplySemanticTokensEdits(originalTokens.Data, (LSP.SemanticTokensEdits)edits); // Raw tokens var rawTokens = await RunGetSemanticTokensAsync(testLspServer, locations["caret"].First()); Assert.True(Enumerable.SequenceEqual(rawTokens.Data, editsToTokens)); } [Fact] public async Task TestConvertSemanticTokenEditsIntoSemanticTokens_ReplacementEdit() { var updatedText = @"// Comment internal struct S { }"; using var testLspServer = CreateTestLspServer(s_standardCase, out var locations); var caretLocation = locations["caret"].First(); var originalTokens = await RunGetSemanticTokensAsync(testLspServer, caretLocation); UpdateDocumentText(updatedText, testLspServer.TestWorkspace); // Edits to tokens conversion var edits = await RunGetSemanticTokensEditsAsync(testLspServer, caretLocation, previousResultId: "1"); var editsToTokens = ApplySemanticTokensEdits(originalTokens.Data, (LSP.SemanticTokensEdits)edits); // Raw tokens var rawTokens = await RunGetSemanticTokensAsync(testLspServer, locations["caret"].First()); Assert.True(Enumerable.SequenceEqual(rawTokens.Data, editsToTokens)); } [Fact] public async Task TestConvertSemanticTokenEditsIntoSemanticTokens_ManyEdits() { var updatedText = @" // Comment class C { static void M(int x) { var v = 1; } }"; using var testLspServer = CreateTestLspServer(s_standardCase, out var locations); var caretLocation = locations["caret"].First(); var originalTokens = await RunGetSemanticTokensAsync(testLspServer, caretLocation); UpdateDocumentText(updatedText, testLspServer.TestWorkspace); // Edits to tokens conversion var edits = await RunGetSemanticTokensEditsAsync(testLspServer, caretLocation, previousResultId: "1"); var editsToTokens = ApplySemanticTokensEdits(originalTokens.Data, (LSP.SemanticTokensEdits)edits); // Raw tokens var rawTokens = await RunGetSemanticTokensAsync(testLspServer, locations["caret"].First()); Assert.True(Enumerable.SequenceEqual(rawTokens.Data, editsToTokens)); } private static int[] ApplySemanticTokensEdits(int[]? originalTokens, LSP.SemanticTokensEdits edits) { var data = originalTokens.ToList(); if (edits.Edits != null) { foreach (var edit in edits.Edits) { data.RemoveRange(edit.Start, edit.DeleteCount); data.InsertRange(edit.Start, edit.Data); } } return data.ToArray(); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable enable using System.Linq; using System.Threading.Tasks; using Microsoft.CodeAnalysis.LanguageServer.Handler.SemanticTokens; using Roslyn.Test.Utilities; using Xunit; using LSP = Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.LanguageServer.UnitTests.SemanticTokens { public class SemanticTokensEditsTests : AbstractSemanticTokensTests { /* * Markup for basic test case: * // Comment * static class C { } */ private static readonly string s_standardCase = @"{|caret:|}// Comment static class C { }"; /* * Markup for single line test case: * // Comment */ private static readonly string s_singleLineCase = @"{|caret:|}// Comment"; [Fact] public async Task TestInsertingNewLineInMiddleOfFile() { var updatedText = @"// Comment static class C { }"; using var testLspServer = CreateTestLspServer(s_standardCase, out var locations); var caretLocation = locations["caret"].First(); await RunGetSemanticTokensAsync(testLspServer, caretLocation); UpdateDocumentText(updatedText, testLspServer.TestWorkspace); var results = await RunGetSemanticTokensEditsAsync(testLspServer, caretLocation, previousResultId: "1"); var expectedEdit = new LSP.SemanticTokensEdit { Start = 5, DeleteCount = 1, Data = new int[] { 2 } }; Assert.Equal(expectedEdit, ((LSP.SemanticTokensEdits)results).Edits.First()); Assert.Equal("2", ((LSP.SemanticTokensEdits)results).ResultId); } /// <summary> /// Tests making a deletion from the end of the file. /// </summary> [Fact] public async Task TestGetSemanticTokensEdits_EndDeletionAsync() { var updatedText = @"// Comment"; using var testLspServer = CreateTestLspServer(s_standardCase, out var locations); var caretLocation = locations["caret"].First(); await RunGetSemanticTokensAsync(testLspServer, caretLocation); UpdateDocumentText(updatedText, testLspServer.TestWorkspace); var results = await RunGetSemanticTokensEditsAsync(testLspServer, caretLocation, previousResultId: "1"); var expectedEdit = new LSP.SemanticTokensEdit { Start = 5, DeleteCount = 25, Data = System.Array.Empty<int>() }; Assert.Equal(expectedEdit, ((LSP.SemanticTokensEdits)results).Edits.First()); Assert.Equal("2", ((LSP.SemanticTokensEdits)results).ResultId); } /// <summary> /// Tests making an insertion at the end of the file. /// </summary> [Fact] public async Task TestGetSemanticTokensEdits_EndInsertionAsync() { var updatedText = @"// Comment static class C { } // Comment"; using var testLspServer = CreateTestLspServer(s_standardCase, out var locations); var caretLocation = locations["caret"].First(); await RunGetSemanticTokensAsync(testLspServer, caretLocation); UpdateDocumentText(updatedText, testLspServer.TestWorkspace); var results = await RunGetSemanticTokensEditsAsync(testLspServer, caretLocation, previousResultId: "1"); var expectedEdit = new LSP.SemanticTokensEdit { Start = 30, DeleteCount = 0, Data = new int[] { 1, 0, 10, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Comment], 0 } }; Assert.Equal(expectedEdit, ((LSP.SemanticTokensEdits)results).Edits.First()); Assert.Equal("2", ((LSP.SemanticTokensEdits)results).ResultId); } /// <summary> /// Tests to make sure we return a minimal number of edits. /// </summary> [Fact] public async Task TestGetSemanticTokensEdits_ReturnMinimalEdits() { var updatedText = @"class // Comment"; using var testLspServer = CreateTestLspServer(s_singleLineCase, out var locations); var caretLocation = locations["caret"].First(); await RunGetSemanticTokensAsync(testLspServer, caretLocation); // Edit text UpdateDocumentText(updatedText, testLspServer.TestWorkspace); var results = await RunGetSemanticTokensEditsAsync(testLspServer, caretLocation, previousResultId: "1"); // 1. Updates length of token (10 to 5) and updates token type (comment to keyword) // 2. Creates new token for '// Comment' var expectedEdit = new LSP.SemanticTokensEdit { Start = 2, DeleteCount = 0, Data = new int[] { // 'class' /* 0, 0, */ 5, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, // '// Comment' 1, 0, /* 10, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Comment], 0 */ } }; Assert.Equal(expectedEdit, ((LSP.SemanticTokensEdits)results).Edits?[0]); Assert.Equal("2", ((LSP.SemanticTokensEdits)results).ResultId); } /// <summary> /// Tests to make sure that if we don't have a matching semantic token set for the document in the cache, /// we return the full set of semantic tokens. /// </summary> [Fact] public async Task TestGetSemanticTokensEditsNoCacheAsync() { var updatedText = @"// Comment static class C { }"; using var testLspServer = CreateTestLspServer(s_standardCase, out var locations); var caretLocation = locations["caret"].First(); await RunGetSemanticTokensAsync(testLspServer, caretLocation); UpdateDocumentText(updatedText, testLspServer.TestWorkspace); var results = await RunGetSemanticTokensEditsAsync(testLspServer, caretLocation, previousResultId: "10"); // Make sure we're returned SemanticTokens instead of SemanticTokensEdits. Assert.True(results.Value is LSP.SemanticTokens); } [Fact] public async Task TestConvertSemanticTokenEditsIntoSemanticTokens_InsertNewlineInMiddleOfFile() { var updatedText = @"// Comment static class C { }"; using var testLspServer = CreateTestLspServer(s_standardCase, out var locations); var caretLocation = locations["caret"].First(); var originalTokens = await RunGetSemanticTokensAsync(testLspServer, caretLocation); UpdateDocumentText(updatedText, testLspServer.TestWorkspace); // Edits to tokens conversion var edits = await RunGetSemanticTokensEditsAsync(testLspServer, caretLocation, previousResultId: "1"); var editsToTokens = ApplySemanticTokensEdits(originalTokens.Data, (LSP.SemanticTokensEdits)edits); // Raw tokens var rawTokens = await RunGetSemanticTokensAsync(testLspServer, locations["caret"].First()); Assert.True(Enumerable.SequenceEqual(rawTokens.Data, editsToTokens)); } [Fact] public async Task TestConvertSemanticTokenEditsIntoSemanticTokens_ReplacementEdit() { var updatedText = @"// Comment internal struct S { }"; using var testLspServer = CreateTestLspServer(s_standardCase, out var locations); var caretLocation = locations["caret"].First(); var originalTokens = await RunGetSemanticTokensAsync(testLspServer, caretLocation); UpdateDocumentText(updatedText, testLspServer.TestWorkspace); // Edits to tokens conversion var edits = await RunGetSemanticTokensEditsAsync(testLspServer, caretLocation, previousResultId: "1"); var editsToTokens = ApplySemanticTokensEdits(originalTokens.Data, (LSP.SemanticTokensEdits)edits); // Raw tokens var rawTokens = await RunGetSemanticTokensAsync(testLspServer, locations["caret"].First()); Assert.True(Enumerable.SequenceEqual(rawTokens.Data, editsToTokens)); } [Fact] public async Task TestConvertSemanticTokenEditsIntoSemanticTokens_ManyEdits() { var updatedText = @" // Comment class C { static void M(int x) { var v = 1; } }"; using var testLspServer = CreateTestLspServer(s_standardCase, out var locations); var caretLocation = locations["caret"].First(); var originalTokens = await RunGetSemanticTokensAsync(testLspServer, caretLocation); UpdateDocumentText(updatedText, testLspServer.TestWorkspace); // Edits to tokens conversion var edits = await RunGetSemanticTokensEditsAsync(testLspServer, caretLocation, previousResultId: "1"); var editsToTokens = ApplySemanticTokensEdits(originalTokens.Data, (LSP.SemanticTokensEdits)edits); // Raw tokens var rawTokens = await RunGetSemanticTokensAsync(testLspServer, locations["caret"].First()); Assert.True(Enumerable.SequenceEqual(rawTokens.Data, editsToTokens)); } [Fact, WorkItem(54671, "https://github.com/dotnet/roslyn/issues/54671")] public async Task TestConvertSemanticTokenEditsIntoSemanticTokens_FragmentedTokens() { var originalText = @"fo {|caret:|}r (int i = 0;/*c*/; i++) { }"; var updatedText = @"for (int i = 0;/*c*/; i++) { }"; using var testLspServer = CreateTestLspServer(originalText, out var locations); var caretLocation = locations["caret"].First(); var originalTokens = await RunGetSemanticTokensAsync(testLspServer, caretLocation); UpdateDocumentText(updatedText, testLspServer.TestWorkspace); // Edits to tokens conversion var edits = await RunGetSemanticTokensEditsAsync(testLspServer, caretLocation, previousResultId: "1"); var editsToTokens = ApplySemanticTokensEdits(originalTokens.Data, (LSP.SemanticTokensEdits)edits); // Raw tokens var rawTokens = await RunGetSemanticTokensAsync(testLspServer, locations["caret"].First()); Assert.True(Enumerable.SequenceEqual(rawTokens.Data, editsToTokens)); } private static int[] ApplySemanticTokensEdits(int[]? originalTokens, LSP.SemanticTokensEdits edits) { var data = originalTokens.ToList(); if (edits.Edits != null) { foreach (var edit in edits.Edits.Reverse()) { data.RemoveRange(edit.Start, edit.DeleteCount); if (edit.Data is not null) { data.InsertRange(edit.Start, edit.Data); } } } return data.ToArray(); } } }
1
dotnet/roslyn
55,430
Fix LSP semantic tokens algorithm
This PR primarily accomplishes two tasks: 1) Overhauls the existing LSP semantic tokens edits processing algorithm to align with [Razor's](https://github.com/dotnet/aspnetcore-tooling/blob/main/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/SemanticTokensEditsDiffer.cs) (shoutout to Ryan and the rest of the Razor team for writing the original 😄). The main change here is going from calculating edits per token (i.e. five ints) to per int. The updated algorithm is much more efficient than our previous algorithm, and returns less edits back to the LSP client. 2) The interpretation of Roslyn's LongestCommonSubstring algorithm, which we use to calculate raw edits, was missing a critical piece. Namely, for insertions, we need to keep track of _where_ we should be inserting into the original token set. We don't keep track of this in the existing implementation, resulting in bugs such as #54671. Resolves #54671
allisonchou
2021-08-05T06:06:43Z
2021-08-06T23:44:44Z
b9200d03a76c74d404040d44b9bbe12b1d0a8ef2
f300a818940ea1acef66c946cfa83756729d5e59
Fix LSP semantic tokens algorithm. This PR primarily accomplishes two tasks: 1) Overhauls the existing LSP semantic tokens edits processing algorithm to align with [Razor's](https://github.com/dotnet/aspnetcore-tooling/blob/main/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/SemanticTokensEditsDiffer.cs) (shoutout to Ryan and the rest of the Razor team for writing the original 😄). The main change here is going from calculating edits per token (i.e. five ints) to per int. The updated algorithm is much more efficient than our previous algorithm, and returns less edits back to the LSP client. 2) The interpretation of Roslyn's LongestCommonSubstring algorithm, which we use to calculate raw edits, was missing a critical piece. Namely, for insertions, we need to keep track of _where_ we should be inserting into the original token set. We don't keep track of this in the existing implementation, resulting in bugs such as #54671. Resolves #54671
./src/Features/LanguageServer/ProtocolUnitTests/SemanticTokens/SemanticTokensTests.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable enable using System.Linq; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Classification; using Microsoft.CodeAnalysis.LanguageServer.Handler.SemanticTokens; using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using LSP = Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.LanguageServer.UnitTests.SemanticTokens { public class SemanticTokensTests : AbstractSemanticTokensTests { [Fact] public async Task TestGetSemanticTokensAsync() { var markup = @"{|caret:|}// Comment static class C { }"; using var testLspServer = CreateTestLspServer(markup, out var locations); var results = await RunGetSemanticTokensAsync(testLspServer, locations["caret"].First()); var expectedResults = new LSP.SemanticTokens { Data = new int[] { // Line | Char | Len | Token type | Modifier 0, 0, 10, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Comment], 0, // '// Comment' 1, 0, 6, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, // 'static' 0, 7, 5, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, // 'class' 0, 6, 1, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Class], (int)TokenModifiers.Static, // 'C' 0, 2, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '{' 0, 2, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '}' }, ResultId = "1" }; await VerifyNoMultiLineTokens(testLspServer, results.Data!).ConfigureAwait(false); Assert.Equal(expectedResults.Data, results.Data); Assert.Equal(expectedResults.ResultId, results.ResultId); } /// <summary> /// Tests all three handlers in succession and makes sure we receive the expected result at each stage. /// </summary> [Fact] public async Task TestAllHandlersAsync() { var markup = @"{|caret:|}// Comment static class C { } "; using var testLspServer = CreateTestLspServer(markup, out var locations); var caretLocation = locations["caret"].First(); // 1. Range handler var range = new LSP.Range { Start = new Position(1, 0), End = new Position(2, 0) }; var rangeResults = await RunGetSemanticTokensRangeAsync(testLspServer, caretLocation, range); var expectedRangeResults = new LSP.SemanticTokens { Data = new int[] { // Line | Char | Len | Token type | Modifier 1, 0, 6, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, // 'static' 0, 7, 5, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, // 'class' 0, 6, 1, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Class], (int)TokenModifiers.Static, // 'C' 0, 2, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '{' 0, 2, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '}' }, ResultId = "1" }; await VerifyNoMultiLineTokens(testLspServer, rangeResults.Data!).ConfigureAwait(false); Assert.Equal(expectedRangeResults.Data, rangeResults.Data); Assert.Equal(expectedRangeResults.ResultId, rangeResults.ResultId); // 2. Whole document handler var wholeDocResults = await RunGetSemanticTokensAsync(testLspServer, caretLocation); var expectedWholeDocResults = new LSP.SemanticTokens { Data = new int[] { // Line | Char | Len | Token type | Modifier 0, 0, 10, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Comment], 0, // '// Comment' 1, 0, 6, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, // 'static' 0, 7, 5, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, // 'class' 0, 6, 1, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Class], (int)TokenModifiers.Static, // 'C' 0, 2, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '{' 0, 2, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '}' }, ResultId = "2" }; await VerifyNoMultiLineTokens(testLspServer, wholeDocResults.Data!).ConfigureAwait(false); Assert.Equal(expectedWholeDocResults.Data, wholeDocResults.Data); Assert.Equal(expectedWholeDocResults.ResultId, wholeDocResults.ResultId); // 3. Edits handler - insert newline at beginning of file var newMarkup = @" // Comment static class C { } "; UpdateDocumentText(newMarkup, testLspServer.TestWorkspace); var editResults = await RunGetSemanticTokensEditsAsync(testLspServer, caretLocation, previousResultId: "2"); var expectedEdit = SemanticTokensEditsHandler.GenerateEdit(0, 1, new int[] { 1 }); Assert.Equal(expectedEdit, ((LSP.SemanticTokensEdits)editResults).Edits.First()); Assert.Equal("3", ((LSP.SemanticTokensEdits)editResults).ResultId); // 4. Edits handler - no changes (ResultId should remain same) var editResultsNoChange = await RunGetSemanticTokensEditsAsync(testLspServer, caretLocation, previousResultId: "3"); Assert.Equal("3", ((LSP.SemanticTokensEdits)editResultsNoChange).ResultId); // 5. Re-request whole document handler (may happen if LSP runs into an error) var wholeDocResults2 = await RunGetSemanticTokensAsync(testLspServer, caretLocation); var expectedWholeDocResults2 = new LSP.SemanticTokens { Data = new int[] { // Line | Char | Len | Token type | Modifier 1, 0, 10, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Comment], 0, // '// Comment' 1, 0, 6, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, // 'static' 0, 7, 5, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, // 'class' 0, 6, 1, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Class], (int)TokenModifiers.Static, // 'C' 0, 2, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '{' 0, 2, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '}' }, ResultId = "4" }; await VerifyNoMultiLineTokens(testLspServer, wholeDocResults2.Data!).ConfigureAwait(false); Assert.Equal(expectedWholeDocResults2.Data, wholeDocResults2.Data); Assert.Equal(expectedWholeDocResults2.ResultId, wholeDocResults2.ResultId); } [Fact] public async Task TestGetSemanticTokensMultiLineCommentAsync() { var markup = @"{|caret:|}class C { /* one two three */ } "; using var testLspServer = CreateTestLspServer(markup, out var locations); var results = await RunGetSemanticTokensAsync(testLspServer, locations["caret"].First()); var expectedResults = new LSP.SemanticTokens { Data = new int[] { // Line | Char | Len | Token type | Modifier 0, 0, 5, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, // 'class' 0, 6, 1, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Class], 0, // 'C' 0, 2, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '{' 0, 2, 6, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Comment], 0, // '/* one' 1, 0, 3, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Comment], 0, // 'two' 1, 0, 8, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Comment], 0, // 'three */' 0, 9, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '}' }, ResultId = "1" }; await VerifyNoMultiLineTokens(testLspServer, results.Data!).ConfigureAwait(false); Assert.Equal(expectedResults.Data, results.Data); Assert.Equal(expectedResults.ResultId, results.ResultId); } [Fact] public async Task TestGetSemanticTokensStringLiteralAsync() { var markup = @"{|caret:|}class C { void M() { var x = @""one two """" three""; } } "; using var testLspServer = CreateTestLspServer(markup, out var locations); var results = await RunGetSemanticTokensAsync(testLspServer, locations["caret"].First()); var expectedResults = new LSP.SemanticTokens { Data = new int[] { // Line | Char | Len | Token type | Modifier 0, 0, 5, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, // 'class' 0, 6, 1, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Class], 0, // 'C' 1, 0, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '{' 1, 4, 4, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, // 'void' 0, 5, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.MethodName], 0, // 'M' 0, 1, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '(' 0, 1, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // ')' 1, 4, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '{' 1, 8, 3, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Keyword], 0, // 'var' 0, 4, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.LocalName], 0, // 'x' 0, 2, 1, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Operator], 0, // '=' 0, 2, 5, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.VerbatimStringLiteral], 0, // '@"one' 1, 0, 6, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.VerbatimStringLiteral], 0, // 'two' 0, 4, 2, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.StringEscapeCharacter], 0, // '""' 1, 0, 6, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.VerbatimStringLiteral], 0, // 'three"' 0, 6, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // ';' 1, 4, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '}' 1, 0, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '}' }, ResultId = "1" }; await VerifyNoMultiLineTokens(testLspServer, results.Data!).ConfigureAwait(false); Assert.Equal(expectedResults.Data, results.Data); Assert.Equal(expectedResults.ResultId, results.ResultId); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable enable using System.Linq; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Classification; using Microsoft.CodeAnalysis.LanguageServer.Handler.SemanticTokens; using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using LSP = Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.LanguageServer.UnitTests.SemanticTokens { public class SemanticTokensTests : AbstractSemanticTokensTests { [Fact] public async Task TestGetSemanticTokensAsync() { var markup = @"{|caret:|}// Comment static class C { }"; using var testLspServer = CreateTestLspServer(markup, out var locations); var results = await RunGetSemanticTokensAsync(testLspServer, locations["caret"].First()); var expectedResults = new LSP.SemanticTokens { Data = new int[] { // Line | Char | Len | Token type | Modifier 0, 0, 10, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Comment], 0, // '// Comment' 1, 0, 6, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, // 'static' 0, 7, 5, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, // 'class' 0, 6, 1, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Class], (int)TokenModifiers.Static, // 'C' 0, 2, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '{' 0, 2, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '}' }, ResultId = "1" }; await VerifyNoMultiLineTokens(testLspServer, results.Data!).ConfigureAwait(false); Assert.Equal(expectedResults.Data, results.Data); Assert.Equal(expectedResults.ResultId, results.ResultId); } /// <summary> /// Tests all three handlers in succession and makes sure we receive the expected result at each stage. /// </summary> [Fact] public async Task TestAllHandlersAsync() { var markup = @"{|caret:|}// Comment static class C { } "; using var testLspServer = CreateTestLspServer(markup, out var locations); var caretLocation = locations["caret"].First(); // 1. Range handler var range = new LSP.Range { Start = new Position(1, 0), End = new Position(2, 0) }; var rangeResults = await RunGetSemanticTokensRangeAsync(testLspServer, caretLocation, range); var expectedRangeResults = new LSP.SemanticTokens { Data = new int[] { // Line | Char | Len | Token type | Modifier 1, 0, 6, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, // 'static' 0, 7, 5, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, // 'class' 0, 6, 1, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Class], (int)TokenModifiers.Static, // 'C' 0, 2, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '{' 0, 2, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '}' }, ResultId = "1" }; await VerifyNoMultiLineTokens(testLspServer, rangeResults.Data!).ConfigureAwait(false); Assert.Equal(expectedRangeResults.Data, rangeResults.Data); Assert.Equal(expectedRangeResults.ResultId, rangeResults.ResultId); // 2. Whole document handler var wholeDocResults = await RunGetSemanticTokensAsync(testLspServer, caretLocation); var expectedWholeDocResults = new LSP.SemanticTokens { Data = new int[] { // Line | Char | Len | Token type | Modifier 0, 0, 10, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Comment], 0, // '// Comment' 1, 0, 6, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, // 'static' 0, 7, 5, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, // 'class' 0, 6, 1, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Class], (int)TokenModifiers.Static, // 'C' 0, 2, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '{' 0, 2, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '}' }, ResultId = "2" }; await VerifyNoMultiLineTokens(testLspServer, wholeDocResults.Data!).ConfigureAwait(false); Assert.Equal(expectedWholeDocResults.Data, wholeDocResults.Data); Assert.Equal(expectedWholeDocResults.ResultId, wholeDocResults.ResultId); // 3. Edits handler - insert newline at beginning of file var newMarkup = @" // Comment static class C { } "; UpdateDocumentText(newMarkup, testLspServer.TestWorkspace); var editResults = await RunGetSemanticTokensEditsAsync(testLspServer, caretLocation, previousResultId: "2"); var expectedEdit = new LSP.SemanticTokensEdit { Start = 0, DeleteCount = 1, Data = new int[] { 1 } }; Assert.Equal(expectedEdit, ((LSP.SemanticTokensEdits)editResults).Edits.First()); Assert.Equal("3", ((LSP.SemanticTokensEdits)editResults).ResultId); // 4. Edits handler - no changes (ResultId should remain same) var editResultsNoChange = await RunGetSemanticTokensEditsAsync(testLspServer, caretLocation, previousResultId: "3"); Assert.Equal("3", ((LSP.SemanticTokensEdits)editResultsNoChange).ResultId); // 5. Re-request whole document handler (may happen if LSP runs into an error) var wholeDocResults2 = await RunGetSemanticTokensAsync(testLspServer, caretLocation); var expectedWholeDocResults2 = new LSP.SemanticTokens { Data = new int[] { // Line | Char | Len | Token type | Modifier 1, 0, 10, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Comment], 0, // '// Comment' 1, 0, 6, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, // 'static' 0, 7, 5, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, // 'class' 0, 6, 1, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Class], (int)TokenModifiers.Static, // 'C' 0, 2, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '{' 0, 2, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '}' }, ResultId = "4" }; await VerifyNoMultiLineTokens(testLspServer, wholeDocResults2.Data!).ConfigureAwait(false); Assert.Equal(expectedWholeDocResults2.Data, wholeDocResults2.Data); Assert.Equal(expectedWholeDocResults2.ResultId, wholeDocResults2.ResultId); } [Fact] public async Task TestGetSemanticTokensMultiLineCommentAsync() { var markup = @"{|caret:|}class C { /* one two three */ } "; using var testLspServer = CreateTestLspServer(markup, out var locations); var results = await RunGetSemanticTokensAsync(testLspServer, locations["caret"].First()); var expectedResults = new LSP.SemanticTokens { Data = new int[] { // Line | Char | Len | Token type | Modifier 0, 0, 5, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, // 'class' 0, 6, 1, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Class], 0, // 'C' 0, 2, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '{' 0, 2, 6, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Comment], 0, // '/* one' 1, 0, 3, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Comment], 0, // 'two' 1, 0, 8, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Comment], 0, // 'three */' 0, 9, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '}' }, ResultId = "1" }; await VerifyNoMultiLineTokens(testLspServer, results.Data!).ConfigureAwait(false); Assert.Equal(expectedResults.Data, results.Data); Assert.Equal(expectedResults.ResultId, results.ResultId); } [Fact] public async Task TestGetSemanticTokensStringLiteralAsync() { var markup = @"{|caret:|}class C { void M() { var x = @""one two """" three""; } } "; using var testLspServer = CreateTestLspServer(markup, out var locations); var results = await RunGetSemanticTokensAsync(testLspServer, locations["caret"].First()); var expectedResults = new LSP.SemanticTokens { Data = new int[] { // Line | Char | Len | Token type | Modifier 0, 0, 5, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, // 'class' 0, 6, 1, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Class], 0, // 'C' 1, 0, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '{' 1, 4, 4, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Keyword], 0, // 'void' 0, 5, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.MethodName], 0, // 'M' 0, 1, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '(' 0, 1, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // ')' 1, 4, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '{' 1, 8, 3, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Keyword], 0, // 'var' 0, 4, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.LocalName], 0, // 'x' 0, 2, 1, SemanticTokensCache.TokenTypeToIndex[LSP.SemanticTokenTypes.Operator], 0, // '=' 0, 2, 5, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.VerbatimStringLiteral], 0, // '@"one' 1, 0, 6, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.VerbatimStringLiteral], 0, // 'two' 0, 4, 2, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.StringEscapeCharacter], 0, // '""' 1, 0, 6, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.VerbatimStringLiteral], 0, // 'three"' 0, 6, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // ';' 1, 4, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '}' 1, 0, 1, SemanticTokensCache.TokenTypeToIndex[ClassificationTypeNames.Punctuation], 0, // '}' }, ResultId = "1" }; await VerifyNoMultiLineTokens(testLspServer, results.Data!).ConfigureAwait(false); Assert.Equal(expectedResults.Data, results.Data); Assert.Equal(expectedResults.ResultId, results.ResultId); } } }
1
dotnet/roslyn
55,430
Fix LSP semantic tokens algorithm
This PR primarily accomplishes two tasks: 1) Overhauls the existing LSP semantic tokens edits processing algorithm to align with [Razor's](https://github.com/dotnet/aspnetcore-tooling/blob/main/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/SemanticTokensEditsDiffer.cs) (shoutout to Ryan and the rest of the Razor team for writing the original 😄). The main change here is going from calculating edits per token (i.e. five ints) to per int. The updated algorithm is much more efficient than our previous algorithm, and returns less edits back to the LSP client. 2) The interpretation of Roslyn's LongestCommonSubstring algorithm, which we use to calculate raw edits, was missing a critical piece. Namely, for insertions, we need to keep track of _where_ we should be inserting into the original token set. We don't keep track of this in the existing implementation, resulting in bugs such as #54671. Resolves #54671
allisonchou
2021-08-05T06:06:43Z
2021-08-06T23:44:44Z
b9200d03a76c74d404040d44b9bbe12b1d0a8ef2
f300a818940ea1acef66c946cfa83756729d5e59
Fix LSP semantic tokens algorithm. This PR primarily accomplishes two tasks: 1) Overhauls the existing LSP semantic tokens edits processing algorithm to align with [Razor's](https://github.com/dotnet/aspnetcore-tooling/blob/main/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/SemanticTokensEditsDiffer.cs) (shoutout to Ryan and the rest of the Razor team for writing the original 😄). The main change here is going from calculating edits per token (i.e. five ints) to per int. The updated algorithm is much more efficient than our previous algorithm, and returns less edits back to the LSP client. 2) The interpretation of Roslyn's LongestCommonSubstring algorithm, which we use to calculate raw edits, was missing a critical piece. Namely, for insertions, we need to keep track of _where_ we should be inserting into the original token set. We don't keep track of this in the existing implementation, resulting in bugs such as #54671. Resolves #54671
./src/Workspaces/Core/Portable/Editing/SolutionEditor.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; namespace Microsoft.CodeAnalysis.Editing { /// <summary> /// An editor for making changes to multiple documents in a solution. /// </summary> public class SolutionEditor { private readonly Solution _solution; private readonly Dictionary<DocumentId, DocumentEditor> _documentEditors; public SolutionEditor(Solution solution) { _solution = solution; _documentEditors = new Dictionary<DocumentId, DocumentEditor>(); } /// <summary> /// The <see cref="Solution"/> that was specified when the <see cref="SolutionEditor"/> was constructed. /// </summary> public Solution OriginalSolution => _solution; /// <summary> /// Gets the <see cref="DocumentEditor"/> for the corresponding <see cref="DocumentId"/>. /// </summary> public async Task<DocumentEditor> GetDocumentEditorAsync(DocumentId id, CancellationToken cancellationToken = default) { if (!_documentEditors.TryGetValue(id, out var editor)) { editor = await DocumentEditor.CreateAsync(_solution.GetDocument(id), cancellationToken).ConfigureAwait(false); _documentEditors.Add(id, editor); } return editor; } /// <summary> /// Returns the changed <see cref="Solution"/>. /// </summary> public Solution GetChangedSolution() { var changedSolution = _solution; foreach (var docEd in _documentEditors.Values) { var currentDoc = changedSolution.GetDocument(docEd.OriginalDocument.Id); var newDoc = currentDoc.WithSyntaxRoot(docEd.GetChangedRoot()); changedSolution = newDoc.Project.Solution; } return changedSolution; } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; namespace Microsoft.CodeAnalysis.Editing { /// <summary> /// An editor for making changes to multiple documents in a solution. /// </summary> public class SolutionEditor { private readonly Solution _solution; private readonly Dictionary<DocumentId, DocumentEditor> _documentEditors; public SolutionEditor(Solution solution) { _solution = solution; _documentEditors = new Dictionary<DocumentId, DocumentEditor>(); } /// <summary> /// The <see cref="Solution"/> that was specified when the <see cref="SolutionEditor"/> was constructed. /// </summary> public Solution OriginalSolution => _solution; /// <summary> /// Gets the <see cref="DocumentEditor"/> for the corresponding <see cref="DocumentId"/>. /// </summary> public async Task<DocumentEditor> GetDocumentEditorAsync(DocumentId id, CancellationToken cancellationToken = default) { if (!_documentEditors.TryGetValue(id, out var editor)) { editor = await DocumentEditor.CreateAsync(_solution.GetDocument(id), cancellationToken).ConfigureAwait(false); _documentEditors.Add(id, editor); } return editor; } /// <summary> /// Returns the changed <see cref="Solution"/>. /// </summary> public Solution GetChangedSolution() { var changedSolution = _solution; foreach (var docEd in _documentEditors.Values) { var currentDoc = changedSolution.GetDocument(docEd.OriginalDocument.Id); var newDoc = currentDoc.WithSyntaxRoot(docEd.GetChangedRoot()); changedSolution = newDoc.Project.Solution; } return changedSolution; } } }
-1
dotnet/roslyn
55,430
Fix LSP semantic tokens algorithm
This PR primarily accomplishes two tasks: 1) Overhauls the existing LSP semantic tokens edits processing algorithm to align with [Razor's](https://github.com/dotnet/aspnetcore-tooling/blob/main/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/SemanticTokensEditsDiffer.cs) (shoutout to Ryan and the rest of the Razor team for writing the original 😄). The main change here is going from calculating edits per token (i.e. five ints) to per int. The updated algorithm is much more efficient than our previous algorithm, and returns less edits back to the LSP client. 2) The interpretation of Roslyn's LongestCommonSubstring algorithm, which we use to calculate raw edits, was missing a critical piece. Namely, for insertions, we need to keep track of _where_ we should be inserting into the original token set. We don't keep track of this in the existing implementation, resulting in bugs such as #54671. Resolves #54671
allisonchou
2021-08-05T06:06:43Z
2021-08-06T23:44:44Z
b9200d03a76c74d404040d44b9bbe12b1d0a8ef2
f300a818940ea1acef66c946cfa83756729d5e59
Fix LSP semantic tokens algorithm. This PR primarily accomplishes two tasks: 1) Overhauls the existing LSP semantic tokens edits processing algorithm to align with [Razor's](https://github.com/dotnet/aspnetcore-tooling/blob/main/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/SemanticTokensEditsDiffer.cs) (shoutout to Ryan and the rest of the Razor team for writing the original 😄). The main change here is going from calculating edits per token (i.e. five ints) to per int. The updated algorithm is much more efficient than our previous algorithm, and returns less edits back to the LSP client. 2) The interpretation of Roslyn's LongestCommonSubstring algorithm, which we use to calculate raw edits, was missing a critical piece. Namely, for insertions, we need to keep track of _where_ we should be inserting into the original token set. We don't keep track of this in the existing implementation, resulting in bugs such as #54671. Resolves #54671
./src/EditorFeatures/Core/FindUsages/AbstractFindUsagesService_FindImplementations.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.FindSymbols; using Microsoft.CodeAnalysis.FindUsages; using Microsoft.CodeAnalysis.Remote; using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Shared.Utilities; using Microsoft.CodeAnalysis.Text; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.Editor.FindUsages { internal abstract partial class AbstractFindUsagesService { public async Task FindImplementationsAsync( Document document, int position, IFindUsagesContext context, CancellationToken cancellationToken) { // If this is a symbol from a metadata-as-source project, then map that symbol back to a symbol in the primary workspace. var symbolAndProjectOpt = await FindUsagesHelpers.GetRelevantSymbolAndProjectAtPositionAsync( document, position, cancellationToken).ConfigureAwait(false); if (symbolAndProjectOpt == null) { await context.ReportMessageAsync( EditorFeaturesResources.Cannot_navigate_to_the_symbol_under_the_caret, cancellationToken).ConfigureAwait(false); return; } var symbolAndProject = symbolAndProjectOpt.Value; await FindImplementationsAsync( symbolAndProject.symbol, symbolAndProject.project, context, cancellationToken).ConfigureAwait(false); } public static async Task FindImplementationsAsync( ISymbol symbol, Project project, IFindUsagesContext context, CancellationToken cancellationToken) { var solution = project.Solution; var client = await RemoteHostClient.TryGetClientAsync(solution.Workspace, cancellationToken).ConfigureAwait(false); if (client != null) { // Create a callback that we can pass to the server process to hear about the // results as it finds them. When we hear about results we'll forward them to // the 'progress' parameter which will then update the UI. var serverCallback = new FindUsagesServerCallback(solution, context); var symbolAndProjectId = SerializableSymbolAndProjectId.Create(symbol, project, cancellationToken); await client.TryInvokeAsync<IRemoteFindUsagesService>( solution, (service, solutionInfo, callbackId, cancellationToken) => service.FindImplementationsAsync(solutionInfo, callbackId, symbolAndProjectId, cancellationToken), serverCallback, cancellationToken).ConfigureAwait(false); } else { // Couldn't effectively search in OOP. Perform the search in-process. await FindImplementationsInCurrentProcessAsync( symbol, project, context, cancellationToken).ConfigureAwait(false); } } private static async Task FindImplementationsInCurrentProcessAsync( ISymbol symbol, Project project, IFindUsagesContext context, CancellationToken cancellationToken) { var solution = project.Solution; var implementations = await FindSourceImplementationsAsync(solution, symbol, cancellationToken).ConfigureAwait(false); if (implementations.IsEmpty) { await context.ReportMessageAsync(EditorFeaturesResources.The_symbol_has_no_implementations, cancellationToken).ConfigureAwait(false); return; } await context.SetSearchTitleAsync( string.Format(EditorFeaturesResources._0_implementations, FindUsagesHelpers.GetDisplayName(symbol)), cancellationToken).ConfigureAwait(false); foreach (var implementation in implementations) { var definitionItem = await implementation.ToClassifiedDefinitionItemAsync( solution, isPrimary: true, includeHiddenLocations: false, FindReferencesSearchOptions.Default, cancellationToken).ConfigureAwait(false); await context.OnDefinitionFoundAsync(definitionItem, cancellationToken).ConfigureAwait(false); } } private static async Task<ImmutableArray<ISymbol>> FindSourceImplementationsAsync( Solution solution, ISymbol symbol, CancellationToken cancellationToken) { var builder = new HashSet<ISymbol>(SymbolEquivalenceComparer.Instance); // If we're in a linked file, try to find all the symbols this links to, and find all the implementations of // each of those linked symbols. De-dupe the results so the user only gets unique results. var linkedSymbols = await SymbolFinder.FindLinkedSymbolsAsync( symbol, solution, cancellationToken).ConfigureAwait(false); // Because we're searching linked files, we may get many symbols that are conceptually // 'duplicates' to the user. Specifically, any symbols that would navigate to the same // location do not provide value to the user as selecting any from that set of items // would navigate them to the exact same location. For this, we use file-paths and spans // as those will be the same regardless of how a file is linked or used in shared project // scenarios. var seenLocations = new HashSet<(string filePath, TextSpan span)>(); foreach (var linkedSymbol in linkedSymbols) { var implementations = await FindSourceImplementationsWorkerAsync( solution, linkedSymbol, cancellationToken).ConfigureAwait(false); foreach (var implementation in implementations) { if (AddedAllLocations(implementation, seenLocations)) builder.Add(implementation); } } return builder.ToImmutableArray(); static bool AddedAllLocations(ISymbol implementation, HashSet<(string filePath, TextSpan span)> seenLocations) { foreach (var location in implementation.Locations) { Contract.ThrowIfFalse(location.IsInSource); if (!seenLocations.Add((location.SourceTree.FilePath, location.SourceSpan))) return false; } return true; } } private static async Task<ImmutableArray<ISymbol>> FindSourceImplementationsWorkerAsync( Solution solution, ISymbol symbol, CancellationToken cancellationToken) { var implementations = await FindSourceAndMetadataImplementationsAsync(solution, symbol, cancellationToken).ConfigureAwait(false); var sourceImplementations = new HashSet<ISymbol>(implementations.Where(s => s.IsFromSource()).Select(s => s.OriginalDefinition)); // For members, if we've found overrides of the original symbol, then filter out any abstract // members these inherit from. The user has asked for literal implementations, and in the case // of an override, including the abstract as well isn't helpful. var overrides = sourceImplementations.Where(s => s.IsOverride).ToImmutableArray(); foreach (var ov in overrides) { for (var overridden = ov.GetOverriddenMember(); overridden != null; overridden = overridden.GetOverriddenMember()) { if (overridden.IsAbstract) sourceImplementations.Remove(overridden.OriginalDefinition); } } return sourceImplementations.ToImmutableArray(); } private static async Task<ImmutableArray<ISymbol>> FindSourceAndMetadataImplementationsAsync( Solution solution, ISymbol symbol, CancellationToken cancellationToken) { if (symbol.IsInterfaceType() || symbol.IsImplementableMember()) { var implementations = await SymbolFinder.FindImplementationsAsync( symbol, solution, cancellationToken: cancellationToken).ConfigureAwait(false); // It's important we use a HashSet here -- we may have cases in an inheritance hierarchy where more than one method // in an overrides chain implements the same interface method, and we want to duplicate those. The easiest way to do it // is to just use a HashSet. var implementationsAndOverrides = new HashSet<ISymbol>(); foreach (var implementation in implementations) { implementationsAndOverrides.Add(implementation); // FindImplementationsAsync will only return the base virtual/abstract method, not that method and the overrides // of the method. We should also include those. if (implementation.IsOverridable()) { var overrides = await SymbolFinder.FindOverridesAsync( implementation, solution, cancellationToken: cancellationToken).ConfigureAwait(false); implementationsAndOverrides.AddRange(overrides); } } if (!symbol.IsInterfaceType() && !symbol.IsAbstract) { implementationsAndOverrides.Add(symbol); } return implementationsAndOverrides.ToImmutableArray(); } else if (symbol is INamedTypeSymbol { TypeKind: TypeKind.Class } namedType) { var derivedClasses = await SymbolFinder.FindDerivedClassesAsync( namedType, solution, cancellationToken: cancellationToken).ConfigureAwait(false); return derivedClasses.Concat(symbol).ToImmutableArray(); } else if (symbol.IsOverridable()) { var overrides = await SymbolFinder.FindOverridesAsync( symbol, solution, cancellationToken: cancellationToken).ConfigureAwait(false); return overrides.Concat(symbol).ToImmutableArray(); } else { // This is something boring like a regular method or type, so we'll just go there directly return ImmutableArray.Create(symbol); } } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.FindSymbols; using Microsoft.CodeAnalysis.FindUsages; using Microsoft.CodeAnalysis.Remote; using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Shared.Utilities; using Microsoft.CodeAnalysis.Text; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.Editor.FindUsages { internal abstract partial class AbstractFindUsagesService { public async Task FindImplementationsAsync( Document document, int position, IFindUsagesContext context, CancellationToken cancellationToken) { // If this is a symbol from a metadata-as-source project, then map that symbol back to a symbol in the primary workspace. var symbolAndProjectOpt = await FindUsagesHelpers.GetRelevantSymbolAndProjectAtPositionAsync( document, position, cancellationToken).ConfigureAwait(false); if (symbolAndProjectOpt == null) { await context.ReportMessageAsync( EditorFeaturesResources.Cannot_navigate_to_the_symbol_under_the_caret, cancellationToken).ConfigureAwait(false); return; } var symbolAndProject = symbolAndProjectOpt.Value; await FindImplementationsAsync( symbolAndProject.symbol, symbolAndProject.project, context, cancellationToken).ConfigureAwait(false); } public static async Task FindImplementationsAsync( ISymbol symbol, Project project, IFindUsagesContext context, CancellationToken cancellationToken) { var solution = project.Solution; var client = await RemoteHostClient.TryGetClientAsync(solution.Workspace, cancellationToken).ConfigureAwait(false); if (client != null) { // Create a callback that we can pass to the server process to hear about the // results as it finds them. When we hear about results we'll forward them to // the 'progress' parameter which will then update the UI. var serverCallback = new FindUsagesServerCallback(solution, context); var symbolAndProjectId = SerializableSymbolAndProjectId.Create(symbol, project, cancellationToken); await client.TryInvokeAsync<IRemoteFindUsagesService>( solution, (service, solutionInfo, callbackId, cancellationToken) => service.FindImplementationsAsync(solutionInfo, callbackId, symbolAndProjectId, cancellationToken), serverCallback, cancellationToken).ConfigureAwait(false); } else { // Couldn't effectively search in OOP. Perform the search in-process. await FindImplementationsInCurrentProcessAsync( symbol, project, context, cancellationToken).ConfigureAwait(false); } } private static async Task FindImplementationsInCurrentProcessAsync( ISymbol symbol, Project project, IFindUsagesContext context, CancellationToken cancellationToken) { var solution = project.Solution; var implementations = await FindSourceImplementationsAsync(solution, symbol, cancellationToken).ConfigureAwait(false); if (implementations.IsEmpty) { await context.ReportMessageAsync(EditorFeaturesResources.The_symbol_has_no_implementations, cancellationToken).ConfigureAwait(false); return; } await context.SetSearchTitleAsync( string.Format(EditorFeaturesResources._0_implementations, FindUsagesHelpers.GetDisplayName(symbol)), cancellationToken).ConfigureAwait(false); foreach (var implementation in implementations) { var definitionItem = await implementation.ToClassifiedDefinitionItemAsync( solution, isPrimary: true, includeHiddenLocations: false, FindReferencesSearchOptions.Default, cancellationToken).ConfigureAwait(false); await context.OnDefinitionFoundAsync(definitionItem, cancellationToken).ConfigureAwait(false); } } private static async Task<ImmutableArray<ISymbol>> FindSourceImplementationsAsync( Solution solution, ISymbol symbol, CancellationToken cancellationToken) { var builder = new HashSet<ISymbol>(SymbolEquivalenceComparer.Instance); // If we're in a linked file, try to find all the symbols this links to, and find all the implementations of // each of those linked symbols. De-dupe the results so the user only gets unique results. var linkedSymbols = await SymbolFinder.FindLinkedSymbolsAsync( symbol, solution, cancellationToken).ConfigureAwait(false); // Because we're searching linked files, we may get many symbols that are conceptually // 'duplicates' to the user. Specifically, any symbols that would navigate to the same // location do not provide value to the user as selecting any from that set of items // would navigate them to the exact same location. For this, we use file-paths and spans // as those will be the same regardless of how a file is linked or used in shared project // scenarios. var seenLocations = new HashSet<(string filePath, TextSpan span)>(); foreach (var linkedSymbol in linkedSymbols) { var implementations = await FindSourceImplementationsWorkerAsync( solution, linkedSymbol, cancellationToken).ConfigureAwait(false); foreach (var implementation in implementations) { if (AddedAllLocations(implementation, seenLocations)) builder.Add(implementation); } } return builder.ToImmutableArray(); static bool AddedAllLocations(ISymbol implementation, HashSet<(string filePath, TextSpan span)> seenLocations) { foreach (var location in implementation.Locations) { Contract.ThrowIfFalse(location.IsInSource); if (!seenLocations.Add((location.SourceTree.FilePath, location.SourceSpan))) return false; } return true; } } private static async Task<ImmutableArray<ISymbol>> FindSourceImplementationsWorkerAsync( Solution solution, ISymbol symbol, CancellationToken cancellationToken) { var implementations = await FindSourceAndMetadataImplementationsAsync(solution, symbol, cancellationToken).ConfigureAwait(false); var sourceImplementations = new HashSet<ISymbol>(implementations.Where(s => s.IsFromSource()).Select(s => s.OriginalDefinition)); // For members, if we've found overrides of the original symbol, then filter out any abstract // members these inherit from. The user has asked for literal implementations, and in the case // of an override, including the abstract as well isn't helpful. var overrides = sourceImplementations.Where(s => s.IsOverride).ToImmutableArray(); foreach (var ov in overrides) { for (var overridden = ov.GetOverriddenMember(); overridden != null; overridden = overridden.GetOverriddenMember()) { if (overridden.IsAbstract) sourceImplementations.Remove(overridden.OriginalDefinition); } } return sourceImplementations.ToImmutableArray(); } private static async Task<ImmutableArray<ISymbol>> FindSourceAndMetadataImplementationsAsync( Solution solution, ISymbol symbol, CancellationToken cancellationToken) { if (symbol.IsInterfaceType() || symbol.IsImplementableMember()) { var implementations = await SymbolFinder.FindImplementationsAsync( symbol, solution, cancellationToken: cancellationToken).ConfigureAwait(false); // It's important we use a HashSet here -- we may have cases in an inheritance hierarchy where more than one method // in an overrides chain implements the same interface method, and we want to duplicate those. The easiest way to do it // is to just use a HashSet. var implementationsAndOverrides = new HashSet<ISymbol>(); foreach (var implementation in implementations) { implementationsAndOverrides.Add(implementation); // FindImplementationsAsync will only return the base virtual/abstract method, not that method and the overrides // of the method. We should also include those. if (implementation.IsOverridable()) { var overrides = await SymbolFinder.FindOverridesAsync( implementation, solution, cancellationToken: cancellationToken).ConfigureAwait(false); implementationsAndOverrides.AddRange(overrides); } } if (!symbol.IsInterfaceType() && !symbol.IsAbstract) { implementationsAndOverrides.Add(symbol); } return implementationsAndOverrides.ToImmutableArray(); } else if (symbol is INamedTypeSymbol { TypeKind: TypeKind.Class } namedType) { var derivedClasses = await SymbolFinder.FindDerivedClassesAsync( namedType, solution, cancellationToken: cancellationToken).ConfigureAwait(false); return derivedClasses.Concat(symbol).ToImmutableArray(); } else if (symbol.IsOverridable()) { var overrides = await SymbolFinder.FindOverridesAsync( symbol, solution, cancellationToken: cancellationToken).ConfigureAwait(false); return overrides.Concat(symbol).ToImmutableArray(); } else { // This is something boring like a regular method or type, so we'll just go there directly return ImmutableArray.Create(symbol); } } } }
-1