-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Verify synthesized RequiresLocationAttribute
cannot be accessed by fnptrs
#69328
Verify synthesized RequiresLocationAttribute
cannot be accessed by fnptrs
#69328
Conversation
34aeaba
to
a745c27
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly lgtm and addresses my concerns :)
c4b8474
to
2bddd9a
Compare
src/Compilers/CSharp/Test/Emit2/Semantics/RefReadonlyParameterTests.cs
Outdated
Show resolved
Hide resolved
@jcouv PTAL, this is a test-only change |
public void M2(ref readonly int p) { } | ||
} | ||
"""; | ||
var comp = CreateCompilation(source, options: TestOptions.UnsafeDebugDll); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The core CreateCompilation
helper is expected to roll forward to the latest target framework as we move forward. At the moment this references the net7.0
assemblies but will move to net8.0
(likely early 2024). At that point the test will fail because this will succeed since RequiresLocationAttribute
will be available. Think this test should specify TargetFramework.Net70
explicitly to avoid that future issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that right? Seems that the default target framework is netstandard2.0
. Otherwise, I would probably need to change a lot of tests in this file because for example all function pointer tests include the attribute definition as source.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake. Your correct this defaults to TargteFramework.Standard
not TargetFramework.Latest
.
public void M(ref readonly int p) { } | ||
} | ||
"""; | ||
var comp1 = CreateCompilation(source1, assemblyName: "Assembly1").VerifyDiagnostics(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar feedback about all the CreateCompilation
uses in this particular PR.
Test plan: #68056