Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update codeanalysis for genfacades to support new language features #6971

Merged
merged 2 commits into from
Feb 19, 2021

Conversation

safern
Copy link
Member

@safern safern commented Feb 17, 2021

Currently if someone tries to use C# 9.0 language features genfacades doesn't parse the syntax tree correctly and could lead to problems, i.e, when adding an attribute to a local function in PriorityQueue it causes the parent of PriorityQueue.UnorderedItemsCollection to be a CompilationUnitSyntax instead of a ClassDeclarationSyntax, causing:

C:\Users\safern\.nuget\packages\microsoft.dotnet.genfacades\6.0.0-dev\build\Microsoft.DotNet.GenPartialFacadeSource.targets(30,5): error : Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Syntax.CompilationUnitSyntax' to type 'Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax'. [C:\repos\runtime\src\libraries\System.Collections\src\System.Collections.csproj]

I tested this on dotnet/runtime and apparently now MSBuild loads tasks in it's own AssemblyLoadContext so now we don't have the restriction of matching the roslyn version that MSBuild depends on. This was fixed on: dotnet/msbuild#4916

cc: @ericstj @stephentoub @Anipik

@safern safern merged commit 1ca4a46 into dotnet:master Feb 19, 2021
@safern safern deleted the UpdateCodeAnalysis branch February 19, 2021 23:51
@stephentoub
Copy link
Member

Thanks, @safern.

akoeplinger pushed a commit to akoeplinger/arcade that referenced this pull request Apr 12, 2021
…otnet#6971)

* Update codeanalysis for genfacades to support new language features

* Fix source build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants