diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index 73eb5d1d02d..f6232cee7e0 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"microsoft.dotnet.darc": {
- "version": "1.1.0-beta.25263.3",
+ "version": "1.1.0-beta.25264.3",
"commands": [
"darc"
]
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index dba5c7c0cb3..88649a1e361 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -10,9 +10,9 @@
https://github.com/dotnet/arcade
e46d1266547513110e67a3e4709fe8ecdfb20849
-
+
https://github.com/dotnet/arcade-services
- 4db7c74da4dcd71e2a5b4f5a65cc871dc06288d2
+ 7126d7cb6f801691b0dfcc4e8357471f8dc750a9
diff --git a/eng/common/build.sh b/eng/common/build.sh
index 36fba82a379..27ae2c85601 100755
--- a/eng/common/build.sh
+++ b/eng/common/build.sh
@@ -136,7 +136,7 @@ while [[ $# > 0 ]]; do
restore=true
pack=true
;;
- -productBuild|-pb)
+ -productbuild|-pb)
build=true
product_build=true
restore=true
diff --git a/eng/pipelines/templates/jobs/vmr-build.yml b/eng/pipelines/templates/jobs/vmr-build.yml
index b3f46059a4e..0add8ee8c6d 100644
--- a/eng/pipelines/templates/jobs/vmr-build.yml
+++ b/eng/pipelines/templates/jobs/vmr-build.yml
@@ -114,6 +114,12 @@ parameters:
type: stepList
default: []
+#### repo parameters ####
+
+- name: isBuiltFromVmr
+ displayName: True when build is running from dotnet/dotnet directly
+ type: boolean
+
jobs:
- job: ${{ parameters.buildName }}_${{ parameters.targetArchitecture }}${{ replace(format('_BuildPass{0}', coalesce(parameters.buildPass, '1')), '_BuildPass1', '') }}
pool: ${{ parameters.pool }}
@@ -160,8 +166,13 @@ jobs:
value: ''
- name: runTestsTimeout
value: 30
- - name: vmrPath
- value: $(Build.SourcesDirectory)
+
+ - ${{ if parameters.isBuiltFromVmr }}:
+ - name: vmrPath
+ value: $(Build.SourcesDirectory)
+ - ${{ else }}:
+ - name: vmrPath
+ value: $(Agent.BuildDirectory)/vmr
# Location of the VMR sources
# We either build the repo directly, or we extract them outside (which is what partners do)
@@ -270,7 +281,7 @@ jobs:
timeoutInMinutes: 720
## Currently, CodeQL slows the build down too much
## https://github.com/dotnet/source-build/issues/4276
- ${{ elseif and(startswith(parameters.buildName, 'Windows'), eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}:
+ ${{ elseif and(parameters.isBuiltFromVmr, startswith(parameters.buildName, 'Windows'), eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}:
timeoutInMinutes: 720
${{ else }}:
timeoutInMinutes: 240
@@ -312,6 +323,13 @@ jobs:
sbomEnabled: false
steps:
+ - ${{ if not(parameters.isBuiltFromVmr) }}:
+ # Synchronize new content in the VMR during PRs
+ - template: /eng/common/templates/steps/vmr-pull-updates.yml@self
+ parameters:
+ vmrPath: $(vmrPath)
+ targetRef: $(Build.SourceVersion) # Synchronize the current repo commit
+
- ${{ if parameters.buildFromArchive }}:
- script: |
set -ex
@@ -323,7 +341,7 @@ jobs:
- ${{ if ne(parameters.reuseBuildArtifactsFrom,'') }}:
- ${{ each reuseBuildArtifacts in parameters.reuseBuildArtifactsFrom }}:
- ${{ if eq(parameters.buildSourceOnly, true) }}:
- - template: ../steps/download-artifacts.yml@self
+ - template: ../steps/download-artifacts.yml
parameters:
artifactDescription: Previous Build (${{ reuseBuildArtifacts }} - Source Build artifacts)
artifactName: ${{ reuseBuildArtifacts }}_Artifacts
diff --git a/eng/pipelines/templates/stages/source-build-and-validate.yml b/eng/pipelines/templates/stages/source-build-and-validate.yml
index 2ae5096297b..5bc2427f59b 100644
--- a/eng/pipelines/templates/stages/source-build-and-validate.yml
+++ b/eng/pipelines/templates/stages/source-build-and-validate.yml
@@ -15,6 +15,11 @@ parameters:
- name: legs
type: object
+# True when build is running from dotnet/dotnet directly
+- name: isBuiltFromVmr
+ type: boolean
+ default: true
+
stages:
- stage: VMR_SourceOnly_Build
displayName: VMR Source-Only Build
@@ -83,6 +88,7 @@ stages:
targetRid: ${{ variables.alpineX64Rid }}
targetArchitecture: ${{ leg.targetArchitecture }}
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
${{ if eq(leg.targetArchitecture, 'arm64') }}:
pool: ${{ parameters.pool_LinuxArm64 }}
${{ else }}:
@@ -150,6 +156,7 @@ stages:
targetRid: ${{ variables.alpineX64Rid }}
targetArchitecture: ${{ leg.targetArchitecture }}
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
${{ if eq(leg.targetArchitecture, 'arm64') }}:
pool: ${{ parameters.pool_LinuxArm64 }}
${{ else }}:
diff --git a/eng/pipelines/templates/stages/source-build-stages.yml b/eng/pipelines/templates/stages/source-build-stages.yml
index e885c95ade4..c8572eea6ea 100644
--- a/eng/pipelines/templates/stages/source-build-stages.yml
+++ b/eng/pipelines/templates/stages/source-build-stages.yml
@@ -14,6 +14,11 @@ parameters:
type: boolean
default: true
+# True when build is running from dotnet/dotnet directly
+- name: isBuiltFromVmr
+ type: boolean
+ default: true
+
# Temporarily needed to enable SB PR legs from the unified build pipeline
# This parameter should be removed with https://github.com/dotnet/dotnet/pull/400
- name: officialBuildId
@@ -27,6 +32,7 @@ stages:
pool_LinuxArm64: ${{ parameters.pool_LinuxArm64 }}
scope: ${{ parameters.scope }}
useMicrosoftBuildAssetsForTests: ${{ parameters.useMicrosoftBuildAssetsForTests }}
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
# Description of the source build legs to run.
# This is described here as a parameter to allow two separate stages to be produced from this list (one for building
diff --git a/eng/pipelines/templates/stages/vmr-build-with-join.yml b/eng/pipelines/templates/stages/vmr-build-with-join.yml
index 47a1e4c9d8e..01be49bad62 100644
--- a/eng/pipelines/templates/stages/vmr-build-with-join.yml
+++ b/eng/pipelines/templates/stages/vmr-build-with-join.yml
@@ -10,6 +10,11 @@ parameters:
- name: finalJoinCondition
type: boolean
+#### repo parameters ####
+- name: isBuiltFromVmr
+ displayName: True when build is running from dotnet/dotnet directly
+ type: boolean
+
# These are not expected to be passed it but rather just object variables reused below
- name: pool_Linux
type: object
@@ -66,8 +71,12 @@ stages:
- ${{ if ne(stage.templateContext.validationOnly, 'true') }}:
- ${{ stage.stage }}
variables:
- - name: vmrPath
- value: $(Build.SourcesDirectory)
+ - ${{ if parameters.isBuiltFromVmr }}:
+ - name: vmrPath
+ value: $(Build.SourcesDirectory)
+ - ${{ else }}:
+ - name: vmrPath
+ value: $(Agent.BuildDirectory)/vmr
- template: ../variables/vmr-build.yml
jobs:
- job: FinalJoin
@@ -129,6 +138,11 @@ stages:
inputs:
path: $(Build.ArtifactStagingDirectory)/VerticalArtifacts/${{ vertical.job }}
artifactName: ${{ vertical.job }}_Artifacts
+ - ${{ if not(parameters.isBuiltFromVmr) }}:
+ - template: /eng/common/templates/steps/vmr-pull-updates.yml@self
+ parameters:
+ vmrPath: ${{ variables.vmrPath }}
+ targetRef: $(Build.SourceVersion) # Synchronize the current repo commit
- template: ../steps/vmr-join-verticals.yml
parameters:
dotNetBuildPass: final
diff --git a/eng/pipelines/templates/stages/vmr-build.yml b/eng/pipelines/templates/stages/vmr-build.yml
index 9e6f35126c7..7da7b66e898 100644
--- a/eng/pipelines/templates/stages/vmr-build.yml
+++ b/eng/pipelines/templates/stages/vmr-build.yml
@@ -21,6 +21,11 @@ parameters:
# run everything
- full
+# True when build is running from dotnet/dotnet directly
+- name: isBuiltFromVmr
+ type: boolean
+ default: true
+
# True when building the VMR in source-only mode
- name: isSourceOnlyBuild
type: boolean
@@ -76,15 +81,17 @@ stages:
parameters:
desiredSigning: ${{ parameters.desiredSigning }}
desiredIbc: ${{ parameters.desiredIbc }}
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
scope: ${{ parameters.scope }}
isSourceOnlyBuild: ${{ parameters.isSourceOnlyBuild }}
finalJoinCondition: ${{ and(not(parameters.isSourceOnlyBuild), eq(parameters.scope, 'full')) }}
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
postJoinStages:
- - ${{ if and(not(parameters.isSourceOnlyBuild), eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}:
+ - ${{ if and(parameters.isBuiltFromVmr, not(parameters.isSourceOnlyBuild), eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}:
- stage: Publish_Build_Assets
displayName: Publish Assets
jobs:
- - template: /eng/common/templates-official/job/publish-build-assets.yml@self
+ - template: /eng/common/templates-official/job/publish-build-assets.yml
parameters:
publishUsingPipelines: true
publishAssetsImmediately: true
@@ -104,11 +111,13 @@ stages:
pool_LinuxArm64: ${{ parameters.pool_LinuxArm64 }}
scope: ${{ parameters.scope }}
useMicrosoftBuildAssetsForTests: false
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
- ${{ else }}:
- template: source-build-stages.yml
parameters:
pool_Linux: ${{ parameters.pool_Linux }}
pool_LinuxArm64: ${{ parameters.pool_LinuxArm64 }}
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
scope: ultralite
# Temporarily needed to enable SB PR legs from the unified build pipeline
diff --git a/eng/pipelines/templates/stages/vmr-verticals.yml b/eng/pipelines/templates/stages/vmr-verticals.yml
index 906d2172696..1971666bfdf 100644
--- a/eng/pipelines/templates/stages/vmr-verticals.yml
+++ b/eng/pipelines/templates/stages/vmr-verticals.yml
@@ -21,6 +21,11 @@ parameters:
# run everything
- full
+# True when build is running from dotnet/dotnet directly
+- name: isBuiltFromVmr
+ type: boolean
+ default: true
+
# True when building the VMR in source-only mode
- name: isSourceOnlyBuild
type: boolean
@@ -84,6 +89,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: ${{ format('{0}_Ubuntu_BuildTests', variables.ubuntuName) }}
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
pool: ${{ parameters.pool_Linux }}
container:
name: ${{ variables.ubuntuContainerName }}
@@ -96,6 +102,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: Windows_BuildTests
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
pool: ${{ parameters.pool_Windows }}
targetOS: windows
targetArchitecture: x64
@@ -116,6 +123,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: Windows
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
signDac: ${{ variables.signDacEnabled }}
pool: ${{ parameters.pool_Windows }}
@@ -126,6 +134,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: Windows
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
signDac: ${{ variables.signDacEnabled }}
pool: ${{ parameters.pool_Windows }}
@@ -135,6 +144,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: Android_Shortstack
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Linux_Shortstack }}
container:
@@ -146,6 +156,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: Browser_Shortstack
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Linux_Shortstack }}
container:
@@ -158,6 +169,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: iOSSimulator_Shortstack
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Mac }}
targetOS: iossimulator
@@ -169,6 +181,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: Android_Shortstack
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Linux_Shortstack }}
container:
@@ -180,6 +193,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: Android_Shortstack
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Linux_Shortstack }}
container:
@@ -191,6 +205,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: Android_Shortstack
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Linux_Shortstack }}
container:
@@ -202,6 +217,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: Browser_Multithreaded_Shortstack
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Linux_Shortstack }}
container:
@@ -215,6 +231,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: LinuxBionic_Shortstack
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Linux_Shortstack }}
container:
@@ -226,6 +243,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: LinuxBionic_Shortstack
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Linux_Shortstack }}
container:
@@ -237,6 +255,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: LinuxBionic_Shortstack
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Linux_Shortstack }}
container:
@@ -248,6 +267,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: iOS_Shortstack
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Mac }}
targetOS: ios
@@ -256,6 +276,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: iOSSimulator_Shortstack
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Mac }}
targetOS: iossimulator
@@ -264,6 +285,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: MacCatalyst_Shortstack
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Mac }}
targetOS: maccatalyst
@@ -272,6 +294,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: MacCatalyst_Shortstack
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Mac }}
targetOS: maccatalyst
@@ -280,6 +303,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: tvOS_Shortstack
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Mac }}
targetOS: tvos
@@ -288,6 +312,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: tvOSSimulator_Shortstack
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Mac }}
targetOS: tvossimulator
@@ -296,6 +321,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: tvOSSimulator_Shortstack
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Mac }}
targetOS: tvossimulator
@@ -304,6 +330,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: Wasi_Shortstack
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Linux_Shortstack }}
container:
@@ -316,6 +343,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: OSX
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Mac }}
targetOS: osx
@@ -324,6 +352,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: OSX_Shortstack_Mono_LLVMAOT
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Mac }}
useMonoRuntime: true
@@ -334,6 +363,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: AzureLinux_x64_Cross
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Linux }}
container:
@@ -346,6 +376,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: AzureLinux_x64_Cross_Pgo
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: false
pool: ${{ parameters.pool_Linux }}
container:
@@ -359,6 +390,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: AzureLinux_x64_Cross_Shortstack_Mono_LLVMAOT
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Linux_Shortstack }}
container:
@@ -373,6 +405,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: AzureLinux_x64_Cross
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Linux }}
container:
@@ -385,6 +418,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: AzureLinux_x64_Cross
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Linux }}
container:
@@ -397,6 +431,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: AzureLinux_x64_Cross_Pgo
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: false
pool: ${{ parameters.pool_Linux }}
container:
@@ -410,6 +445,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: AzureLinux_x64_Cross_Alpine
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Linux }}
container:
@@ -423,6 +459,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: AzureLinux_x64_Cross_Alpine
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Linux }}
container:
@@ -436,6 +473,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: AzureLinux_x64_Cross_Alpine
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Linux }}
container:
@@ -449,6 +487,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: AzureLinux_x64_Cross_Shortstack_Mono_LLVMAOT
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Linux_Shortstack }}
container:
@@ -463,6 +502,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: OSX
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Mac }}
targetOS: osx
@@ -471,6 +511,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: Windows
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
signDac: ${{ variables.signDacEnabled }}
pool: ${{ parameters.pool_Windows }}
@@ -481,6 +522,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: Windows_Pgo
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: false
pool: ${{ parameters.pool_Windows }}
targetOS: windows
@@ -490,6 +532,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: Windows_Pgo
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: false
pool: ${{ parameters.pool_Windows }}
targetOS: windows
@@ -500,6 +543,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: Windows_Pgo
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: false
pool: ${{ parameters.pool_Windows }}
targetOS: windows
@@ -512,6 +556,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: Windows
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
signDac: ${{ variables.signDacEnabled }}
pool: ${{ parameters.pool_Windows }}
@@ -533,6 +578,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: Windows
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Windows }}
targetOS: windows
@@ -547,6 +593,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: Windows_Workloads
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Windows }}
targetOS: windows
@@ -579,6 +626,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: Windows
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Windows }}
targetOS: windows
@@ -593,6 +641,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: Windows
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Windows }}
targetOS: windows
@@ -607,6 +656,7 @@ stages:
- template: ../jobs/vmr-build.yml
parameters:
buildName: Windows
+ isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Windows }}
targetOS: windows
diff --git a/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/UpdateNuGetConfigPackageSourcesMappings.cs b/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/UpdateNuGetConfigPackageSourcesMappings.cs
index 5a6c99ae3bc..4bc201c91c2 100644
--- a/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/UpdateNuGetConfigPackageSourcesMappings.cs
+++ b/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/UpdateNuGetConfigPackageSourcesMappings.cs
@@ -81,7 +81,7 @@ public override bool Execute()
string xml = File.ReadAllText(NuGetConfigFile);
string newLineChars = FileUtilities.DetectNewLineChars(xml);
XDocument document = XDocument.Parse(xml);
- XElement pkgSourcesElement = document.Root.Descendants().FirstOrDefault(e => e.Name == "packageSources");
+ XElement pkgSourcesElement = document.Root.Elements().FirstOrDefault(e => e.Name == "packageSources");
if (pkgSourcesElement == null)
{
Log.LogMessage(MessageImportance.Low, "Package sources are missing.");
@@ -89,7 +89,7 @@ public override bool Execute()
return true;
}
- XElement pkgSrcMappingElement = document.Root.Descendants().FirstOrDefault(e => e.Name == "packageSourceMapping");
+ XElement pkgSrcMappingElement = document.Root.Elements().FirstOrDefault(e => e.Name == "packageSourceMapping");
if (pkgSrcMappingElement == null)
{
pkgSrcMappingElement = new XElement("packageSourceMapping");
@@ -115,7 +115,7 @@ public override bool Execute()
// Remove all packageSourceMappings
pkgSrcMappingElement.ReplaceNodes(new XElement("clear"));
- XElement pkgSrcMappingClearElement = pkgSrcMappingElement.Descendants().FirstOrDefault(e => e.Name == "clear");
+ XElement pkgSrcMappingClearElement = pkgSrcMappingElement.Elements().FirstOrDefault(e => e.Name == "clear");
// Add package source mappings for local package sources
foreach (string packageSource in allSourcesPackages.Keys)
diff --git a/prereqs/git-info/aspnetcore.props b/prereqs/git-info/aspnetcore.props
index ba97b21e61f..f095ff93c61 100644
--- a/prereqs/git-info/aspnetcore.props
+++ b/prereqs/git-info/aspnetcore.props
@@ -1,8 +1,8 @@
- 92072c79ed8c2c86b093ebd676d531f5e5bf406b
- 20250513.4
- 10.0.0-preview.5.25263.4
+ 343594eb69a5aa15377465351bb4381d9cee30c5
+ 20250514.4
+ 10.0.0-preview.5.25264.4
\ No newline at end of file
diff --git a/prereqs/git-info/diagnostics.props b/prereqs/git-info/diagnostics.props
index 9123991a484..82b0400284c 100644
--- a/prereqs/git-info/diagnostics.props
+++ b/prereqs/git-info/diagnostics.props
@@ -1,8 +1,8 @@
- 3a08702ea8e0083a74e10556c60c0bccd868b64a
- 20250512.2
- 9.0.626202
+ a3c354f4ea00123f55276619455569d53c4c402d
+ 20250513.2
+ 9.0.626302
\ No newline at end of file
diff --git a/prereqs/git-info/efcore.props b/prereqs/git-info/efcore.props
index 26e9db422d8..85db6ab251f 100644
--- a/prereqs/git-info/efcore.props
+++ b/prereqs/git-info/efcore.props
@@ -1,8 +1,8 @@
- 7a87abf268190f3a0d5f218e9b0b595360701af3
- 20250512.1
- 10.0.0-preview.4.25262.1
+ 79501924853a69442628f286fb3fc3e165d370d3
+ 20250514.1
+ 10.0.0-preview.4.25264.1
\ No newline at end of file
diff --git a/prereqs/git-info/roslyn.props b/prereqs/git-info/roslyn.props
index c7d2e942eeb..209afcda117 100644
--- a/prereqs/git-info/roslyn.props
+++ b/prereqs/git-info/roslyn.props
@@ -1,8 +1,8 @@
- 4215d71efbdb059bbb092fe9d385c11aba1c8969
- 20250512.9
- 5.0.0-1.25262.9
+ 4358d1222f26078b302f1f79c18dee05a5f2766b
+ 20250514.5
+ 5.0.0-1.25264.5
\ No newline at end of file
diff --git a/src/arcade/eng/common/build.sh b/src/arcade/eng/common/build.sh
index 27ae2c85601..08f99154b7d 100755
--- a/src/arcade/eng/common/build.sh
+++ b/src/arcade/eng/common/build.sh
@@ -129,14 +129,14 @@ while [[ $# > 0 ]]; do
-pack)
pack=true
;;
- -sourcebuild|-sb)
+ -sourcebuild|-source-build|-sb)
build=true
source_build=true
product_build=true
restore=true
pack=true
;;
- -productbuild|-pb)
+ -productbuild|-product-build|-pb)
build=true
product_build=true
restore=true
diff --git a/src/arcade/global.json b/src/arcade/global.json
index 2310fb93991..8696508044b 100644
--- a/src/arcade/global.json
+++ b/src/arcade/global.json
@@ -1,10 +1,10 @@
{
"sdk": {
- "version": "10.0.100-preview.3.25201.16",
+ "version": "10.0.100-preview.5.25230.108",
"rollForward": "latestFeature"
},
"tools": {
- "dotnet": "10.0.100-preview.3.25201.16"
+ "dotnet": "10.0.100-preview.5.25230.108"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25256.1",
diff --git a/src/arcade/src/Microsoft.DotNet.Helix/Sdk/tools/dotnet-cli/DotNetCli.props b/src/arcade/src/Microsoft.DotNet.Helix/Sdk/tools/dotnet-cli/DotNetCli.props
index f90a939fd9a..6540304a0a9 100644
--- a/src/arcade/src/Microsoft.DotNet.Helix/Sdk/tools/dotnet-cli/DotNetCli.props
+++ b/src/arcade/src/Microsoft.DotNet.Helix/Sdk/tools/dotnet-cli/DotNetCli.props
@@ -3,7 +3,7 @@
false
- 10.0.0-preview.3.25172.1
+ 10.0.0-preview.5.25230.108
runtime
$(BundledNETCoreAppPackageVersion)
diff --git a/src/aspnetcore/eng/Versions.props b/src/aspnetcore/eng/Versions.props
index 5cef785a625..ed056a7a6f7 100644
--- a/src/aspnetcore/eng/Versions.props
+++ b/src/aspnetcore/eng/Versions.props
@@ -325,8 +325,8 @@
$(XunitVersion)
2.8.2
5.2.2
- 2.0.0-preview.17
- 2.0.0-preview.17
+ 2.0.0-preview.18
+ 2.0.0-preview.18
6.0.322601
1.10.93
diff --git a/src/aspnetcore/src/Http/Http.Abstractions/src/PublicAPI.Unshipped.txt b/src/aspnetcore/src/Http/Http.Abstractions/src/PublicAPI.Unshipped.txt
index 2524b5a9cef..8cb332fa9f2 100644
--- a/src/aspnetcore/src/Http/Http.Abstractions/src/PublicAPI.Unshipped.txt
+++ b/src/aspnetcore/src/Http/Http.Abstractions/src/PublicAPI.Unshipped.txt
@@ -24,7 +24,7 @@ Microsoft.AspNetCore.Http.Validation.ValidateContext.CurrentDepth.set -> void
Microsoft.AspNetCore.Http.Validation.ValidateContext.CurrentValidationPath.get -> string!
Microsoft.AspNetCore.Http.Validation.ValidateContext.CurrentValidationPath.set -> void
Microsoft.AspNetCore.Http.Validation.ValidateContext.ValidateContext() -> void
-Microsoft.AspNetCore.Http.Validation.ValidateContext.ValidationContext.get -> System.ComponentModel.DataAnnotations.ValidationContext?
+Microsoft.AspNetCore.Http.Validation.ValidateContext.ValidationContext.get -> System.ComponentModel.DataAnnotations.ValidationContext!
Microsoft.AspNetCore.Http.Validation.ValidateContext.ValidationContext.set -> void
Microsoft.AspNetCore.Http.Validation.ValidateContext.ValidationErrors.get -> System.Collections.Generic.Dictionary?
Microsoft.AspNetCore.Http.Validation.ValidateContext.ValidationErrors.set -> void
diff --git a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatableParameterInfo.cs b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatableParameterInfo.cs
index 9fba8ab854b..48de32c0daf 100644
--- a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatableParameterInfo.cs
+++ b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatableParameterInfo.cs
@@ -3,7 +3,6 @@
using System.Collections;
using System.ComponentModel.DataAnnotations;
-using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace Microsoft.AspNetCore.Http.Validation;
@@ -60,8 +59,6 @@ protected ValidatableParameterInfo(
///
public virtual async Task ValidateAsync(object? value, ValidateContext context, CancellationToken cancellationToken)
{
- Debug.Assert(context.ValidationContext is not null);
-
// Skip validation if value is null and parameter is optional
if (value == null && ParameterType.IsNullable())
{
diff --git a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatablePropertyInfo.cs b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatablePropertyInfo.cs
index 167d5450046..0b16e34d1dc 100644
--- a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatablePropertyInfo.cs
+++ b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatablePropertyInfo.cs
@@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System.ComponentModel.DataAnnotations;
-using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace Microsoft.AspNetCore.Http.Validation;
@@ -61,8 +60,6 @@ protected ValidatablePropertyInfo(
///
public virtual async Task ValidateAsync(object? value, ValidateContext context, CancellationToken cancellationToken)
{
- Debug.Assert(context.ValidationContext is not null);
-
var property = DeclaringType.GetProperty(Name) ?? throw new InvalidOperationException($"Property '{Name}' not found on type '{DeclaringType.Name}'.");
var propertyValue = property.GetValue(value);
var validationAttributes = GetValidationAttributes();
diff --git a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatableTypeInfo.cs b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatableTypeInfo.cs
index 82ae03465f9..6245c43c1b6 100644
--- a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatableTypeInfo.cs
+++ b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatableTypeInfo.cs
@@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System.ComponentModel.DataAnnotations;
-using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
@@ -45,7 +44,6 @@ protected ValidatableTypeInfo(
///
public virtual async Task ValidateAsync(object? value, ValidateContext context, CancellationToken cancellationToken)
{
- Debug.Assert(context.ValidationContext is not null);
if (value == null)
{
return;
diff --git a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidateContext.cs b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidateContext.cs
index 3e02c35a472..d38ada2ddeb 100644
--- a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidateContext.cs
+++ b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidateContext.cs
@@ -16,7 +16,24 @@ public sealed class ValidateContext
/// Gets or sets the validation context used for validating objects that implement or have .
/// This context provides access to service provider and other validation metadata.
///
- public ValidationContext? ValidationContext { get; set; }
+ ///
+ /// This property should be set by the consumer of the
+ /// interface to provide the necessary context for validation. The object should be initialized
+ /// with the current object being validated, the display name, and the service provider to support
+ /// the complete set of validation scenarios.
+ ///
+ ///
+ ///
+ /// var validationContext = new ValidationContext(objectToValidate, serviceProvider, items);
+ /// var validationOptions = serviceProvider.GetService<IOptions<ValidationOptions>>()?.Value;
+ /// var validateContext = new ValidateContext
+ /// {
+ /// ValidationContext = validationContext,
+ /// ValidationOptions = validationOptions
+ /// };
+ ///
+ ///
+ public required ValidationContext ValidationContext { get; set; }
///
/// Gets or sets the prefix used to identify the current object being validated in a complex object graph.
diff --git a/src/aspnetcore/src/Http/Http.Abstractions/test/Validation/ValidatableTypeInfoTests.cs b/src/aspnetcore/src/Http/Http.Abstractions/test/Validation/ValidatableTypeInfoTests.cs
index 98e74bd9d32..a6123bb11c6 100644
--- a/src/aspnetcore/src/Http/Http.Abstractions/test/Validation/ValidatableTypeInfoTests.cs
+++ b/src/aspnetcore/src/Http/Http.Abstractions/test/Validation/ValidatableTypeInfoTests.cs
@@ -41,17 +41,16 @@ [new RequiredAttribute()])
{ typeof(Address), addressType }
});
- var context = new ValidateContext
- {
- ValidationOptions = validationOptions,
- };
-
var personWithMissingRequiredFields = new Person
{
Age = 150, // Invalid age
Address = new Address() // Missing required City and Street
};
- context.ValidationContext = new ValidationContext(personWithMissingRequiredFields);
+ var context = new ValidateContext
+ {
+ ValidationOptions = validationOptions,
+ ValidationContext = new ValidationContext(personWithMissingRequiredFields)
+ };
// Act
await personType.ValidateAsync(personWithMissingRequiredFields, context, default);
@@ -96,21 +95,20 @@ [new RequiredAttribute()]),
[])
]);
- var context = new ValidateContext
- {
- ValidationOptions = new TestValidationOptions(new Dictionary
- {
- { typeof(Employee), employeeType }
- })
- };
-
var employee = new Employee
{
Name = "John Doe",
Department = "IT",
Salary = -5000 // Negative salary will trigger IValidatableObject validation
};
- context.ValidationContext = new ValidationContext(employee);
+ var context = new ValidateContext
+ {
+ ValidationOptions = new TestValidationOptions(new Dictionary
+ {
+ { typeof(Employee), employeeType }
+ }),
+ ValidationContext = new ValidationContext(employee)
+ };
// Act
await employeeType.ValidateAsync(employee, context, default);
@@ -142,22 +140,21 @@ [new RequiredAttribute()])
[new RangeAttribute(2, 5)])
]);
+ var car = new Car
+ {
+ // Missing Make and Model (required in base type)
+ Doors = 7 // Invalid number of doors
+ };
var context = new ValidateContext
{
ValidationOptions = new TestValidationOptions(new Dictionary
{
{ typeof(Vehicle), baseType },
{ typeof(Car), derivedType }
- })
+ }),
+ ValidationContext = new ValidationContext(car)
};
- var car = new Car
- {
- // Missing Make and Model (required in base type)
- Doors = 7 // Invalid number of doors
- };
- context.ValidationContext = new ValidationContext(car);
-
// Act
await derivedType.ValidateAsync(car, context, default);
@@ -203,15 +200,6 @@ [new RequiredAttribute()]),
[])
]);
- var context = new ValidateContext
- {
- ValidationOptions = new TestValidationOptions(new Dictionary
- {
- { typeof(OrderItem), itemType },
- { typeof(Order), orderType }
- })
- };
-
var order = new Order
{
OrderNumber = "ORD-12345",
@@ -222,7 +210,15 @@ [new RequiredAttribute()]),
new OrderItem { ProductName = "Another Product", Quantity = 200 /* Invalid quantity */ }
]
};
- context.ValidationContext = new ValidationContext(order);
+ var context = new ValidateContext
+ {
+ ValidationOptions = new TestValidationOptions(new Dictionary
+ {
+ { typeof(OrderItem), itemType },
+ { typeof(Order), orderType }
+ }),
+ ValidationContext = new ValidationContext(order)
+ };
// Act
await orderType.ValidateAsync(order, context, default);
@@ -260,20 +256,19 @@ public async Task Validate_HandlesNullValues_Appropriately()
[])
]);
+ var person = new Person
+ {
+ Name = null,
+ Address = null
+ };
var context = new ValidateContext
{
ValidationOptions = new TestValidationOptions(new Dictionary
{
{ typeof(Person), personType }
- })
- };
-
- var person = new Person
- {
- Name = null,
- Address = null
+ }),
+ ValidationContext = new ValidationContext(person)
};
- context.ValidationContext = new ValidationContext(person);
// Act
await personType.ValidateAsync(person, context, default);
@@ -305,12 +300,6 @@ [new RequiredAttribute()]),
});
validationOptions.MaxDepth = 3; // Set a small max depth to trigger the limit
- var context = new ValidateContext
- {
- ValidationOptions = validationOptions,
- ValidationErrors = []
- };
-
// Create a deep tree with circular references
var rootNode = new TreeNode { Name = "Root" };
var level1 = new TreeNode { Name = "Level1", Parent = rootNode };
@@ -328,7 +317,12 @@ [new RequiredAttribute()]),
// Add a circular reference
level5.Children.Add(rootNode);
- context.ValidationContext = new ValidationContext(rootNode);
+ var context = new ValidateContext
+ {
+ ValidationOptions = validationOptions,
+ ValidationErrors = [],
+ ValidationContext = new ValidationContext(rootNode)
+ };
// Act + Assert
var exception = await Assert.ThrowsAsync(
@@ -349,17 +343,16 @@ public async Task Validate_HandlesCustomValidationAttributes()
CreatePropertyInfo(typeof(Product), typeof(string), "SKU", "SKU", [new RequiredAttribute(), new CustomSkuValidationAttribute()]),
]);
+ var product = new Product { SKU = "INVALID-SKU" };
var context = new ValidateContext
{
ValidationOptions = new TestValidationOptions(new Dictionary
{
{ typeof(Product), productType }
- })
+ }),
+ ValidationContext = new ValidationContext(product)
};
- var product = new Product { SKU = "INVALID-SKU" };
- context.ValidationContext = new ValidationContext(product);
-
// Act
await productType.ValidateAsync(product, context, default);
@@ -385,17 +378,16 @@ public async Task Validate_HandlesMultipleErrorsOnSameProperty()
])
]);
+ var user = new User { Password = "abc" }; // Too short and not complex enough
var context = new ValidateContext
{
ValidationOptions = new TestValidationOptions(new Dictionary
{
{ typeof(User), userType }
- })
+ }),
+ ValidationContext = new ValidationContext(user)
};
- var user = new User { Password = "abc" }; // Too short and not complex enough
- context.ValidationContext = new ValidationContext(user);
-
// Act
await userType.ValidateAsync(user, context, default);
@@ -429,6 +421,11 @@ public async Task Validate_HandlesMultiLevelInheritance()
CreatePropertyInfo(typeof(DerivedEntity), typeof(string), "Name", "Name", [new RequiredAttribute()])
]);
+ var entity = new DerivedEntity
+ {
+ Name = "", // Invalid: required
+ CreatedAt = DateTime.Now.AddDays(1) // Invalid: future date
+ };
var context = new ValidateContext
{
ValidationOptions = new TestValidationOptions(new Dictionary
@@ -436,16 +433,10 @@ public async Task Validate_HandlesMultiLevelInheritance()
{ typeof(BaseEntity), baseType },
{ typeof(IntermediateEntity), intermediateType },
{ typeof(DerivedEntity), derivedType }
- })
+ }),
+ ValidationContext = new ValidationContext(entity)
};
- var entity = new DerivedEntity
- {
- Name = "", // Invalid: required
- CreatedAt = DateTime.Now.AddDays(1) // Invalid: future date
- };
- context.ValidationContext = new ValidationContext(entity);
-
// Act
await derivedType.ValidateAsync(entity, context, default);
@@ -475,17 +466,16 @@ public async Task Validate_RequiredOnPropertyShortCircuitsOtherValidations()
[new RequiredAttribute(), new PasswordComplexityAttribute()])
]);
+ var user = new User { Password = null }; // Invalid: required
var context = new ValidateContext
{
ValidationOptions = new TestValidationOptions(new Dictionary
{
{ typeof(User), userType }
- })
+ }),
+ ValidationContext = new ValidationContext(user) // Invalid: required
};
- var user = new User { Password = null }; // Invalid: required
- context.ValidationContext = new ValidationContext(user);
-
// Act
await userType.ValidateAsync(user, context, default);
@@ -503,18 +493,17 @@ public async Task Validate_IValidatableObject_WithZeroAndMultipleMemberNames_Beh
var globalType = new TestValidatableTypeInfo(
typeof(GlobalErrorObject),
[]); // no properties – nothing sets MemberName
+ var globalErrorInstance = new GlobalErrorObject { Data = -1 };
var context = new ValidateContext
{
ValidationOptions = new TestValidationOptions(new Dictionary
{
{ typeof(GlobalErrorObject), globalType }
- })
+ }),
+ ValidationContext = new ValidationContext(globalErrorInstance)
};
- var globalErrorInstance = new GlobalErrorObject { Data = -1 };
- context.ValidationContext = new ValidationContext(globalErrorInstance);
-
await globalType.ValidateAsync(globalErrorInstance, context, default);
Assert.NotNull(context.ValidationErrors);
diff --git a/src/aspnetcore/src/Http/Http.Extensions/gen/Microsoft.AspNetCore.Http.ValidationsGenerator/Emitters/ValidationsGenerator.Emitter.cs b/src/aspnetcore/src/Http/Http.Extensions/gen/Microsoft.AspNetCore.Http.ValidationsGenerator/Emitters/ValidationsGenerator.Emitter.cs
index b929819c591..5d4e9fdaba5 100644
--- a/src/aspnetcore/src/Http/Http.Extensions/gen/Microsoft.AspNetCore.Http.ValidationsGenerator/Emitters/ValidationsGenerator.Emitter.cs
+++ b/src/aspnetcore/src/Http/Http.Extensions/gen/Microsoft.AspNetCore.Http.ValidationsGenerator/Emitters/ValidationsGenerator.Emitter.cs
@@ -67,6 +67,7 @@ public GeneratedValidatablePropertyInfo(
Name = name;
}
+ [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
internal global::System.Type ContainingType { get; }
internal string Name { get; }
@@ -124,10 +125,11 @@ file static class GeneratedServiceCollectionExtensions
{{GeneratedCodeAttribute}}
file static class ValidationAttributeCache
{
- private sealed record CacheKey(global::System.Type ContainingType, string PropertyName);
+ private sealed record CacheKey([property: global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] global::System.Type ContainingType, string PropertyName);
private static readonly global::System.Collections.Concurrent.ConcurrentDictionary _cache = new();
public static global::System.ComponentModel.DataAnnotations.ValidationAttribute[] GetValidationAttributes(
+ [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
global::System.Type containingType,
string propertyName)
{
diff --git a/src/aspnetcore/src/Http/Http.Extensions/gen/Microsoft.AspNetCore.Http.ValidationsGenerator/Extensions/ITypeSymbolExtensions.cs b/src/aspnetcore/src/Http/Http.Extensions/gen/Microsoft.AspNetCore.Http.ValidationsGenerator/Extensions/ITypeSymbolExtensions.cs
index 89392a93849..0cd85d9df75 100644
--- a/src/aspnetcore/src/Http/Http.Extensions/gen/Microsoft.AspNetCore.Http.ValidationsGenerator/Extensions/ITypeSymbolExtensions.cs
+++ b/src/aspnetcore/src/Http/Http.Extensions/gen/Microsoft.AspNetCore.Http.ValidationsGenerator/Extensions/ITypeSymbolExtensions.cs
@@ -124,4 +124,18 @@ internal static bool IsExemptType(this ITypeSymbol type, WellKnownTypes wellKnow
return null;
}
+
+ ///
+ /// Checks if the parameter is marked with [FromService] or [FromKeyedService] attributes.
+ ///
+ /// The parameter to check.
+ /// The symbol representing the [FromService] attribute.
+ /// The symbol representing the [FromKeyedService] attribute.
+ internal static bool IsServiceParameter(this IParameterSymbol parameter, INamedTypeSymbol fromServiceMetadataSymbol, INamedTypeSymbol fromKeyedServiceAttributeSymbol)
+ {
+ return parameter.GetAttributes().Any(attr =>
+ attr.AttributeClass is not null &&
+ (attr.AttributeClass.ImplementsInterface(fromServiceMetadataSymbol) ||
+ SymbolEqualityComparer.Default.Equals(attr.AttributeClass, fromKeyedServiceAttributeSymbol)));
+ }
}
diff --git a/src/aspnetcore/src/Http/Http.Extensions/gen/Microsoft.AspNetCore.Http.ValidationsGenerator/Parsers/ValidationsGenerator.TypesParser.cs b/src/aspnetcore/src/Http/Http.Extensions/gen/Microsoft.AspNetCore.Http.ValidationsGenerator/Parsers/ValidationsGenerator.TypesParser.cs
index dd0092f31fd..482a90c334b 100644
--- a/src/aspnetcore/src/Http/Http.Extensions/gen/Microsoft.AspNetCore.Http.ValidationsGenerator/Parsers/ValidationsGenerator.TypesParser.cs
+++ b/src/aspnetcore/src/Http/Http.Extensions/gen/Microsoft.AspNetCore.Http.ValidationsGenerator/Parsers/ValidationsGenerator.TypesParser.cs
@@ -25,10 +25,23 @@ internal ImmutableArray ExtractValidatableTypes(IInvocationOper
var parameters = operation.TryGetRouteHandlerMethod(operation.SemanticModel, out var method)
? method.Parameters
: [];
+
+ var fromServiceMetadataSymbol = wellKnownTypes.Get(
+ WellKnownTypeData.WellKnownType.Microsoft_AspNetCore_Http_Metadata_IFromServiceMetadata);
+ var fromKeyedServiceAttributeSymbol = wellKnownTypes.Get(
+ WellKnownTypeData.WellKnownType.Microsoft_Extensions_DependencyInjection_FromKeyedServicesAttribute);
+
var validatableTypes = new HashSet(ValidatableTypeComparer.Instance);
List visitedTypes = [];
+
foreach (var parameter in parameters)
{
+ // Skip parameters that are injected as services
+ if (parameter.IsServiceParameter(fromServiceMetadataSymbol, fromKeyedServiceAttributeSymbol))
+ {
+ continue;
+ }
+
_ = TryExtractValidatableType(parameter.Type, wellKnownTypes, ref validatableTypes, ref visitedTypes);
}
return [.. validatableTypes];
diff --git a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGenerator.IValidatableObject.cs b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGenerator.IValidatableObject.cs
index d50498d4a99..70f1d725bc7 100644
--- a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGenerator.IValidatableObject.cs
+++ b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGenerator.IValidatableObject.cs
@@ -15,16 +15,23 @@ public async Task CanValidateIValidatableObject()
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Validation;
+using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection;
var builder = WebApplication.CreateBuilder();
builder.Services.AddSingleton();
+builder.Services.AddKeyedSingleton("serviceKey");
builder.Services.AddValidation();
var app = builder.Build();
-app.MapPost("/validatable-object", (ComplexValidatableType model) => Results.Ok());
+app.MapPost("/validatable-object", (
+ ComplexValidatableType model,
+ // Demonstrates that parameters that are annotated with [FromService] are not processed
+ // by the source generator and not emitted as ValidatableTypes in the generated code.
+ [FromServices] IRangeService rangeService,
+ [FromKeyedServices("serviceKey")] TestService testService) => Results.Ok(rangeService.GetMinimum()));
app.Run();
@@ -86,6 +93,12 @@ public class RangeService : IRangeService
public int GetMinimum() => 10;
public int GetMaximum() => 100;
}
+
+public class TestService
+{
+ [Range(10, 100)]
+ public int Value { get; set; } = 4;
+}
""";
await Verify(source, out var compilation);
diff --git a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGenerator.Parameters.cs b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGenerator.Parameters.cs
index 3be6e96fe7a..7494e27efa2 100644
--- a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGenerator.Parameters.cs
+++ b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGenerator.Parameters.cs
@@ -16,21 +16,30 @@ public async Task CanValidateParameters()
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Validation;
+using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection;
var builder = WebApplication.CreateBuilder();
builder.Services.AddValidation();
+builder.Services.AddSingleton();
+builder.Services.AddKeyedSingleton("serviceKey");
var app = builder.Build();
app.MapGet("/params", (
+ // Skipped from validation because it is resolved as a service by IServiceProviderIsService
+ TestService testService,
+ // Skipped from validation because it is marked as a [FromKeyedService] parameter
+ [FromKeyedServices("serviceKey")] TestService testService2,
[Range(10, 100)] int value1,
[Range(10, 100), Display(Name = "Valid identifier")] int value2,
[Required] string value3 = "some-value",
[CustomValidation(ErrorMessage = "Value must be an even number")] int value4 = 4,
- [CustomValidation, Range(10, 100)] int value5 = 10) => "OK");
+ [CustomValidation, Range(10, 100)] int value5 = 10,
+ // Skipped from validation because it is marked as a [FromService] parameter
+ [FromServices] [Range(10, 100)] int? value6 = 4) => "OK");
app.Run();
@@ -38,6 +47,12 @@ public class CustomValidationAttribute : ValidationAttribute
{
public override bool IsValid(object? value) => value is int number && number % 2 == 0;
}
+
+public class TestService
+{
+ [Range(10, 100)]
+ public int Value { get; set; } = 4;
+}
""";
await Verify(source, out var compilation);
await VerifyEndpoint(compilation, "/params", async (endpoint, serviceProvider) =>
diff --git a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateComplexTypes#ValidatableInfoResolver.g.verified.cs b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateComplexTypes#ValidatableInfoResolver.g.verified.cs
index 046365541ef..74899270ca0 100644
--- a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateComplexTypes#ValidatableInfoResolver.g.verified.cs
+++ b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateComplexTypes#ValidatableInfoResolver.g.verified.cs
@@ -39,6 +39,7 @@ public GeneratedValidatablePropertyInfo(
Name = name;
}
+ [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
internal global::System.Type ContainingType { get; }
internal string Name { get; }
@@ -207,10 +208,11 @@ file static class GeneratedServiceCollectionExtensions
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.Http.ValidationsGenerator, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file static class ValidationAttributeCache
{
- private sealed record CacheKey(global::System.Type ContainingType, string PropertyName);
+ private sealed record CacheKey([property: global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] global::System.Type ContainingType, string PropertyName);
private static readonly global::System.Collections.Concurrent.ConcurrentDictionary _cache = new();
public static global::System.ComponentModel.DataAnnotations.ValidationAttribute[] GetValidationAttributes(
+ [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
global::System.Type containingType,
string propertyName)
{
diff --git a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateIValidatableObject#ValidatableInfoResolver.g.verified.cs b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateIValidatableObject#ValidatableInfoResolver.g.verified.cs
index 5babdce85f2..997eecca5ec 100644
--- a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateIValidatableObject#ValidatableInfoResolver.g.verified.cs
+++ b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateIValidatableObject#ValidatableInfoResolver.g.verified.cs
@@ -39,6 +39,7 @@ public GeneratedValidatablePropertyInfo(
Name = name;
}
+ [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
internal global::System.Type ContainingType { get; }
internal string Name { get; }
@@ -158,10 +159,11 @@ file static class GeneratedServiceCollectionExtensions
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.Http.ValidationsGenerator, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file static class ValidationAttributeCache
{
- private sealed record CacheKey(global::System.Type ContainingType, string PropertyName);
+ private sealed record CacheKey([property: global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] global::System.Type ContainingType, string PropertyName);
private static readonly global::System.Collections.Concurrent.ConcurrentDictionary _cache = new();
public static global::System.ComponentModel.DataAnnotations.ValidationAttribute[] GetValidationAttributes(
+ [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
global::System.Type containingType,
string propertyName)
{
diff --git a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateParameters#ValidatableInfoResolver.g.verified.cs b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateParameters#ValidatableInfoResolver.g.verified.cs
index ddd57a0dc8b..2b7c2a0c272 100644
--- a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateParameters#ValidatableInfoResolver.g.verified.cs
+++ b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateParameters#ValidatableInfoResolver.g.verified.cs
@@ -39,6 +39,7 @@ public GeneratedValidatablePropertyInfo(
Name = name;
}
+ [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
internal global::System.Type ContainingType { get; }
internal string Name { get; }
@@ -61,6 +62,11 @@ public GeneratedValidatableTypeInfo(
public bool TryGetValidatableTypeInfo(global::System.Type type, [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out global::Microsoft.AspNetCore.Http.Validation.IValidatableInfo? validatableInfo)
{
validatableInfo = null;
+ if (type == typeof(global::TestService))
+ {
+ validatableInfo = CreateTestService();
+ return true;
+ }
return false;
}
@@ -72,6 +78,20 @@ public bool TryGetValidatableParameterInfo(global::System.Reflection.ParameterIn
return false;
}
+ private ValidatableTypeInfo CreateTestService()
+ {
+ return new GeneratedValidatableTypeInfo(
+ type: typeof(global::TestService),
+ members: [
+ new GeneratedValidatablePropertyInfo(
+ containingType: typeof(global::TestService),
+ propertyType: typeof(int),
+ name: "Value",
+ displayName: "Value"
+ ),
+ ]
+ );
+ }
}
@@ -96,10 +116,11 @@ file static class GeneratedServiceCollectionExtensions
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.Http.ValidationsGenerator, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file static class ValidationAttributeCache
{
- private sealed record CacheKey(global::System.Type ContainingType, string PropertyName);
+ private sealed record CacheKey([property: global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] global::System.Type ContainingType, string PropertyName);
private static readonly global::System.Collections.Concurrent.ConcurrentDictionary _cache = new();
public static global::System.ComponentModel.DataAnnotations.ValidationAttribute[] GetValidationAttributes(
+ [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
global::System.Type containingType,
string propertyName)
{
diff --git a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidatePolymorphicTypes#ValidatableInfoResolver.g.verified.cs b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidatePolymorphicTypes#ValidatableInfoResolver.g.verified.cs
index d435bf7996f..b85bdf853f4 100644
--- a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidatePolymorphicTypes#ValidatableInfoResolver.g.verified.cs
+++ b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidatePolymorphicTypes#ValidatableInfoResolver.g.verified.cs
@@ -39,6 +39,7 @@ public GeneratedValidatablePropertyInfo(
Name = name;
}
+ [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
internal global::System.Type ContainingType { get; }
internal string Name { get; }
@@ -196,10 +197,11 @@ file static class GeneratedServiceCollectionExtensions
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.Http.ValidationsGenerator, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file static class ValidationAttributeCache
{
- private sealed record CacheKey(global::System.Type ContainingType, string PropertyName);
+ private sealed record CacheKey([property: global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] global::System.Type ContainingType, string PropertyName);
private static readonly global::System.Collections.Concurrent.ConcurrentDictionary _cache = new();
public static global::System.ComponentModel.DataAnnotations.ValidationAttribute[] GetValidationAttributes(
+ [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
global::System.Type containingType,
string propertyName)
{
diff --git a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecordTypes#ValidatableInfoResolver.g.verified.cs b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecordTypes#ValidatableInfoResolver.g.verified.cs
index 2a5085a534a..03a4b0af066 100644
--- a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecordTypes#ValidatableInfoResolver.g.verified.cs
+++ b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecordTypes#ValidatableInfoResolver.g.verified.cs
@@ -39,6 +39,7 @@ public GeneratedValidatablePropertyInfo(
Name = name;
}
+ [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
internal global::System.Type ContainingType { get; }
internal string Name { get; }
@@ -238,10 +239,11 @@ file static class GeneratedServiceCollectionExtensions
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.Http.ValidationsGenerator, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file static class ValidationAttributeCache
{
- private sealed record CacheKey(global::System.Type ContainingType, string PropertyName);
+ private sealed record CacheKey([property: global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] global::System.Type ContainingType, string PropertyName);
private static readonly global::System.Collections.Concurrent.ConcurrentDictionary _cache = new();
public static global::System.ComponentModel.DataAnnotations.ValidationAttribute[] GetValidationAttributes(
+ [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
global::System.Type containingType,
string propertyName)
{
diff --git a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecursiveTypes#ValidatableInfoResolver.g.verified.cs b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecursiveTypes#ValidatableInfoResolver.g.verified.cs
index 7fb61484070..65848f1ab71 100644
--- a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecursiveTypes#ValidatableInfoResolver.g.verified.cs
+++ b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecursiveTypes#ValidatableInfoResolver.g.verified.cs
@@ -39,6 +39,7 @@ public GeneratedValidatablePropertyInfo(
Name = name;
}
+ [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
internal global::System.Type ContainingType { get; }
internal string Name { get; }
@@ -121,10 +122,11 @@ file static class GeneratedServiceCollectionExtensions
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.Http.ValidationsGenerator, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file static class ValidationAttributeCache
{
- private sealed record CacheKey(global::System.Type ContainingType, string PropertyName);
+ private sealed record CacheKey([property: global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] global::System.Type ContainingType, string PropertyName);
private static readonly global::System.Collections.Concurrent.ConcurrentDictionary _cache = new();
public static global::System.ComponentModel.DataAnnotations.ValidationAttribute[] GetValidationAttributes(
+ [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
global::System.Type containingType,
string propertyName)
{
diff --git a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypeWithParsableProperties#ValidatableInfoResolver.g.verified.cs b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypeWithParsableProperties#ValidatableInfoResolver.g.verified.cs
index 03f94852185..716e738ec5b 100644
--- a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypeWithParsableProperties#ValidatableInfoResolver.g.verified.cs
+++ b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypeWithParsableProperties#ValidatableInfoResolver.g.verified.cs
@@ -39,6 +39,7 @@ public GeneratedValidatablePropertyInfo(
Name = name;
}
+ [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
internal global::System.Type ContainingType { get; }
internal string Name { get; }
@@ -163,10 +164,11 @@ file static class GeneratedServiceCollectionExtensions
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.Http.ValidationsGenerator, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file static class ValidationAttributeCache
{
- private sealed record CacheKey(global::System.Type ContainingType, string PropertyName);
+ private sealed record CacheKey([property: global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] global::System.Type ContainingType, string PropertyName);
private static readonly global::System.Collections.Concurrent.ConcurrentDictionary _cache = new();
public static global::System.ComponentModel.DataAnnotations.ValidationAttribute[] GetValidationAttributes(
+ [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
global::System.Type containingType,
string propertyName)
{
diff --git a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypesWithAttribute#ValidatableInfoResolver.g.verified.cs b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypesWithAttribute#ValidatableInfoResolver.g.verified.cs
index 75c87732a0d..34c77a5cb5f 100644
--- a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypesWithAttribute#ValidatableInfoResolver.g.verified.cs
+++ b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypesWithAttribute#ValidatableInfoResolver.g.verified.cs
@@ -39,6 +39,7 @@ public GeneratedValidatablePropertyInfo(
Name = name;
}
+ [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
internal global::System.Type ContainingType { get; }
internal string Name { get; }
@@ -201,10 +202,11 @@ file static class GeneratedServiceCollectionExtensions
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.Http.ValidationsGenerator, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file static class ValidationAttributeCache
{
- private sealed record CacheKey(global::System.Type ContainingType, string PropertyName);
+ private sealed record CacheKey([property: global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] global::System.Type ContainingType, string PropertyName);
private static readonly global::System.Collections.Concurrent.ConcurrentDictionary _cache = new();
public static global::System.ComponentModel.DataAnnotations.ValidationAttribute[] GetValidationAttributes(
+ [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
global::System.Type containingType,
string propertyName)
{
diff --git a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.DoesNotEmitForExemptTypes#ValidatableInfoResolver.g.verified.cs b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.DoesNotEmitForExemptTypes#ValidatableInfoResolver.g.verified.cs
index c5a4eb4152b..fba31434401 100644
--- a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.DoesNotEmitForExemptTypes#ValidatableInfoResolver.g.verified.cs
+++ b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.DoesNotEmitForExemptTypes#ValidatableInfoResolver.g.verified.cs
@@ -39,6 +39,7 @@ public GeneratedValidatablePropertyInfo(
Name = name;
}
+ [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
internal global::System.Type ContainingType { get; }
internal string Name { get; }
@@ -115,10 +116,11 @@ file static class GeneratedServiceCollectionExtensions
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.Http.ValidationsGenerator, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file static class ValidationAttributeCache
{
- private sealed record CacheKey(global::System.Type ContainingType, string PropertyName);
+ private sealed record CacheKey([property: global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] global::System.Type ContainingType, string PropertyName);
private static readonly global::System.Collections.Concurrent.ConcurrentDictionary _cache = new();
public static global::System.ComponentModel.DataAnnotations.ValidationAttribute[] GetValidationAttributes(
+ [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
global::System.Type containingType,
string propertyName)
{
diff --git a/src/aspnetcore/src/Http/Routing/src/ValidationEndpointFilterFactory.cs b/src/aspnetcore/src/Http/Routing/src/ValidationEndpointFilterFactory.cs
index bd9b841fd55..73a41f0f8d5 100644
--- a/src/aspnetcore/src/Http/Routing/src/ValidationEndpointFilterFactory.cs
+++ b/src/aspnetcore/src/Http/Routing/src/ValidationEndpointFilterFactory.cs
@@ -4,7 +4,9 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System.ComponentModel.DataAnnotations;
+using System.Linq;
using System.Reflection;
+using Microsoft.AspNetCore.Http.Metadata;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
@@ -21,6 +23,8 @@ public static EndpointFilterDelegate Create(EndpointFilterFactoryContext context
return next;
}
+ var serviceProviderIsService = context.ApplicationServices.GetService();
+
var parameterCount = parameters.Length;
var validatableParameters = new IValidatableInfo[parameterCount];
var parameterDisplayNames = new string[parameterCount];
@@ -28,6 +32,12 @@ public static EndpointFilterDelegate Create(EndpointFilterFactoryContext context
for (var i = 0; i < parameterCount; i++)
{
+ // Ignore parameters that are resolved from the DI container.
+ if (IsServiceParameter(parameters[i], serviceProviderIsService))
+ {
+ continue;
+ }
+
if (options.TryGetValidatableParameterInfo(parameters[i], out var validatableParameter))
{
validatableParameters[i] = validatableParameter;
@@ -43,7 +53,7 @@ public static EndpointFilterDelegate Create(EndpointFilterFactoryContext context
return async (context) =>
{
- var validatableContext = new ValidateContext { ValidationOptions = options };
+ ValidateContext? validateContext = null;
for (var i = 0; i < context.Arguments.Count; i++)
{
@@ -57,21 +67,41 @@ public static EndpointFilterDelegate Create(EndpointFilterFactoryContext context
}
var validationContext = new ValidationContext(argument, displayName, context.HttpContext.RequestServices, items: null);
- validatableContext.ValidationContext = validationContext;
- await validatableParameter.ValidateAsync(argument, validatableContext, context.HttpContext.RequestAborted);
+
+ if (validateContext == null)
+ {
+ validateContext = new ValidateContext
+ {
+ ValidationOptions = options,
+ ValidationContext = validationContext
+ };
+ }
+ else
+ {
+ validateContext.ValidationContext = validationContext;
+ }
+
+ await validatableParameter.ValidateAsync(argument, validateContext, context.HttpContext.RequestAborted);
}
- if (validatableContext.ValidationErrors is { Count: > 0 })
+ if (validateContext is { ValidationErrors.Count: > 0 })
{
context.HttpContext.Response.StatusCode = StatusCodes.Status400BadRequest;
context.HttpContext.Response.ContentType = "application/problem+json";
- return await ValueTask.FromResult(new HttpValidationProblemDetails(validatableContext.ValidationErrors));
+ return await ValueTask.FromResult(new HttpValidationProblemDetails(validateContext.ValidationErrors));
}
return await next(context);
};
}
+ private static bool IsServiceParameter(ParameterInfo parameterInfo, IServiceProviderIsService? isService)
+ => HasFromServicesAttribute(parameterInfo) ||
+ (isService?.IsService(parameterInfo.ParameterType) == true);
+
+ private static bool HasFromServicesAttribute(ParameterInfo parameterInfo)
+ => parameterInfo.CustomAttributes.OfType().Any();
+
private static string GetDisplayName(ParameterInfo parameterInfo)
{
var displayAttribute = parameterInfo.GetCustomAttribute();
diff --git a/src/aspnetcore/src/Identity/EntityFrameworkCore/test/EF.Test/UserStoreTest.cs b/src/aspnetcore/src/Identity/EntityFrameworkCore/test/EF.Test/UserStoreTest.cs
index f55c2b48340..fe7eb5ee900 100644
--- a/src/aspnetcore/src/Identity/EntityFrameworkCore/test/EF.Test/UserStoreTest.cs
+++ b/src/aspnetcore/src/Identity/EntityFrameworkCore/test/EF.Test/UserStoreTest.cs
@@ -144,6 +144,9 @@ await Assert.ThrowsAsync("user",
await Assert.ThrowsAsync("user", async () => await store.GetTwoFactorEnabledAsync(null));
await Assert.ThrowsAsync("user",
async () => await store.SetTwoFactorEnabledAsync(null, true));
+ await Assert.ThrowsAsync("user", async () => await store.RedeemCodeAsync(user: null, code: "fake", default));
+ await Assert.ThrowsAsync("code", async () => await store.RedeemCodeAsync(new IdentityUser("fake"), code: null, default));
+ await Assert.ThrowsAsync("code", async () => await store.RedeemCodeAsync(new IdentityUser("fake"), code: "", default));
await Assert.ThrowsAsync("user", async () => await store.GetAccessFailedCountAsync(null));
await Assert.ThrowsAsync("user", async () => await store.GetLockoutEnabledAsync(null));
await Assert.ThrowsAsync("user", async () => await store.SetLockoutEnabledAsync(null, false));
diff --git a/src/aspnetcore/src/Identity/Extensions.Stores/src/UserStoreBase.cs b/src/aspnetcore/src/Identity/Extensions.Stores/src/UserStoreBase.cs
index c45dd197e4a..804ebcbad7d 100644
--- a/src/aspnetcore/src/Identity/Extensions.Stores/src/UserStoreBase.cs
+++ b/src/aspnetcore/src/Identity/Extensions.Stores/src/UserStoreBase.cs
@@ -969,7 +969,7 @@ public virtual async Task RedeemCodeAsync(TUser user, string code, Cancell
ThrowIfDisposed();
ArgumentNullThrowHelper.ThrowIfNull(user);
- ArgumentNullThrowHelper.ThrowIfNull(code);
+ ArgumentNullThrowHelper.ThrowIfNullOrEmpty(code);
var mergedCodes = await GetTokenAsync(user, InternalLoginProvider, RecoveryCodeTokenName, cancellationToken).ConfigureAwait(false) ?? "";
var splitCodes = mergedCodes.Split(';');
diff --git a/src/aspnetcore/src/OpenApi/gen/XmlCommentGenerator.Emitter.cs b/src/aspnetcore/src/OpenApi/gen/XmlCommentGenerator.Emitter.cs
index 6b6e7139e37..9dca2b99100 100644
--- a/src/aspnetcore/src/OpenApi/gen/XmlCommentGenerator.Emitter.cs
+++ b/src/aspnetcore/src/OpenApi/gen/XmlCommentGenerator.Emitter.cs
@@ -61,7 +61,6 @@ namespace Microsoft.AspNetCore.OpenApi.Generated
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.Interfaces;
using Microsoft.OpenApi.Models.References;
- using Microsoft.OpenApi.Any;
{{GeneratedCodeAttribute}}
file record XmlComment(
diff --git a/src/aspnetcore/src/OpenApi/perf/Microbenchmarks/TransformersBenchmark.cs b/src/aspnetcore/src/OpenApi/perf/Microbenchmarks/TransformersBenchmark.cs
index b9c3267ca07..dc7a78d517d 100644
--- a/src/aspnetcore/src/OpenApi/perf/Microbenchmarks/TransformersBenchmark.cs
+++ b/src/aspnetcore/src/OpenApi/perf/Microbenchmarks/TransformersBenchmark.cs
@@ -5,7 +5,7 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection;
-using Microsoft.OpenApi.Any;
+using Microsoft.OpenApi.Extensions;
using Microsoft.OpenApi.Models;
namespace Microsoft.AspNetCore.OpenApi.Microbenchmarks;
@@ -105,11 +105,11 @@ public void SchemaTransformer_Setup()
schema.Extensions ??= [];
if (context.JsonTypeInfo.Type == typeof(Todo) && context.ParameterDescription != null)
{
- schema.Extensions["x-my-extension"] = new OpenApiAny(context.ParameterDescription.Name);
+ schema.Extensions["x-my-extension"] = new JsonNodeExtension(context.ParameterDescription.Name);
}
else
{
- schema.Extensions["x-my-extension"] = new OpenApiAny("response");
+ schema.Extensions["x-my-extension"] = new JsonNodeExtension("response");
}
return Task.CompletedTask;
});
@@ -179,11 +179,11 @@ public Task TransformAsync(OpenApiSchema schema, OpenApiSchemaTransformerContext
schema.Extensions ??= [];
if (context.JsonTypeInfo.Type == typeof(Todo) && context.ParameterDescription != null)
{
- schema.Extensions["x-my-extension"] = new OpenApiAny(context.ParameterDescription.Name);
+ schema.Extensions["x-my-extension"] = new JsonNodeExtension(context.ParameterDescription.Name);
}
else
{
- schema.Extensions["x-my-extension"] = new OpenApiAny("response");
+ schema.Extensions["x-my-extension"] = new JsonNodeExtension("response");
}
return Task.CompletedTask;
}
diff --git a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/AddOpenApiTests.CanInterceptAddOpenApi#OpenApiXmlCommentSupport.generated.verified.cs b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/AddOpenApiTests.CanInterceptAddOpenApi#OpenApiXmlCommentSupport.generated.verified.cs
index 3d2702fbe1f..0d3d206fec8 100644
--- a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/AddOpenApiTests.CanInterceptAddOpenApi#OpenApiXmlCommentSupport.generated.verified.cs
+++ b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/AddOpenApiTests.CanInterceptAddOpenApi#OpenApiXmlCommentSupport.generated.verified.cs
@@ -43,7 +43,6 @@ namespace Microsoft.AspNetCore.OpenApi.Generated
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.Interfaces;
using Microsoft.OpenApi.Models.References;
- using Microsoft.OpenApi.Any;
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file record XmlComment(
diff --git a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/AdditionalTextsTests.CanHandleXmlForSchemasInAdditionalTexts#OpenApiXmlCommentSupport.generated.verified.cs b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/AdditionalTextsTests.CanHandleXmlForSchemasInAdditionalTexts#OpenApiXmlCommentSupport.generated.verified.cs
index 945ae11f52c..b876791c810 100644
--- a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/AdditionalTextsTests.CanHandleXmlForSchemasInAdditionalTexts#OpenApiXmlCommentSupport.generated.verified.cs
+++ b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/AdditionalTextsTests.CanHandleXmlForSchemasInAdditionalTexts#OpenApiXmlCommentSupport.generated.verified.cs
@@ -43,7 +43,6 @@ namespace Microsoft.AspNetCore.OpenApi.Generated
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.Interfaces;
using Microsoft.OpenApi.Models.References;
- using Microsoft.OpenApi.Any;
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file record XmlComment(
diff --git a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/CompletenessTests.SupportsAllXmlTagsOnSchemas#OpenApiXmlCommentSupport.generated.verified.cs b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/CompletenessTests.SupportsAllXmlTagsOnSchemas#OpenApiXmlCommentSupport.generated.verified.cs
index 391c9872505..a9b36cb7dae 100644
--- a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/CompletenessTests.SupportsAllXmlTagsOnSchemas#OpenApiXmlCommentSupport.generated.verified.cs
+++ b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/CompletenessTests.SupportsAllXmlTagsOnSchemas#OpenApiXmlCommentSupport.generated.verified.cs
@@ -43,7 +43,6 @@ namespace Microsoft.AspNetCore.OpenApi.Generated
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.Interfaces;
using Microsoft.OpenApi.Models.References;
- using Microsoft.OpenApi.Any;
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file record XmlComment(
diff --git a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/OperationTests.SupportsXmlCommentsOnOperationsFromControllers#OpenApiXmlCommentSupport.generated.verified.cs b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/OperationTests.SupportsXmlCommentsOnOperationsFromControllers#OpenApiXmlCommentSupport.generated.verified.cs
index 2b2e1e1d01f..7905cbba951 100644
--- a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/OperationTests.SupportsXmlCommentsOnOperationsFromControllers#OpenApiXmlCommentSupport.generated.verified.cs
+++ b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/OperationTests.SupportsXmlCommentsOnOperationsFromControllers#OpenApiXmlCommentSupport.generated.verified.cs
@@ -43,7 +43,6 @@ namespace Microsoft.AspNetCore.OpenApi.Generated
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.Interfaces;
using Microsoft.OpenApi.Models.References;
- using Microsoft.OpenApi.Any;
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file record XmlComment(
diff --git a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/OperationTests.SupportsXmlCommentsOnOperationsFromMinimalApis#OpenApiXmlCommentSupport.generated.verified.cs b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/OperationTests.SupportsXmlCommentsOnOperationsFromMinimalApis#OpenApiXmlCommentSupport.generated.verified.cs
index 3ee9ad39a98..301db6afae0 100644
--- a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/OperationTests.SupportsXmlCommentsOnOperationsFromMinimalApis#OpenApiXmlCommentSupport.generated.verified.cs
+++ b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/OperationTests.SupportsXmlCommentsOnOperationsFromMinimalApis#OpenApiXmlCommentSupport.generated.verified.cs
@@ -43,7 +43,6 @@ namespace Microsoft.AspNetCore.OpenApi.Generated
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.Interfaces;
using Microsoft.OpenApi.Models.References;
- using Microsoft.OpenApi.Any;
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file record XmlComment(
diff --git a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/SchemaTests.SupportsXmlCommentsOnSchemas#OpenApiXmlCommentSupport.generated.verified.cs b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/SchemaTests.SupportsXmlCommentsOnSchemas#OpenApiXmlCommentSupport.generated.verified.cs
index ae28560f635..8f57fda92e1 100644
--- a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/SchemaTests.SupportsXmlCommentsOnSchemas#OpenApiXmlCommentSupport.generated.verified.cs
+++ b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/SchemaTests.SupportsXmlCommentsOnSchemas#OpenApiXmlCommentSupport.generated.verified.cs
@@ -43,7 +43,6 @@ namespace Microsoft.AspNetCore.OpenApi.Generated
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.Interfaces;
using Microsoft.OpenApi.Models.References;
- using Microsoft.OpenApi.Any;
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file record XmlComment(
diff --git a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Services/OpenApiSchemaService/OpenApiSchemaService.PolymorphicSchemas.cs b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Services/OpenApiSchemaService/OpenApiSchemaService.PolymorphicSchemas.cs
index a222c5e3083..ab21291453a 100644
--- a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Services/OpenApiSchemaService/OpenApiSchemaService.PolymorphicSchemas.cs
+++ b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Services/OpenApiSchemaService/OpenApiSchemaService.PolymorphicSchemas.cs
@@ -3,7 +3,7 @@
using System.Net.Http;
using Microsoft.AspNetCore.Builder;
-using Microsoft.OpenApi.Any;
+using Microsoft.OpenApi.Extensions;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.References;
diff --git a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Services/OpenApiSchemaService/OpenApiSchemaService.RequestBodySchemas.cs b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Services/OpenApiSchemaService/OpenApiSchemaService.RequestBodySchemas.cs
index 9d2576b8cbf..5eb02fb1274 100644
--- a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Services/OpenApiSchemaService/OpenApiSchemaService.RequestBodySchemas.cs
+++ b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Services/OpenApiSchemaService/OpenApiSchemaService.RequestBodySchemas.cs
@@ -10,7 +10,7 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
-using Microsoft.OpenApi.Any;
+using Microsoft.OpenApi.Extensions;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.References;
diff --git a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Services/OpenApiSchemaService/OpenApiSchemaService.ResponseSchemas.cs b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Services/OpenApiSchemaService/OpenApiSchemaService.ResponseSchemas.cs
index a59bfb28d1d..ac92e52bce0 100644
--- a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Services/OpenApiSchemaService/OpenApiSchemaService.ResponseSchemas.cs
+++ b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Services/OpenApiSchemaService/OpenApiSchemaService.ResponseSchemas.cs
@@ -7,7 +7,7 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
-using Microsoft.OpenApi.Any;
+using Microsoft.OpenApi.Extensions;
using Microsoft.OpenApi.Models;
public partial class OpenApiSchemaServiceTests : OpenApiDocumentServiceTestBase
diff --git a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/CustomSchemaTransformerTests.cs b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/CustomSchemaTransformerTests.cs
index 9a98cd71ec0..aff3182bd2e 100644
--- a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/CustomSchemaTransformerTests.cs
+++ b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/CustomSchemaTransformerTests.cs
@@ -9,7 +9,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.OpenApi;
using Microsoft.Extensions.DependencyInjection;
-using Microsoft.OpenApi.Any;
+using Microsoft.OpenApi.Extensions;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.References;
@@ -159,7 +159,7 @@ public async Task GetOrCreateSchema_CanBeUsedInSchemaTransformer()
// Add a reference to the example in the shape schema
schema.Extensions ??= [];
- schema.Extensions["x-example-component"] = new OpenApiAny("#/components/schemas/TriangleExample");
+ schema.Extensions["x-example-component"] = new JsonNodeExtension("#/components/schemas/TriangleExample");
schema.Description = "A shape with an example reference";
}
});
diff --git a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs
index 2fa5cce2989..603007c0a08 100644
--- a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs
+++ b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs
@@ -8,7 +8,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.OpenApi;
using Microsoft.Extensions.DependencyInjection;
-using Microsoft.OpenApi.Any;
+using Microsoft.OpenApi.Extensions;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.References;
using Microsoft.OpenApi.Writers;
@@ -287,7 +287,7 @@ public async Task TypeModifiedWithSchemaTransformerMapsToDifferentReferenceId()
if (context.JsonTypeInfo.Type == typeof(Todo) && context.ParameterDescription is not null)
{
schema.Extensions ??= [];
- schema.Extensions["x-my-extension"] = new OpenApiAny(context.ParameterDescription.Name);
+ schema.Extensions["x-my-extension"] = new JsonNodeExtension(context.ParameterDescription.Name);
}
return Task.CompletedTask;
});
@@ -301,7 +301,7 @@ await VerifyOpenApiDocument(builder, options, document =>
var responseSchema = getOperation.Responses["200"].Content["application/json"].Schema;
// Schemas are distinct because of applied transformer so no reference is used.
Assert.NotEqual(((OpenApiSchemaReference)requestSchema).Reference.Id, ((OpenApiSchemaReference)responseSchema).Reference.Id);
- Assert.Equal("todo", ((OpenApiAny)requestSchema.Extensions["x-my-extension"]).Node.GetValue());
+ Assert.Equal("todo", ((JsonNodeExtension)requestSchema.Extensions["x-my-extension"]).Node.GetValue());
Assert.False(responseSchema.Extensions.TryGetValue("x-my-extension", out var _));
});
}
diff --git a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/SchemaTransformerTests.cs b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/SchemaTransformerTests.cs
index 6cc281bf6b9..bed6a02e50f 100644
--- a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/SchemaTransformerTests.cs
+++ b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/SchemaTransformerTests.cs
@@ -8,7 +8,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.OpenApi;
using Microsoft.Extensions.DependencyInjection;
-using Microsoft.OpenApi.Any;
+using Microsoft.OpenApi.Extensions;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.References;
@@ -156,15 +156,15 @@ public async Task SchemaTransformer_RunsInRegisteredOrder()
options.AddSchemaTransformer((schema, context, cancellationToken) =>
{
schema.Extensions ??= [];
- schema.Extensions["x-my-extension"] = new OpenApiAny("1");
+ schema.Extensions["x-my-extension"] = new JsonNodeExtension("1");
schema.Format = "1";
return Task.CompletedTask;
});
options.AddSchemaTransformer((schema, context, cancellationToken) =>
{
schema.Extensions ??= [];
- Assert.Equal("1", ((OpenApiAny)schema.Extensions["x-my-extension"]).Node.GetValue());
- schema.Extensions["x-my-extension"] = new OpenApiAny("2");
+ Assert.Equal("1", ((JsonNodeExtension)schema.Extensions["x-my-extension"]).Node.GetValue());
+ schema.Extensions["x-my-extension"] = new JsonNodeExtension("2");
return Task.CompletedTask;
});
@@ -172,7 +172,7 @@ await VerifyOpenApiDocument(builder, options, document =>
{
var operation = Assert.Single(document.Paths.Values).Operations.Values.Single();
var schema = operation.RequestBody.Content["application/json"].Schema;
- Assert.Equal("2", ((OpenApiAny)schema.Extensions["x-my-extension"]).Node.GetValue());
+ Assert.Equal("2", ((JsonNodeExtension)schema.Extensions["x-my-extension"]).Node.GetValue());
});
}
@@ -190,7 +190,7 @@ public async Task SchemaTransformer_OnTypeModifiesBothRequestAndResponse()
if (context.JsonTypeInfo.Type == typeof(Todo))
{
schema.Extensions ??= [];
- schema.Extensions["x-my-extension"] = new OpenApiAny("1");
+ schema.Extensions["x-my-extension"] = new JsonNodeExtension("1");
}
return Task.CompletedTask;
});
@@ -200,10 +200,10 @@ await VerifyOpenApiDocument(builder, options, document =>
var path = Assert.Single(document.Paths.Values);
var postOperation = path.Operations[HttpMethod.Post];
var requestSchema = postOperation.RequestBody.Content["application/json"].Schema;
- Assert.Equal("1", ((OpenApiAny)requestSchema.Extensions["x-my-extension"]).Node.GetValue());
+ Assert.Equal("1", ((JsonNodeExtension)requestSchema.Extensions["x-my-extension"]).Node.GetValue());
var getOperation = path.Operations[HttpMethod.Get];
var responseSchema = getOperation.Responses["200"].Content["application/json"].Schema;
- Assert.Equal("1", ((OpenApiAny)responseSchema.Extensions["x-my-extension"]).Node.GetValue());
+ Assert.Equal("1", ((JsonNodeExtension)responseSchema.Extensions["x-my-extension"]).Node.GetValue());
});
}
@@ -220,7 +220,7 @@ public async Task SchemaTransformer_WithDescriptionOnlyModifiesParameter()
{
if (context.JsonTypeInfo.Type == typeof(Todo) && context.ParameterDescription is not null)
{
- schema.Extensions["x-my-extension"] = new OpenApiAny(context.ParameterDescription.Name);
+ schema.Extensions["x-my-extension"] = new JsonNodeExtension(context.ParameterDescription.Name);
}
return Task.CompletedTask;
});
@@ -230,7 +230,7 @@ await VerifyOpenApiDocument(builder, options, document =>
var path = Assert.Single(document.Paths.Values);
var postOperation = path.Operations[HttpMethod.Post];
var requestSchema = postOperation.RequestBody.Content["application/json"].Schema;
- Assert.Equal("todo", ((OpenApiAny)requestSchema.Extensions["x-my-extension"]).Node.GetValue());
+ Assert.Equal("todo", ((JsonNodeExtension)requestSchema.Extensions["x-my-extension"]).Node.GetValue());
var getOperation = path.Operations[HttpMethod.Get];
var responseSchema = getOperation.Responses["200"].Content["application/json"].Schema;
Assert.False(responseSchema.Extensions.TryGetValue("x-my-extension", out var _));
@@ -253,10 +253,10 @@ await VerifyOpenApiDocument(builder, options, document =>
var path = Assert.Single(document.Paths.Values);
var postOperation = path.Operations[HttpMethod.Post];
var requestSchema = postOperation.RequestBody.Content["application/json"].Schema;
- Assert.Equal("1", ((OpenApiAny)requestSchema.Extensions["x-my-extension"]).Node.GetValue());
+ Assert.Equal("1", ((JsonNodeExtension)requestSchema.Extensions["x-my-extension"]).Node.GetValue());
var getOperation = path.Operations[HttpMethod.Get];
var responseSchema = getOperation.Responses["200"].Content["application/json"].Schema;
- Assert.Equal("1", ((OpenApiAny)responseSchema.Extensions["x-my-extension"]).Node.GetValue());
+ Assert.Equal("1", ((JsonNodeExtension)responseSchema.Extensions["x-my-extension"]).Node.GetValue());
});
}
@@ -276,10 +276,10 @@ await VerifyOpenApiDocument(builder, options, document =>
var path = Assert.Single(document.Paths.Values);
var postOperation = path.Operations[HttpMethod.Post];
var requestSchema = postOperation.RequestBody.Content["application/json"].Schema;
- Assert.Equal("1", ((OpenApiAny)requestSchema.Extensions["x-my-extension"]).Node.GetValue());
+ Assert.Equal("1", ((JsonNodeExtension)requestSchema.Extensions["x-my-extension"]).Node.GetValue());
var getOperation = path.Operations[HttpMethod.Get];
var responseSchema = getOperation.Responses["200"].Content["application/json"].Schema;
- Assert.Equal("1", ((OpenApiAny)responseSchema.Extensions["x-my-extension"]).Node.GetValue());
+ Assert.Equal("1", ((JsonNodeExtension)responseSchema.Extensions["x-my-extension"]).Node.GetValue());
});
}
@@ -303,21 +303,21 @@ await VerifyOpenApiDocument(builder, options, document =>
var path = Assert.Single(document.Paths.Values);
var postOperation = path.Operations[HttpMethod.Post];
var requestSchema = postOperation.RequestBody.Content["application/json"].Schema;
- value = ((OpenApiAny)requestSchema.Extensions["x-my-extension"]).Node.GetValue();
+ value = ((JsonNodeExtension)requestSchema.Extensions["x-my-extension"]).Node.GetValue();
Assert.Equal(Dependency.InstantiationCount.ToString(CultureInfo.InvariantCulture), value);
var getOperation = path.Operations[HttpMethod.Get];
var responseSchema = getOperation.Responses["200"].Content["application/json"].Schema;
- Assert.Equal(value, ((OpenApiAny)responseSchema.Extensions["x-my-extension"]).Node.GetValue());
+ Assert.Equal(value, ((JsonNodeExtension)responseSchema.Extensions["x-my-extension"]).Node.GetValue());
});
await VerifyOpenApiDocument(builder, options, document =>
{
var path = Assert.Single(document.Paths.Values);
var postOperation = path.Operations[HttpMethod.Post];
var requestSchema = postOperation.RequestBody.Content["application/json"].Schema;
- Assert.Equal(value, ((OpenApiAny)requestSchema.Extensions["x-my-extension"]).Node.GetValue());
+ Assert.Equal(value, ((JsonNodeExtension)requestSchema.Extensions["x-my-extension"]).Node.GetValue());
var getOperation = path.Operations[HttpMethod.Get];
var responseSchema = getOperation.Responses["200"].Content["application/json"].Schema;
- Assert.Equal(value, ((OpenApiAny)responseSchema.Extensions["x-my-extension"]).Node.GetValue());
+ Assert.Equal(value, ((JsonNodeExtension)responseSchema.Extensions["x-my-extension"]).Node.GetValue());
});
}
@@ -500,7 +500,7 @@ public async Task SchemaTransformer_CanModifyPolymorphicChildSchemas()
if (context.JsonTypeInfo.Type == typeof(Triangle))
{
schema.Extensions ??= [];
- schema.Extensions["x-my-extension"] = new OpenApiAny("this-is-a-triangle");
+ schema.Extensions["x-my-extension"] = new JsonNodeExtension("this-is-a-triangle");
}
return Task.CompletedTask;
});
@@ -518,7 +518,7 @@ await VerifyOpenApiDocument(builder, options, document =>
path = document.Paths["/triangle"];
postOperation = path.Operations[HttpMethod.Post];
requestSchema = postOperation.RequestBody.Content["application/json"].Schema;
- Assert.Equal("this-is-a-triangle", ((OpenApiAny)requestSchema.Extensions["x-my-extension"]).Node.GetValue());
+ Assert.Equal("this-is-a-triangle", ((JsonNodeExtension)requestSchema.Extensions["x-my-extension"]).Node.GetValue());
});
}
@@ -571,11 +571,11 @@ public async Task SchemaTransformer_CanModifyListOfPolymorphicTypes()
schema.Extensions ??= [];
if (context.JsonTypeInfo.Type == typeof(Triangle))
{
- schema.Extensions["x-my-extension"] = new OpenApiAny("this-is-a-triangle");
+ schema.Extensions["x-my-extension"] = new JsonNodeExtension("this-is-a-triangle");
}
if (context.JsonTypeInfo.Type == typeof(Square))
{
- schema.Extensions["x-my-extension"] = new OpenApiAny("this-is-a-square");
+ schema.Extensions["x-my-extension"] = new JsonNodeExtension("this-is-a-square");
}
return Task.CompletedTask;
});
@@ -590,13 +590,13 @@ await VerifyOpenApiDocument(builder, options, document =>
var triangleSubschema = Assert.Single(itemSchema.AnyOf.Where(s => ((OpenApiSchemaReference)s).Reference.Id == "ShapeTriangle"));
// Assert that the x-my-extension type is set to this-is-a-triangle
Assert.True(triangleSubschema.Extensions.TryGetValue("x-my-extension", out var triangleExtension));
- Assert.Equal("this-is-a-triangle", ((OpenApiAny)triangleExtension).Node.GetValue());
+ Assert.Equal("this-is-a-triangle", ((JsonNodeExtension)triangleExtension).Node.GetValue());
// Assert that the `Square` type within the polymorphic type list has been updated
var squareSubschema = Assert.Single(itemSchema.AnyOf.Where(s => ((OpenApiSchemaReference)s).Reference.Id == "ShapeSquare"));
// Assert that the x-my-extension type is set to this-is-a-square
Assert.True(squareSubschema.Extensions.TryGetValue("x-my-extension", out var squareExtension));
- Assert.Equal("this-is-a-square", ((OpenApiAny)squareExtension).Node.GetValue());
+ Assert.Equal("this-is-a-square", ((JsonNodeExtension)squareExtension).Node.GetValue());
});
}
@@ -613,11 +613,11 @@ public async Task SchemaTransformer_CanModifyPolymorphicTypesInProperties()
schema.Extensions ??= [];
if (context.JsonTypeInfo.Type == typeof(Triangle))
{
- schema.Extensions["x-my-extension"] = new OpenApiAny("this-is-a-triangle");
+ schema.Extensions["x-my-extension"] = new JsonNodeExtension("this-is-a-triangle");
}
if (context.JsonTypeInfo.Type == typeof(Square))
{
- schema.Extensions["x-my-extension"] = new OpenApiAny("this-is-a-square");
+ schema.Extensions["x-my-extension"] = new JsonNodeExtension("this-is-a-square");
}
return Task.CompletedTask;
});
@@ -632,13 +632,13 @@ await VerifyOpenApiDocument(builder, options, document =>
var triangleSubschema = Assert.Single(someShapeSchema.AnyOf.Where(s => ((OpenApiSchemaReference)s).Reference.Id == "ShapeTriangle"));
// Assert that the x-my-extension type is set to this-is-a-triangle
Assert.True(triangleSubschema.Extensions.TryGetValue("x-my-extension", out var triangleExtension));
- Assert.Equal("this-is-a-triangle", ((OpenApiAny)triangleExtension).Node.GetValue());
+ Assert.Equal("this-is-a-triangle", ((JsonNodeExtension)triangleExtension).Node.GetValue());
// Assert that the `Square` type within the polymorphic type list has been updated
var squareSubschema = Assert.Single(someShapeSchema.AnyOf.Where(s => ((OpenApiSchemaReference)s).Reference.Id == "ShapeSquare"));
// Assert that the x-my-extension type is set to this-is-a-square
Assert.True(squareSubschema.Extensions.TryGetValue("x-my-extension", out var squareExtension));
- Assert.Equal("this-is-a-square", ((OpenApiAny)squareExtension).Node.GetValue());
+ Assert.Equal("this-is-a-square", ((JsonNodeExtension)squareExtension).Node.GetValue());
});
}
@@ -655,11 +655,11 @@ public async Task SchemaTransformer_CanModifyDeeplyNestedPolymorphicTypesInPrope
schema.Extensions ??= [];
if (context.JsonTypeInfo.Type == typeof(Triangle))
{
- schema.Extensions["x-my-extension"] = new OpenApiAny("this-is-a-triangle");
+ schema.Extensions["x-my-extension"] = new JsonNodeExtension("this-is-a-triangle");
}
if (context.JsonTypeInfo.Type == typeof(Square))
{
- schema.Extensions["x-my-extension"] = new OpenApiAny("this-is-a-square");
+ schema.Extensions["x-my-extension"] = new JsonNodeExtension("this-is-a-square");
}
return Task.CompletedTask;
});
@@ -674,13 +674,13 @@ await VerifyOpenApiDocument(builder, options, document =>
var triangleSubschema = Assert.Single(someShapeSchema.AnyOf.Where(s => ((OpenApiSchemaReference)s).Reference.Id == "ShapeTriangle"));
// Assert that the x-my-extension type is set to this-is-a-triangle
Assert.True(triangleSubschema.Extensions.TryGetValue("x-my-extension", out var triangleExtension));
- Assert.Equal("this-is-a-triangle", ((OpenApiAny)triangleExtension).Node.GetValue());
+ Assert.Equal("this-is-a-triangle", ((JsonNodeExtension)triangleExtension).Node.GetValue());
// Assert that the `Square` type within the polymorphic type list has been updated
var squareSubschema = Assert.Single(someShapeSchema.AnyOf.Where(s => ((OpenApiSchemaReference)s).Reference.Id == "ShapeSquare"));
// Assert that the x-my-extension type is set to this-is-a-square
Assert.True(squareSubschema.Extensions.TryGetValue("x-my-extension", out var squareExtension));
- Assert.Equal("this-is-a-square", ((OpenApiAny)squareExtension).Node.GetValue());
+ Assert.Equal("this-is-a-square", ((JsonNodeExtension)squareExtension).Node.GetValue());
});
}
@@ -742,7 +742,7 @@ public async Task SchemaTransformers_CanImplementNotSchemaIndependently()
UseNotSchemaTransformer(options, (schema, context, cancellationToken) =>
{
schema.Extensions ??= [];
- schema.Extensions["modified-by-not-schema-transformer"] = new OpenApiAny(true);
+ schema.Extensions["modified-by-not-schema-transformer"] = new JsonNodeExtension(true);
return Task.CompletedTask;
});
@@ -752,13 +752,13 @@ await VerifyOpenApiDocument(builder, options, document =>
var path = document.Paths["/todo"];
var getOperation = path.Operations[HttpMethod.Get];
var responseSchema = getOperation.Responses["200"].Content["application/json"].Schema;
- Assert.True(((OpenApiAny)responseSchema.Not.Extensions["modified-by-not-schema-transformer"]).Node.GetValue());
+ Assert.True(((JsonNodeExtension)responseSchema.Not.Extensions["modified-by-not-schema-transformer"]).Node.GetValue());
var shapePath = document.Paths["/shape"];
var shapeOperation = shapePath.Operations[HttpMethod.Post];
var shapeRequestSchema = shapeOperation.RequestBody.Content["application/json"].Schema;
var triangleSchema = Assert.Single(shapeRequestSchema.AnyOf.Where(s => ((OpenApiSchemaReference)s).Reference.Id == "ShapeTriangle"));
- Assert.True(((OpenApiAny)triangleSchema.Not.Extensions["modified-by-not-schema-transformer"]).Node.GetValue());
+ Assert.True(((JsonNodeExtension)triangleSchema.Not.Extensions["modified-by-not-schema-transformer"]).Node.GetValue());
});
static void UseNotSchemaTransformer(OpenApiOptions options, Func func)
@@ -958,7 +958,7 @@ public Task TransformAsync(OpenApiSchema schema, OpenApiSchemaTransformerContext
if (context.JsonTypeInfo.Type == typeof(Todo))
{
schema.Extensions ??= [];
- schema.Extensions["x-my-extension"] = new OpenApiAny("1");
+ schema.Extensions["x-my-extension"] = new JsonNodeExtension("1");
}
return Task.CompletedTask;
}
@@ -1007,7 +1007,7 @@ public Task TransformAsync(OpenApiSchema schema, OpenApiSchemaTransformerContext
{
dependency.TestMethod();
schema.Extensions ??= [];
- schema.Extensions["x-my-extension"] = new OpenApiAny(Dependency.InstantiationCount.ToString(CultureInfo.InvariantCulture));
+ schema.Extensions["x-my-extension"] = new JsonNodeExtension(Dependency.InstantiationCount.ToString(CultureInfo.InvariantCulture));
return Task.CompletedTask;
}
}
diff --git a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/TypeBasedTransformerLifetimeTests.cs b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/TypeBasedTransformerLifetimeTests.cs
index 0a4c6708797..8f343a95d51 100644
--- a/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/TypeBasedTransformerLifetimeTests.cs
+++ b/src/aspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/TypeBasedTransformerLifetimeTests.cs
@@ -4,7 +4,7 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.OpenApi;
using Microsoft.Extensions.DependencyInjection;
-using Microsoft.OpenApi.Any;
+using Microsoft.OpenApi.Extensions;
using Microsoft.OpenApi.Models;
public class TypeBasedTransformerLifetimeTests : OpenApiDocumentServiceTestBase
@@ -349,7 +349,7 @@ public Task TransformAsync(OpenApiSchema schema, OpenApiSchemaTransformerContext
if (context.JsonTypeInfo.Type == typeof(Todo))
{
schema.Extensions ??= [];
- schema.Extensions["x-my-extension"] = new OpenApiAny("1");
+ schema.Extensions["x-my-extension"] = new JsonNodeExtension("1");
}
return Task.CompletedTask;
}
diff --git a/src/aspnetcore/src/Shared/ThrowHelpers/ArgumentNullThrowHelper.cs b/src/aspnetcore/src/Shared/ThrowHelpers/ArgumentNullThrowHelper.cs
index 630651cecc0..1c44975d5a3 100644
--- a/src/aspnetcore/src/Shared/ThrowHelpers/ArgumentNullThrowHelper.cs
+++ b/src/aspnetcore/src/Shared/ThrowHelpers/ArgumentNullThrowHelper.cs
@@ -30,6 +30,29 @@ public static void ThrowIfNull(
#endif
}
+ /// Throws an if is null or empty.
+ /// The argument to validate as non-null and non-empty.
+ /// The name of the parameter with which corresponds.
+ public static void ThrowIfNullOrEmpty(
+#if INTERNAL_NULLABLE_ATTRIBUTES || NETSTANDARD2_1_OR_GREATER || NET5_0_OR_GREATER
+ [NotNull]
+#endif
+ string? argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null)
+ {
+#if !NET7_0_OR_GREATER || NETSTANDARD || NETFRAMEWORK
+ if (argument is null)
+ {
+ Throw(paramName);
+ }
+ else if (argument.Length == 0)
+ {
+ throw new ArgumentException("Must not be null or empty", paramName);
+ }
+#else
+ ArgumentException.ThrowIfNullOrEmpty(argument, paramName);
+#endif
+ }
+
#if !NET7_0_OR_GREATER || NETSTANDARD || NETFRAMEWORK
#if INTERNAL_NULLABLE_ATTRIBUTES || NETSTANDARD2_1_OR_GREATER || NET5_0_OR_GREATER
[DoesNotReturn]
diff --git a/src/diagnostics/src/Microsoft.Diagnostics.DebugServices.Implementation/Runtime.cs b/src/diagnostics/src/Microsoft.Diagnostics.DebugServices.Implementation/Runtime.cs
index 7e02dcaf0f5..f3eeb4aa957 100644
--- a/src/diagnostics/src/Microsoft.Diagnostics.DebugServices.Implementation/Runtime.cs
+++ b/src/diagnostics/src/Microsoft.Diagnostics.DebugServices.Implementation/Runtime.cs
@@ -25,6 +25,7 @@ public class Runtime : IRuntime, IDisposable
private Version _runtimeVersion;
private ClrRuntime _clrRuntime;
private string _dacFilePath;
+ private bool _verifySignature; // This only applies to the regular DAC, not the CDAC
private string _cdacFilePath;
private string _dbiFilePath;
@@ -113,9 +114,11 @@ public string GetCDacFilePath()
public string GetDacFilePath(out bool verifySignature)
{
- verifySignature = false;
if (_settingsService.ForceUseContractReader)
{
+ // Don't verify signature when using the CDAC and don't change the cached value
+ // because it only applies to the regular DAC in _dacFilePath.
+ verifySignature = false;
return GetCDacFilePath();
}
if (_dacFilePath is null)
@@ -123,9 +126,10 @@ public string GetDacFilePath(out bool verifySignature)
_dacFilePath = GetLibraryPath(DebugLibraryKind.Dac);
if (_dacFilePath is not null)
{
- verifySignature = _settingsService.DacSignatureVerificationEnabled;
+ _verifySignature = _settingsService.DacSignatureVerificationEnabled;
}
}
+ verifySignature = _verifySignature;
return _dacFilePath;
}
@@ -339,7 +343,8 @@ public override string ToString()
if (_dacFilePath is not null)
{
sb.AppendLine();
- sb.Append($" DAC: {_dacFilePath}");
+ string verify = _verifySignature ? "(verify)" : "(don't verify)";
+ sb.Append($" DAC: {_dacFilePath} {verify}");
}
if (_cdacFilePath is not null)
{
diff --git a/src/diagnostics/src/Microsoft.Diagnostics.ExtensionCommands/Host/CommandFormatHelpers.cs b/src/diagnostics/src/Microsoft.Diagnostics.ExtensionCommands/Host/CommandFormatHelpers.cs
index 9b490156e43..8a7e2f69efc 100644
--- a/src/diagnostics/src/Microsoft.Diagnostics.ExtensionCommands/Host/CommandFormatHelpers.cs
+++ b/src/diagnostics/src/Microsoft.Diagnostics.ExtensionCommands/Host/CommandFormatHelpers.cs
@@ -16,6 +16,15 @@ public static class CommandFormatHelpers
public const string DebugHeaderExport = "DotNetRuntimeDebugHeader";
public const string ContractDescriptorExport = "DotNetRuntimeContractDescriptor";
+ public static void DisplaySettingService(this CommandBase command)
+ {
+ ISettingsService settingsService = command.Services.GetService() ?? throw new DiagnosticsException("Settings service required");
+ command.Console.WriteLine("Settings:");
+ command.Console.WriteLine($"-> Use CDAC contract reader: {settingsService.UseContractReader}");
+ command.Console.WriteLine($"-> Force use CDAC contract reader: {settingsService.ForceUseContractReader}");
+ command.Console.WriteLine($"-> DAC signature verification check enabled: {settingsService.DacSignatureVerificationEnabled}");
+ }
+
///
/// Displays the special diagnostics info header memory block (.NET Core 8 or later on Linux/MacOS)
///
diff --git a/src/diagnostics/src/Microsoft.Diagnostics.ExtensionCommands/Host/RuntimesCommand.cs b/src/diagnostics/src/Microsoft.Diagnostics.ExtensionCommands/Host/RuntimesCommand.cs
index 95c93e8cef2..83c70cef29f 100644
--- a/src/diagnostics/src/Microsoft.Diagnostics.ExtensionCommands/Host/RuntimesCommand.cs
+++ b/src/diagnostics/src/Microsoft.Diagnostics.ExtensionCommands/Host/RuntimesCommand.cs
@@ -128,10 +128,8 @@ public override void Invoke()
}
this.DisplayResources(runtime.RuntimeModule, all: false, indent: " ");
this.DisplayRuntimeExports(runtime.RuntimeModule, error: true, indent: " ");
- WriteLine($"Use CDAC contract reader: {SettingsService.UseContractReader}");
- WriteLine($"Force use CDAC contract reader: {SettingsService.ForceUseContractReader}");
- WriteLine($"DAC signature verification check enabled: {SettingsService.DacSignatureVerificationEnabled}");
}
+ this.DisplaySettingService();
}
}
}
diff --git a/src/diagnostics/src/Microsoft.Diagnostics.ExtensionCommands/Host/StatusCommand.cs b/src/diagnostics/src/Microsoft.Diagnostics.ExtensionCommands/Host/StatusCommand.cs
index aa960e9d31f..3c425e251d2 100644
--- a/src/diagnostics/src/Microsoft.Diagnostics.ExtensionCommands/Host/StatusCommand.cs
+++ b/src/diagnostics/src/Microsoft.Diagnostics.ExtensionCommands/Host/StatusCommand.cs
@@ -63,6 +63,7 @@ public override void Invoke()
}
}
this.DisplaySpecialInfo();
+ this.DisplaySettingService();
Write(SymbolService.ToString());
List extensions = new(ServiceManager.ExtensionsLoaded);
diff --git a/src/diagnostics/src/SOS/SOS.Extensions/HostServices.cs b/src/diagnostics/src/SOS/SOS.Extensions/HostServices.cs
index 114d4d2b96c..04b401c647a 100644
--- a/src/diagnostics/src/SOS/SOS.Extensions/HostServices.cs
+++ b/src/diagnostics/src/SOS/SOS.Extensions/HostServices.cs
@@ -356,6 +356,10 @@ private int DispatchCommand(
{
return HResult.E_INVALIDARG;
}
+ if (_commandService is null)
+ {
+ return HResult.E_FAIL;
+ }
try
{
_commandService.Execute(commandName, commandArguments, string.Equals(commandName, "help", StringComparison.OrdinalIgnoreCase) ? _contextServiceFromDebuggerServices.Services : _servicesWithManagedOnlyFilter);
diff --git a/src/diagnostics/src/SOS/SOS.Hosting/RuntimeWrapper.cs b/src/diagnostics/src/SOS/SOS.Hosting/RuntimeWrapper.cs
index 98d223def6a..bfca28db91b 100644
--- a/src/diagnostics/src/SOS/SOS.Hosting/RuntimeWrapper.cs
+++ b/src/diagnostics/src/SOS/SOS.Hosting/RuntimeWrapper.cs
@@ -383,10 +383,9 @@ private IntPtr CreateClrDataProcess(IntPtr dacHandle)
private IntPtr CreateCorDebugProcess()
{
string dbiFilePath = _runtime.GetDbiFilePath();
- string dacFilePath = _runtime.GetDacFilePath(out bool verifySignature);
- if (dbiFilePath == null || dacFilePath == null)
+ if (dbiFilePath == null)
{
- Trace.TraceError($"Could not find matching DBI {dbiFilePath ?? ""} or DAC {dacFilePath ?? ""} for this runtime: {_runtime.RuntimeModule.FileName}");
+ Trace.TraceError($"Could not find matching DBI {dbiFilePath ?? ""} for this runtime: {_runtime.RuntimeModule.FileName}");
return IntPtr.Zero;
}
if (_dbiHandle == IntPtr.Zero)
@@ -415,6 +414,16 @@ private IntPtr CreateCorDebugProcess()
int hresult = 0;
try
{
+ // This will verify the DAC signature if needed before DBI is passed the DAC path or handle
+ IntPtr dacHandle = GetDacHandle();
+ if (dacHandle == IntPtr.Zero)
+ {
+ return IntPtr.Zero;
+ }
+
+ // The DAC was verified in the GetDacHandle call above. Ignore the verifySignature parameter here.
+ string dacFilePath = _runtime.GetDacFilePath(out bool _);
+
OpenVirtualProcessImpl2Delegate openVirtualProcessImpl2 = SOSHost.GetDelegateFunction(_dbiHandle, "OpenVirtualProcessImpl2");
if (openVirtualProcessImpl2 != null)
{
@@ -436,12 +445,6 @@ private IntPtr CreateCorDebugProcess()
return corDebugProcess;
}
- IntPtr dacHandle = GetDacHandle();
- if (dacHandle == IntPtr.Zero)
- {
- return IntPtr.Zero;
- }
-
// On Linux/MacOS the DAC module handle needs to be re-created using the DAC PAL instance
// before being passed to DBI's OpenVirtualProcess* implementation. The DBI and DAC share
// the same PAL where dbgshim has it's own.
diff --git a/src/efcore/src/EFCore.Relational/Storage/RelationalDatabaseCreator.cs b/src/efcore/src/EFCore.Relational/Storage/RelationalDatabaseCreator.cs
index 96f5ca0f76a..7ba78522385 100644
--- a/src/efcore/src/EFCore.Relational/Storage/RelationalDatabaseCreator.cs
+++ b/src/efcore/src/EFCore.Relational/Storage/RelationalDatabaseCreator.cs
@@ -373,7 +373,8 @@ public virtual bool CanConnect()
///
///
///
- /// Any exceptions thrown when attempting to connect are caught and not propagated to the application.
+ /// Any exceptions thrown when attempting to connect are caught and not propagated to the application,
+ /// except for the ones indicating cancellation.
///
///
/// The configured connection string is used to create the connection in the normal way, so all
@@ -386,13 +387,16 @@ public virtual bool CanConnect()
///
/// A to observe while waiting for the task to complete.
/// if the database is available; otherwise.
- /// If the is canceled.
public virtual async Task CanConnectAsync(CancellationToken cancellationToken = default)
{
try
{
return await ExistsAsync(cancellationToken).ConfigureAwait(false);
}
+ catch (Exception exception) when (Dependencies.ExceptionDetector.IsCancellation(exception, cancellationToken))
+ {
+ throw;
+ }
catch
{
return false;
diff --git a/src/efcore/src/EFCore.Relational/Storage/RelationalDatabaseCreatorDependencies.cs b/src/efcore/src/EFCore.Relational/Storage/RelationalDatabaseCreatorDependencies.cs
index 8343a802486..46966b3538b 100644
--- a/src/efcore/src/EFCore.Relational/Storage/RelationalDatabaseCreatorDependencies.cs
+++ b/src/efcore/src/EFCore.Relational/Storage/RelationalDatabaseCreatorDependencies.cs
@@ -54,7 +54,8 @@ public RelationalDatabaseCreatorDependencies(
IExecutionStrategy executionStrategy,
ICurrentDbContext currentContext,
IDbContextOptions contextOptions,
- IRelationalCommandDiagnosticsLogger commandLogger)
+ IRelationalCommandDiagnosticsLogger commandLogger,
+ IExceptionDetector exceptionDetector)
{
Connection = connection;
ModelDiffer = modelDiffer;
@@ -65,6 +66,7 @@ public RelationalDatabaseCreatorDependencies(
CurrentContext = currentContext;
ContextOptions = contextOptions;
CommandLogger = commandLogger;
+ ExceptionDetector = exceptionDetector;
}
///
@@ -111,4 +113,9 @@ public RelationalDatabaseCreatorDependencies(
/// Contains the currently in use.
///
public ICurrentDbContext CurrentContext { get; init; }
+
+ ///
+ /// Gets the exception detector.
+ ///
+ public IExceptionDetector ExceptionDetector { get; init; }
}
diff --git a/src/efcore/src/EFCore/Metadata/Builders/ConventionSetBuilder.cs b/src/efcore/src/EFCore/Metadata/Builders/ConventionSetBuilder.cs
index a79c5f41313..ae3531c137c 100644
--- a/src/efcore/src/EFCore/Metadata/Builders/ConventionSetBuilder.cs
+++ b/src/efcore/src/EFCore/Metadata/Builders/ConventionSetBuilder.cs
@@ -68,10 +68,10 @@ public virtual void Remove(Type conventionType)
///
/// Remove the convention of the given type.
///
- /// The type of convention to remove
- public virtual void Remove()
- where TImplementaion : IConvention
- => Remove(typeof(TImplementaion));
+ /// The type of convention to remove
+ public virtual void Remove()
+ where TImplementation : IConvention
+ => Remove(typeof(TImplementation));
#region Hidden System.Object members
diff --git a/src/msbuild/NuGet.config b/src/msbuild/NuGet.config
index a11137a9563..c39ceddacb7 100644
--- a/src/msbuild/NuGet.config
+++ b/src/msbuild/NuGet.config
@@ -15,13 +15,37 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/roslyn/.vscode/tasks.json b/src/roslyn/.vscode/tasks.json
index ea68cf0efae..78745a3ada3 100644
--- a/src/roslyn/.vscode/tasks.json
+++ b/src/roslyn/.vscode/tasks.json
@@ -169,7 +169,7 @@
"type": "process",
"options": {
"env": {
- "DOTNET_ROSLYN_SERVER_PATH": "${workspaceRoot}/artifacts/bin/Microsoft.CodeAnalysis.LanguageServer/Debug/net8.0/Microsoft.CodeAnalysis.LanguageServer.dll"
+ "DOTNET_ROSLYN_SERVER_PATH": "${workspaceRoot}/artifacts/bin/Microsoft.CodeAnalysis.LanguageServer/Debug/net9.0/Microsoft.CodeAnalysis.LanguageServer.dll"
}
},
"dependsOn": [ "build language server" ]
diff --git a/src/roslyn/Roslyn.sln b/src/roslyn/Roslyn.sln
index fcfe71c1f73..683605cf978 100644
--- a/src/roslyn/Roslyn.sln
+++ b/src/roslyn/Roslyn.sln
@@ -725,6 +725,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestReferenceAssembly", "sr
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.ExternalAccess.Extensions", "src\Tools\ExternalAccess\Extensions\Microsoft.CodeAnalysis.ExternalAccess.Extensions.csproj", "{6C816C16-D563-884A-D65B-5E68C6FB6659}"
EndProject
+Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Microsoft.CodeAnalysis.Extensions", "src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Microsoft.CodeAnalysis.Extensions.shproj", "{02BCC112-0A29-43AA-84FA-C71C18A9486C}"
+EndProject
+Project("{9a19103f-16f7-4668-be54-9a1e7a4f7556}") = "Microsoft.CodeAnalysis.Extensions.Package", "src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Microsoft.CodeAnalysis.Extensions.Package.csproj", "{EEFAB994-3778-9C0D-1E88-C0ABB1D3DE43}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -1787,6 +1791,10 @@ Global
{6C816C16-D563-884A-D65B-5E68C6FB6659}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6C816C16-D563-884A-D65B-5E68C6FB6659}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6C816C16-D563-884A-D65B-5E68C6FB6659}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EEFAB994-3778-9C0D-1E88-C0ABB1D3DE43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EEFAB994-3778-9C0D-1E88-C0ABB1D3DE43}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EEFAB994-3778-9C0D-1E88-C0ABB1D3DE43}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EEFAB994-3778-9C0D-1E88-C0ABB1D3DE43}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -2126,6 +2134,8 @@ Global
{29080628-23A6-1DCB-F15E-93F1D1682CC1} = {482C1FC7-4FD6-4381-8078-73BEBFAF4349}
{31EB654C-B562-73B4-2456-78FA875515D2} = {0DDCFE67-7D4E-4709-9882-EC032A031789}
{6C816C16-D563-884A-D65B-5E68C6FB6659} = {8977A560-45C2-4EC2-A849-97335B382C74}
+ {02BCC112-0A29-43AA-84FA-C71C18A9486C} = {7A69EA65-4411-4CD0-B439-035E720C1BD3}
+ {EEFAB994-3778-9C0D-1E88-C0ABB1D3DE43} = {7A69EA65-4411-4CD0-B439-035E720C1BD3}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {604E6B91-7BC0-4126-AE07-D4D2FEFC3D29}
@@ -2134,6 +2144,7 @@ Global
src\Analyzers\VisualBasic\CodeFixes\VisualBasicCodeFixes.projitems*{0141285d-8f6c-42c7-baf3-3c0ccd61c716}*SharedItemsImports = 5
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\VisualBasicWorkspaceExtensions.projitems*{0141285d-8f6c-42c7-baf3-3c0ccd61c716}*SharedItemsImports = 5
src\Compilers\CSharp\csc\CscCommandLine.projitems*{0161e25c-918a-4dc8-9648-30fdcc8e31e9}*SharedItemsImports = 5
+ src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Microsoft.CodeAnalysis.Extensions.projitems*{02bcc112-0a29-43aa-84fa-c71c18a9486c}*SharedItemsImports = 13
src\RoslynAnalyzers\Utilities\Compiler\Analyzer.Utilities.projitems*{08735294-3e6b-4420-9916-e7b8c4eb874d}*SharedItemsImports = 13
src\RoslynAnalyzers\Utilities\Compiler\Analyzer.Utilities.projitems*{0a1267e9-52ff-b8de-8522-802be55f41da}*SharedItemsImports = 5
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis.Utilities.projitems*{0a1267e9-52ff-b8de-8522-802be55f41da}*SharedItemsImports = 5
@@ -2160,6 +2171,7 @@ Global
src\Dependencies\PooledObjects\Microsoft.CodeAnalysis.PooledObjects.projitems*{275812ee-dedb-4232-9439-91c9757d2ae4}*SharedItemsImports = 5
src\Dependencies\Threading\Microsoft.CodeAnalysis.Threading.projitems*{275812ee-dedb-4232-9439-91c9757d2ae4}*SharedItemsImports = 5
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CompilerExtensions.projitems*{275812ee-dedb-4232-9439-91c9757d2ae4}*SharedItemsImports = 5
+ src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Microsoft.CodeAnalysis.Extensions.projitems*{275812ee-dedb-4232-9439-91c9757d2ae4}*SharedItemsImports = 5
src\Dependencies\Contracts\Microsoft.CodeAnalysis.Contracts.projitems*{2801f82b-78ce-4bae-b06f-537574751e2e}*SharedItemsImports = 5
src\RoslynAnalyzers\Utilities\Refactoring.CSharp\Refactoring.CSharp.Utilities.projitems*{3055f932-0d1e-4823-a03a-7b62c7639bda}*SharedItemsImports = 13
src\ExpressionEvaluator\VisualBasic\Source\ResultProvider\BasicResultProvider.projitems*{3140fe61-0856-4367-9aa3-8081b9a80e35}*SharedItemsImports = 13
@@ -2184,6 +2196,7 @@ Global
src\Dependencies\PooledObjects\Microsoft.CodeAnalysis.PooledObjects.projitems*{5f8d2414-064a-4b3a-9b42-8e2a04246be5}*SharedItemsImports = 5
src\Dependencies\Threading\Microsoft.CodeAnalysis.Threading.projitems*{5f8d2414-064a-4b3a-9b42-8e2a04246be5}*SharedItemsImports = 5
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CompilerExtensions.projitems*{5f8d2414-064a-4b3a-9b42-8e2a04246be5}*SharedItemsImports = 5
+ src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Microsoft.CodeAnalysis.Extensions.projitems*{5f8d2414-064a-4b3a-9b42-8e2a04246be5}*SharedItemsImports = 5
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\WorkspaceExtensions.projitems*{5f8d2414-064a-4b3a-9b42-8e2a04246be5}*SharedItemsImports = 5
src\Analyzers\Core\CodeFixes\CodeFixes.projitems*{5ff1e493-69cc-4d0b-83f2-039f469a04e1}*SharedItemsImports = 5
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\WorkspaceExtensions.projitems*{5ff1e493-69cc-4d0b-83f2-039f469a04e1}*SharedItemsImports = 5
@@ -2267,6 +2280,9 @@ Global
src\Analyzers\Core\CodeFixes\CodeFixes.projitems*{edc68a0e-c68d-4a74-91b7-bf38ec909888}*SharedItemsImports = 5
src\Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{edc68a0e-c68d-4a74-91b7-bf38ec909888}*SharedItemsImports = 5
src\Dependencies\CodeAnalysis.Debugging\Microsoft.CodeAnalysis.Debugging.projitems*{edc68a0e-c68d-4a74-91b7-bf38ec909888}*SharedItemsImports = 5
+ src\Dependencies\Collections\Microsoft.CodeAnalysis.Collections.projitems*{eefab994-3778-9c0d-1e88-c0abb1d3de43}*SharedItemsImports = 5
+ src\Dependencies\Contracts\Microsoft.CodeAnalysis.Contracts.projitems*{eefab994-3778-9c0d-1e88-c0abb1d3de43}*SharedItemsImports = 5
+ src\Dependencies\PooledObjects\Microsoft.CodeAnalysis.PooledObjects.projitems*{eefab994-3778-9c0d-1e88-c0abb1d3de43}*SharedItemsImports = 5
src\Dependencies\Contracts\Microsoft.CodeAnalysis.Contracts.projitems*{fa0e905d-ec46-466d-b7b2-3b5557f9428c}*SharedItemsImports = 5
src\ExpressionEvaluator\Core\Source\ResultProvider\ResultProvider.projitems*{fa0e905d-ec46-466d-b7b2-3b5557f9428c}*SharedItemsImports = 5
src\Dependencies\Contracts\Microsoft.CodeAnalysis.Contracts.projitems*{fc2ae90b-2e4b-4045-9fdd-73d4f5ed6c89}*SharedItemsImports = 5
diff --git a/src/roslyn/docs/features/file-based-programs-vscode.md b/src/roslyn/docs/features/file-based-programs-vscode.md
new file mode 100644
index 00000000000..dddaa13667d
--- /dev/null
+++ b/src/roslyn/docs/features/file-based-programs-vscode.md
@@ -0,0 +1,59 @@
+# File-based programs VS Code support
+
+See also [dotnet-run-file.md](https://github.com/dotnet/sdk/blob/main/documentation/general/dotnet-run-file.md).
+
+## Feature overview
+
+A file-based program embeds a subset of MSBuild project capabilities into C# code, allowing single files to stand alone as ordinary projects.
+
+The following is a file-based program:
+
+```cs
+Console.WriteLine("Hello World!");
+```
+
+So is the following:
+
+```cs
+#!/usr/bin/env dotnet run
+#:sdk Microsoft.Net.Sdk
+#:package Newtonsoft.Json@13.0.3
+#:property LangVersion=preview
+
+using Newtonsoft.Json;
+
+Main();
+
+void Main()
+{
+ if (args is not [_, var jsonPath, ..])
+ {
+ Console.Error.WriteLine("Usage: app ");
+ return;
+ }
+
+ var json = File.ReadAllText(jsonPath);
+ var data = JsonConvert.DeserializeObject(json);
+ // ...
+}
+
+record Data(string field1, int field2);
+```
+
+This basically works by having the `dotnet` command line interpret the `#:` directives in source files, produce a C# project XML document in memory, and pass it off to MSBuild. The in-memory project is sometimes called a "virtual project".
+
+## Miscellaneous files changes
+
+There is a long-standing backlog item to enhance the experience of working with miscellaneous files ("loose files" not associated with any project). We think that as part of the "file-based program" work, we can enable the following in such files without substantial issues:
+- Syntax diagnostics.
+- Intellisense for the "default" set of references. e.g. those references which are included in the project created by `dotnet new console` with the current SDK.
+
+### Heuristic
+The IDE considers a file to be a file-based program, if:
+- It has any `#:` directives which configure the file-based program project, or,
+- It has any top-level statements.
+Any of the above is met, and, the file is not included in an ordinary `.csproj` project (i.e. it is not part of any ordinary project's list of `Compile` items).
+
+### Opt-out
+
+We added an opt-out flag with option name `dotnet.projects.enableFileBasedPrograms`. If issues arise with the file-based program experience, then VS Code users should set the corresponding setting `"dotnet.projects.enableFileBasedPrograms": false` to revert back to the old miscellaneous files experience.
diff --git a/src/roslyn/eng/Version.Details.xml b/src/roslyn/eng/Version.Details.xml
index 711efd18b94..9af6ee4e621 100644
--- a/src/roslyn/eng/Version.Details.xml
+++ b/src/roslyn/eng/Version.Details.xml
@@ -110,13 +110,13 @@
-
+
https://github.com/dotnet/arcade
- 1cfa39f82d00b3659a3d367bc344241946e10681
+ ac63dcf2791c32bf2102fd2b5ebb46479bd48a83
-
+
https://github.com/dotnet/arcade
- 1cfa39f82d00b3659a3d367bc344241946e10681
+ ac63dcf2791c32bf2102fd2b5ebb46479bd48a83
https://github.com/dotnet/symreader
@@ -126,9 +126,9 @@
https://github.com/dotnet/roslyn
5d10d428050c0d6afef30a072c4ae68776621877
-
+
https://github.com/dotnet/arcade
- 1cfa39f82d00b3659a3d367bc344241946e10681
+ ac63dcf2791c32bf2102fd2b5ebb46479bd48a83
https://github.com/dotnet/roslyn-analyzers
diff --git a/src/roslyn/eng/config/BannedSymbols.txt b/src/roslyn/eng/config/BannedSymbols.txt
index d8c18b513fd..8558e121b5d 100644
--- a/src/roslyn/eng/config/BannedSymbols.txt
+++ b/src/roslyn/eng/config/BannedSymbols.txt
@@ -59,6 +59,7 @@ M:Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxTree.Create(Microsoft.Code
M:Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxTree.Create(Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxNode,Microsoft.CodeAnalysis.VisualBasic.VisualBasicParseOptions,System.String,System.Text.Encoding); Use VisualBasicSyntaxTree sublass that takes checksum algorithm
M:Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxTree.ParseText(System.String,Microsoft.CodeAnalysis.VisualBasic.VisualBasicParseOptions,System.String,System.Text.Encoding,System.Collections.Immutable.ImmutableDictionary{System.String,Microsoft.CodeAnalysis.ReportDiagnostic},System.Threading.CancellationToken); Use overload with SourceText
M:Microsoft.CodeAnalysis.Workspaces.Workspace.SetCurrentSolution(Microsoft.CodeAnalysis.Solution); Use SetCurrentSolutionEx instead.
+M:Microsoft.CodeAnalysis.Project.AddDocument(System.String,System.String,System.Collections.Generic.IEnumerable{System.String},System.String); Use overload that takes SourceText. Make sure SourceText is created with encoding and checksum algorithm.
M:System.Enum.GetHashCode(); Cast to integral type to avoid boxing on .NET Framework
M:Microsoft.CodeAnalysis.CodeActions.CodeAction.PostProcessAsync(System.Collections.Generic.IEnumerable{Microsoft.CodeAnalysis.CodeActions.CodeActionOperation},System.Threading.CancellationToken); Use overload that takes a solution
M:Microsoft.CodeAnalysis.CodeActions.CodeAction.PostProcessChangesAsync(Microsoft.CodeAnalysis.Solution,System.Threading.CancellationToken); Use overload that takes a solution
diff --git a/src/roslyn/eng/config/PublishData.json b/src/roslyn/eng/config/PublishData.json
index 44e979e154e..1d494eeb3f5 100644
--- a/src/roslyn/eng/config/PublishData.json
+++ b/src/roslyn/eng/config/PublishData.json
@@ -36,6 +36,7 @@
"Microsoft.CodeAnalysis.PooledObjects": "arcade",
"Microsoft.CodeAnalysis.Collections": "arcade",
"Microsoft.CodeAnalysis.Threading": "arcade",
+ "Microsoft.CodeAnalysis.Extensions": "vs-impl",
"Microsoft.CodeAnalysis.Features": "arcade",
"Microsoft.CodeAnalysis.EditorFeatures": "vssdk",
"Microsoft.CodeAnalysis.EditorFeatures.Common": "vssdk",
diff --git a/src/roslyn/eng/test-rebuild.ps1 b/src/roslyn/eng/test-rebuild.ps1
index d58e2a4f1e2..8f6e6d33a8c 100644
--- a/src/roslyn/eng/test-rebuild.ps1
+++ b/src/roslyn/eng/test-rebuild.ps1
@@ -65,6 +65,7 @@ try {
" --exclude netstandard2.0\Microsoft.CodeAnalysis.Debugging.Package.dll" +
" --exclude netstandard2.0\Microsoft.CodeAnalysis.PooledObjects.Package.dll" +
" --exclude netstandard2.0\Microsoft.CodeAnalysis.Threading.Package.dll" +
+ " --exclude netstandard2.0\Microsoft.CodeAnalysis.Extensions.Package.dll" +
" --exclude netcoreapp3.1\Microsoft.CodeAnalysis.Workspaces.UnitTests.dll" +
" --exclude net472\Zip\tools\vsixexpinstaller\System.ValueTuple.dll" +
" --exclude net472\Zip\tools\vsixexpinstaller\VSIXExpInstaller.exe" +
diff --git a/src/roslyn/global.json b/src/roslyn/global.json
index d966053a94b..c3f433c9da3 100644
--- a/src/roslyn/global.json
+++ b/src/roslyn/global.json
@@ -11,8 +11,8 @@
}
},
"msbuild-sdks": {
- "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25255.5",
- "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.25255.5",
+ "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25263.2",
+ "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.25263.2",
"Microsoft.Build.Traversal": "3.4.0"
}
}
diff --git a/src/roslyn/src/Analyzers/CSharp/Tests/MakeFieldReadonly/MakeFieldReadonlyTests.cs b/src/roslyn/src/Analyzers/CSharp/Tests/MakeFieldReadonly/MakeFieldReadonlyTests.cs
index 64900d236f1..19047d5507c 100644
--- a/src/roslyn/src/Analyzers/CSharp/Tests/MakeFieldReadonly/MakeFieldReadonlyTests.cs
+++ b/src/roslyn/src/Analyzers/CSharp/Tests/MakeFieldReadonly/MakeFieldReadonlyTests.cs
@@ -2012,7 +2012,7 @@ await TestMissingInRegularAndScriptAsync(
"""
-
+
public sealed partial class Test
{
private int [|_value|];
@@ -2021,7 +2021,7 @@ public static void M()
=> _ = new Test { Value = 1 };
}
-
+
using System.CodeDom.Compiler;
[GeneratedCode(null, null)]
diff --git a/src/roslyn/src/Analyzers/CSharp/Tests/UseAutoProperty/UseAutoPropertyTests.cs b/src/roslyn/src/Analyzers/CSharp/Tests/UseAutoProperty/UseAutoPropertyTests.cs
index dee40acd9b0..600dd05a4ac 100644
--- a/src/roslyn/src/Analyzers/CSharp/Tests/UseAutoProperty/UseAutoPropertyTests.cs
+++ b/src/roslyn/src/Analyzers/CSharp/Tests/UseAutoProperty/UseAutoPropertyTests.cs
@@ -2751,7 +2751,7 @@ await TestInRegularAndScript1Async(
"""
-
+
public class Foo
{
private readonly object o;
@@ -2759,7 +2759,7 @@ public class Foo
[||]public object O => o;
}
-
+
[*]
indent_style = tab
@@ -2769,13 +2769,13 @@ public class Foo
"""
-
+
public class Foo
{
public object O { get; }
}
-
+
[*]
indent_style = tab
@@ -2791,7 +2791,7 @@ await TestInRegularAndScript1Async(
"""
-
+
public class Foo
{
private readonly object o;
@@ -2799,7 +2799,7 @@ public class Foo
[||]public object O => o;
}
-
+
[*]
indent_style = space
@@ -2809,13 +2809,13 @@ public class Foo
"""
-
+
public class Foo
{
public object O { get; }
}
-
+
[*]
indent_style = space
diff --git a/src/roslyn/src/Analyzers/Core/Analyzers/Formatting/AbstractFormattingAnalyzer.cs b/src/roslyn/src/Analyzers/Core/Analyzers/Formatting/AbstractFormattingAnalyzer.cs
index 7d4f8392dff..4d168bbc826 100644
--- a/src/roslyn/src/Analyzers/Core/Analyzers/Formatting/AbstractFormattingAnalyzer.cs
+++ b/src/roslyn/src/Analyzers/Core/Analyzers/Formatting/AbstractFormattingAnalyzer.cs
@@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Formatting;
using Microsoft.CodeAnalysis.Text;
diff --git a/src/roslyn/src/Analyzers/Core/CodeFixes/GenerateConstructor/AbstractGenerateConstructorService.cs b/src/roslyn/src/Analyzers/Core/CodeFixes/GenerateConstructor/AbstractGenerateConstructorService.cs
index 587e31e3c10..cf95b95ade7 100644
--- a/src/roslyn/src/Analyzers/Core/CodeFixes/GenerateConstructor/AbstractGenerateConstructorService.cs
+++ b/src/roslyn/src/Analyzers/Core/CodeFixes/GenerateConstructor/AbstractGenerateConstructorService.cs
@@ -10,6 +10,7 @@
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.Diagnostics.Analyzers.NamingStyles;
using Microsoft.CodeAnalysis.Internal.Log;
using Microsoft.CodeAnalysis.LanguageService;
diff --git a/src/roslyn/src/Analyzers/VisualBasic/Analyzers/RemoveUnnecessaryImports/VisualBasicRemoveUnnecessaryImportsDiagnosticAnalyzer.vb b/src/roslyn/src/Analyzers/VisualBasic/Analyzers/RemoveUnnecessaryImports/VisualBasicRemoveUnnecessaryImportsDiagnosticAnalyzer.vb
index 2352fc3b1e0..4351838cff6 100644
--- a/src/roslyn/src/Analyzers/VisualBasic/Analyzers/RemoveUnnecessaryImports/VisualBasicRemoveUnnecessaryImportsDiagnosticAnalyzer.vb
+++ b/src/roslyn/src/Analyzers/VisualBasic/Analyzers/RemoveUnnecessaryImports/VisualBasicRemoveUnnecessaryImportsDiagnosticAnalyzer.vb
@@ -5,6 +5,7 @@
Imports System.Collections.Immutable
Imports System.Threading
Imports Microsoft.CodeAnalysis
+Imports Microsoft.CodeAnalysis.Collections
Imports Microsoft.CodeAnalysis.Diagnostics
Imports Microsoft.CodeAnalysis.LanguageService
Imports Microsoft.CodeAnalysis.PooledObjects
diff --git a/src/roslyn/src/Analyzers/VisualBasic/Tests/UseAutoProperty/UseAutoPropertyTests.vb b/src/roslyn/src/Analyzers/VisualBasic/Tests/UseAutoProperty/UseAutoPropertyTests.vb
index b4315767663..6b45bb99245 100644
--- a/src/roslyn/src/Analyzers/VisualBasic/Tests/UseAutoProperty/UseAutoPropertyTests.vb
+++ b/src/roslyn/src/Analyzers/VisualBasic/Tests/UseAutoProperty/UseAutoPropertyTests.vb
@@ -1126,7 +1126,7 @@ End Class", options:=[Option](FormattingOptions2.UseTabs, False))
Await TestInRegularAndScriptAsync(
"
-
+
Public Class Foo
[||]Private ReadOnly o2 As Object
@@ -1137,7 +1137,7 @@ Public Class Foo
End Property
End Class
-
+
[*]
indent_style = tab
@@ -1145,12 +1145,12 @@ indent_style = tab
",
"
-
+
Public Class Foo
Public ReadOnly Property O As Object
End Class
-
+
[*]
indent_style = tab
@@ -1163,7 +1163,7 @@ indent_style = tab
Await TestInRegularAndScriptAsync(
"
-
+
Public Class Foo
[||]Private ReadOnly o2 As Object
@@ -1174,7 +1174,7 @@ Public Class Foo
End Property
End Class
-
+
[*]
indent_style = space
@@ -1182,12 +1182,12 @@ indent_style = space
",
"
-
+
Public Class Foo
Public ReadOnly Property O As Object
End Class
-
+
[*]
indent_style = space
diff --git a/src/roslyn/src/CodeStyle/Core/Analyzers/Microsoft.CodeAnalysis.CodeStyle.csproj b/src/roslyn/src/CodeStyle/Core/Analyzers/Microsoft.CodeAnalysis.CodeStyle.csproj
index 8860cb81eed..928ffeb9c51 100644
--- a/src/roslyn/src/CodeStyle/Core/Analyzers/Microsoft.CodeAnalysis.CodeStyle.csproj
+++ b/src/roslyn/src/CodeStyle/Core/Analyzers/Microsoft.CodeAnalysis.CodeStyle.csproj
@@ -51,5 +51,6 @@
+
\ No newline at end of file
diff --git a/src/roslyn/src/Compilers/CSharp/CSharpAnalyzerDriver/CSharpDeclarationComputer.cs b/src/roslyn/src/Compilers/CSharp/CSharpAnalyzerDriver/CSharpDeclarationComputer.cs
index 85c78efd1a2..e2bef81c113 100644
--- a/src/roslyn/src/Compilers/CSharp/CSharpAnalyzerDriver/CSharpDeclarationComputer.cs
+++ b/src/roslyn/src/Compilers/CSharp/CSharpAnalyzerDriver/CSharpDeclarationComputer.cs
@@ -10,6 +10,7 @@
using System.Diagnostics;
using System.Linq;
using System.Threading;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.CodeAnalysis.Text;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Binder/Binder.CapturedParametersFinder.cs b/src/roslyn/src/Compilers/CSharp/Portable/Binder/Binder.CapturedParametersFinder.cs
index 8a67729e863..ed16cb85c3d 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Binder/Binder.CapturedParametersFinder.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Binder/Binder.CapturedParametersFinder.cs
@@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.Diagnostics;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.PooledObjects;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Binder/Binder_Deconstruct.cs b/src/roslyn/src/Compilers/CSharp/Portable/Binder/Binder_Deconstruct.cs
index 06a853b99f7..36f16a49668 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Binder/Binder_Deconstruct.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Binder/Binder_Deconstruct.cs
@@ -683,7 +683,7 @@ private BoundExpression MakeDeconstructInvocationExpression(
// This prevents, for example, an unused params parameter after the out parameters.
var deconstructMethod = ((BoundCall)result).Method;
var parameters = deconstructMethod.Parameters;
- for (int i = (deconstructMethod.IsExtensionMethod ? 1 : 0); i < parameters.Length; i++) // Tracked by https://github.com/dotnet/roslyn/issues/76130: Test this code path with new extensions
+ for (int i = (deconstructMethod.IsExtensionMethod ? 1 : 0); i < parameters.Length; i++)
{
if (parameters[i].RefKind != RefKind.Out)
{
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Binder/Binder_InterpolatedString.cs b/src/roslyn/src/Compilers/CSharp/Portable/Binder/Binder_InterpolatedString.cs
index 2fe795e8b50..fb21a3e6ba5 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Binder/Binder_InterpolatedString.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Binder/Binder_InterpolatedString.cs
@@ -339,7 +339,7 @@ private BoundInterpolatedString BindUnconvertedInterpolatedExpressionToFactory(
SyntaxNode syntax = unconvertedSource.Syntax;
ImmutableArray expressions = makeInterpolatedStringFactoryArguments(syntax, parts, diagnostics);
- BoundExpression construction = MakeInvocationExpression(
+ BoundExpression construction = MakeInvocationExpression( // Tracked by https://github.com/dotnet/roslyn/issues/76130 : test this scenario with a delegate-returning property (should be blocked by virtue of allowFieldsAndProperties: false)
syntax,
new BoundTypeExpression(syntax, null, factoryType) { WasCompilerGenerated = true },
factoryMethod,
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Binder/Binder_Invocation.cs b/src/roslyn/src/Compilers/CSharp/Portable/Binder/Binder_Invocation.cs
index c434edd5229..ef11a6d9fb0 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Binder/Binder_Invocation.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Binder/Binder_Invocation.cs
@@ -137,11 +137,11 @@ internal BoundExpression MakeInvocationExpression(
}
BoundExpression result = BindInvocationExpression(
- node, node, methodName, boundExpression, analyzedArguments, diagnostics, queryClause,
- ignoreNormalFormIfHasValidParamsParameter: ignoreNormalFormIfHasValidParamsParameter,
+ node, node, methodName, boundExpression, analyzedArguments, diagnostics, acceptOnlyMethods: !allowFieldsAndProperties,
+ queryClause, ignoreNormalFormIfHasValidParamsParameter: ignoreNormalFormIfHasValidParamsParameter,
disallowExpandedNonArrayParams: disallowExpandedNonArrayParams);
- // Query operator can't be called dynamically.
+ // Query operator can't be called dynamically.
if (queryClause != null && result.Kind == BoundKind.DynamicInvocation)
{
// the error has already been reported by BindInvocationExpression
@@ -245,7 +245,7 @@ BoundExpression bindArgumentsAndInvocation(InvocationExpressionSyntax node, Boun
boundExpression = CheckValue(boundExpression, BindValueKind.RValueOrMethodGroup, diagnostics);
string name = boundExpression.Kind == BoundKind.MethodGroup ? GetName(node.Expression) : null;
BindArgumentsAndNames(node.ArgumentList, diagnostics, analyzedArguments, allowArglist: true);
- return BindInvocationExpression(node, node.Expression, name, boundExpression, analyzedArguments, diagnostics);
+ return BindInvocationExpression(node, node.Expression, name, boundExpression, analyzedArguments, diagnostics, acceptOnlyMethods: false);
}
static bool receiverIsInvocation(InvocationExpressionSyntax node, out InvocationExpressionSyntax nested)
@@ -324,6 +324,7 @@ private BoundExpression BindInvocationExpression(
BoundExpression boundExpression,
AnalyzedArguments analyzedArguments,
BindingDiagnosticBag diagnostics,
+ bool acceptOnlyMethods,
CSharpSyntaxNode queryClause = null,
bool ignoreNormalFormIfHasValidParamsParameter = false,
bool disallowExpandedNonArrayParams = false)
@@ -356,7 +357,7 @@ private BoundExpression BindInvocationExpression(
ignoreNormalFormIfHasValidParamsParameter: ignoreNormalFormIfHasValidParamsParameter,
disallowExpandedNonArrayParams: disallowExpandedNonArrayParams,
anyApplicableCandidates: out _,
- acceptOnlyMethods: false);
+ acceptOnlyMethods: acceptOnlyMethods);
}
else if ((object)(delegateType = GetDelegateType(boundExpression)) != null)
{
@@ -727,7 +728,7 @@ private BoundExpression BindMethodGroupInvocation(
Debug.Assert(extensionMemberAccess.Kind != BoundKind.MethodGroup);
extensionMemberAccess = CheckValue(extensionMemberAccess, BindValueKind.RValue, diagnostics);
- BoundExpression extensionMemberInvocation = BindInvocationExpression(syntax, expression, methodName: null, extensionMemberAccess, analyzedArguments, diagnostics);
+ BoundExpression extensionMemberInvocation = BindInvocationExpression(syntax, expression, methodName: null, extensionMemberAccess, analyzedArguments, diagnostics, acceptOnlyMethods: false);
anyApplicableCandidates = !extensionMemberInvocation.HasAnyErrors;
return extensionMemberInvocation;
}
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Binder/Binder_Patterns.cs b/src/roslyn/src/Compilers/CSharp/Portable/Binder/Binder_Patterns.cs
index ce3304eef8d..860fbe3e565 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Binder/Binder_Patterns.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Binder/Binder_Patterns.cs
@@ -1058,7 +1058,7 @@ deconstructMethod is null &&
if (deconstructMethod is null)
hasErrors = true;
- int skippedExtensionParameters = deconstructMethod?.IsExtensionMethod == true ? 1 : 0; // Tracked by https://github.com/dotnet/roslyn/issues/76130: Test this code path with new extensions
+ int skippedExtensionParameters = deconstructMethod?.IsExtensionMethod == true ? 1 : 0;
for (int i = 0; i < node.Subpatterns.Count; i++)
{
var subPattern = node.Subpatterns[i];
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Binder/RefSafetyAnalysis.cs b/src/roslyn/src/Compilers/CSharp/Portable/Binder/RefSafetyAnalysis.cs
index 91747ec2bbc..019efd40e18 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Binder/RefSafetyAnalysis.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Binder/RefSafetyAnalysis.cs
@@ -627,7 +627,7 @@ static SafeContext getDeclarationValEscape(BoundTypeExpression typeExpression, S
// and so the ref safety of the pattern is equivalent to a `Deconstruct(out var ...)` invocation
// where "safe-context inference of declaration expressions" would have the same effect.
if (node.DeconstructMethod is { } m &&
- tryGetThisParameter(m)?.EffectiveScope == ScopedKind.None)
+ tryGetReceiverParameter(m)?.EffectiveScope == ScopedKind.None)
{
using (new PatternInput(this, _localScopeDepth))
{
@@ -637,12 +637,16 @@ static SafeContext getDeclarationValEscape(BoundTypeExpression typeExpression, S
return base.VisitRecursivePattern(node);
- static ParameterSymbol? tryGetThisParameter(MethodSymbol method)
+ static ParameterSymbol? tryGetReceiverParameter(MethodSymbol method)
{
- if (method.IsExtensionMethod) // Tracked by https://github.com/dotnet/roslyn/issues/76130: Test this code path with new extensions
+ if (method.IsExtensionMethod)
{
return method.Parameters is [{ } firstParameter, ..] ? firstParameter : null;
}
+ else if (method.GetIsNewExtensionMember())
+ {
+ return method.ContainingType.ExtensionParameter;
+ }
return method.TryGetThisParameter(out var thisParameter) ? thisParameter : null;
}
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/MethodTypeInference.cs b/src/roslyn/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/MethodTypeInference.cs
index 6739e439ee5..e6c1bb9edd3 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/MethodTypeInference.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/MethodTypeInference.cs
@@ -652,7 +652,7 @@ private void MakeExplicitParameterTypeInferences(Binder binder, BoundExpression
}
else if (IsUnfixedTypeParameter(target) && !target.NullableAnnotation.IsAnnotated() && kind is ExactOrBoundsKind.LowerBound)
{
- var ordinal = GetOrdinal((TypeParameterSymbol)target.Type); // Tracked by https://github.com/dotnet/roslyn/issues/76130 : test nullability scenario where the override of ordinals matters
+ var ordinal = GetOrdinal((TypeParameterSymbol)target.Type);
_nullableAnnotationLowerBounds[ordinal] = _nullableAnnotationLowerBounds[ordinal].Join(argumentType.NullableAnnotation);
}
}
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/CSharpResources.resx b/src/roslyn/src/Compilers/CSharp/Portable/CSharpResources.resx
index 61cb849a9e4..b3f569a40c1 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/CSharpResources.resx
+++ b/src/roslyn/src/Compilers/CSharp/Portable/CSharpResources.resx
@@ -547,7 +547,7 @@
Inconsistent accessibility: indexer return type '{1}' is less accessible than indexer '{0}'
- Inconsistent accessibility: parameter type '{1}' is less accessible than indexer '{0}'
+ Inconsistent accessibility: parameter type '{1}' is less accessible than indexer or property '{0}'
Inconsistent accessibility: return type '{1}' is less accessible than operator '{0}'
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Declarations/DeclarationTable.cs b/src/roslyn/src/Compilers/CSharp/Portable/Declarations/DeclarationTable.cs
index 35274e114af..44c7cfa969a 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Declarations/DeclarationTable.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Declarations/DeclarationTable.cs
@@ -6,6 +6,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.PooledObjects;
using Roslyn.Utilities;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Emitter/EditAndContinue/EmitHelpers.cs b/src/roslyn/src/Compilers/CSharp/Portable/Emitter/EditAndContinue/EmitHelpers.cs
index 03e2185b727..222963e9f55 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Emitter/EditAndContinue/EmitHelpers.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Emitter/EditAndContinue/EmitHelpers.cs
@@ -10,6 +10,7 @@
using System.Reflection.Metadata;
using System.Threading;
using Microsoft.CodeAnalysis.CodeGen;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE;
using Microsoft.CodeAnalysis.Emit;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/AssemblyReference.cs b/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/AssemblyReference.cs
index 4c682100fcd..067c5910bc0 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/AssemblyReference.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/AssemblyReference.cs
@@ -6,11 +6,12 @@
using System;
using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Diagnostics;
using System.Reflection;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Roslyn.Utilities;
-using System.Diagnostics;
-using System.Collections.Immutable;
namespace Microsoft.CodeAnalysis.CSharp.Emit
{
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/FunctionPointerTypeSymbolAdapter.cs b/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/FunctionPointerTypeSymbolAdapter.cs
index 08765ddc7a0..7bf3c4b7924 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/FunctionPointerTypeSymbolAdapter.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/FunctionPointerTypeSymbolAdapter.cs
@@ -7,6 +7,7 @@
using System.Reflection.Metadata;
using System.Threading;
using Microsoft.Cci;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.Emit;
using Microsoft.CodeAnalysis.Symbols;
using Roslyn.Utilities;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/ModuleReference.cs b/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/ModuleReference.cs
index 3feead87fc0..788ee08c2ef 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/ModuleReference.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/ModuleReference.cs
@@ -8,6 +8,7 @@
using System.Collections.Immutable;
using System.Diagnostics;
using System.Reflection;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.Emit;
using Roslyn.Utilities;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/NamedTypeReference.cs b/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/NamedTypeReference.cs
index 0636eb1fa96..ec227b7a699 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/NamedTypeReference.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/NamedTypeReference.cs
@@ -7,6 +7,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection.Metadata;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.Emit;
using Roslyn.Utilities;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/NamedTypeSymbolAdapter.cs b/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/NamedTypeSymbolAdapter.cs
index 9fb7c177d38..7be1ce2af19 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/NamedTypeSymbolAdapter.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/NamedTypeSymbolAdapter.cs
@@ -11,6 +11,7 @@
using System.Reflection.Metadata;
using System.Runtime.InteropServices;
using Microsoft.Cci;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Emit;
using Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE;
using Microsoft.CodeAnalysis.Emit;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/PEModuleBuilder.cs b/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/PEModuleBuilder.cs
index 38f5669225f..44178fe8e4c 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/PEModuleBuilder.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/PEModuleBuilder.cs
@@ -15,6 +15,7 @@
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeGen;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.Emit;
using Microsoft.CodeAnalysis.PooledObjects;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/PENetModuleBuilder.cs b/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/PENetModuleBuilder.cs
index 576881232a3..f8889a0a0be 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/PENetModuleBuilder.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/PENetModuleBuilder.cs
@@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.Emit;
using Microsoft.CodeAnalysis.PooledObjects;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/SymbolAdapter.cs b/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/SymbolAdapter.cs
index 44b552ef719..07c68572755 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/SymbolAdapter.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/SymbolAdapter.cs
@@ -8,6 +8,7 @@
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Emit;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/TypeMemberReference.cs b/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/TypeMemberReference.cs
index e10acefabb9..eda13204ce1 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/TypeMemberReference.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Emitter/Model/TypeMemberReference.cs
@@ -5,6 +5,7 @@
#nullable disable
using System.Collections.Generic;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.Emit;
using Roslyn.Utilities;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Errors/CSDiagnosticInfo.cs b/src/roslyn/src/Compilers/CSharp/Portable/Errors/CSDiagnosticInfo.cs
index a55bd7fcd3e..704d7fa78a5 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Errors/CSDiagnosticInfo.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Errors/CSDiagnosticInfo.cs
@@ -8,6 +8,7 @@
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
+using Microsoft.CodeAnalysis.Collections;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.CSharp
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/FlowAnalysis/AlwaysAssignedWalker.cs b/src/roslyn/src/Compilers/CSharp/Portable/FlowAnalysis/AlwaysAssignedWalker.cs
index d0968cbae14..c562970d33c 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/FlowAnalysis/AlwaysAssignedWalker.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/FlowAnalysis/AlwaysAssignedWalker.cs
@@ -7,6 +7,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/FlowAnalysis/EmptyStructTypeCache.cs b/src/roslyn/src/Compilers/CSharp/Portable/FlowAnalysis/EmptyStructTypeCache.cs
index ba93a2a6603..7884d845796 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/FlowAnalysis/EmptyStructTypeCache.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/FlowAnalysis/EmptyStructTypeCache.cs
@@ -6,6 +6,7 @@
using System.Collections.Generic;
using System.Diagnostics;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Roslyn.Utilities;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/FlowAnalysis/EntryPointsWalker.cs b/src/roslyn/src/Compilers/CSharp/Portable/FlowAnalysis/EntryPointsWalker.cs
index b7ef6b04e09..13ae85db3ca 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/FlowAnalysis/EntryPointsWalker.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/FlowAnalysis/EntryPointsWalker.cs
@@ -7,6 +7,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/FlowAnalysis/VariablesDeclaredWalker.cs b/src/roslyn/src/Compilers/CSharp/Portable/FlowAnalysis/VariablesDeclaredWalker.cs
index 06a907ec88a..4fbadee5185 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/FlowAnalysis/VariablesDeclaredWalker.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/FlowAnalysis/VariablesDeclaredWalker.cs
@@ -5,12 +5,13 @@
#nullable disable
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;
-using System.Diagnostics;
namespace Microsoft.CodeAnalysis.CSharp
{
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Lowering/ClosureConversion/SynthesizedClosureEnvironment.cs b/src/roslyn/src/Compilers/CSharp/Portable/Lowering/ClosureConversion/SynthesizedClosureEnvironment.cs
index b7754a59820..c7929635e69 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Lowering/ClosureConversion/SynthesizedClosureEnvironment.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Lowering/ClosureConversion/SynthesizedClosureEnvironment.cs
@@ -8,6 +8,7 @@
using System.Collections.Immutable;
using System.Diagnostics;
using Microsoft.CodeAnalysis.CodeGen;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.Emit;
using Microsoft.CodeAnalysis.PooledObjects;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter.PatternLocalRewriter.cs b/src/roslyn/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter.PatternLocalRewriter.cs
index 56b944a4888..ac58ea84b9d 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter.PatternLocalRewriter.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter.PatternLocalRewriter.cs
@@ -152,6 +152,7 @@ protected BoundExpression LowerEvaluation(BoundDagEvaluation evaluation)
PropertySymbol property = p.Property;
var outputTemp = new BoundDagTemp(p.Syntax, property.Type, p);
BoundExpression output = _tempAllocator.GetTemp(outputTemp);
+ input = _factory.ConvertReceiverForExtensionMemberIfNeeded(property, input);
return _factory.AssignmentExpression(output, _localRewriter.MakePropertyAccess(_factory.Syntax, input, property, LookupResultKind.Viable, property.Type, isLeftOfAssignment: false));
}
@@ -169,7 +170,7 @@ void addArg(RefKind refKind, BoundExpression expression)
Debug.Assert(method.Name == WellKnownMemberNames.DeconstructMethodName);
int extensionExtra;
- if (method.IsStatic) // Tracked by https://github.com/dotnet/roslyn/issues/76130: Test this code path with new extensions
+ if (method.IsStatic)
{
Debug.Assert(method.IsExtensionMethod);
receiver = _factory.Type(method.ContainingType);
@@ -190,6 +191,7 @@ void addArg(RefKind refKind, BoundExpression expression)
addArg(RefKind.Out, _tempAllocator.GetTemp(outputTemp));
}
+ receiver = _factory.ConvertReceiverForExtensionMemberIfNeeded(method, receiver);
return _factory.Call(receiver, method, refKindBuilder.ToImmutableAndFree(), argBuilder.ToImmutableAndFree());
}
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_FixedStatement.cs b/src/roslyn/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_FixedStatement.cs
index 892a1ba24ef..718c3fda82a 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_FixedStatement.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_FixedStatement.cs
@@ -355,6 +355,7 @@ private BoundStatement InitializeFixedStatementGetPinnable(
}
// .GetPinnable()
+ callReceiver = factory.ConvertReceiverForExtensionMemberIfNeeded(getPinnableMethod, callReceiver);
var getPinnableCall = getPinnableMethod.IsStatic ?
factory.Call(null, getPinnableMethod, callReceiver) :
factory.Call(callReceiver, getPinnableMethod);
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_ObjectOrCollectionInitializerExpression.cs b/src/roslyn/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_ObjectOrCollectionInitializerExpression.cs
index ec0cd11e141..da2b10c2df2 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_ObjectOrCollectionInitializerExpression.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_ObjectOrCollectionInitializerExpression.cs
@@ -698,9 +698,11 @@ private BoundExpression MakeObjectInitializerMemberAccess(
#if DEBUG
var discardedUseSiteInfo = CompoundUseSiteInfo.Discarded;
Debug.Assert(_compilation.Conversions.ClassifyConversionFromType(rewrittenReceiver.Type, memberSymbol.ContainingType, isChecked: false, ref discardedUseSiteInfo).IsImplicit ||
+ (memberSymbol.GetIsNewExtensionMember() && !memberSymbol.IsStatic && ConversionsBase.IsValidExtensionMethodThisArgConversion(_compilation.Conversions.ClassifyConversionFromType(rewrittenReceiver.Type, memberSymbol.ContainingType.ExtensionParameter!.Type, isChecked: false, ref discardedUseSiteInfo))) ||
_compilation.Conversions.HasImplicitConversionToOrImplementsVarianceCompatibleInterface(rewrittenReceiver.Type, memberSymbol.ContainingType, ref discardedUseSiteInfo, out _));
// It is possible there are use site diagnostics from the above, but none that we need report as we aren't generating code for the conversion
#endif
+ rewrittenReceiver = _factory.ConvertReceiverForExtensionMemberIfNeeded(memberSymbol, rewrittenReceiver);
switch (memberSymbol.Kind)
{
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Lowering/SynthesizedMethodBaseSymbol.cs b/src/roslyn/src/Compilers/CSharp/Portable/Lowering/SynthesizedMethodBaseSymbol.cs
index a796c718606..09f0b8d2868 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Lowering/SynthesizedMethodBaseSymbol.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Lowering/SynthesizedMethodBaseSymbol.cs
@@ -11,6 +11,7 @@
using System.Reflection;
using System.Threading;
using Microsoft.Cci;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Emit;
using Microsoft.CodeAnalysis.PooledObjects;
using Roslyn.Utilities;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs b/src/roslyn/src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs
index 15748f836eb..72e2a86bf7c 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs
@@ -431,6 +431,24 @@ public BoundExpression AssignmentExpression(BoundExpression left, BoundExpressio
return AssignmentExpression(Syntax, left, right, isRef: isRef, wasCompilerGenerated: true);
}
+ public BoundExpression ConvertReceiverForExtensionMemberIfNeeded(Symbol member, BoundExpression receiver)
+ {
+ if (member.GetIsNewExtensionMember())
+ {
+ Debug.Assert(!member.IsStatic);
+ ParameterSymbol? extensionParameter = member.ContainingType.ExtensionParameter;
+ Debug.Assert(extensionParameter is not null);
+#if DEBUG
+ var discardedUseSiteInfo = CompoundUseSiteInfo.Discarded;
+ Debug.Assert(Conversions.IsValidExtensionMethodThisArgConversion(this.Compilation.Conversions.ClassifyConversionFromType(receiver.Type, extensionParameter.Type, isChecked: false, ref discardedUseSiteInfo)));
+#endif
+
+ return this.Convert(extensionParameter.Type, receiver);
+ }
+
+ return receiver;
+ }
+
///
/// Creates a general assignment that might be instrumented.
///
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/SymbolDisplay/SymbolDisplayVisitor_Minimal.cs b/src/roslyn/src/Compilers/CSharp/Portable/SymbolDisplay/SymbolDisplayVisitor_Minimal.cs
index 6f1c92c44ad..4df1ce062cf 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/SymbolDisplay/SymbolDisplayVisitor_Minimal.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/SymbolDisplay/SymbolDisplayVisitor_Minimal.cs
@@ -7,6 +7,7 @@
using System.Diagnostics;
using System.Linq;
using System.Threading;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.PooledObjects;
using Roslyn.Utilities;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/PublicSymbols/AnonymousManager.TypeOrDelegatePublicSymbol.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/PublicSymbols/AnonymousManager.TypeOrDelegatePublicSymbol.cs
index 7a7f6e03314..1faee4ca6cd 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/PublicSymbols/AnonymousManager.TypeOrDelegatePublicSymbol.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/PublicSymbols/AnonymousManager.TypeOrDelegatePublicSymbol.cs
@@ -6,6 +6,7 @@
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Runtime.InteropServices;
+using Microsoft.CodeAnalysis.Collections;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.CSharp.Symbols
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/SynthesizedSymbols/AnonymousType.DelegateTemplateSymbol.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/SynthesizedSymbols/AnonymousType.DelegateTemplateSymbol.cs
index 9988175aaa0..5f29d796fec 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/SynthesizedSymbols/AnonymousType.DelegateTemplateSymbol.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/SynthesizedSymbols/AnonymousType.DelegateTemplateSymbol.cs
@@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Emit;
using Microsoft.CodeAnalysis.PooledObjects;
using Roslyn.Utilities;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/SynthesizedSymbols/AnonymousType.TypeOrDelegateTemplateSymbol.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/SynthesizedSymbols/AnonymousType.TypeOrDelegateTemplateSymbol.cs
index 2d5944bc713..c8041fcc68a 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/SynthesizedSymbols/AnonymousType.TypeOrDelegateTemplateSymbol.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/SynthesizedSymbols/AnonymousType.TypeOrDelegateTemplateSymbol.cs
@@ -8,6 +8,7 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;
+using Microsoft.CodeAnalysis.Collections;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.CSharp.Symbols
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/ArrayTypeSymbol.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/ArrayTypeSymbol.cs
index 572ee0cc344..0ad5f45886c 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/ArrayTypeSymbol.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/ArrayTypeSymbol.cs
@@ -8,6 +8,7 @@
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.CodeAnalysis.Symbols;
using Roslyn.Utilities;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/DynamicTypeSymbol.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/DynamicTypeSymbol.cs
index 305545280cf..c88106e235d 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/DynamicTypeSymbol.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/DynamicTypeSymbol.cs
@@ -6,6 +6,7 @@
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.PooledObjects;
using Roslyn.Utilities;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/ErrorTypeSymbol.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/ErrorTypeSymbol.cs
index e1ce775921f..bc35c827607 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/ErrorTypeSymbol.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/ErrorTypeSymbol.cs
@@ -7,6 +7,7 @@
using System.Collections.Immutable;
using System.Diagnostics;
using System.Runtime.InteropServices;
+using Microsoft.CodeAnalysis.Collections;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.CSharp.Symbols
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/FunctionPointers/FunctionPointerTypeSymbol.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/FunctionPointers/FunctionPointerTypeSymbol.cs
index 0af58ff20b8..5a595ddcecf 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/FunctionPointers/FunctionPointerTypeSymbol.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/FunctionPointers/FunctionPointerTypeSymbol.cs
@@ -7,6 +7,7 @@
using System.Collections.Immutable;
using System.Diagnostics;
using Microsoft.Cci;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.PooledObjects;
using Roslyn.Utilities;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PEGlobalNamespaceSymbol.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PEGlobalNamespaceSymbol.cs
index 05500ca014e..546018c6523 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PEGlobalNamespaceSymbol.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PEGlobalNamespaceSymbol.cs
@@ -4,16 +4,17 @@
#nullable disable
-using Microsoft.CodeAnalysis.CSharp.Symbols;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-using Microsoft.CodeAnalysis.Text;
-using Roslyn.Utilities;
+using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection.Metadata;
-using System;
using System.Threading;
+using Microsoft.CodeAnalysis.Collections;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE
{
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/MissingAssemblySymbol.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/MissingAssemblySymbol.cs
index 91cb0f329d3..1c1c488965e 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/MissingAssemblySymbol.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/MissingAssemblySymbol.cs
@@ -10,6 +10,7 @@
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Threading;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/MissingModuleSymbol.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/MissingModuleSymbol.cs
index 4154d729b90..e5ded01c4a2 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/MissingModuleSymbol.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/MissingModuleSymbol.cs
@@ -10,6 +10,7 @@
using System.Diagnostics;
using System.Reflection.PortableExecutable;
using System.Runtime.InteropServices;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/NamespaceOrTypeSymbol.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/NamespaceOrTypeSymbol.cs
index 10ec3093df8..23a25f694e8 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/NamespaceOrTypeSymbol.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/NamespaceOrTypeSymbol.cs
@@ -7,6 +7,7 @@
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.CodeAnalysis.Symbols;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/NativeIntegerTypeSymbol.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/NativeIntegerTypeSymbol.cs
index 1364dedfc3c..f736683de14 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/NativeIntegerTypeSymbol.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/NativeIntegerTypeSymbol.cs
@@ -8,6 +8,7 @@
using System.Diagnostics;
using System.Linq;
using System.Threading;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.PooledObjects;
using Roslyn.Utilities;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/PointerTypeSymbol.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/PointerTypeSymbol.cs
index 11cd05b0834..8a19a720f6d 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/PointerTypeSymbol.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/PointerTypeSymbol.cs
@@ -5,9 +5,10 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
-using Roslyn.Utilities;
using System.Diagnostics;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.PooledObjects;
+using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.CSharp.Symbols
{
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/PropertyOrEventSymbolExtensions.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/PropertyOrEventSymbolExtensions.cs
index f692fb763a0..6671fc0a0d9 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/PropertyOrEventSymbolExtensions.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/PropertyOrEventSymbolExtensions.cs
@@ -6,6 +6,7 @@
using System.Collections.Generic;
using System.Collections.Immutable;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Source/SourceAssemblySymbol.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Source/SourceAssemblySymbol.cs
index 90d064f042a..629b285bde5 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Source/SourceAssemblySymbol.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Source/SourceAssemblySymbol.cs
@@ -12,6 +12,7 @@
using System.Linq;
using System.Reflection;
using System.Threading;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Emit;
using Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE;
using Microsoft.CodeAnalysis.CSharp.Syntax;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Source/SourceFixedFieldSymbol.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Source/SourceFixedFieldSymbol.cs
index 16402ae80cc..5c1e3e3e790 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Source/SourceFixedFieldSymbol.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Source/SourceFixedFieldSymbol.cs
@@ -10,6 +10,7 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Emit;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.PooledObjects;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Source/SourceMethodSymbolWithAttributes.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Source/SourceMethodSymbolWithAttributes.cs
index 39cd11f8b51..740883fe346 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Source/SourceMethodSymbolWithAttributes.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Source/SourceMethodSymbolWithAttributes.cs
@@ -14,6 +14,7 @@
using System.Text;
using System.Threading;
using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.CodeAnalysis.Shared.Collections;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/ReadOnlyListType/SynthesizedReadOnlyListEnumeratorTypeSymbol.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/ReadOnlyListType/SynthesizedReadOnlyListEnumeratorTypeSymbol.cs
index 0d6a1dd0e47..10585d9c9d7 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/ReadOnlyListType/SynthesizedReadOnlyListEnumeratorTypeSymbol.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/ReadOnlyListType/SynthesizedReadOnlyListEnumeratorTypeSymbol.cs
@@ -8,6 +8,7 @@
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.PooledObjects;
using Roslyn.Utilities;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/ReadOnlyListType/SynthesizedReadOnlyListTypeSymbol.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/ReadOnlyListType/SynthesizedReadOnlyListTypeSymbol.cs
index 7d1c4d80cfd..53039024f9c 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/ReadOnlyListType/SynthesizedReadOnlyListTypeSymbol.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/ReadOnlyListType/SynthesizedReadOnlyListTypeSymbol.cs
@@ -8,6 +8,7 @@
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Emit;
using Microsoft.CodeAnalysis.PooledObjects;
using Roslyn.Utilities;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/Records/SynthesizedPrimaryConstructor.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/Records/SynthesizedPrimaryConstructor.cs
index 965d2db9659..11062737533 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/Records/SynthesizedPrimaryConstructor.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/Records/SynthesizedPrimaryConstructor.cs
@@ -7,6 +7,7 @@
using System.Diagnostics;
using System.Linq;
using System.Threading;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Roslyn.Utilities;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedContainer.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedContainer.cs
index f4582d2a201..777c42eff8b 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedContainer.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedContainer.cs
@@ -9,8 +9,9 @@
using System.Collections.Immutable;
using System.Diagnostics;
using System.Runtime.InteropServices;
-using Microsoft.CodeAnalysis.PooledObjects;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Emit;
+using Microsoft.CodeAnalysis.PooledObjects;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.CSharp.Symbols
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedEmbeddedAttributeSymbol.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedEmbeddedAttributeSymbol.cs
index c57954b8425..12a5391732c 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedEmbeddedAttributeSymbol.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedEmbeddedAttributeSymbol.cs
@@ -4,16 +4,17 @@
#nullable disable
-using Microsoft.Cci;
-using Roslyn.Utilities;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
-using System.Runtime.InteropServices;
using System.Linq;
+using System.Runtime.InteropServices;
+using Microsoft.Cci;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Emit;
using Microsoft.CodeAnalysis.PooledObjects;
+using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.CSharp.Symbols
{
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedInlineArrayTypeSymbol.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedInlineArrayTypeSymbol.cs
index 317f919c9ba..54d00df7b3b 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedInlineArrayTypeSymbol.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedInlineArrayTypeSymbol.cs
@@ -7,6 +7,7 @@
using System.Collections.Immutable;
using System.Diagnostics;
using System.Runtime.InteropServices;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Emit;
using Microsoft.CodeAnalysis.PooledObjects;
using Roslyn.Utilities;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedIntrinsicOperatorSymbol.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedIntrinsicOperatorSymbol.cs
index 3c3fe92963a..12ec047f2ef 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedIntrinsicOperatorSymbol.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedIntrinsicOperatorSymbol.cs
@@ -4,11 +4,12 @@
#nullable disable
+using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
+using Microsoft.CodeAnalysis.Collections;
using Roslyn.Utilities;
-using System;
namespace Microsoft.CodeAnalysis.CSharp.Symbols
{
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedPrivateImplementationDetailsType.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedPrivateImplementationDetailsType.cs
index e207f611093..0fec97a2b57 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedPrivateImplementationDetailsType.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedPrivateImplementationDetailsType.cs
@@ -9,6 +9,7 @@
using System.Runtime.InteropServices;
using Microsoft.Cci;
using Microsoft.CodeAnalysis.CodeGen;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.Emit;
using Microsoft.CodeAnalysis.Symbols;
using Roslyn.Utilities;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/TypeParameterSymbol.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/TypeParameterSymbol.cs
index 57ed680f453..ae94e980832 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/TypeParameterSymbol.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/TypeParameterSymbol.cs
@@ -8,6 +8,7 @@
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.CodeAnalysis.Symbols;
using Roslyn.Utilities;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Syntax/CSharpSyntaxTree.cs b/src/roslyn/src/Compilers/CSharp/Portable/Syntax/CSharpSyntaxTree.cs
index d9563546a49..c7c3d656049 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Syntax/CSharpSyntaxTree.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Syntax/CSharpSyntaxTree.cs
@@ -13,6 +13,7 @@
using System.Text;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.CodeAnalysis.Text;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Syntax/CompilationUnitSyntax.cs b/src/roslyn/src/Compilers/CSharp/Portable/Syntax/CompilationUnitSyntax.cs
index e3bc236f583..726e2702ce4 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Syntax/CompilationUnitSyntax.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Syntax/CompilationUnitSyntax.cs
@@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
+using Microsoft.CodeAnalysis.Collections;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.CSharp.Syntax
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Syntax/InternalSyntax/CSharpSyntaxNode.cs b/src/roslyn/src/Compilers/CSharp/Portable/Syntax/InternalSyntax/CSharpSyntaxNode.cs
index 39479fcba12..5fcbbead083 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/Syntax/InternalSyntax/CSharpSyntaxNode.cs
+++ b/src/roslyn/src/Compilers/CSharp/Portable/Syntax/InternalSyntax/CSharpSyntaxNode.cs
@@ -9,6 +9,7 @@
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.Syntax.InternalSyntax;
using Roslyn.Utilities;
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf
index 37ae8bfc426..164941bfe1c 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf
+++ b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf
@@ -6009,8 +6009,8 @@
- Inconsistent accessibility: parameter type '{1}' is less accessible than indexer '{0}'
- Nekonzistentní dostupnost: Typ parametru {1} je míň dostupný než indexer {0}.
+ Inconsistent accessibility: parameter type '{1}' is less accessible than indexer or property '{0}'
+ Nekonzistentní dostupnost: Typ parametru {1} je míň dostupný než indexer {0}.
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf
index e481e2a7893..2cfd37350a1 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf
+++ b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf
@@ -6009,8 +6009,8 @@
- Inconsistent accessibility: parameter type '{1}' is less accessible than indexer '{0}'
- Inkonsistenter Zugriff: Parametertyp "{1}" ist weniger zugreifbar als Indexer "{0}".
+ Inconsistent accessibility: parameter type '{1}' is less accessible than indexer or property '{0}'
+ Inkonsistenter Zugriff: Parametertyp "{1}" ist weniger zugreifbar als Indexer "{0}".
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf
index 3dcae73e93f..5b904b8347d 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf
+++ b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf
@@ -6009,8 +6009,8 @@
- Inconsistent accessibility: parameter type '{1}' is less accessible than indexer '{0}'
- Incoherencia de accesibilidad: el tipo de parámetro '{1}' es menos accesible que el indizador '{0}'
+ Inconsistent accessibility: parameter type '{1}' is less accessible than indexer or property '{0}'
+ Incoherencia de accesibilidad: el tipo de parámetro '{1}' es menos accesible que el indizador '{0}'
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf
index 73299c0f677..3643165b3ae 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf
+++ b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf
@@ -6009,8 +6009,8 @@
- Inconsistent accessibility: parameter type '{1}' is less accessible than indexer '{0}'
- Accessibilité incohérente : le type de paramètre '{1}' est moins accessible que l'indexeur '{0}'
+ Inconsistent accessibility: parameter type '{1}' is less accessible than indexer or property '{0}'
+ Accessibilité incohérente : le type de paramètre '{1}' est moins accessible que l'indexeur '{0}'
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf
index ca9c6d18326..8f62ff52a10 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf
+++ b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf
@@ -6009,8 +6009,8 @@ target:module Compila un modulo che può essere aggiunto ad altro
- Inconsistent accessibility: parameter type '{1}' is less accessible than indexer '{0}'
- Accessibilità incoerente: il tipo parametro '{1}' è meno accessibile dell'indicizzatore '{0}'
+ Inconsistent accessibility: parameter type '{1}' is less accessible than indexer or property '{0}'
+ Accessibilità incoerente: il tipo parametro '{1}' è meno accessibile dell'indicizzatore '{0}'
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf
index 64ffd6274ee..af9147be028 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf
+++ b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf
@@ -6009,8 +6009,8 @@
- Inconsistent accessibility: parameter type '{1}' is less accessible than indexer '{0}'
- アクセシビリティに一貫性がありません。パラメーター型 '{1}' のアクセシビリティはインデクサー '{0}' よりも低く設定されています
+ Inconsistent accessibility: parameter type '{1}' is less accessible than indexer or property '{0}'
+ アクセシビリティに一貫性がありません。パラメーター型 '{1}' のアクセシビリティはインデクサー '{0}' よりも低く設定されています
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf
index 7c16a674e24..8f1588fb754 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf
+++ b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf
@@ -6009,8 +6009,8 @@
- Inconsistent accessibility: parameter type '{1}' is less accessible than indexer '{0}'
- 일관성 없는 액세스 가능성: '{1}' 매개 변수 형식이 '{0}' 인덱서보다 액세스하기 어렵습니다.
+ Inconsistent accessibility: parameter type '{1}' is less accessible than indexer or property '{0}'
+ 일관성 없는 액세스 가능성: '{1}' 매개 변수 형식이 '{0}' 인덱서보다 액세스하기 어렵습니다.
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf
index 40a51a9d7ab..8a892cfd63d 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf
+++ b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf
@@ -6009,8 +6009,8 @@
- Inconsistent accessibility: parameter type '{1}' is less accessible than indexer '{0}'
- Niespójność dostępności: typ parametru „{1}” jest mniej dostępny niż indeksator „{0}”
+ Inconsistent accessibility: parameter type '{1}' is less accessible than indexer or property '{0}'
+ Niespójność dostępności: typ parametru „{1}” jest mniej dostępny niż indeksator „{0}”
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf
index 133576185f6..827cc499e67 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf
+++ b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf
@@ -6009,8 +6009,8 @@
- Inconsistent accessibility: parameter type '{1}' is less accessible than indexer '{0}'
- Acessibilidade inconsistente: tipo de parâmetro "{1}" é menos acessível do que o indexador "{0}"
+ Inconsistent accessibility: parameter type '{1}' is less accessible than indexer or property '{0}'
+ Acessibilidade inconsistente: tipo de parâmetro "{1}" é menos acessível do que o indexador "{0}"
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf
index 30b7d953160..7488a8c4a28 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf
+++ b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf
@@ -6010,8 +6010,8 @@
- Inconsistent accessibility: parameter type '{1}' is less accessible than indexer '{0}'
- Несогласованность по доступности: доступность типа параметра "{1}" ниже доступности индексатора "{0}"
+ Inconsistent accessibility: parameter type '{1}' is less accessible than indexer or property '{0}'
+ Несогласованность по доступности: доступность типа параметра "{1}" ниже доступности индексатора "{0}"
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf
index 2c46ca1dae0..1e55e37679f 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf
+++ b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf
@@ -6009,8 +6009,8 @@
- Inconsistent accessibility: parameter type '{1}' is less accessible than indexer '{0}'
- Tutarsız erişilebilirlik: '{1}' parametre türü, '{0}' dizin oluşturucusundan daha az erişilebilir
+ Inconsistent accessibility: parameter type '{1}' is less accessible than indexer or property '{0}'
+ Tutarsız erişilebilirlik: '{1}' parametre türü, '{0}' dizin oluşturucusundan daha az erişilebilir
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf
index 8ca0b9a047b..d205367c9b8 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf
+++ b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf
@@ -6009,8 +6009,8 @@
- Inconsistent accessibility: parameter type '{1}' is less accessible than indexer '{0}'
- 可访问性不一致: 参数类型“{1}”的可访问性低于索引器“{0}”
+ Inconsistent accessibility: parameter type '{1}' is less accessible than indexer or property '{0}'
+ 可访问性不一致: 参数类型“{1}”的可访问性低于索引器“{0}”
diff --git a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf
index 04b102802f3..fa2ad94a245 100644
--- a/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf
+++ b/src/roslyn/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf
@@ -6009,8 +6009,8 @@ strument:TestCoverage 產生檢測要收集
- Inconsistent accessibility: parameter type '{1}' is less accessible than indexer '{0}'
- 不一致的存取範圍: 參數類型 '{1}' 比索引子 '{0}' 的存取範圍小
+ Inconsistent accessibility: parameter type '{1}' is less accessible than indexer or property '{0}'
+ 不一致的存取範圍: 參數類型 '{1}' 比索引子 '{0}' 的存取範圍小
diff --git a/src/roslyn/src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs b/src/roslyn/src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs
index f67a433d908..8b56952f07c 100644
--- a/src/roslyn/src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs
+++ b/src/roslyn/src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs
@@ -8,6 +8,7 @@
using System.Collections.Generic;
using System.Collections.Immutable;
using System.ComponentModel;
+using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.IO.MemoryMappedFiles;
@@ -20,7 +21,9 @@
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
+using Basic.Reference.Assemblies;
using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.CSharp.Test.Utilities;
using Microsoft.CodeAnalysis.Diagnostics;
@@ -35,10 +38,8 @@
using Roslyn.Utilities;
using TestResources.Analyzers;
using Xunit;
-using Basic.Reference.Assemblies;
using static Microsoft.CodeAnalysis.CommonDiagnosticAnalyzers;
using static Roslyn.Test.Utilities.SharedResourceHelpers;
-using System.Diagnostics;
namespace Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests
{
diff --git a/src/roslyn/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenExprLambdaTests.cs b/src/roslyn/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenExprLambdaTests.cs
index a79f04945d6..0e748539c83 100644
--- a/src/roslyn/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenExprLambdaTests.cs
+++ b/src/roslyn/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenExprLambdaTests.cs
@@ -30,362 +30,6 @@ protected CompilationVerifier CompileAndVerifyUtil(
///
protected static MetadataReference ExpressionAssemblyRef => SystemCoreRef_v46;
- #region A string containing expression-tree dumping utilities
- private const string ExpressionTestLibrary = @"
-using System;
-using System.Globalization;
-using System.Linq.Expressions;
-using System.Text;
-
-public class TestBase
-{
- protected static void DCheck(Expression e, string expected) { Check(e.Dump(), expected); }
- protected static void Check(Expression> e, string expected) { Check(e.Dump(), expected); }
- protected static void Check(Expression> e, string expected) { Check(e.Dump(), expected); }
- protected static void Check(Expression> e, string expected) { Check(e.Dump(), expected); }
- protected static void Check(Expression> e, string expected) { Check(e.Dump(), expected); }
- protected static string ToString(Expression> e) { return e.Dump(); }
- protected static string ToString(Expression> e) { return e.Dump(); }
- protected static string ToString(Expression> e) { return e.Dump(); }
- private static void Check(string actual, string expected)
- {
- if (expected != actual)
- {
- Console.WriteLine(""FAIL"");
- Console.WriteLine(""expected: "" + expected);
- Console.WriteLine(""actual: "" + actual);
-// throw new Exception(""expected='"" + expected + ""'; actual='"" + actual + ""'"");
- }
- }
-}
-
-public static class ExpressionExtensions
-{
- public static string Dump(this Expression self)
- {
- return ExpressionPrinter.Print(self.Body);
- }
-}
-
-class ExpressionPrinter : System.Linq.Expressions.ExpressionVisitor
-{
- private StringBuilder s = new StringBuilder();
-
- public static string Print(Expression e)
- {
- var p = new ExpressionPrinter();
- p.Visit(e);
- return p.s.ToString();
- }
-
- public override Expression Visit(Expression node)
- {
- if (node == null) { s.Append(""null""); return null; }
- s.Append(node.NodeType.ToString());
- s.Append(""("");
- base.Visit(node);
- s.Append("" Type:"" + node.Type);
- s.Append("")"");
- return null;
- }
-
- protected override MemberBinding VisitMemberBinding(MemberBinding node)
- {
- if (node == null) { s.Append(""null""); return null; }
- return base.VisitMemberBinding(node);
- }
-
- protected override MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding node)
- {
- s.Append(""MemberMemberBinding(Member="");
- s.Append(node.Member.ToString());
- foreach (var b in node.Bindings)
- {
- s.Append("" "");
- VisitMemberBinding(b);
- }
- s.Append("")"");
- return null;
- }
-
- protected override MemberListBinding VisitMemberListBinding(MemberListBinding node)
- {
- s.Append(""MemberListBinding(Member="");
- s.Append(node.Member.ToString());
- foreach (var i in node.Initializers)
- {
- s.Append("" "");
- VisitElementInit(i);
- }
- s.Append("")"");
- return null;
- }
-
- protected override MemberAssignment VisitMemberAssignment(MemberAssignment node)
- {
- s.Append(""MemberAssignment(Member="");
- s.Append(node.Member.ToString());
- s.Append("" Expression="");
- Visit(node.Expression);
- s.Append("")"");
- return null;
- }
-
- protected override Expression VisitMemberInit(MemberInitExpression node)
- {
- s.Append(""NewExpression: "");
- Visit(node.NewExpression);
- s.Append("" Bindings:["");
- bool first = true;
- foreach (var b in node.Bindings)
- {
- if (!first) s.Append("" "");
- VisitMemberBinding(b);
- first = false;
- }
- s.Append(""]"");
- return null;
- }
-
- protected override Expression VisitBinary(BinaryExpression node)
- {
- Visit(node.Left);
- s.Append("" "");
- Visit(node.Right);
- if (node.Conversion != null)
- {
- s.Append("" Conversion:"");
- Visit(node.Conversion);
- }
- if (node.IsLifted) s.Append("" Lifted"");
- if (node.IsLiftedToNull) s.Append("" LiftedToNull"");
- if (node.Method != null) s.Append("" Method:["" + node.Method + ""]"");
- return null;
- }
-
- protected override Expression VisitConditional(ConditionalExpression node)
- {
- Visit(node.Test);
- s.Append("" ? "");
- Visit(node.IfTrue);
- s.Append("" : "");
- Visit(node.IfFalse);
- return null;
- }
-
- protected override Expression VisitConstant(ConstantExpression node)
- {
- // s.Append(node.Value == null ? ""null"" : node.Value.ToString());
- s.Append(node.Value == null ? ""null"" : GetCultureInvariantString(node.Value));
- return null;
- }
-
- protected override Expression VisitDefault(DefaultExpression node)
- {
- return null;
- }
-
- protected override Expression VisitIndex(IndexExpression node)
- {
- Visit(node.Object);
- s.Append(""["");
- int n = node.Arguments.Count;
- for (int i = 0; i < n; i++)
- {
- if (i != 0) s.Append("" "");
- Visit(node.Arguments[i]);
- }
- s.Append(""]"");
- if (node.Indexer != null) s.Append("" Indexer:"" + node.Indexer);
- return null;
- }
-
- protected override Expression VisitInvocation(InvocationExpression node)
- {
- Visit(node.Expression);
- s.Append(""("");
- int n = node.Arguments.Count;
- for (int i = 0; i < n; i++)
- {
- if (i != 0) s.Append("" "");
- Visit(node.Arguments[i]);
- }
- s.Append("")"");
- return null;
- }
-
- protected override Expression VisitLambda(Expression node)
- {
- s.Append(""("");
- int n = node.Parameters.Count;
- for (int i = 0; i < n; i++)
- {
- if (i != 0) s.Append("" "");
- Visit(node.Parameters[i]);
- }
- s.Append("") => "");
- if (node.Name != null) s.Append(node.Name);
- Visit(node.Body);
- if (node.ReturnType != null) s.Append("" ReturnType:"" + node.ReturnType);
- if (node.TailCall) s.Append("" TailCall"");
- return null;
- }
-
- protected override Expression VisitListInit(ListInitExpression node)
- {
- Visit(node.NewExpression);
- s.Append(""{"");
- int n = node.Initializers.Count;
- for (int i = 0; i < n; i++)
- {
- if (i != 0) s.Append("" "");
- Visit(node.Initializers[i]);
- }
- s.Append(""}"");
- return null;
- }
-
- protected override ElementInit VisitElementInit(ElementInit node)
- {
- Visit(node);
- return null;
- }
-
- private void Visit(ElementInit node)
- {
- s.Append(""ElementInit("");
- s.Append(node.AddMethod);
- int n = node.Arguments.Count;
- for (int i = 0; i < n; i++)
- {
- s.Append("" "");
- Visit(node.Arguments[i]);
- }
- s.Append("")"");
- }
-
- protected override Expression VisitMember(MemberExpression node)
- {
- Visit(node.Expression);
- s.Append(""."");
- s.Append(node.Member.Name);
- return null;
- }
-
- protected override Expression VisitMethodCall(MethodCallExpression node)
- {
- Visit(node.Object);
- s.Append("".["" + node.Method + ""]"");
- s.Append(""("");
- int n = node.Arguments.Count;
- for (int i = 0; i < n; i++)
- {
- if (i != 0) s.Append("", "");
- Visit(node.Arguments[i]);
- }
- s.Append("")"");
- return null;
- }
-
- protected override Expression VisitNew(NewExpression node)
- {
- s.Append((node.Constructor != null) ? ""["" + node.Constructor + ""]"" : ""<.ctor>"");
- s.Append(""("");
- int n = node.Arguments.Count;
- for (int i = 0; i < n; i++)
- {
- if (i != 0) s.Append("", "");
- Visit(node.Arguments[i]);
- }
- s.Append("")"");
- if (node.Members != null)
- {
- n = node.Members.Count;
- if (n != 0)
- {
- s.Append(""{"");
- for (int i = 0; i < n; i++)
- {
- var info = node.Members[i];
- if (i != 0) s.Append("" "");
- s.Append(info);
- }
- s.Append(""}"");
- }
- }
- return null;
- }
-
- protected override Expression VisitNewArray(NewArrayExpression node)
- {
- s.Append(""["");
- int n = node.Expressions.Count;
- for (int i = 0; i < n; i++)
- {
- if (i != 0) s.Append("" "");
- Visit(node.Expressions[i]);
- }
- s.Append(""]"");
- return null;
- }
-
- protected override Expression VisitParameter(ParameterExpression node)
- {
- s.Append(node.Name);
- if (node.IsByRef) s.Append("" ByRef"");
- return null;
- }
-
- protected override Expression VisitTypeBinary(TypeBinaryExpression node)
- {
- Visit(node.Expression);
- s.Append("" TypeOperand:"" + node.TypeOperand);
- return null;
- }
-
- protected override Expression VisitUnary(UnaryExpression node)
- {
- Visit(node.Operand);
- if (node.IsLifted) s.Append("" Lifted"");
- if (node.IsLiftedToNull) s.Append("" LiftedToNull"");
- if (node.Method != null) s.Append("" Method:["" + node.Method + ""]"");
- return null;
- }
-
- public static string GetCultureInvariantString(object value)
- {
- var valueType = value.GetType();
- if (valueType == typeof(string))
- {
- return value as string;
- }
-
- if (valueType == typeof(DateTime))
- {
- return ((DateTime)value).ToString(""M/d/yyyy h:mm:ss tt"", CultureInfo.InvariantCulture);
- }
-
- if (valueType == typeof(float))
- {
- return ((float)value).ToString(CultureInfo.InvariantCulture);
- }
-
- if (valueType == typeof(double))
- {
- return ((double)value).ToString(CultureInfo.InvariantCulture);
- }
-
- if (valueType == typeof(decimal))
- {
- return ((decimal)value).ToString(CultureInfo.InvariantCulture);
- }
-
- return value.ToString();
- }
-}
-";
- #endregion A string containing expression-tree dumping utilities
-
[Fact]
public void ExprLambdaReordering()
{
diff --git a/src/roslyn/src/Compilers/CSharp/Test/Emit/Emit/CompilationEmitTests.cs b/src/roslyn/src/Compilers/CSharp/Test/Emit/Emit/CompilationEmitTests.cs
index c4dca4e0d28..a85ace38643 100644
--- a/src/roslyn/src/Compilers/CSharp/Test/Emit/Emit/CompilationEmitTests.cs
+++ b/src/roslyn/src/Compilers/CSharp/Test/Emit/Emit/CompilationEmitTests.cs
@@ -15,6 +15,8 @@
using System.Reflection.PortableExecutable;
using System.Text;
using System.Threading;
+using Basic.Reference.Assemblies;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Emit;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE;
@@ -24,7 +26,6 @@
using Roslyn.Test.Utilities;
using Roslyn.Utilities;
using Xunit;
-using Basic.Reference.Assemblies;
namespace Microsoft.CodeAnalysis.CSharp.UnitTests.Emit
{
diff --git a/src/roslyn/src/Compilers/CSharp/Test/Emit/Emit/EmitMetadataTests.cs b/src/roslyn/src/Compilers/CSharp/Test/Emit/Emit/EmitMetadataTests.cs
index 484d3f8c0f0..d70f3f478ae 100644
--- a/src/roslyn/src/Compilers/CSharp/Test/Emit/Emit/EmitMetadataTests.cs
+++ b/src/roslyn/src/Compilers/CSharp/Test/Emit/Emit/EmitMetadataTests.cs
@@ -13,6 +13,7 @@
using System.Reflection.PortableExecutable;
using System.Runtime.InteropServices;
using System.Threading;
+using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Emit;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE;
diff --git a/src/roslyn/src/Compilers/CSharp/Test/Emit3/Semantics/ExtensionTests.cs b/src/roslyn/src/Compilers/CSharp/Test/Emit3/Semantics/ExtensionTests.cs
index 17f3ef8e322..b0656529312 100644
--- a/src/roslyn/src/Compilers/CSharp/Test/Emit3/Semantics/ExtensionTests.cs
+++ b/src/roslyn/src/Compilers/CSharp/Test/Emit3/Semantics/ExtensionTests.cs
@@ -24,7 +24,7 @@
namespace Microsoft.CodeAnalysis.CSharp.UnitTests.Semantics;
[CompilerTrait(CompilerFeature.Extensions)]
-public class ExtensionTests : CompilingTestBase
+public partial class ExtensionTests : CompilingTestBase
{
private static string ExpectedOutput(string output)
{
@@ -126,10 +126,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0'
extends [netstandard]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
object ''
- ) cil managed
+ ) cil managed
{
.custom instance void [netstandard]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -296,10 +296,10 @@ 01 00 00 00
extends [netstandard]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
!T ''
- ) cil managed
+ ) cil managed
{
.custom instance void [netstandard]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -585,10 +585,10 @@ extends [netstandard]System.Object
01 00 01 00 00
)
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
!T ''
- ) cil managed
+ ) cil managed
{
.custom instance void [netstandard]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -829,10 +829,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0'
extends [netstandard]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
object ''
- ) cil managed
+ ) cil managed
{
.custom instance void [netstandard]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -1125,10 +1125,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0'
extends [netstandard]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
class [netstandard]System.Text.StringBuilder ''
- ) cil managed
+ ) cil managed
{
.custom instance void [netstandard]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -1138,10 +1138,10 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0'::'$'
- .method public hidebysig static
+ .method public hidebysig static
class [netstandard]System.Text.StringBuilder Inspect (
class [netstandard]System.Text.StringBuilder sb
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x20a7
// Code size 2 (0x2)
@@ -1159,8 +1159,8 @@ 01 00 00 00
// Fields
.field public class [netstandard]System.Text.StringBuilder sb
// Methods
- .method public hidebysig specialname rtspecialname
- instance void .ctor () cil managed
+ .method public hidebysig specialname rtspecialname
+ instance void .ctor () cil managed
{
// Method begins at RVA 0x2079
// Code size 7 (0x7)
@@ -1169,8 +1169,8 @@ .maxstack 8
IL_0001: call instance void [netstandard]System.Object::.ctor()
IL_0006: ret
} // end of method '<>c__DisplayClass1_0'::.ctor
- .method assembly hidebysig
- instance void 'b__0' () cil managed
+ .method assembly hidebysig
+ instance void 'b__0' () cil managed
{
// Method begins at RVA 0x20ac
// Code size 42 (0x2a)
@@ -1204,10 +1204,10 @@ [1] int32
} // end of method '<>c__DisplayClass1_0'::'b__0'
} // end of class <>c__DisplayClass1_0
// Methods
- .method public hidebysig static
+ .method public hidebysig static
class [netstandard]System.Text.StringBuilder Inspect (
class [netstandard]System.Text.StringBuilder sb
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x2081
// Code size 35 (0x23)
@@ -1289,10 +1289,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0'
extends [netstandard]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
int32 ''
- ) cil managed
+ ) cil managed
{
.custom instance void [netstandard]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -1302,8 +1302,8 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0'::'$'
- .method public hidebysig static
- class [netstandard]System.Action DoSomething () cil managed
+ .method public hidebysig static
+ class [netstandard]System.Action DoSomething () cil managed
{
// Method begins at RVA 0x20be
// Code size 2 (0x2)
@@ -1321,8 +1321,8 @@ 01 00 00 00
// Fields
.field public int32 b
// Methods
- .method public hidebysig specialname rtspecialname
- instance void .ctor () cil managed
+ .method public hidebysig specialname rtspecialname
+ instance void .ctor () cil managed
{
// Method begins at RVA 0x2073
// Code size 7 (0x7)
@@ -1331,8 +1331,8 @@ .maxstack 8
IL_0001: call instance void [netstandard]System.Object::.ctor()
IL_0006: ret
} // end of method '<>c__DisplayClass1_0'::.ctor
- .method assembly hidebysig
- instance void 'b__0' () cil managed
+ .method assembly hidebysig
+ instance void 'b__0' () cil managed
{
// Method begins at RVA 0x20c4
// Code size 35 (0x23)
@@ -1357,8 +1357,8 @@ [0] int32
} // end of method '<>c__DisplayClass1_0'::'b__0'
} // end of class <>c__DisplayClass1_0
// Methods
- .method public hidebysig static
- class [netstandard]System.Action DoSomething () cil managed
+ .method public hidebysig static
+ class [netstandard]System.Action DoSomething () cil managed
{
// Method begins at RVA 0x207c
// Code size 52 (0x34)
@@ -1454,10 +1454,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0'
extends [netstandard]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
int32 ''
- ) cil managed
+ ) cil managed
{
.custom instance void [netstandard]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -1467,8 +1467,8 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0'::'$'
- .method public hidebysig static
- class [netstandard]System.Action DoSomething () cil managed
+ .method public hidebysig static
+ class [netstandard]System.Action DoSomething () cil managed
{
// Method begins at RVA 0x20bc
// Code size 2 (0x2)
@@ -1486,8 +1486,8 @@ 01 00 00 00
// Fields
.field public int32 b
// Methods
- .method public hidebysig specialname rtspecialname
- instance void .ctor () cil managed
+ .method public hidebysig specialname rtspecialname
+ instance void .ctor () cil managed
{
// Method begins at RVA 0x2073
// Code size 7 (0x7)
@@ -1496,8 +1496,8 @@ .maxstack 8
IL_0001: call instance void [netstandard]System.Object::.ctor()
IL_0006: ret
} // end of method '<>c__DisplayClass1_0'::.ctor
- .method assembly hidebysig
- instance void 'b__0' () cil managed
+ .method assembly hidebysig
+ instance void 'b__0' () cil managed
{
// Method begins at RVA 0x20c0
// Code size 35 (0x23)
@@ -1522,8 +1522,8 @@ [0] int32
} // end of method '<>c__DisplayClass1_0'::'b__0'
} // end of class <>c__DisplayClass1_0
// Methods
- .method public hidebysig static
- class [netstandard]System.Action DoSomething () cil managed
+ .method public hidebysig static
+ class [netstandard]System.Action DoSomething () cil managed
{
// Method begins at RVA 0x207c
// Code size 50 (0x32)
@@ -1744,10 +1744,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0'
extends [netstandard]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
object o
- ) cil managed
+ ) cil managed
{
.custom instance void [netstandard]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -1757,8 +1757,8 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0'::'$'
- .method private hidebysig
- instance void M () cil managed
+ .method private hidebysig
+ instance void M () cil managed
{
// Method begins at RVA 0x2069
// Code size 2 (0x2)
@@ -1768,10 +1768,10 @@ .maxstack 8
} // end of method '<>E__0'::M
} // end of class <>E__0
// Methods
- .method private hidebysig static
+ .method private hidebysig static
void M (
object o
- ) cil managed
+ ) cil managed
{
.custom instance void [netstandard]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = (
01 00 00 00
@@ -1850,10 +1850,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0'
extends [netstandard]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
object ''
- ) cil managed
+ ) cil managed
{
.custom instance void [netstandard]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -1863,8 +1863,8 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0'::'$'
- .method private hidebysig static
- void M () cil managed
+ .method private hidebysig static
+ void M () cil managed
{
// Method begins at RVA 0x2069
// Code size 2 (0x2)
@@ -1874,8 +1874,8 @@ .maxstack 8
} // end of method '<>E__0'::M
} // end of class <>E__0
// Methods
- .method private hidebysig static
- void M () cil managed
+ .method private hidebysig static
+ void M () cil managed
{
// Method begins at RVA 0x2067
// Code size 1 (0x1)
@@ -1971,10 +1971,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0'
extends [netstandard]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
object o
- ) cil managed
+ ) cil managed
{
.custom instance void [netstandard]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -1984,8 +1984,8 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0'::'$'
- .method private hidebysig specialname
- instance int32 get_Property () cil managed
+ .method private hidebysig specialname
+ instance int32 get_Property () cil managed
{
// Method begins at RVA 0x206d
// Code size 2 (0x2)
@@ -1993,10 +1993,10 @@ .maxstack 8
IL_0000: ldnull
IL_0001: throw
} // end of method '<>E__0'::get_Property
- .method private hidebysig specialname
+ .method private hidebysig specialname
instance void set_Property (
int32 'value'
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x206d
// Code size 2 (0x2)
@@ -2012,10 +2012,10 @@ .property instance int32 Property()
}
} // end of class <>E__0
// Methods
- .method private hidebysig static
+ .method private hidebysig static
int32 get_Property (
object o
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x2067
// Code size 3 (0x3)
@@ -2023,11 +2023,11 @@ .maxstack 8
IL_0000: ldc.i4.s 42
IL_0002: ret
} // end of method Extensions::get_Property
- .method private hidebysig static
+ .method private hidebysig static
void set_Property (
object o,
int32 'value'
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x206b
// Code size 1 (0x1)
@@ -2140,10 +2140,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0'
extends [netstandard]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
object ''
- ) cil managed
+ ) cil managed
{
.custom instance void [netstandard]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -2153,8 +2153,8 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0'::'$'
- .method private hidebysig specialname static
- int32 get_Property () cil managed
+ .method private hidebysig specialname static
+ int32 get_Property () cil managed
{
// Method begins at RVA 0x206d
// Code size 2 (0x2)
@@ -2162,10 +2162,10 @@ .maxstack 8
IL_0000: ldnull
IL_0001: throw
} // end of method '<>E__0'::get_Property
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void set_Property (
int32 'value'
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x206d
// Code size 2 (0x2)
@@ -2181,8 +2181,8 @@ .property int32 Property()
}
} // end of class <>E__0
// Methods
- .method private hidebysig static
- int32 get_Property () cil managed
+ .method private hidebysig static
+ int32 get_Property () cil managed
{
// Method begins at RVA 0x2067
// Code size 3 (0x3)
@@ -2190,10 +2190,10 @@ .maxstack 8
IL_0000: ldc.i4.s 42
IL_0002: ret
} // end of method Extensions::get_Property
- .method private hidebysig static
+ .method private hidebysig static
void set_Property (
int32 'value'
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x206b
// Code size 1 (0x1)
@@ -2279,10 +2279,10 @@ extends [netstandard]System.Object
01 00 04 49 74 65 6d 00 00
)
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
object o
- ) cil managed
+ ) cil managed
{
.custom instance void [netstandard]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -2292,10 +2292,10 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0'::'$'
- .method private hidebysig specialname
+ .method private hidebysig specialname
instance int32 get_Item (
int32 i
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x206d
// Code size 2 (0x2)
@@ -2303,11 +2303,11 @@ .maxstack 8
IL_0000: ldnull
IL_0001: throw
} // end of method '<>E__0'::get_Item
- .method private hidebysig specialname
+ .method private hidebysig specialname
instance void set_Item (
int32 i,
int32 'value'
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x206d
// Code size 2 (0x2)
@@ -2325,11 +2325,11 @@ int32 i
}
} // end of class <>E__0
// Methods
- .method private hidebysig static
+ .method private hidebysig static
int32 get_Item (
object o,
int32 i
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x2067
// Code size 3 (0x3)
@@ -2337,12 +2337,12 @@ .maxstack 8
IL_0000: ldc.i4.s 42
IL_0002: ret
} // end of method Extensions::get_Item
- .method private hidebysig static
+ .method private hidebysig static
void set_Item (
object o,
int32 i,
int32 'value'
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x206b
// Code size 1 (0x1)
@@ -2731,7 +2731,7 @@ public void ReceiverParameter_WithIdentifier()
var src = """
public static class Extensions
{
- extension(object o)
+ extension(object o)
{
public object M() { return o; }
}
@@ -2884,7 +2884,7 @@ public void ReceiverParameter_TypeParameter_Unreferenced_01()
public static class Extensions
{
- extension(int)
+ extension(int)
{
public static void M() { }
}
@@ -2896,7 +2896,7 @@ public static void M() { }
// int.M();
Diagnostic(ErrorCode.ERR_NoSuchMemberOrExtension, "M").WithArguments("int", "M").WithLocation(1, 5),
// (5,18): error CS9295: The extended type 'int' must reference all the type parameters declared by the extension, but type parameter 'T' is not referenced.
- // extension(int)
+ // extension(int)
Diagnostic(ErrorCode.ERR_UnderspecifiedExtension, "int").WithArguments("int", "T").WithLocation(5, 18));
}
@@ -2908,7 +2908,7 @@ public void ReceiverParameter_TypeParameter_Unreferenced_02()
public static class Extensions
{
- extension(T1)
+ extension(T1)
{
public static void M() { }
}
@@ -2920,7 +2920,7 @@ public static void M() { }
// int.M();
Diagnostic(ErrorCode.ERR_NoSuchMemberOrExtension, "M").WithArguments("int", "M").WithLocation(1, 5),
// (5,23): error CS9295: The extended type 'T1' must reference all the type parameters declared by the extension, but type parameter 'T2' is not referenced.
- // extension(T1)
+ // extension(T1)
Diagnostic(ErrorCode.ERR_UnderspecifiedExtension, "T1").WithArguments("T1", "T2").WithLocation(5, 23));
}
@@ -3302,7 +3302,7 @@ public void ReceiverParameter_Ref_01()
public static class Extensions
{
- extension(ref int i)
+ extension(ref int i)
{
public void M() { System.Console.Write(i); i = 43; }
}
@@ -3519,7 +3519,7 @@ public void ReceiverParameter_RefReadonly_01()
public static class Extensions
{
- extension(ref readonly int i)
+ extension(ref readonly int i)
{
public void M() { System.Console.Write(i); }
}
@@ -3941,25 +3941,51 @@ static class Extensions
);
}
- [Fact]
- public void ReceiverParameter_RefScope()
+ [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/78491")]
+ public void ReceiverParameter_RefScope_01()
{
var src = """
+int i = 42;
+i.M();
+
static class Extensions
{
extension(scoped ref int receiver)
{
+ public void M() => System.Console.Write(receiver);
}
}
""";
var comp = CreateCompilation(src);
- CompileAndVerify(comp, symbolValidator: (m) =>
+ CompileAndVerify(comp, expectedOutput: "42", symbolValidator: (m) =>
{
AssertEx.Equal(ScopedKind.ScopedRef, m.GlobalNamespace.GetMember("Extensions.<>E__0.$").Parameters[0].EffectiveScope);
}).VerifyDiagnostics();
}
+ [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/78491")]
+ public void ReceiverParameter_RefScope_02()
+ {
+ var src = """
+int i = 42;
+i.M();
+
+static class Extensions
+{
+ extension(scoped ref int receiver)
+ {
+ public ref int M() => ref receiver;
+ }
+}
+""";
+ var comp = CreateCompilation(src);
+ comp.VerifyEmitDiagnostics(
+ // (8,35): error CS9075: Cannot return a parameter by reference 'receiver' because it is scoped to the current method
+ // public ref int M() => ref receiver;
+ Diagnostic(ErrorCode.ERR_RefReturnScopedParameter, "receiver").WithArguments("receiver").WithLocation(8, 35));
+ }
+
[Fact]
public void ReceiverParameter_Nullability()
{
@@ -3985,7 +4011,11 @@ static class Extensions
AssertEx.Equal("System.String?", m.GlobalNamespace.GetMember("Extensions.<>E__1.$").Parameters[0].TypeWithAnnotations.ToTestDisplayString());
}).VerifyDiagnostics();
- // Tracked by https://github.com/dotnet/roslyn/issues/76130 : verify nullability in GetDeclaredSymbol and GetSymbolInfo
+ var tree = comp.SyntaxTrees.Single();
+ var model = comp.GetSemanticModel(tree);
+ var parameters = tree.GetRoot().DescendantNodes().OfType().ToArray();
+ Assert.Equal("System.String? receiver", model.GetDeclaredSymbol(parameters[0]).ToTestDisplayString(includeNonNullable: true));
+ Assert.Equal("System.String?", model.GetDeclaredSymbol(parameters[1]).ToTestDisplayString(includeNonNullable: true));
}
[Fact]
@@ -4044,12 +4074,10 @@ class C {}
// (5,21): error CS0051: Inconsistent accessibility: parameter type 'C' is less accessible than method 'Extensions.extension(C).M()'
// public void M() {}
Diagnostic(ErrorCode.ERR_BadVisParamType, "M").WithArguments("Extensions.extension(C).M()", "C").WithLocation(5, 21),
-
- // Tracked by https://github.com/dotnet/roslyn/issues/76130 : Error wording, this isn't an indexer
- // (6,20): error CS0055: Inconsistent accessibility: parameter type 'C' is less accessible than indexer 'Extensions.extension(C).P'
+ // (6,20): error CS0055: Inconsistent accessibility: parameter type 'C' is less accessible than indexer or property 'Extensions.extension(C).P'
// public int P { get => 0; set {}}
Diagnostic(ErrorCode.ERR_BadVisIndexerParam, "P").WithArguments("Extensions.extension(C).P", "C").WithLocation(6, 20),
- // (7,20): error CS0055: Inconsistent accessibility: parameter type 'C' is less accessible than indexer 'Extensions.extension(C).this[int]'
+ // (7,20): error CS0055: Inconsistent accessibility: parameter type 'C' is less accessible than indexer or property 'Extensions.extension(C).this[int]'
// public int this[int i] { get => 0; set {}}
Diagnostic(ErrorCode.ERR_BadVisIndexerParam, "this").WithArguments("Extensions.extension(C).this[int]", "C").WithLocation(7, 20)
);
@@ -4103,22 +4131,19 @@ private class C {}
// (5,21): error CS0051: Inconsistent accessibility: parameter type 'Extensions.C' is less accessible than method 'Extensions.extension(Extensions.C).M()'
// public void M() {}
Diagnostic(ErrorCode.ERR_BadVisParamType, "M").WithArguments("Extensions.extension(Extensions.C).M()", "Extensions.C").WithLocation(5, 21),
-
- // Tracked by https://github.com/dotnet/roslyn/issues/76130 : Error wording, this isn't an indexer
-
- // (6,20): error CS0055: Inconsistent accessibility: parameter type 'Extensions.C' is less accessible than indexer 'Extensions.extension(Extensions.C).P'
+ // (6,20): error CS0055: Inconsistent accessibility: parameter type 'Extensions.C' is less accessible than indexer or property 'Extensions.extension(Extensions.C).P'
// public int P { get => 0; set {}}
Diagnostic(ErrorCode.ERR_BadVisIndexerParam, "P").WithArguments("Extensions.extension(Extensions.C).P", "Extensions.C").WithLocation(6, 20),
- // (7,20): error CS0055: Inconsistent accessibility: parameter type 'Extensions.C' is less accessible than indexer 'Extensions.extension(Extensions.C).this[int]'
+ // (7,20): error CS0055: Inconsistent accessibility: parameter type 'Extensions.C' is less accessible than indexer or property 'Extensions.extension(Extensions.C).this[int]'
// public int this[int i] { get => 0; set {}}
Diagnostic(ErrorCode.ERR_BadVisIndexerParam, "this").WithArguments("Extensions.extension(Extensions.C).this[int]", "Extensions.C").WithLocation(7, 20),
// (13,23): error CS0051: Inconsistent accessibility: parameter type 'Extensions.C' is less accessible than method 'Extensions.extension(Extensions.C).M2()'
// internal void M2() {}
Diagnostic(ErrorCode.ERR_BadVisParamType, "M2").WithArguments("Extensions.extension(Extensions.C).M2()", "Extensions.C").WithLocation(13, 23),
- // (14,22): error CS0055: Inconsistent accessibility: parameter type 'Extensions.C' is less accessible than indexer 'Extensions.extension(Extensions.C).P2'
+ // (14,22): error CS0055: Inconsistent accessibility: parameter type 'Extensions.C' is less accessible than indexer or property 'Extensions.extension(Extensions.C).P2'
// internal int P2 { get => 0; set {}}
Diagnostic(ErrorCode.ERR_BadVisIndexerParam, "P2").WithArguments("Extensions.extension(Extensions.C).P2", "Extensions.C").WithLocation(14, 22),
- // (15,22): error CS0055: Inconsistent accessibility: parameter type 'Extensions.C' is less accessible than indexer 'Extensions.extension(Extensions.C).this[byte]'
+ // (15,22): error CS0055: Inconsistent accessibility: parameter type 'Extensions.C' is less accessible than indexer or property 'Extensions.extension(Extensions.C).this[byte]'
// internal int this[byte i] { get => 0; set {}}
Diagnostic(ErrorCode.ERR_BadVisIndexerParam, "this").WithArguments("Extensions.extension(Extensions.C).this[byte]", "Extensions.C").WithLocation(15, 22)
);
@@ -4538,7 +4563,7 @@ static void Main()
_ = GetInt().P;
}
- static int GetInt() => 0;
+ static int GetInt() => 0;
}
static class Extensions
@@ -4582,23 +4607,24 @@ static void Main()
_ = GetInt().P;
}
- static int GetInt() => 0;
+ static int GetInt() => 0;
}
static class Extensions
{
extension(ref readonly int receiver)
{
- public void M1() {}
- public int P => 0;
+ public void M1() { System.Console.Write("ranM1 "); }
+ public int P { get { System.Console.Write("ranP"); return 0; } }
}
public static void M2 (this ref readonly int receiver)
{
+ System.Console.Write("ranM2 ");
}
}
""";
- var comp = CreateCompilation(src);
+ var comp = CreateCompilation(src, options: TestOptions.DebugExe);
comp.VerifyEmitDiagnostics(
// (5,9): warning CS9193: Argument 0 should be a variable because it is passed to a 'ref readonly' parameter
@@ -4612,7 +4638,7 @@ public static void M2 (this ref readonly int receiver)
Diagnostic(ErrorCode.WRN_RefReadonlyNotVariable, "GetInt()").WithArguments("0").WithLocation(7, 13)
);
- // Tracked by https://github.com/dotnet/roslyn/issues/76130 : Test emit and execution for a scenario like this
+ CompileAndVerify(comp, expectedOutput: "ranM1 ranM2 ranP");
}
[Fact]
@@ -4628,25 +4654,25 @@ static void Main()
_ = GetInt().P;
}
- static int GetInt() => 0;
+ static int GetInt() => 0;
}
static class Extensions
{
extension(in int receiver)
{
- public void M1() {}
- public int P => 0;
+ public void M1() { System.Console.Write("ranM1 "); }
+ public int P { get { System.Console.Write("ranP"); return 0; } }
}
- public static void M2 (this in int receiver)
+ public static void M2(this in int receiver)
{
+ System.Console.Write("ranM2 ");
}
}
""";
- var comp = CreateCompilation(src);
-
- comp.VerifyEmitDiagnostics(); // Tracked by https://github.com/dotnet/roslyn/issues/76130 : Test emit and execution for a scenario like this
+ var comp = CreateCompilation(src, options: TestOptions.DebugExe);
+ CompileAndVerify(comp, expectedOutput: "ranM1 ranM2 ranP").VerifyDiagnostics();
}
[Fact]
@@ -4680,10 +4706,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0'
extends [mscorlib]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
object o
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -4693,10 +4719,10 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0'::'$'
- .method private hidebysig
+ .method private hidebysig
instance void M (
string s
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x2079
// Code size 2 (0x2)
@@ -4706,11 +4732,11 @@ .maxstack 8
} // end of method '<>E__0'::M
} // end of class <>E__0
// Methods
- .method private hidebysig static
+ .method private hidebysig static
void M (
object o,
string s
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = (
01 00 00 00
@@ -4799,10 +4825,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0'
extends [mscorlib]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
object o
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -4812,10 +4838,10 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0'::'$'
- .method public hidebysig
+ .method public hidebysig
instance string M (
string s
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x207d
// Code size 2 (0x2)
@@ -4825,11 +4851,11 @@ .maxstack 8
} // end of method '<>E__0'::M
} // end of class <>E__0
// Methods
- .method public hidebysig static
+ .method public hidebysig static
string M (
object o,
string s
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = (
01 00 00 00
@@ -5168,10 +5194,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0'
extends [mscorlib]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
object o
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -5181,10 +5207,10 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0'::'$'
- .method public hidebysig
+ .method public hidebysig
instance string M (
string s
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x20ad
// Code size 2 (0x2)
@@ -5204,11 +5230,11 @@ .field public object o
.field public string s
} // end of class <>c__DisplayClass1_0
// Methods
- .method public hidebysig static
+ .method public hidebysig static
string M (
object o,
string s
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = (
01 00 00 00
@@ -5229,10 +5255,10 @@ [0] valuetype Extensions/'<>c__DisplayClass1_0'
IL_0012: call string Extensions::'b__1_0'(valuetype Extensions/'<>c__DisplayClass1_0'&)
IL_0017: ret
} // end of method Extensions::M
- .method assembly hidebysig static
+ .method assembly hidebysig static
string 'b__1_0' (
valuetype Extensions/'<>c__DisplayClass1_0'& ''
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -5348,10 +5374,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0'
extends [mscorlib]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
object o
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -5361,10 +5387,10 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0'::'$'
- .method public hidebysig
+ .method public hidebysig
instance string M (
string s
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x208e
// Code size 2 (0x2)
@@ -5383,8 +5409,8 @@ 01 00 00 00
.field public object o
.field public string s
// Methods
- .method public hidebysig specialname rtspecialname
- instance void .ctor () cil managed
+ .method public hidebysig specialname rtspecialname
+ instance void .ctor () cil managed
{
// Method begins at RVA 0x2091
// Code size 7 (0x7)
@@ -5393,8 +5419,8 @@ .maxstack 8
IL_0001: call instance void [mscorlib]System.Object::.ctor()
IL_0006: ret
} // end of method '<>c__DisplayClass1_0'::.ctor
- .method assembly hidebysig
- instance string 'b__0' () cil managed
+ .method assembly hidebysig
+ instance string 'b__0' () cil managed
{
// Method begins at RVA 0x2099
// Code size 30 (0x1e)
@@ -5414,11 +5440,11 @@ .maxstack 8
} // end of method '<>c__DisplayClass1_0'::'b__0'
} // end of class <>c__DisplayClass1_0
// Methods
- .method public hidebysig static
+ .method public hidebysig static
string M (
object o,
string s
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = (
01 00 00 00
@@ -5536,10 +5562,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0'
extends [mscorlib]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
object o
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -5549,10 +5575,10 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0'::'$'
- .method public hidebysig
+ .method public hidebysig
instance class [mscorlib]System.Collections.Generic.IEnumerable`1 M (
string s
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x2080
// Code size 2 (0x2)
@@ -5593,10 +5619,10 @@ .field public object '<>3__o'
.field private string s
.field public string '<>3__s'
// Methods
- .method public hidebysig specialname rtspecialname
+ .method public hidebysig specialname rtspecialname
instance void .ctor (
int32 '<>1__state'
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -5614,8 +5640,8 @@ .maxstack 8
IL_0013: stfld int32 Extensions/'d__1'::'<>l__initialThreadId'
IL_0018: ret
} // end of method 'd__1'::.ctor
- .method private final hidebysig newslot virtual
- instance void System.IDisposable.Dispose () cil managed
+ .method private final hidebysig newslot virtual
+ instance void System.IDisposable.Dispose () cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -5629,8 +5655,8 @@ .maxstack 8
IL_0003: stfld int32 Extensions/'d__1'::'<>1__state'
IL_0008: ret
} // end of method 'd__1'::System.IDisposable.Dispose
- .method private final hidebysig newslot virtual
- instance bool MoveNext () cil managed
+ .method private final hidebysig newslot virtual
+ instance bool MoveNext () cil managed
{
.override method instance bool [mscorlib]System.Collections.IEnumerator::MoveNext()
// Method begins at RVA 0x20a8
@@ -5676,8 +5702,8 @@ [0] int32
IL_004a: ldc.i4.0
IL_004b: ret
} // end of method 'd__1'::MoveNext
- .method private final hidebysig specialname newslot virtual
- instance string 'System.Collections.Generic.IEnumerator.get_Current' () cil managed
+ .method private final hidebysig specialname newslot virtual
+ instance string 'System.Collections.Generic.IEnumerator.get_Current' () cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -5690,8 +5716,8 @@ .maxstack 8
IL_0001: ldfld string Extensions/'d__1'::'<>2__current'
IL_0006: ret
} // end of method 'd__1'::'System.Collections.Generic.IEnumerator.get_Current'
- .method private final hidebysig newslot virtual
- instance void System.Collections.IEnumerator.Reset () cil managed
+ .method private final hidebysig newslot virtual
+ instance void System.Collections.IEnumerator.Reset () cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -5703,8 +5729,8 @@ .maxstack 8
IL_0000: newobj instance void [mscorlib]System.NotSupportedException::.ctor()
IL_0005: throw
} // end of method 'd__1'::System.Collections.IEnumerator.Reset
- .method private final hidebysig specialname newslot virtual
- instance object System.Collections.IEnumerator.get_Current () cil managed
+ .method private final hidebysig specialname newslot virtual
+ instance object System.Collections.IEnumerator.get_Current () cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -5717,8 +5743,8 @@ .maxstack 8
IL_0001: ldfld string Extensions/'d__1'::'<>2__current'
IL_0006: ret
} // end of method 'd__1'::System.Collections.IEnumerator.get_Current
- .method private final hidebysig newslot virtual
- instance class [mscorlib]System.Collections.Generic.IEnumerator`1 'System.Collections.Generic.IEnumerable.GetEnumerator' () cil managed
+ .method private final hidebysig newslot virtual
+ instance class [mscorlib]System.Collections.Generic.IEnumerator`1 'System.Collections.Generic.IEnumerable.GetEnumerator' () cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -5758,8 +5784,8 @@ [0] class Extensions/'d__1'
IL_0041: ldloc.0
IL_0042: ret
} // end of method 'd__1'::'System.Collections.Generic.IEnumerable.GetEnumerator'
- .method private final hidebysig newslot virtual
- instance class [mscorlib]System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator () cil managed
+ .method private final hidebysig newslot virtual
+ instance class [mscorlib]System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator () cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -5783,11 +5809,11 @@ .property instance object System.Collections.IEnumerator.Current()
}
} // end of class d__1
// Methods
- .method public hidebysig static
+ .method public hidebysig static
class [mscorlib]System.Collections.Generic.IEnumerable`1 M (
object o,
string s
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.IteratorStateMachineAttribute::.ctor(class [mscorlib]System.Type) = (
01 00 12 45 78 74 65 6e 73 69 6f 6e 73 2b 3c 4d
@@ -5937,10 +5963,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0'
extends [mscorlib]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
object o
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -5950,10 +5976,10 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0'::'$'
- .method public hidebysig
+ .method public hidebysig
instance class [mscorlib]System.Threading.Tasks.Task`1 M (
string s
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x20b5
// Code size 2 (0x2)
@@ -5976,8 +6002,8 @@ .field public object o
.field public string s
.field private valuetype [mscorlib]System.Runtime.CompilerServices.YieldAwaitable/YieldAwaiter '<>u__1'
// Methods
- .method private final hidebysig newslot virtual
- instance void MoveNext () cil managed
+ .method private final hidebysig newslot virtual
+ instance void MoveNext () cil managed
{
.override method instance void [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine::MoveNext()
// Method begins at RVA 0x20b8
@@ -6067,10 +6093,10 @@ [4] class [mscorlib]System.Exception
IL_00ac: call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::SetResult(!0)
IL_00b1: ret
} // end of method 'd__1'::MoveNext
- .method private final hidebysig newslot virtual
+ .method private final hidebysig newslot virtual
instance void SetStateMachine (
class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine stateMachine
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -6087,11 +6113,11 @@ .maxstack 8
} // end of method 'd__1'::SetStateMachine
} // end of class d__1
// Methods
- .method public hidebysig static
+ .method public hidebysig static
class [mscorlib]System.Threading.Tasks.Task`1 M (
object o,
string s
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.AsyncStateMachineAttribute::.ctor(class [mscorlib]System.Type) = (
01 00 12 45 78 74 65 6e 73 69 6f 6e 73 2b 3c 4d
@@ -6237,10 +6263,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0`1'
extends [mscorlib]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
class C`1 o
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -6250,11 +6276,11 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0`1'::'$'
- .method public hidebysig
+ .method public hidebysig
instance string M (
!T t,
!!U u
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x20a7
// Code size 2 (0x2)
@@ -6264,12 +6290,12 @@ .maxstack 8
} // end of method '<>E__0`1'::M
} // end of class <>E__0`1
// Methods
- .method public hidebysig static
+ .method public hidebysig static
string M (
class C`1 o,
!!T t,
!!U u
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = (
01 00 00 00
@@ -6478,10 +6504,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0`1'
extends [mscorlib]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
class C`1 o
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -6491,11 +6517,11 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0`1'::'$'
- .method public hidebysig
+ .method public hidebysig
instance class C`1 M (
!T t1,
!!U u1
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x216f
// Code size 2 (0x2)
@@ -6516,12 +6542,12 @@ .field public !U u1
.field public !T t1
} // end of class <>c__DisplayClass1_0`2
// Methods
- .method public hidebysig static
+ .method public hidebysig static
class C`1 M (
class C`1 o,
!!T t1,
!!U u1
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = (
01 00 00 00
@@ -6554,7 +6580,7 @@ .locals init (
IL_0033: call class C`1 Extensions::'b__1_0'(!!0, !!1, !!2, !!3, !!4, valuetype Extensions/'<>c__DisplayClass1_0`2'&)
IL_0038: ret
} // end of method Extensions::M
- .method assembly hidebysig static
+ .method assembly hidebysig static
class C`1 'b__1_0' (
!!T t2,
!!U u2,
@@ -6562,7 +6588,7 @@ class C`1 'b__1_0' (
!!Y y2,
!!Z z2,
valuetype Extensions/'<>c__DisplayClass1_0`2'& ''
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -6753,10 +6779,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0`1'
extends [mscorlib]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
class C`1 o
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -6766,11 +6792,11 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0`1'::'$'
- .method public hidebysig
+ .method public hidebysig
instance class C`1 M (
!T t1,
!!U u1
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x20c6
// Code size 2 (0x2)
@@ -6790,8 +6816,8 @@ .field public class C`1 o
.field public !U u1
.field public !T t1
// Methods
- .method public hidebysig specialname rtspecialname
- instance void .ctor () cil managed
+ .method public hidebysig specialname rtspecialname
+ instance void .ctor () cil managed
{
// Method begins at RVA 0x20c9
// Code size 7 (0x7)
@@ -6800,11 +6826,11 @@ .maxstack 8
IL_0001: call instance void [mscorlib]System.Object::.ctor()
IL_0006: ret
} // end of method '<>c__DisplayClass1_0`2'::.ctor
- .method assembly hidebysig
+ .method assembly hidebysig
instance class C`1 'b__0' (
!T t2,
!U u2
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x20d4
// Code size 103 (0x67)
@@ -6849,12 +6875,12 @@ .maxstack 4
} // end of method '<>c__DisplayClass1_0`2'::'b__0'
} // end of class <>c__DisplayClass1_0`2
// Methods
- .method public hidebysig static
+ .method public hidebysig static
class C`1 M (
class C`1 o,
!!T t1,
!!U u1
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = (
01 00 00 00
@@ -7012,10 +7038,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0`1'
extends [mscorlib]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
class C`1 o
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -7025,11 +7051,11 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0`1'::'$'
- .method public hidebysig
+ .method public hidebysig
instance class [mscorlib]System.Collections.Generic.IEnumerable`1 M (
!T t1,
!!U u1
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x209e
// Code size 2 (0x2)
@@ -7072,10 +7098,10 @@ .field public !U '<>3__u1'
.field private !T t1
.field public !T '<>3__t1'
// Methods
- .method public hidebysig specialname rtspecialname
+ .method public hidebysig specialname rtspecialname
instance void .ctor (
int32 '<>1__state'
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -7093,8 +7119,8 @@ .maxstack 8
IL_0013: stfld int32 class Extensions/'d__1`2'::'<>l__initialThreadId'
IL_0018: ret
} // end of method 'd__1`2'::.ctor
- .method private final hidebysig newslot virtual
- instance void System.IDisposable.Dispose () cil managed
+ .method private final hidebysig newslot virtual
+ instance void System.IDisposable.Dispose () cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -7108,8 +7134,8 @@ .maxstack 8
IL_0003: stfld int32 class Extensions/'d__1`2'::'<>1__state'
IL_0008: ret
} // end of method 'd__1`2'::System.IDisposable.Dispose
- .method private final hidebysig newslot virtual
- instance bool MoveNext () cil managed
+ .method private final hidebysig newslot virtual
+ instance bool MoveNext () cil managed
{
.override method instance bool [mscorlib]System.Collections.IEnumerator::MoveNext()
// Method begins at RVA 0x20c8
@@ -7156,8 +7182,8 @@ [0] int32
IL_005f: ldc.i4.0
IL_0060: ret
} // end of method 'd__1`2'::MoveNext
- .method private final hidebysig specialname newslot virtual
- instance string 'System.Collections.Generic.IEnumerator.get_Current' () cil managed
+ .method private final hidebysig specialname newslot virtual
+ instance string 'System.Collections.Generic.IEnumerator.get_Current' () cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -7170,8 +7196,8 @@ .maxstack 8
IL_0001: ldfld string class Extensions/'d__1`2'::'<>2__current'
IL_0006: ret
} // end of method 'd__1`2'::'System.Collections.Generic.IEnumerator.get_Current'
- .method private final hidebysig newslot virtual
- instance void System.Collections.IEnumerator.Reset () cil managed
+ .method private final hidebysig newslot virtual
+ instance void System.Collections.IEnumerator.Reset () cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -7183,8 +7209,8 @@ .maxstack 8
IL_0000: newobj instance void [mscorlib]System.NotSupportedException::.ctor()
IL_0005: throw
} // end of method 'd__1`2'::System.Collections.IEnumerator.Reset
- .method private final hidebysig specialname newslot virtual
- instance object System.Collections.IEnumerator.get_Current () cil managed
+ .method private final hidebysig specialname newslot virtual
+ instance object System.Collections.IEnumerator.get_Current () cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -7197,8 +7223,8 @@ .maxstack 8
IL_0001: ldfld string class Extensions/'d__1`2'::'<>2__current'
IL_0006: ret
} // end of method 'd__1`2'::System.Collections.IEnumerator.get_Current
- .method private final hidebysig newslot virtual
- instance class [mscorlib]System.Collections.Generic.IEnumerator`1 'System.Collections.Generic.IEnumerable.GetEnumerator' () cil managed
+ .method private final hidebysig newslot virtual
+ instance class [mscorlib]System.Collections.Generic.IEnumerator`1 'System.Collections.Generic.IEnumerable.GetEnumerator' () cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -7242,8 +7268,8 @@ .locals init (
IL_004d: ldloc.0
IL_004e: ret
} // end of method 'd__1`2'::'System.Collections.Generic.IEnumerable.GetEnumerator'
- .method private final hidebysig newslot virtual
- instance class [mscorlib]System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator () cil managed
+ .method private final hidebysig newslot virtual
+ instance class [mscorlib]System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator () cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -7267,12 +7293,12 @@ .property instance object System.Collections.IEnumerator.Current()
}
} // end of class d__1`2
// Methods
- .method public hidebysig static
+ .method public hidebysig static
class [mscorlib]System.Collections.Generic.IEnumerable`1 M (
class C`1 o,
!!T t1,
!!U u1
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.IteratorStateMachineAttribute::.ctor(class [mscorlib]System.Type) = (
01 00 14 45 78 74 65 6e 73 69 6f 6e 73 2b 3c 4d
@@ -7401,10 +7427,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0`1'
extends [mscorlib]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
class C`1 o
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -7414,11 +7440,11 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0`1'::'$'
- .method public hidebysig
+ .method public hidebysig
instance class [mscorlib]System.Threading.Tasks.Task`1 M (
!T t1,
!!U u1
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x20d4
// Code size 2 (0x2)
@@ -7442,8 +7468,8 @@ .field public !U u1
.field public !T t1
.field private valuetype [mscorlib]System.Runtime.CompilerServices.YieldAwaitable/YieldAwaiter '<>u__1'
// Methods
- .method private final hidebysig newslot virtual
- instance void MoveNext () cil managed
+ .method private final hidebysig newslot virtual
+ instance void MoveNext () cil managed
{
.override method instance void [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine::MoveNext()
// Method begins at RVA 0x20d8
@@ -7534,10 +7560,10 @@ [4] class [mscorlib]System.Exception
IL_00c4: call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::SetResult(!0)
IL_00c9: ret
} // end of method 'd__1`2'::MoveNext
- .method private final hidebysig newslot virtual
+ .method private final hidebysig newslot virtual
instance void SetStateMachine (
class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine stateMachine
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -7554,12 +7580,12 @@ .maxstack 8
} // end of method 'd__1`2'::SetStateMachine
} // end of class d__1`2
// Methods
- .method public hidebysig static
+ .method public hidebysig static
class [mscorlib]System.Threading.Tasks.Task`1 M (
class C`1 o,
!!T t1,
!!U u1
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.AsyncStateMachineAttribute::.ctor(class [mscorlib]System.Type) = (
01 00 14 45 78 74 65 6e 73 69 6f 6e 73 2b 3c 4d
@@ -7718,10 +7744,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0'
extends [mscorlib]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
object _
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -7731,11 +7757,11 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0'::'$'
- .method public hidebysig static
+ .method public hidebysig static
string M (
object o,
string s
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x207d
// Code size 2 (0x2)
@@ -7745,11 +7771,11 @@ .maxstack 8
} // end of method '<>E__0'::M
} // end of class <>E__0
// Methods
- .method public hidebysig static
+ .method public hidebysig static
string M (
object o,
string s
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x2067
// Code size 19 (0x13)
@@ -8199,10 +8225,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0'
extends [mscorlib]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
object _
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -8212,11 +8238,11 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0'::'$'
- .method public hidebysig static
+ .method public hidebysig static
string M (
object o,
string s
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x20ad
// Code size 2 (0x2)
@@ -8236,11 +8262,11 @@ .field public object o
.field public string s
} // end of class <>c__DisplayClass1_0
// Methods
- .method public hidebysig static
+ .method public hidebysig static
string M (
object o,
string s
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x2068
// Code size 24 (0x18)
@@ -8258,10 +8284,10 @@ [0] valuetype Extensions/'<>c__DisplayClass1_0'
IL_0012: call string Extensions::'b__1_0'(valuetype Extensions/'<>c__DisplayClass1_0'&)
IL_0017: ret
} // end of method Extensions::M
- .method assembly hidebysig static
+ .method assembly hidebysig static
string 'b__1_0' (
valuetype Extensions/'<>c__DisplayClass1_0'& ''
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -8377,10 +8403,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0'
extends [mscorlib]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
object _
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -8390,11 +8416,11 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0'::'$'
- .method public hidebysig static
+ .method public hidebysig static
string M (
object o,
string s
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x208e
// Code size 2 (0x2)
@@ -8413,8 +8439,8 @@ 01 00 00 00
.field public object o
.field public string s
// Methods
- .method public hidebysig specialname rtspecialname
- instance void .ctor () cil managed
+ .method public hidebysig specialname rtspecialname
+ instance void .ctor () cil managed
{
// Method begins at RVA 0x2091
// Code size 7 (0x7)
@@ -8423,8 +8449,8 @@ .maxstack 8
IL_0001: call instance void [mscorlib]System.Object::.ctor()
IL_0006: ret
} // end of method '<>c__DisplayClass1_0'::.ctor
- .method assembly hidebysig
- instance string 'b__0' () cil managed
+ .method assembly hidebysig
+ instance string 'b__0' () cil managed
{
// Method begins at RVA 0x2099
// Code size 30 (0x1e)
@@ -8444,11 +8470,11 @@ .maxstack 8
} // end of method '<>c__DisplayClass1_0'::'b__0'
} // end of class <>c__DisplayClass1_0
// Methods
- .method public hidebysig static
+ .method public hidebysig static
string M (
object o,
string s
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x2067
// Code size 36 (0x24)
@@ -8563,10 +8589,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0'
extends [mscorlib]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
object _
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -8576,11 +8602,11 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0'::'$'
- .method public hidebysig static
+ .method public hidebysig static
class [mscorlib]System.Collections.Generic.IEnumerable`1 M (
object o,
string s
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x2080
// Code size 2 (0x2)
@@ -8621,10 +8647,10 @@ .field public object '<>3__o'
.field private string s
.field public string '<>3__s'
// Methods
- .method public hidebysig specialname rtspecialname
+ .method public hidebysig specialname rtspecialname
instance void .ctor (
int32 '<>1__state'
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -8642,8 +8668,8 @@ .maxstack 8
IL_0013: stfld int32 Extensions/'d__1'::'<>l__initialThreadId'
IL_0018: ret
} // end of method 'd__1'::.ctor
- .method private final hidebysig newslot virtual
- instance void System.IDisposable.Dispose () cil managed
+ .method private final hidebysig newslot virtual
+ instance void System.IDisposable.Dispose () cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -8657,8 +8683,8 @@ .maxstack 8
IL_0003: stfld int32 Extensions/'d__1'::'<>1__state'
IL_0008: ret
} // end of method 'd__1'::System.IDisposable.Dispose
- .method private final hidebysig newslot virtual
- instance bool MoveNext () cil managed
+ .method private final hidebysig newslot virtual
+ instance bool MoveNext () cil managed
{
.override method instance bool [mscorlib]System.Collections.IEnumerator::MoveNext()
// Method begins at RVA 0x20a8
@@ -8704,8 +8730,8 @@ [0] int32
IL_004a: ldc.i4.0
IL_004b: ret
} // end of method 'd__1'::MoveNext
- .method private final hidebysig specialname newslot virtual
- instance string 'System.Collections.Generic.IEnumerator.get_Current' () cil managed
+ .method private final hidebysig specialname newslot virtual
+ instance string 'System.Collections.Generic.IEnumerator.get_Current' () cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -8718,8 +8744,8 @@ .maxstack 8
IL_0001: ldfld string Extensions/'d__1'::'<>2__current'
IL_0006: ret
} // end of method 'd__1'::'System.Collections.Generic.IEnumerator.get_Current'
- .method private final hidebysig newslot virtual
- instance void System.Collections.IEnumerator.Reset () cil managed
+ .method private final hidebysig newslot virtual
+ instance void System.Collections.IEnumerator.Reset () cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -8731,8 +8757,8 @@ .maxstack 8
IL_0000: newobj instance void [mscorlib]System.NotSupportedException::.ctor()
IL_0005: throw
} // end of method 'd__1'::System.Collections.IEnumerator.Reset
- .method private final hidebysig specialname newslot virtual
- instance object System.Collections.IEnumerator.get_Current () cil managed
+ .method private final hidebysig specialname newslot virtual
+ instance object System.Collections.IEnumerator.get_Current () cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -8745,8 +8771,8 @@ .maxstack 8
IL_0001: ldfld string Extensions/'d__1'::'<>2__current'
IL_0006: ret
} // end of method 'd__1'::System.Collections.IEnumerator.get_Current
- .method private final hidebysig newslot virtual
- instance class [mscorlib]System.Collections.Generic.IEnumerator`1 'System.Collections.Generic.IEnumerable.GetEnumerator' () cil managed
+ .method private final hidebysig newslot virtual
+ instance class [mscorlib]System.Collections.Generic.IEnumerator`1 'System.Collections.Generic.IEnumerable.GetEnumerator' () cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -8786,8 +8812,8 @@ [0] class Extensions/'d__1'
IL_0041: ldloc.0
IL_0042: ret
} // end of method 'd__1'::'System.Collections.Generic.IEnumerable.GetEnumerator'
- .method private final hidebysig newslot virtual
- instance class [mscorlib]System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator () cil managed
+ .method private final hidebysig newslot virtual
+ instance class [mscorlib]System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator () cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -8811,11 +8837,11 @@ .property instance object System.Collections.IEnumerator.Current()
}
} // end of class d__1
// Methods
- .method public hidebysig static
+ .method public hidebysig static
class [mscorlib]System.Collections.Generic.IEnumerable`1 M (
object o,
string s
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.IteratorStateMachineAttribute::.ctor(class [mscorlib]System.Type) = (
01 00 12 45 78 74 65 6e 73 69 6f 6e 73 2b 3c 4d
@@ -8928,10 +8954,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0'
extends [mscorlib]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
object _
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -8941,11 +8967,11 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0'::'$'
- .method public hidebysig static
+ .method public hidebysig static
class [mscorlib]System.Threading.Tasks.Task`1 M (
object o,
string s
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x20b5
// Code size 2 (0x2)
@@ -8968,8 +8994,8 @@ .field public object o
.field public string s
.field private valuetype [mscorlib]System.Runtime.CompilerServices.YieldAwaitable/YieldAwaiter '<>u__1'
// Methods
- .method private final hidebysig newslot virtual
- instance void MoveNext () cil managed
+ .method private final hidebysig newslot virtual
+ instance void MoveNext () cil managed
{
.override method instance void [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine::MoveNext()
// Method begins at RVA 0x20b8
@@ -9059,10 +9085,10 @@ [4] class [mscorlib]System.Exception
IL_00ac: call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::SetResult(!0)
IL_00b1: ret
} // end of method 'd__1'::MoveNext
- .method private final hidebysig newslot virtual
+ .method private final hidebysig newslot virtual
instance void SetStateMachine (
class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine stateMachine
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
@@ -9079,11 +9105,11 @@ .maxstack 8
} // end of method 'd__1'::SetStateMachine
} // end of class d__1
// Methods
- .method public hidebysig static
+ .method public hidebysig static
class [mscorlib]System.Threading.Tasks.Task`1 M (
object o,
string s
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.AsyncStateMachineAttribute::.ctor(class [mscorlib]System.Type) = (
01 00 12 45 78 74 65 6e 73 69 6f 6e 73 2b 3c 4d
@@ -9218,10 +9244,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0'
extends [mscorlib]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
object o
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -9231,8 +9257,8 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0'::'$'
- .method public hidebysig specialname
- instance string get_P () cil managed
+ .method public hidebysig specialname
+ instance string get_P () cil managed
{
// Method begins at RVA 0x2071
// Code size 2 (0x2)
@@ -9247,10 +9273,10 @@ .property instance string P()
}
} // end of class <>E__0
// Methods
- .method public hidebysig static
+ .method public hidebysig static
string get_P (
object o
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x2067
// Code size 7 (0x7)
@@ -9507,10 +9533,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0'
extends [mscorlib]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
object ''
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -9520,8 +9546,8 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0'::'$'
- .method public hidebysig specialname static
- string get_P () cil managed
+ .method public hidebysig specialname static
+ string get_P () cil managed
{
// Method begins at RVA 0x2070
// Code size 2 (0x2)
@@ -9536,8 +9562,8 @@ .property string P()
}
} // end of class <>E__0
// Methods
- .method public hidebysig static
- string get_P () cil managed
+ .method public hidebysig static
+ string get_P () cil managed
{
// Method begins at RVA 0x2067
// Code size 6 (0x6)
@@ -9718,10 +9744,10 @@ .class nested public auto ansi sealed beforefieldinit '<>E__0'
extends [mscorlib]System.Object
{
// Methods
- .method private hidebysig specialname static
+ .method private hidebysig specialname static
void '$' (
object o
- ) cil managed
+ ) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
@@ -9731,8 +9757,8 @@ 01 00 00 00
.maxstack 8
IL_0000: ret
} // end of method '<>E__0'::'$'
- .method public hidebysig specialname
- instance string get_P () cil managed
+ .method public hidebysig specialname
+ instance string get_P () cil managed
{
// Method begins at RVA 0x2071
// Code size 2 (0x2)
@@ -9747,10 +9773,10 @@ .property instance string P()
}
} // end of class <>E__0
// Methods
- .method public hidebysig static
+ .method public hidebysig static
string get_P (
object o
- ) cil managed
+ ) cil managed
{
// Method begins at RVA 0x2067
// Code size 7 (0x7)
@@ -9829,13 +9855,16 @@ .maxstack 1
public void Implementation_DelegateCaching_01()
{
var src = """
+42.M2