Uh oh!
There was an error while loading. Please reload this page.
Adding a new DataAttribute to improve specifying realsig, optimize and baselines. - #18161
Adding a new DataAttribute to improve specifying realsig, optimize and baselines.#18161KevinRansom wants to merge 2 commits into
Conversation
✅ No release notes required |
There was a problem hiding this comment.
Would it be possible to use https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/caller-information instead?
Why exactly do we need it?
There was a problem hiding this comment.
@T-Gro , no. The Xunit.Sdk.DataAttribute.GetData override requires a MethodInfo instance. The caller-information attributes return the names of the member, the source file and line numbers.
Here is the Xunit description:
https://csharp-tokyo.github.io/xUnit-Hands-on/class_xunit_1_1_sdk_1_1_data_attribute.html#ab74ea9efe0a313e19ac0e8d8136a9071
There was a problem hiding this comment.
We need it, because GetData _ = is how XUnit retrieves the test data instance, and in this case we are using the DirectoryAttribute to create a compiler instance, and so we need to 'pretend' we are being xunit. It is true that our DirectoryAttribute doesn't actually use it, but we do need an instance to even invoke the method. And there is a decent probablility that at some point in the future DirectoryAttribute.GetData() will use it, so I didn't want to pass Unchecked.DefaultOf.
There was a problem hiding this comment.
If we reuse the functionality of DirectoryAttribute possibly we could extract createCompilationUnit from it into a module or maybe inherit?
There was a problem hiding this comment.
@majocha --- I'm still trying to figure out what we need. But we can certainly refactor, if necessary once we understand the necessities.
9111444 to
ee66618Compare1e413e8 to
5d7fe2bCompareThere was a problem hiding this comment.
That is temporary, although I think I will add an an environment variable to turn off deletes.
T-Gro
commented
Jan 2, 2025
Can you please help with making the review surface more manageable? I see some file re-orgs, file renames as well as bulk (regex?) changes of attribute usage. |
KevinRansom
commented
Jan 2, 2025
What I can do is split it into a few PR's.
The only change I really care about is the new attribute and the refactor. How does that sound? |
b370561 to
403c43cCompare403c43c to
7a713b3Compare…18195) * refactor * tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop
…18196) * More tests - directory attribute improvements * methordresolution
Todo:
-[] Convert more tests to use the new attribute.