Skip to content

Conversation

@AlekseyTs
Copy link
Contributor

Closes #78433
Closes #78188

Also relaxed some asserts that looked to "tight" and were blocking investigation.

… initialized during "completion" of a primary constructor.

Closes dotnet#78433
Closes dotnet#78188

Also relaxed some asserts that looked to "tight" and were blocking investigation.
@AlekseyTs
Copy link
Contributor Author

@dotnet/roslyn-compiler Please review

}
";
var comp = CreateCompilation(source);
var comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.WithFeature("run-nullable-analysis", "never"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is .WithFeature("run-nullable-analysis", "never") somehow important for the test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is .WithFeature("run-nullable-analysis", "never") somehow important for the test?

Yes, by default debug build performs nullable analysis even if one is not enabled in source. That requests attributes from symbols. We want to control when attributes are requested and from what symbols.

var test1 = comp.GetTypeByMetadataName("Test1");
var ctor = test1.InstanceConstructors.Where(c => !c.IsDefaultValueTypeConstructor()).Single();

ctor.GetAttributes();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider asserting at least number of the attributes returned by this call.

Copy link
Contributor Author

@AlekseyTs AlekseyTs Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider asserting at least number of the attributes returned by this call.

This is not interesting. We are requesting the attributes to get symbol into a certain state.

@AlekseyTs AlekseyTs merged commit 6523b74 into dotnet:main Sep 24, 2025
25 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants