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

Test plan for "interceptors" #67421

Closed
30 of 84 tasks
RikkiGibson opened this issue Mar 21, 2023 · 0 comments
Closed
30 of 84 tasks

Test plan for "interceptors" #67421

RikkiGibson opened this issue Mar 21, 2023 · 0 comments

Comments

@RikkiGibson
Copy link
Contributor

RikkiGibson commented Mar 21, 2023

Spec: https://github.com/dotnet/roslyn/blob/features/interceptors/docs/features/interceptors.md (in-flight PRs may have more recent revisions)

  • <Features>InterceptorsPreview</Features> flag - FeatureFlag
  • Test intercepting a call with the same method which is already being called. - SelfInterception
  • Test with a large number of intercepted calls (to ensure perf is not quadratic) - EndToEndTests.Interceptors
  • Confirm the signature compatibility rules (are dynamic and object compatible, as they are in OHI?)
    • Yes. A warning is issued instead of an error when types differ in ways that are insignificant to the runtime. SignatureMismatch_06.
    • dynamic vs. object
    • Confirm the expected behavior for tuple name differences (SignatureMismatch_07 currently has no warnings)
    • test with nint vs. IntPtr difference - SignatureMismatch_08
  • params differences - ParamsMismatch_
  • Nullability warnings - SignatureMismatch_04 and SignatureMismatch_05
  • Obsolete - ObsoleteInterceptor
  • Caller attributes - CallerInfo
  • Default parameter values from interceptor do not affect the call-site - DefaultArguments_
  • #line directives ignored - LineDirective_
  • Path mapping -- test various combinations of the following conditions - PathMapping_ and PathNormalization_
    • Confirm /pathmap and #line design with team
    • Pathmap replacement is all forward slashes
    • Pathmap replacement is all backslashes
    • Pathmap replacement is a mix of forward and backslashes
    • SyntaxTree.FilePath is absolute
    • SyntaxTree.FilePath is relative
    • InterceptsLocationAttribute path is all forward slashes
    • InterceptsLocationAttribute path is all backslashes slashes
    • InterceptsLocationAttribute path is a mix of forward and backslashes
    • InterceptsLocationAttribute path is a suffix of some SyntaxTree.FilePath
    • InterceptsLocationAttribute path is a suffix of a mapped path
    • InterceptsLocationAttribute path exactly matches an unmapped path
  • InterceptsLocation line, character out of range - InterceptsLocationBadAttributeArguments_01, InterceptsLocationBadPosition_
  • InterceptsLocation line, character not in method name - InterceptsLocationBadPosition_
  • Test with argument names that differ from interceptor parameter names - ParameterNameDifference
  • Test reordered argument names at callsite - ArgumentLabels, ParameterNamesInDifferentOrder
  • Test InterceptsLocation in metadata (ignored) - InterceptsLocationFromMetadata
  • InterceptsLocation on lambda or local function - InterceptsLocation_BadMethodKind
  • GetEnumerator, Dispose, Deconstruct cannot be intercepted - InterceptGetEnumerator, InterceptDispose, InterceptDeconstruct
  • More calls that cannot be intercepted - GetAwaiter, GetResult, MoveNext, GetPinnableReference, Dispose, Slice, Select (in LINQ query)
  • Semantic model and IOperation
    • Test that the interceptor symbol for an intercepted call is not given by public APIs
  • EnC
    • Test that a call intercepted by a generator can move in source, and we can rerun the generator and successfully emit
    • Test that a hand-authored interception breaks when the call moves in source and we can't emit
    • Test that in a compilation with interceptors, an edit in a file which doesn't contain intercepted calls can be emitted
  • Should some special methods not be intercepted? (for example GetValueOrDefault is recognized specially in CodeGenerator)
  • Duplicates on same and distinct interceptors - DuplicateLocation_
  • Parameter names differ or appear in a different order - ParameterNameDifference, ParameterNamesInDifferentOrder
  • Intercept a generic method call - InterceptableGeneric_
  • Generic interceptor - InterceptorCannotBeGeneric_
  • Inaccessible interceptor
  • file local interceptor
  • Interceptable explicit interface implementation - InterceptableExplicitImplementation
  • Interceptable call is to a retargeting method
  • Scoped and [UnscopedRef] differences - ScopedMismatch_
  • Interceptor is an extern method - InterceptorExtern
  • Interceptor is an abstract method - InterceptorAbstract
  • Interceptor is an interface method - InterceptorInterface
  • Interceptor is a virtual method - InterceptorVirtual_
  • Interceptor is an override method - InterceptorOverride_
  • Intercept struct method with 'ref this' and 'this' extension methods - InterpolatedStringHandler_ and SignatureMismatch_03
  • Interpolated string handler attributes are ignored - InterpolatedStringHandler_
  • Intercept extension call in reduced form with a non-extension static method - InterceptableExtensionMethod_InterceptorStaticMethod
  • Intercept extension call in normal form with extension and non-extension static method - InterceptableExtensionMethod_InterceptorStaticMethod_NormalForm and InterceptableExtensionMethod_InterceptorExtensionMethod_NormalForm
  • Intercept extension call with instance method
  • Call to object.ReferenceEquals has special semantics - ReferenceEquals_
  • Differences in modopts and modreqs between interceptable and interceptor
  • Intercept nameof(X) as an operator (error) or a method call - InterceptableNameOf_
  • Update compiler test plan
  • Uses of invocation syntax which cannot be intercepted (dynamic, delegate, function pointer)? - InterceptableDelegateInvocation. TODO dynamic and function pointers.
  • __arglist, __makeref, __refvalue, __reftype - InterceptableDoubleUnderscoreReservedIdentifiers
  • Spec: should we require interceptors to be static methods?
  • Spec: The spec says "scoped modifiers and [UnscopedRef] must be equivalent.", but the implementation uses more subtle rules
  • Spec: add support for generics? - Add design for interceptors with nonzero arity #68218
  • Constructor initializers: public Widget() : base(), public Widget() : this(), public class Widget(int i) : Base(i) { }
  • Rename to <Features>InterceptorsPreview</Features>
  • Disallow UnmanagedCallersOnly on interceptor - InterceptorUnmanagedCallersOnly
  • Case-sensitive compare for paths - InterceptsLocationBadPath_04
  • InterceptsLocation from project reference - InterceptsLocationFromMetadata
  • PDB test for "debugging into interceptor"
  • Embed type from NoPIA assembly used as default value in:
    • intercepted method
    • intercepting method
  • Interceptor and original method differ by ref/out/in
  • Interceptor and original method differ by ref custom modifiers
  • Permit static non-extension interceptors to be called as though they are extension methods
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Mar 21, 2023
@jcouv jcouv added this to the C# 12.0 milestone Mar 31, 2023
@jcouv jcouv removed the untriaged Issues and PRs which have not yet been triaged by a lead label Mar 31, 2023
@jaredpar jaredpar modified the milestones: C# 12.0, 17.9 Sep 11, 2023
@jaredpar jaredpar modified the milestones: 17.9, .NET 8 Nov 2, 2023
@jaredpar jaredpar closed this as completed Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants