-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Description
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
dynamicandobjectcompatible, 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. -
dynamicvs.object - Confirm the expected behavior for tuple name differences (
SignatureMismatch_07currently has no warnings) - test with nint vs. IntPtr difference -
SignatureMismatch_08
- Yes. A warning is issued instead of an error when types differ in ways that are insignificant to the runtime.
-
paramsdifferences -ParamsMismatch_ - Nullability warnings -
SignatureMismatch_04andSignatureMismatch_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_andPathNormalization_- Confirm
/pathmapand#linedesign 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
- Confirm
- 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
InterceptsLocationin 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
GetValueOrDefaultis recognized specially inCodeGenerator) - 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_- Interceptable has type parameter constraints
InterceptableGeneric_03 - Incorrect arity
- Violated constraints
- Note: this may change in Add design for interceptors with nonzero arity #68218. May be punted to after net8
- Interceptable has type parameter constraints
- Inaccessible interceptor
-
filelocal 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_andSignatureMismatch_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_NormalFormandInterceptableExtensionMethod_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
bool considerArity = true, // PROTOTYPE(ic): remove default value?
- Constructor initializers:
public Widget() : base(),public Widget() : this(),public class Widget(int i) : Base(i) { } - Rename to
<Features>InterceptorsPreview</Features> - Disallow
UnmanagedCallersOnlyon 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
roslyn/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Call.cs
Line 203 in fbb07ae
|| methodThisParameter.RefKind != interceptorThisParameterForCompare.RefKind: // PROTOTYPE(ic): and ref custom modifiers are equal?
- Permit static non-extension interceptors to be called as though they are extension methods
roslyn/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Call.cs
Line 217 in fbb07ae
// PROTOTYPE(ic): use a symbol display format which includes the 'this' modifier?
Reactions are currently unavailable