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

IntrinsicsInSystemPrivateCoreLibAnalyzer throwing ArgumentException #90356

Closed
ericstj opened this issue Aug 11, 2023 · 2 comments · Fixed by #91764
Closed

IntrinsicsInSystemPrivateCoreLibAnalyzer throwing ArgumentException #90356

ericstj opened this issue Aug 11, 2023 · 2 comments · Fixed by #91764
Labels
area-Infrastructure-coreclr in-pr There is an active PR which will close this issue when it is merged

Comments

@ericstj
Copy link
Member

ericstj commented Aug 11, 2023

Description

When building System.Private.CoreLib I see the diagnostic:

error AD0001: Analyzer 'IntrinsicsInSystemPrivateCoreLib.IntrinsicsInSystemPrivateCoreLibAnalyzer' threw an excep
tion of type 'System.ArgumentException' with message 'Syntax node is not within syntax tree'.

I'll suppress this when enabling AD0001 as warning. This issue will track fixing that analyzer and removing the warning suppression.

Reproduction Steps

Remove AD0001 from System.Private.Corelib.csproj and build it.

Expected behavior

Builds without warning.

Actual behavior

Warning as above.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Aug 11, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Aug 11, 2023
@sbomer
Copy link
Member

sbomer commented Aug 11, 2023

I debugged one instance of this - it's failing while trying to decompose the condition

if (PackedSpanHelpers.PackedIndexOfIsSupported && PackedSpanHelpers.CanUsePackedIndexOf(c))

The PackedIndexOfIsSupported part goes through this logic:

var propertyDefiningSyntax = symbolInfo.Symbol.DeclaringSyntaxReferences[0].GetSyntax();
if (propertyDefiningSyntax != null)
{
if (propertyDefiningSyntax is PropertyDeclarationSyntax propertyDeclaration
&& propertyDeclaration.ExpressionBody is ArrowExpressionClauseSyntax arrowExpression)
{
return DecomposeConditionForIsSupportedGroups(context, model, arrowExpression.Expression);

which looks up the definition of PackedIndexOfIsSupported, which is Sse2.IsSupported. Then we recurse into that property, but this line throws:

var symbolInfo = model.GetSymbolInfo(expressionToDecompose);

because the definition of IsSupported isn't in the same syntax tree as the one we started from.

@davidwrighton

@ghost
Copy link

ghost commented Aug 14, 2023

Tagging subscribers to this area: @hoyosjs
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

When building System.Private.CoreLib I see the diagnostic:

error AD0001: Analyzer 'IntrinsicsInSystemPrivateCoreLib.IntrinsicsInSystemPrivateCoreLibAnalyzer' threw an excep
tion of type 'System.ArgumentException' with message 'Syntax node is not within syntax tree'.

I'll suppress this when enabling AD0001 as warning. This issue will track fixing that analyzer and removing the warning suppression.

Reproduction Steps

Remove AD0001 from System.Private.Corelib.csproj and build it.

Expected behavior

Builds without warning.

Actual behavior

Warning as above.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Author: ericstj
Assignees: -
Labels:

area-Infrastructure-coreclr, untriaged, needs-area-label

Milestone: -

@vcsjones vcsjones removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Aug 14, 2023
@agocke agocke added this to AppModel Aug 17, 2023
davidwrighton added a commit to davidwrighton/runtime that referenced this issue Sep 7, 2023
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Sep 7, 2023
@agocke agocke removed this from AppModel Dec 2, 2023
@dotnet-policy-service dotnet-policy-service bot removed the untriaged New issue has not been triaged by the area owner label Mar 14, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Infrastructure-coreclr in-pr There is an active PR which will close this issue when it is merged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants