diff --git a/tracer/src/Datadog.Tracer.Native/calltarget_tokens.cpp b/tracer/src/Datadog.Tracer.Native/calltarget_tokens.cpp index 72a6bc4b54bf..e5b7841c778c 100644 --- a/tracer/src/Datadog.Tracer.Native/calltarget_tokens.cpp +++ b/tracer/src/Datadog.Tracer.Native/calltarget_tokens.cpp @@ -358,9 +358,9 @@ mdMethodSpec CallTargetTokens::GetCallTargetDefaultValueMethodSpec(const TypeSig } HRESULT CallTargetTokens::ModifyLocalSig(ILRewriter* reWriter, TypeSignature* methodReturnValue, - std::vector* methodTypeArguments, + std::vector* methodTypeArguments, FunctionInfo* caller, ULONG* callTargetStateIndex, ULONG* exceptionIndex, - ULONG* callTargetReturnIndex, ULONG* returnValueIndex, + ULONG* callTargetReturnIndex, ULONG* staticValueTypeIndex, ULONG* returnValueIndex, mdToken* callTargetStateToken, mdToken* exceptionToken, mdToken* callTargetReturnToken, std::vector& additionalLocalIndices, bool isAsyncMethod) { @@ -399,7 +399,17 @@ HRESULT CallTargetTokens::ModifyLocalSig(ILRewriter* reWriter, TypeSignature* me } constexpr int variableNumber = 3; const auto additionalLocalsCount = GetAdditionalLocalsCount(*methodTypeArguments); - ULONG newLocalsCount = variableNumber + additionalLocalsCount; + + // For instrumenting static methods in value types, see if we can get the TypeRef for the type. + // If so, include add a local variable with the value type in the signature. + bool isValueType = caller->type.valueType; + bool isStaticValueType = isValueType && !(caller->method_signature.CallingConvention() & IMAGE_CEE_CS_CALLCONV_HASTHIS) && GetCurrentTypeRef(&caller->type, isValueType) != mdTokenNil; + + ULONG newLocalsCount = variableNumber + additionalLocalsCount + (isStaticValueType ? 1 : 0); + + // Gets the static value type buffer and size + unsigned staticValueTypeTypeRefBuffer; + auto staticValueTypeTypeRefSize = CorSigCompressToken(caller->type.id, &staticValueTypeTypeRefBuffer); // Gets the calltarget state type buffer and size unsigned callTargetStateTypeRefBuffer; @@ -496,6 +506,13 @@ HRESULT CallTargetTokens::ModifyLocalSig(ILRewriter* reWriter, TypeSignature* me newSignature.Append(ELEMENT_TYPE_VALUETYPE); newSignature.Append(&callTargetReturnBuffer, callTargetReturnSize); } + + // Static method in a ValueType + if (isStaticValueType) + { + newSignature.Append(ELEMENT_TYPE_VALUETYPE); + newSignature.Append(&staticValueTypeTypeRefBuffer, staticValueTypeTypeRefSize); + } // Add custom locals AddAdditionalLocals(methodReturnValue, methodTypeArguments, newSignature, isAsyncMethod); @@ -519,7 +536,7 @@ HRESULT CallTargetTokens::ModifyLocalSig(ILRewriter* reWriter, TypeSignature* me *callTargetReturnToken = callTargetReturn; const auto sizeOfOtherIndexes = additionalLocalIndices.size(); - auto indexStart = variableNumber + additionalLocalsCount; + auto indexStart = variableNumber + additionalLocalsCount + (isStaticValueType ? 1 : 0); if (returnSignatureType != nullptr) { @@ -533,6 +550,15 @@ HRESULT CallTargetTokens::ModifyLocalSig(ILRewriter* reWriter, TypeSignature* me *exceptionIndex = newLocalsCount - indexStart--; *callTargetReturnIndex = newLocalsCount - indexStart--; + if (isStaticValueType) + { + *staticValueTypeIndex = newLocalsCount - indexStart--; + } + else + { + *staticValueTypeIndex = static_cast(ULONG_MAX); + } + for (unsigned int i = 0; i < sizeOfOtherIndexes; i++) { additionalLocalIndices[i] = newLocalsCount - indexStart--; @@ -870,9 +896,9 @@ mdAssemblyRef CallTargetTokens::GetCorLibAssemblyRef() } HRESULT CallTargetTokens::ModifyLocalSigAndInitialize(void* rewriterWrapperPtr, TypeSignature* methodReturnType, - std::vector* methodTypeArguments, + std::vector* methodTypeArguments, FunctionInfo* caller, ULONG* callTargetStateIndex, ULONG* exceptionIndex, - ULONG* callTargetReturnIndex, ULONG* returnValueIndex, + ULONG* callTargetReturnIndex, ULONG* staticValueTypeIndex, ULONG* returnValueIndex, mdToken* callTargetStateToken, mdToken* exceptionToken, mdToken* callTargetReturnToken, ILInstr** firstInstruction, std::vector& additionalLocalIndices, bool isAsyncMethod) @@ -881,8 +907,8 @@ HRESULT CallTargetTokens::ModifyLocalSigAndInitialize(void* rewriterWrapperPtr, // Modify the Local Var Signature of the method - auto hr = ModifyLocalSig(rewriterWrapper->GetILRewriter(), methodReturnType, methodTypeArguments, - callTargetStateIndex, exceptionIndex, callTargetReturnIndex, + auto hr = ModifyLocalSig(rewriterWrapper->GetILRewriter(), methodReturnType, methodTypeArguments, caller, + callTargetStateIndex, exceptionIndex, callTargetReturnIndex, staticValueTypeIndex, returnValueIndex, callTargetStateToken, exceptionToken, callTargetReturnToken, additionalLocalIndices, isAsyncMethod); diff --git a/tracer/src/Datadog.Tracer.Native/calltarget_tokens.h b/tracer/src/Datadog.Tracer.Native/calltarget_tokens.h index e4057e4534a5..2065c59ef6ef 100644 --- a/tracer/src/Datadog.Tracer.Native/calltarget_tokens.h +++ b/tracer/src/Datadog.Tracer.Native/calltarget_tokens.h @@ -46,8 +46,8 @@ class CallTargetTokens mdMemberRef GetCallTargetReturnValueDefaultMemberRef(mdTypeSpec callTargetReturnTypeSpec); mdMethodSpec GetCallTargetDefaultValueMethodSpec(const TypeSignature* methodArgument); - HRESULT ModifyLocalSig(ILRewriter* reWriter, TypeSignature* methodReturnValue, std::vector* methodTypeArguments, - ULONG* callTargetStateIndex, ULONG* exceptionIndex, ULONG* callTargetReturnIndex, ULONG* returnValueIndex, + HRESULT ModifyLocalSig(ILRewriter* reWriter, TypeSignature* methodReturnValue, std::vector* methodTypeArguments, FunctionInfo* caller, + ULONG* callTargetStateIndex, ULONG* exceptionIndex, ULONG* callTargetReturnIndex, ULONG* staticValueTypeIndex, ULONG* returnValueIndex, mdToken* callTargetStateToken, mdToken* exceptionToken, mdToken* callTargetReturnToken, std::vector& additionalLocalIndices, bool isAsyncMethod = false); @@ -97,8 +97,8 @@ class CallTargetTokens mdMethodDef GetCallTargetStateSkipMethodBodyMemberRef(); - HRESULT ModifyLocalSigAndInitialize(void* rewriterWrapperPtr, TypeSignature* methodReturnType, std::vector* methodTypeArguments, - ULONG* callTargetStateIndex, ULONG* exceptionIndex, ULONG* callTargetReturnIndex, ULONG* returnValueIndex, + HRESULT ModifyLocalSigAndInitialize(void* rewriterWrapperPtr, TypeSignature* methodReturnType, std::vector* methodTypeArguments, FunctionInfo* caller, + ULONG* callTargetStateIndex, ULONG* exceptionIndex, ULONG* callTargetReturnIndex, ULONG* staticValueTypeIndex, ULONG* returnValueIndex, mdToken* callTargetStateToken, mdToken* exceptionToken, mdToken* callTargetReturnToken, ILInstr** firstInstruction, std::vector& additionalLocalIndices, bool isAsyncMethod = false); diff --git a/tracer/src/Datadog.Tracer.Native/debugger_method_rewriter.cpp b/tracer/src/Datadog.Tracer.Native/debugger_method_rewriter.cpp index ffa0dd9338a2..f1b3c48c77da 100644 --- a/tracer/src/Datadog.Tracer.Native/debugger_method_rewriter.cpp +++ b/tracer/src/Datadog.Tracer.Native/debugger_method_rewriter.cpp @@ -2239,6 +2239,7 @@ HRESULT DebuggerMethodRewriter::Rewrite(RejitHandlerModule* moduleHandler, ULONG callTargetStateIndex = static_cast(ULONG_MAX); ULONG exceptionIndex = static_cast(ULONG_MAX); ULONG callTargetReturnIndex = static_cast(ULONG_MAX); + ULONG staticValueTypeIndex = static_cast(ULONG_MAX); ULONG returnValueIndex = static_cast(ULONG_MAX); mdToken callTargetStateToken = mdTokenNil; mdToken exceptionToken = mdTokenNil; @@ -2275,8 +2276,8 @@ HRESULT DebuggerMethodRewriter::Rewrite(RejitHandlerModule* moduleHandler, methodReturnType = caller->method_signature.GetReturnValue(); } auto debuggerLocals = std::vector(debuggerTokens->GetAdditionalLocalsCount(methodArguments)); - hr = debuggerTokens->ModifyLocalSigAndInitialize(&rewriterWrapper, &methodReturnType, &methodArguments, &callTargetStateIndex, &exceptionIndex, - &callTargetReturnIndex, &returnValueIndex, &callTargetStateToken, + hr = debuggerTokens->ModifyLocalSigAndInitialize(&rewriterWrapper, &methodReturnType, &methodArguments, caller, &callTargetStateIndex, &exceptionIndex, + &callTargetReturnIndex, &staticValueTypeIndex, &returnValueIndex, &callTargetStateToken, &exceptionToken, &callTargetReturnToken, &firstInstruction, debuggerLocals, isAsyncMethod); ULONG lineProbeCallTargetStateIndex = debuggerLocals[0]; diff --git a/tracer/src/Datadog.Tracer.Native/tracer_method_rewriter.cpp b/tracer/src/Datadog.Tracer.Native/tracer_method_rewriter.cpp index 9f96758c64d9..cfd9e47f5429 100644 --- a/tracer/src/Datadog.Tracer.Native/tracer_method_rewriter.cpp +++ b/tracer/src/Datadog.Tracer.Native/tracer_method_rewriter.cpp @@ -71,13 +71,12 @@ HRESULT TracerMethodRewriter::Rewrite(RejitHandlerModule* moduleHandler, RejitHa Current CallTarget Limitations: =============================== - 1. Static methods in a ValueType (struct) cannot be instrumented. - 2. Generic ValueTypes (struct) cannot be instrumented. - 3. Nested ValueTypes (struct) inside a Generic parent type will not expose the type instance (the instance will + 1. Generic ValueTypes (struct) cannot be instrumented. + 2. Nested ValueTypes (struct) inside a Generic parent type will not expose the type instance (the instance will be always null). - 4. Nested types (reference types) inside a Generic parent type will not expose the type instance (the instance + 3. Nested types (reference types) inside a Generic parent type will not expose the type instance (the instance will be casted as an object type). - 5. Methods in a Generic type will not expose the Generic type instance (the instance will be casted as a non + 4. Methods in a Generic type will not expose the Generic type instance (the instance will be casted as a non generic base type or object type). */ @@ -183,6 +182,7 @@ HRESULT TracerMethodRewriter::Rewrite(RejitHandlerModule* moduleHandler, RejitHa ULONG callTargetStateIndex = static_cast(ULONG_MAX); ULONG exceptionIndex = static_cast(ULONG_MAX); ULONG callTargetReturnIndex = static_cast(ULONG_MAX); + ULONG staticValueTypeIndex = static_cast(ULONG_MAX); ULONG returnValueIndex = static_cast(ULONG_MAX); std::vector indexes(tracerTokens->GetAdditionalLocalsCount(methodArguments)); @@ -193,7 +193,7 @@ HRESULT TracerMethodRewriter::Rewrite(RejitHandlerModule* moduleHandler, RejitHa auto returnType = caller->method_signature.GetReturnValue(); tracerTokens->ModifyLocalSigAndInitialize( - &reWriterWrapper, &returnType, &methodArguments, &callTargetStateIndex, &exceptionIndex, &callTargetReturnIndex, + &reWriterWrapper, &returnType, &methodArguments, caller, &callTargetStateIndex, &exceptionIndex, &callTargetReturnIndex, &staticValueTypeIndex, &returnValueIndex, &callTargetStateToken, &exceptionToken, &callTargetReturnToken, &firstInstruction, indexes); ULONG exceptionValueIndex = indexes[0]; @@ -207,19 +207,39 @@ HRESULT TracerMethodRewriter::Rewrite(RejitHandlerModule* moduleHandler, RejitHa // *** Load instance into the stack (if not static) if (isStatic) { - if (caller->type.valueType) + bool callerTypeIsValueType = caller->type.valueType; + mdToken callerTypeToken = tracerTokens->GetCurrentTypeRef(&caller->type, callerTypeIsValueType); + if (callerTypeIsValueType && callerTypeToken != mdTokenNil) + { + reWriterWrapper.LoadLocalAddress(staticValueTypeIndex); + if (caller->type.type_spec != mdTypeSpecNil) + { + reWriterWrapper.InitObj(caller->type.type_spec); + } + else if (!caller->type.isGeneric) + { + reWriterWrapper.InitObj(caller->type.id); + } + else + { + // Generic struct instrumentation is not supported + // IMetaDataImport::GetMemberProps and IMetaDataImport::GetMemberRefProps returns + // The parent token as mdTypeDef and not as a mdTypeSpec + // that's because the method definition is stored in the mdTypeDef + // The problem is that we don't have the exact Spec of that generic + // We can't emit LoadObj or Box because that would result in an invalid IL. + // This problem doesn't occur on a class type because we can always relay in the + // object type. + Logger::Warn("*** CallTarget_RewriterCallback(): Generic struct (struct TypeName) instrumentation is not supported."); + return S_FALSE; + } + + reWriterWrapper.LoadLocal(staticValueTypeIndex); + } + else { - // Static methods in a ValueType can't be instrumented. - // In the future this can be supported by adding a local for the valuetype and initialize it to the default - // value. After the signature modification we need to emit the following IL to initialize and load into the - // stack. - // ldloca.s [localIndex] - // initobj [valueType] - // ldloc.s [localIndex] - Logger::Warn("*** CallTarget_RewriterCallback(): Static methods in a ValueType cannot be instrumented. "); - return S_FALSE; + reWriterWrapper.LoadNull(); } - reWriterWrapper.LoadNull(); } else { @@ -505,21 +525,39 @@ HRESULT TracerMethodRewriter::Rewrite(RejitHandlerModule* moduleHandler, RejitHa // *** Load instance into the stack (if not static) if (isStatic) { - if (caller->type.valueType) + bool callerTypeIsValueType = caller->type.valueType; + mdToken callerTypeToken = tracerTokens->GetCurrentTypeRef(&caller->type, callerTypeIsValueType); + if (caller->type.valueType && callerTypeToken != mdTokenNil) + { + endMethodTryStartInstr = reWriterWrapper.LoadLocalAddress(staticValueTypeIndex); + if (caller->type.type_spec != mdTypeSpecNil) + { + reWriterWrapper.InitObj(caller->type.type_spec); + } + else if (!caller->type.isGeneric) + { + reWriterWrapper.InitObj(caller->type.id); + } + else + { + // Generic struct instrumentation is not supported + // IMetaDataImport::GetMemberProps and IMetaDataImport::GetMemberRefProps returns + // The parent token as mdTypeDef and not as a mdTypeSpec + // that's because the method definition is stored in the mdTypeDef + // The problem is that we don't have the exact Spec of that generic + // We can't emit LoadObj or Box because that would result in an invalid IL. + // This problem doesn't occur on a class type because we can always relay in the + // object type. + Logger::Warn("*** CallTarget_RewriterCallback(): Generic struct (struct TypeName) instrumentation is not supported."); + return S_FALSE; + } + + reWriterWrapper.LoadLocal(staticValueTypeIndex); + } + else { - // Static methods in a ValueType can't be instrumented. - // In the future this can be supported by adding a local for the valuetype - // and initialize it to the default value. After the signature - // modification we need to emit the following IL to initialize and load - // into the stack. - // ldloca.s [localIndex] - // initobj [valueType] - // ldloc.s [localIndex] - Logger::Warn("CallTarget_RewriterCallback: Static methods in a ValueType cannot " - "be instrumented. "); - return S_FALSE; + endMethodTryStartInstr = reWriterWrapper.LoadNull(); } - endMethodTryStartInstr = reWriterWrapper.LoadNull(); } else { diff --git a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/CallTargetNativeTests.cs b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/CallTargetNativeTests.cs index 1dbd9a8bd3e5..bef0affacc20 100644 --- a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/CallTargetNativeTests.cs +++ b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/CallTargetNativeTests.cs @@ -65,20 +65,20 @@ public async Task MethodArgumentsInstrumentation(int numberOfArguments, bool fas { // On number of arguments = 0 the throw exception on integrations async continuation runs. // So we have 1 more case with an exception being reported from the integration. - Assert.Equal(180, beginMethodCount); - Assert.Equal(180, endMethodCount); + Assert.Equal(240, beginMethodCount); + Assert.Equal(240, endMethodCount); Assert.Equal(44, exceptionCount); } else if (numberOfArguments == 1) { - Assert.Equal(175, beginMethodCount); - Assert.Equal(175, endMethodCount); + Assert.Equal(235, beginMethodCount); + Assert.Equal(235, endMethodCount); Assert.Equal(40, exceptionCount); } else { - Assert.Equal(168, beginMethodCount); - Assert.Equal(168, endMethodCount); + Assert.Equal(228, beginMethodCount); + Assert.Equal(228, endMethodCount); Assert.Equal(40, exceptionCount); } diff --git a/tracer/test/test-applications/instrumentation/CallTargetNativeTest/Program.cs b/tracer/test/test-applications/instrumentation/CallTargetNativeTest/Program.cs index fb75f0ac7774..a8c28ade823b 100644 --- a/tracer/test/test-applications/instrumentation/CallTargetNativeTest/Program.cs +++ b/tracer/test/test-applications/instrumentation/CallTargetNativeTest/Program.cs @@ -55,23 +55,35 @@ static void InjectCallTargetDefinitions() { $"CallTargetNativeTest.With{i}Arguments", $"CallTargetNativeTest.With{i}ArgumentsGeneric`1", + $"CallTargetNativeTest.With{i}ArgumentsGenericStatic`1", $"CallTargetNativeTest.With{i}ArgumentsStruct", $"CallTargetNativeTest.With{i}ArgumentsStatic", + $"CallTargetNativeTest.With{i}ArgumentsStaticStruct", + $"CallTargetNativeTest.With{i}ArgumentsGenericStaticStruct`1", $"CallTargetNativeTest.ArgumentsParentType+With{i}Arguments", $"CallTargetNativeTest.ArgumentsParentType+With{i}ArgumentsGeneric`1", + $"CallTargetNativeTest.ArgumentsParentType+With{i}ArgumentsGenericStatic`1", $"CallTargetNativeTest.ArgumentsParentType+With{i}ArgumentsStruct", $"CallTargetNativeTest.ArgumentsParentType+With{i}ArgumentsStatic", + $"CallTargetNativeTest.ArgumentsParentType+With{i}ArgumentsStaticStruct", + $"CallTargetNativeTest.ArgumentsParentType+With{i}ArgumentsGenericStaticStruct`1", $"CallTargetNativeTest.ArgumentsStructParentType+With{i}Arguments", $"CallTargetNativeTest.ArgumentsStructParentType+With{i}ArgumentsGeneric`1", + $"CallTargetNativeTest.ArgumentsStructParentType+With{i}ArgumentsGenericStatic`1", $"CallTargetNativeTest.ArgumentsStructParentType+With{i}ArgumentsStruct", $"CallTargetNativeTest.ArgumentsStructParentType+With{i}ArgumentsStatic", + $"CallTargetNativeTest.ArgumentsStructParentType+With{i}ArgumentsStaticStruct", + $"CallTargetNativeTest.ArgumentsStructParentType+With{i}ArgumentsGenericStaticStruct`1", $"CallTargetNativeTest.ArgumentsGenericParentType`1+With{i}Arguments", $"CallTargetNativeTest.ArgumentsGenericParentType`1+With{i}ArgumentsGeneric`1", + $"CallTargetNativeTest.ArgumentsGenericParentType`1+With{i}ArgumentsGenericStatic`1", $"CallTargetNativeTest.ArgumentsGenericParentType`1+With{i}ArgumentsStruct", $"CallTargetNativeTest.ArgumentsGenericParentType`1+With{i}ArgumentsStatic", + $"CallTargetNativeTest.ArgumentsGenericParentType`1+With{i}ArgumentsStaticStruct", + $"CallTargetNativeTest.ArgumentsGenericParentType`1+With{i}ArgumentsGenericStaticStruct`1", }; var wrapperTypeVoid = $"CallTargetNativeTest.NoOp.Noop{i}ArgumentsVoidIntegration"; diff --git a/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With0Arguments.cs b/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With0Arguments.cs index 5ec702df52f3..566d6c108062 100644 --- a/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With0Arguments.cs +++ b/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With0Arguments.cs @@ -42,6 +42,26 @@ private static void Argument0() RunMethod(() => w0g2.ReturnGenericMethod()); Console.WriteLine(); // + Console.WriteLine($"{typeof(With0ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => With0ArgumentsGenericStatic.VoidMethod()); + Console.WriteLine($"{typeof(With0ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => With0ArgumentsGenericStatic.ReturnValueMethod()); + Console.WriteLine($"{typeof(With0ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => With0ArgumentsGenericStatic.ReturnReferenceMethod()); + Console.WriteLine($"{typeof(With0ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => With0ArgumentsGenericStatic.ReturnGenericMethod()); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(With0ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => With0ArgumentsGenericStatic.VoidMethod()); + Console.WriteLine($"{typeof(With0ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => With0ArgumentsGenericStatic.ReturnValueMethod()); + Console.WriteLine($"{typeof(With0ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => With0ArgumentsGenericStatic.ReturnReferenceMethod()); + Console.WriteLine($"{typeof(With0ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => With0ArgumentsGenericStatic.ReturnGenericMethod()); + Console.WriteLine(); + // var w0in = new With0ArgumentsInherits(); Console.WriteLine($"{typeof(With0ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w0in.VoidMethod()); @@ -91,6 +111,40 @@ private static void Argument0() RunMethod(() => With0ArgumentsStatic.ReturnGenericMethod()); Console.WriteLine(); // + Console.WriteLine($"{typeof(With0ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With0ArgumentsStaticStruct.VoidMethod()); + Console.WriteLine($"{typeof(With0ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With0ArgumentsStaticStruct.ReturnValueMethod()); + Console.WriteLine($"{typeof(With0ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With0ArgumentsStaticStruct.ReturnReferenceMethod()); + Console.WriteLine($"{typeof(With0ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With0ArgumentsStaticStruct.ReturnGenericMethod()); + Console.WriteLine($"{typeof(With0ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With0ArgumentsStaticStruct.ReturnGenericMethod()); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(With0ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With0ArgumentsGenericStaticStruct.VoidMethod(), checkInstrumented: false); + Console.WriteLine($"{typeof(With0ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With0ArgumentsGenericStaticStruct.ReturnValueMethod(),checkInstrumented: false); + Console.WriteLine($"{typeof(With0ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With0ArgumentsGenericStaticStruct.ReturnReferenceMethod(),checkInstrumented: false); + Console.WriteLine($"{typeof(With0ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With0ArgumentsGenericStaticStruct.ReturnGenericMethod(),checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(With0ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With0ArgumentsGenericStaticStruct.VoidMethod(),checkInstrumented: false); + Console.WriteLine($"{typeof(With0ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With0ArgumentsGenericStaticStruct.ReturnValueMethod(),checkInstrumented: false); + Console.WriteLine($"{typeof(With0ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With0ArgumentsGenericStaticStruct.ReturnReferenceMethod(),checkInstrumented: false); + Console.WriteLine($"{typeof(With0ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With0ArgumentsGenericStaticStruct.ReturnGenericMethod(),checkInstrumented: false); + Console.WriteLine(); + // var w0TBegin = new With0ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(With0ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w0TBegin.VoidMethod()); @@ -184,6 +238,26 @@ private static void ParentArgument0() RunMethod(() => w0g2.ReturnGenericMethod()); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsParentType.With0ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With0ArgumentsGenericStatic.VoidMethod()); + Console.WriteLine($"{typeof(ArgumentsParentType.With0ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With0ArgumentsGenericStatic.ReturnValueMethod()); + Console.WriteLine($"{typeof(ArgumentsParentType.With0ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With0ArgumentsGenericStatic.ReturnReferenceMethod()); + Console.WriteLine($"{typeof(ArgumentsParentType.With0ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With0ArgumentsGenericStatic.ReturnGenericMethod()); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsParentType.With0ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With0ArgumentsGenericStatic.VoidMethod()); + Console.WriteLine($"{typeof(ArgumentsParentType.With0ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With0ArgumentsGenericStatic.ReturnValueMethod()); + Console.WriteLine($"{typeof(ArgumentsParentType.With0ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With0ArgumentsGenericStatic.ReturnReferenceMethod()); + Console.WriteLine($"{typeof(ArgumentsParentType.With0ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With0ArgumentsGenericStatic.ReturnGenericMethod()); + Console.WriteLine(); + // var w0in = new ArgumentsParentType.With0ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsParentType.With0ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w0in.VoidMethod()); @@ -233,6 +307,40 @@ private static void ParentArgument0() RunMethod(() => ArgumentsParentType.With0ArgumentsStatic.ReturnGenericMethod()); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsParentType.With0ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With0ArgumentsStaticStruct.VoidMethod()); + Console.WriteLine($"{typeof(ArgumentsParentType.With0ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With0ArgumentsStaticStruct.ReturnValueMethod()); + Console.WriteLine($"{typeof(ArgumentsParentType.With0ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With0ArgumentsStaticStruct.ReturnReferenceMethod()); + Console.WriteLine($"{typeof(ArgumentsParentType.With0ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With0ArgumentsStaticStruct.ReturnGenericMethod()); + Console.WriteLine($"{typeof(ArgumentsParentType.With0ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With0ArgumentsStaticStruct.ReturnGenericMethod()); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsParentType.With0ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With0ArgumentsGenericStaticStruct.VoidMethod(), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With0ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With0ArgumentsGenericStaticStruct.ReturnValueMethod(), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With0ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With0ArgumentsGenericStaticStruct.ReturnReferenceMethod(), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With0ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With0ArgumentsGenericStaticStruct.ReturnGenericMethod(), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsParentType.With0ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With0ArgumentsGenericStaticStruct.VoidMethod(), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With0ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With0ArgumentsGenericStaticStruct.ReturnValueMethod(), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With0ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With0ArgumentsGenericStaticStruct.ReturnReferenceMethod(), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With0ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With0ArgumentsGenericStaticStruct.ReturnGenericMethod(), checkInstrumented: false); + Console.WriteLine(); + // var w0TBegin = new ArgumentsParentType.With0ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsParentType.With0ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w0TBegin.VoidMethod()); @@ -302,6 +410,26 @@ private static void StructParentArgument0() RunMethod(() => w0g2.ReturnGenericMethod()); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With0ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With0ArgumentsGenericStatic.VoidMethod()); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With0ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With0ArgumentsGenericStatic.ReturnValueMethod()); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With0ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With0ArgumentsGenericStatic.ReturnReferenceMethod()); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With0ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With0ArgumentsGenericStatic.ReturnGenericMethod()); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With0ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With0ArgumentsGenericStatic.VoidMethod()); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With0ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With0ArgumentsGenericStatic.ReturnValueMethod()); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With0ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With0ArgumentsGenericStatic.ReturnReferenceMethod()); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With0ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With0ArgumentsGenericStatic.ReturnGenericMethod()); + Console.WriteLine(); + // var w0in = new ArgumentsStructParentType.With0ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsStructParentType.With0ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w0in.VoidMethod()); @@ -351,6 +479,40 @@ private static void StructParentArgument0() RunMethod(() => ArgumentsStructParentType.With0ArgumentsStatic.ReturnGenericMethod()); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With0ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With0ArgumentsStaticStruct.VoidMethod()); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With0ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With0ArgumentsStaticStruct.ReturnValueMethod()); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With0ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With0ArgumentsStaticStruct.ReturnReferenceMethod()); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With0ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With0ArgumentsStaticStruct.ReturnGenericMethod()); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With0ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With0ArgumentsStaticStruct.ReturnGenericMethod()); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsStructParentType.With0ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With0ArgumentsGenericStaticStruct.VoidMethod(), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With0ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With0ArgumentsGenericStaticStruct.ReturnValueMethod(), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With0ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With0ArgumentsGenericStaticStruct.ReturnReferenceMethod(), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With0ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With0ArgumentsGenericStaticStruct.ReturnGenericMethod(), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsStructParentType.With0ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With0ArgumentsGenericStaticStruct.VoidMethod(), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With0ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With0ArgumentsGenericStaticStruct.ReturnValueMethod(), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With0ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With0ArgumentsGenericStaticStruct.ReturnReferenceMethod(), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With0ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With0ArgumentsGenericStaticStruct.ReturnGenericMethod(), checkInstrumented: false); + Console.WriteLine(); + // var w0TBegin = new ArgumentsStructParentType.With0ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsStructParentType.With0ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w0TBegin.VoidMethod()); @@ -420,6 +582,26 @@ private static void GenericParentArgument0() RunMethod(() => w0g2.ReturnGenericMethod()); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With0ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With0ArgumentsGenericStatic.VoidMethod()); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With0ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With0ArgumentsGenericStatic.ReturnValueMethod()); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With0ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With0ArgumentsGenericStatic.ReturnReferenceMethod()); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With0ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With0ArgumentsGenericStatic.ReturnGenericMethod()); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With0ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With0ArgumentsGenericStatic.VoidMethod()); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With0ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With0ArgumentsGenericStatic.ReturnValueMethod()); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With0ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With0ArgumentsGenericStatic.ReturnReferenceMethod()); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With0ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With0ArgumentsGenericStatic.ReturnGenericMethod()); + Console.WriteLine(); + // var w0in = new ArgumentsGenericParentType.With0ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsGenericParentType.With0ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w0in.VoidMethod()); @@ -469,6 +651,38 @@ private static void GenericParentArgument0() RunMethod(() => ArgumentsGenericParentType.With0ArgumentsStatic.ReturnGenericMethod()); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With0ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With0ArgumentsStaticStruct.VoidMethod()); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With0ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With0ArgumentsStaticStruct.ReturnValueMethod()); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With0ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With0ArgumentsStaticStruct.ReturnReferenceMethod()); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With0ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With0ArgumentsStaticStruct.ReturnGenericMethod()); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With0ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With0ArgumentsStaticStruct.ReturnGenericMethod()); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With0ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With0ArgumentsGenericStaticStruct.VoidMethod()); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With0ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With0ArgumentsGenericStaticStruct.ReturnValueMethod()); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With0ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With0ArgumentsGenericStaticStruct.ReturnReferenceMethod()); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With0ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With0ArgumentsGenericStaticStruct.ReturnGenericMethod()); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With0ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With0ArgumentsGenericStaticStruct.VoidMethod()); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With0ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With0ArgumentsGenericStaticStruct.ReturnValueMethod()); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With0ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With0ArgumentsGenericStaticStruct.ReturnReferenceMethod()); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With0ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With0ArgumentsGenericStaticStruct.ReturnGenericMethod()); + Console.WriteLine(); + // var w0TBegin = new ArgumentsGenericParentType.With0ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsGenericParentType.With0ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w0TBegin.VoidMethod()); @@ -516,6 +730,13 @@ public void VoidMethod() { } public string ReturnReferenceMethod() => "Hello World"; public T ReturnGenericMethod() => default; } +static class With0ArgumentsGenericStatic +{ + public static void VoidMethod() { } + public static int ReturnValueMethod() => 42; + public static string ReturnReferenceMethod() => "Hello World"; + public static T ReturnGenericMethod() => default; +} class With0ArgumentsInherits : With0Arguments { } class With0ArgumentsInheritsGeneric : With0ArgumentsGeneric { } struct With0ArgumentsStruct @@ -532,6 +753,20 @@ public static void VoidMethod() { } public static string ReturnReferenceMethod() => "Hello World"; public static T ReturnGenericMethod() => default; } +struct With0ArgumentsStaticStruct +{ + public static void VoidMethod() { } + public static int ReturnValueMethod() => 42; + public static string ReturnReferenceMethod() => "Hello World"; + public static T ReturnGenericMethod() => default; +} +struct With0ArgumentsGenericStaticStruct +{ + public static void VoidMethod() { } + public static int ReturnValueMethod() => 42; + public static string ReturnReferenceMethod() => "Hello World"; + public static T ReturnGenericMethod() => default; +} class With0ArgumentsThrowOnBegin : With0Arguments { } class With0ArgumentsThrowOnEnd : With0Arguments { } class With0ArgumentsThrowOnAsyncEnd @@ -579,6 +814,13 @@ public void VoidMethod() { } public string ReturnReferenceMethod() => "Hello World"; public T ReturnGenericMethod() => default; } + public static class With0ArgumentsGenericStatic + { + public static void VoidMethod() { } + public static int ReturnValueMethod() => 42; + public static string ReturnReferenceMethod() => "Hello World"; + public static T ReturnGenericMethod() => default; + } public class With0ArgumentsInherits : With0Arguments { } public class With0ArgumentsInheritsGeneric : With0ArgumentsGeneric { } public struct With0ArgumentsStruct @@ -595,6 +837,20 @@ public static void VoidMethod() { } public static string ReturnReferenceMethod() => "Hello World"; public static T ReturnGenericMethod() => default; } + public struct With0ArgumentsStaticStruct + { + public static void VoidMethod() { } + public static int ReturnValueMethod() => 42; + public static string ReturnReferenceMethod() => "Hello World"; + public static T ReturnGenericMethod() => default; + } + public struct With0ArgumentsGenericStaticStruct + { + public static void VoidMethod() { } + public static int ReturnValueMethod() => 42; + public static string ReturnReferenceMethod() => "Hello World"; + public static T ReturnGenericMethod() => default; + } public class With0ArgumentsThrowOnBegin : With0Arguments { } public class With0ArgumentsThrowOnEnd : With0Arguments { } public class With0ArgumentsThrowOnAsyncEnd @@ -620,6 +876,13 @@ public void VoidMethod() { } public string ReturnReferenceMethod() => "Hello World"; public T ReturnGenericMethod() => default; } + public static class With0ArgumentsGenericStatic + { + public static void VoidMethod() { } + public static int ReturnValueMethod() => 42; + public static string ReturnReferenceMethod() => "Hello World"; + public static T ReturnGenericMethod() => default; + } public class With0ArgumentsInherits : With0Arguments { } public class With0ArgumentsInheritsGeneric : With0ArgumentsGeneric { } public struct With0ArgumentsStruct @@ -636,6 +899,20 @@ public static void VoidMethod() { } public static string ReturnReferenceMethod() => "Hello World"; public static T ReturnGenericMethod() => default; } + public struct With0ArgumentsStaticStruct + { + public static void VoidMethod() { } + public static int ReturnValueMethod() => 42; + public static string ReturnReferenceMethod() => "Hello World"; + public static T ReturnGenericMethod() => default; + } + public struct With0ArgumentsGenericStaticStruct + { + public static void VoidMethod() { } + public static int ReturnValueMethod() => 42; + public static string ReturnReferenceMethod() => "Hello World"; + public static T ReturnGenericMethod() => default; + } public class With0ArgumentsThrowOnBegin : With0Arguments { } public class With0ArgumentsThrowOnEnd : With0Arguments { } public class With0ArgumentsThrowOnAsyncEnd @@ -661,6 +938,13 @@ public void VoidMethod() { } public string ReturnReferenceMethod() => "Hello World"; public T ReturnGenericMethod() => default; } + public static class With0ArgumentsGenericStatic + { + public static void VoidMethod() { } + public static int ReturnValueMethod() => 42; + public static string ReturnReferenceMethod() => "Hello World"; + public static T ReturnGenericMethod() => default; + } public class With0ArgumentsInherits : With0Arguments { } public class With0ArgumentsInheritsGeneric : With0ArgumentsGeneric { } public struct With0ArgumentsStruct @@ -677,6 +961,20 @@ public static void VoidMethod() { } public static string ReturnReferenceMethod() => "Hello World"; public static T ReturnGenericMethod() => default; } + public struct With0ArgumentsStaticStruct + { + public static void VoidMethod() { } + public static int ReturnValueMethod() => 42; + public static string ReturnReferenceMethod() => "Hello World"; + public static T ReturnGenericMethod() => default; + } + public struct With0ArgumentsGenericStaticStruct + { + public static void VoidMethod() { } + public static int ReturnValueMethod() => 42; + public static string ReturnReferenceMethod() => "Hello World"; + public static T ReturnGenericMethod() => default; + } public class With0ArgumentsThrowOnBegin : With0Arguments { } public class With0ArgumentsThrowOnEnd : With0Arguments { } public class With0ArgumentsThrowOnAsyncEnd diff --git a/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With1Arguments.cs b/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With1Arguments.cs index 411e4ead696e..ce400240472a 100644 --- a/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With1Arguments.cs +++ b/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With1Arguments.cs @@ -48,6 +48,26 @@ private static void Argument1() RunMethod(() => w1g2.ReturnValueMethod(Noop1ArgumentsIntegration.SKIPMETHODBODY)); Console.WriteLine(); // + Console.WriteLine($"{typeof(With1ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => With1ArgumentsGenericStatic.VoidMethod("Hello World")); + Console.WriteLine($"{typeof(With1ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => With1ArgumentsGenericStatic.ReturnValueMethod("Hello World")); + Console.WriteLine($"{typeof(With1ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => With1ArgumentsGenericStatic.ReturnReferenceMethod("Hello World")); + Console.WriteLine($"{typeof(With1ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => With1ArgumentsGenericStatic.ReturnGenericMethod("Hello World")); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(With1ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => With1ArgumentsGenericStatic.VoidMethod("Hello world")); + Console.WriteLine($"{typeof(With1ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => With1ArgumentsGenericStatic.ReturnValueMethod("Hello world")); + Console.WriteLine($"{typeof(With1ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => With1ArgumentsGenericStatic.ReturnReferenceMethod("Hello world")); + Console.WriteLine($"{typeof(With1ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => With1ArgumentsGenericStatic.ReturnGenericMethod(42)); + Console.WriteLine(); + // var w1in = new With1ArgumentsInherits(); Console.WriteLine($"{typeof(With1ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w1in.VoidMethod("Hello World")); @@ -105,6 +125,40 @@ private static void Argument1() RunMethod(() => With1ArgumentsStatic.ReturnValueMethod(Noop1ArgumentsIntegration.SKIPMETHODBODY)); Console.WriteLine(); // + Console.WriteLine($"{typeof(With1ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With1ArgumentsStaticStruct.VoidMethod("Hello World")); + Console.WriteLine($"{typeof(With1ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With1ArgumentsStaticStruct.ReturnValueMethod("Hello World")); + Console.WriteLine($"{typeof(With1ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With1ArgumentsStaticStruct.ReturnReferenceMethod("Hello World")); + Console.WriteLine($"{typeof(With1ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With1ArgumentsStaticStruct.ReturnGenericMethod(42)); + Console.WriteLine($"{typeof(With1ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With1ArgumentsStaticStruct.ReturnGenericMethod("Hello World")); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(With1ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With1ArgumentsGenericStaticStruct.VoidMethod("Hello World"), checkInstrumented: false); + Console.WriteLine($"{typeof(With1ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With1ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World"),checkInstrumented: false); + Console.WriteLine($"{typeof(With1ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With1ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World"),checkInstrumented: false); + Console.WriteLine($"{typeof(With1ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With1ArgumentsGenericStaticStruct.ReturnGenericMethod("Hello World"),checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(With1ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With1ArgumentsGenericStaticStruct.VoidMethod("Hello world"),checkInstrumented: false); + Console.WriteLine($"{typeof(With1ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With1ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world"),checkInstrumented: false); + Console.WriteLine($"{typeof(With1ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With1ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world"),checkInstrumented: false); + Console.WriteLine($"{typeof(With1ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With1ArgumentsGenericStaticStruct.ReturnGenericMethod(42),checkInstrumented: false); + Console.WriteLine(); + // var w1TBegin = new With1ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(With1ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w1TBegin.VoidMethod("Hello world")); @@ -169,6 +223,26 @@ private static void ParentArgument1() RunMethod(() => w1g2.ReturnGenericMethod(42)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsParentType.With1ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With1ArgumentsGenericStatic.VoidMethod("Hello World")); + Console.WriteLine($"{typeof(ArgumentsParentType.With1ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With1ArgumentsGenericStatic.ReturnValueMethod("Hello World")); + Console.WriteLine($"{typeof(ArgumentsParentType.With1ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With1ArgumentsGenericStatic.ReturnReferenceMethod("Hello World")); + Console.WriteLine($"{typeof(ArgumentsParentType.With1ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With1ArgumentsGenericStatic.ReturnGenericMethod("Hello World")); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsParentType.With1ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With1ArgumentsGenericStatic.VoidMethod("Hello world")); + Console.WriteLine($"{typeof(ArgumentsParentType.With1ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With1ArgumentsGenericStatic.ReturnValueMethod("Hello world")); + Console.WriteLine($"{typeof(ArgumentsParentType.With1ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With1ArgumentsGenericStatic.ReturnReferenceMethod("Hello world")); + Console.WriteLine($"{typeof(ArgumentsParentType.With1ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With1ArgumentsGenericStatic.ReturnGenericMethod(42)); + Console.WriteLine(); + // var w1in = new ArgumentsParentType.With1ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsParentType.With1ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w1in.VoidMethod("Hello World")); @@ -218,6 +292,41 @@ private static void ParentArgument1() RunMethod(() => ArgumentsParentType.With1ArgumentsStatic.ReturnGenericMethod("Hello World")); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsParentType.With1ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With1ArgumentsStaticStruct.VoidMethod("Hello World")); + Console.WriteLine($"{typeof(ArgumentsParentType.With1ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With1ArgumentsStaticStruct.ReturnValueMethod("Hello World")); + Console.WriteLine($"{typeof(ArgumentsParentType.With1ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With1ArgumentsStaticStruct.ReturnReferenceMethod("Hello World")); + Console.WriteLine($"{typeof(ArgumentsParentType.With1ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With1ArgumentsStaticStruct.ReturnGenericMethod(42)); + Console.WriteLine($"{typeof(ArgumentsParentType.With1ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With1ArgumentsStaticStruct.ReturnGenericMethod("Hello World")); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsParentType.With1ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With1ArgumentsGenericStaticStruct.VoidMethod("Hello World"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With1ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With1ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With1ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With1ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With1ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With1ArgumentsGenericStaticStruct.ReturnGenericMethod("Hello World"), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsParentType.With1ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With1ArgumentsGenericStaticStruct.VoidMethod("Hello world"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With1ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With1ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With1ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With1ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With1ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With1ArgumentsGenericStaticStruct.ReturnGenericMethod(42), checkInstrumented: false); + Console.WriteLine(); + // + // var w1TBegin = new ArgumentsParentType.With1ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsParentType.With1ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w1TBegin.VoidMethod("Hello world")); @@ -282,6 +391,26 @@ private static void StructParentArgument1() RunMethod(() => w1g2.ReturnGenericMethod(42)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With1ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With1ArgumentsGenericStatic.VoidMethod("Hello World")); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With1ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With1ArgumentsGenericStatic.ReturnValueMethod("Hello World")); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With1ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With1ArgumentsGenericStatic.ReturnReferenceMethod("Hello World")); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With1ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With1ArgumentsGenericStatic.ReturnGenericMethod("Hello World")); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With1ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With1ArgumentsGenericStatic.VoidMethod("Hello world")); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With1ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With1ArgumentsGenericStatic.ReturnValueMethod("Hello world")); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With1ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With1ArgumentsGenericStatic.ReturnReferenceMethod("Hello world")); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With1ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With1ArgumentsGenericStatic.ReturnGenericMethod(42)); + Console.WriteLine(); + // var w1in = new ArgumentsStructParentType.With1ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsStructParentType.With1ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w1in.VoidMethod("Hello World")); @@ -331,6 +460,41 @@ private static void StructParentArgument1() RunMethod(() => ArgumentsStructParentType.With1ArgumentsStatic.ReturnGenericMethod("Hello World")); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With1ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With1ArgumentsStaticStruct.VoidMethod("Hello World")); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With1ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With1ArgumentsStaticStruct.ReturnValueMethod("Hello World")); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With1ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With1ArgumentsStaticStruct.ReturnReferenceMethod("Hello World")); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With1ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With1ArgumentsStaticStruct.ReturnGenericMethod(42)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With1ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With1ArgumentsStaticStruct.ReturnGenericMethod("Hello World")); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsStructParentType.With1ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With1ArgumentsGenericStaticStruct.VoidMethod("Hello World"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With1ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With1ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With1ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With1ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With1ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With1ArgumentsGenericStaticStruct.ReturnGenericMethod("Hello World"), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsStructParentType.With1ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With1ArgumentsGenericStaticStruct.VoidMethod("Hello world"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With1ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With1ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With1ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With1ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With1ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With1ArgumentsGenericStaticStruct.ReturnGenericMethod(42), checkInstrumented: false); + Console.WriteLine(); + // + // var w1TBegin = new ArgumentsStructParentType.With1ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsStructParentType.With1ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w1TBegin.VoidMethod("Hello world")); @@ -395,6 +559,26 @@ private static void GenericParentArgument1() RunMethod(() => w1g2.ReturnGenericMethod(42)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With1ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With1ArgumentsGenericStatic.VoidMethod("Hello World")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With1ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With1ArgumentsGenericStatic.ReturnValueMethod("Hello World")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With1ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With1ArgumentsGenericStatic.ReturnReferenceMethod("Hello World")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With1ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With1ArgumentsGenericStatic.ReturnGenericMethod("Hello World")); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With1ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With1ArgumentsGenericStatic.VoidMethod("Hello world")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With1ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With1ArgumentsGenericStatic.ReturnValueMethod("Hello world")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With1ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With1ArgumentsGenericStatic.ReturnReferenceMethod("Hello world")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With1ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With1ArgumentsGenericStatic.ReturnGenericMethod(42)); + Console.WriteLine(); + // var w1in = new ArgumentsGenericParentType.With1ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsGenericParentType.With1ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w1in.VoidMethod("Hello World")); @@ -444,6 +628,38 @@ private static void GenericParentArgument1() RunMethod(() => ArgumentsGenericParentType.With1ArgumentsStatic.ReturnGenericMethod("Hello World")); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With1ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With1ArgumentsStaticStruct.VoidMethod("Hello World")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With1ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With1ArgumentsStaticStruct.ReturnValueMethod("Hello World")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With1ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With1ArgumentsStaticStruct.ReturnReferenceMethod("Hello World")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With1ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With1ArgumentsStaticStruct.ReturnGenericMethod(42)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With1ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With1ArgumentsStaticStruct.ReturnGenericMethod("Hello World")); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With1ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With1ArgumentsGenericStaticStruct.VoidMethod("Hello World")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With1ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With1ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With1ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With1ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With1ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With1ArgumentsGenericStaticStruct.ReturnGenericMethod("Hello World")); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With1ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With1ArgumentsGenericStaticStruct.VoidMethod("Hello world")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With1ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With1ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With1ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With1ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With1ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With1ArgumentsGenericStaticStruct.ReturnGenericMethod(42)); + Console.WriteLine(); + // var w1TBegin = new ArgumentsGenericParentType.With1ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsGenericParentType.With1ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w1TBegin.VoidMethod("Hello world")); @@ -486,6 +702,13 @@ public void VoidMethod(string arg1) { } public string ReturnReferenceMethod(string arg1) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1) => default; } +static class With1ArgumentsGenericStatic +{ + public static void VoidMethod(string arg1) { } + public static int ReturnValueMethod(string arg1) => 42; + public static string ReturnReferenceMethod(string arg1) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1) => default; +} class With1ArgumentsInherits : With1Arguments { } class With1ArgumentsInheritsGeneric : With1ArgumentsGeneric { } struct With1ArgumentsStruct @@ -502,6 +725,20 @@ public static void VoidMethod(string arg1) { } public static string ReturnReferenceMethod(string arg1) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1) => default; } +struct With1ArgumentsStaticStruct +{ + public static void VoidMethod(string arg1) { } + public static int ReturnValueMethod(string arg1) => 42; + public static string ReturnReferenceMethod(string arg1) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1) => default; +} +struct With1ArgumentsGenericStaticStruct +{ + public static void VoidMethod(string arg1) { } + public static int ReturnValueMethod(string arg1) => 42; + public static string ReturnReferenceMethod(string arg1) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1) => default; +} class With1ArgumentsThrowOnBegin : With1Arguments { } class With1ArgumentsThrowOnEnd : With1Arguments { } @@ -521,6 +758,13 @@ public void VoidMethod(string arg1) { } public string ReturnReferenceMethod(string arg1) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1) => default; } + public static class With1ArgumentsGenericStatic + { + public static void VoidMethod(string arg1) { } + public static int ReturnValueMethod(string arg1) => 42; + public static string ReturnReferenceMethod(string arg1) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1) => default; + } public class With1ArgumentsInherits : With1Arguments { } public class With1ArgumentsInheritsGeneric : With1ArgumentsGeneric { } public struct With1ArgumentsStruct @@ -537,6 +781,20 @@ public static void VoidMethod(string arg1) { } public static string ReturnReferenceMethod(string arg1) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1) => default; } + public struct With1ArgumentsStaticStruct + { + public static void VoidMethod(string arg1) { } + public static int ReturnValueMethod(string arg1) => 42; + public static string ReturnReferenceMethod(string arg1) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1) => default; + } + public struct With1ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1) { } + public static int ReturnValueMethod(string arg1) => 42; + public static string ReturnReferenceMethod(string arg1) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1) => default; + } public class With1ArgumentsThrowOnBegin : With1Arguments { } public class With1ArgumentsThrowOnEnd : With1Arguments { } } @@ -557,6 +815,13 @@ public void VoidMethod(string arg1) { } public string ReturnReferenceMethod(string arg1) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1) => default; } + public static class With1ArgumentsGenericStatic + { + public static void VoidMethod(string arg1) { } + public static int ReturnValueMethod(string arg1) => 42; + public static string ReturnReferenceMethod(string arg1) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1) => default; + } public class With1ArgumentsInherits : With1Arguments { } public class With1ArgumentsInheritsGeneric : With1ArgumentsGeneric { } public struct With1ArgumentsStruct @@ -573,6 +838,20 @@ public static void VoidMethod(string arg1) { } public static string ReturnReferenceMethod(string arg1) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1) => default; } + public struct With1ArgumentsStaticStruct + { + public static void VoidMethod(string arg1) { } + public static int ReturnValueMethod(string arg1) => 42; + public static string ReturnReferenceMethod(string arg1) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1) => default; + } + public struct With1ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1) { } + public static int ReturnValueMethod(string arg1) => 42; + public static string ReturnReferenceMethod(string arg1) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1) => default; + } public class With1ArgumentsThrowOnBegin : With1Arguments { } public class With1ArgumentsThrowOnEnd : With1Arguments { } } @@ -593,6 +872,13 @@ public void VoidMethod(string arg1) { } public string ReturnReferenceMethod(string arg1) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1) => default; } + public static class With1ArgumentsGenericStatic + { + public static void VoidMethod(string arg1) { } + public static int ReturnValueMethod(string arg1) => 42; + public static string ReturnReferenceMethod(string arg1) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1) => default; + } public class With1ArgumentsInherits : With1Arguments { } public class With1ArgumentsInheritsGeneric : With1ArgumentsGeneric { } public struct With1ArgumentsStruct @@ -609,6 +895,20 @@ public static void VoidMethod(string arg1) { } public static string ReturnReferenceMethod(string arg1) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1) => default; } + public struct With1ArgumentsStaticStruct + { + public static void VoidMethod(string arg1) { } + public static int ReturnValueMethod(string arg1) => 42; + public static string ReturnReferenceMethod(string arg1) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1) => default; + } + public struct With1ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1) { } + public static int ReturnValueMethod(string arg1) => 42; + public static string ReturnReferenceMethod(string arg1) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1) => default; + } public class With1ArgumentsThrowOnBegin : With1Arguments { } public class With1ArgumentsThrowOnEnd : With1Arguments { } } diff --git a/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With2Arguments.cs b/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With2Arguments.cs index 0e9435b34788..68bd2e810956 100644 --- a/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With2Arguments.cs +++ b/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With2Arguments.cs @@ -41,6 +41,26 @@ private static void Argument2() RunMethod(() => w2g2.ReturnGenericMethod(42, 99)); Console.WriteLine(); // + Console.WriteLine($"{typeof(With2ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => With2ArgumentsGenericStatic.VoidMethod("Hello World", 42)); + Console.WriteLine($"{typeof(With2ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => With2ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42)); + Console.WriteLine($"{typeof(With2ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => With2ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42)); + Console.WriteLine($"{typeof(With2ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => With2ArgumentsGenericStatic.ReturnGenericMethod("Hello World", 42)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(With2ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => With2ArgumentsGenericStatic.VoidMethod("Hello world", 42)); + Console.WriteLine($"{typeof(With2ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => With2ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42)); + Console.WriteLine($"{typeof(With2ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => With2ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42)); + Console.WriteLine($"{typeof(With2ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => With2ArgumentsGenericStatic.ReturnGenericMethod(42, 99)); + Console.WriteLine(); + // var w2in = new With2ArgumentsInherits(); Console.WriteLine($"{typeof(With2ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w2in.VoidMethod("Hello World", 42)); @@ -90,6 +110,40 @@ private static void Argument2() RunMethod(() => With2ArgumentsStatic.ReturnGenericMethod("Hello World", 42)); Console.WriteLine(); // + Console.WriteLine($"{typeof(With2ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With2ArgumentsStaticStruct.VoidMethod("Hello World", 42)); + Console.WriteLine($"{typeof(With2ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With2ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42)); + Console.WriteLine($"{typeof(With2ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With2ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42)); + Console.WriteLine($"{typeof(With2ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With2ArgumentsStaticStruct.ReturnGenericMethod(42, 99)); + Console.WriteLine($"{typeof(With2ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With2ArgumentsStaticStruct.ReturnGenericMethod("Hello World", 42)); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(With2ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With2ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42), checkInstrumented: false); + Console.WriteLine($"{typeof(With2ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With2ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42), checkInstrumented: false); + Console.WriteLine($"{typeof(With2ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With2ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42), checkInstrumented: false); + Console.WriteLine($"{typeof(With2ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With2ArgumentsGenericStaticStruct.ReturnGenericMethod("Hello World", 42), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(With2ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With2ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42), checkInstrumented: false); + Console.WriteLine($"{typeof(With2ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With2ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42), checkInstrumented: false); + Console.WriteLine($"{typeof(With2ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With2ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42), checkInstrumented: false); + Console.WriteLine($"{typeof(With2ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With2ArgumentsGenericStaticStruct.ReturnGenericMethod(42, 99), checkInstrumented: false); + Console.WriteLine(); + // var w2TBegin = new With2ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(With2ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w2TBegin.VoidMethod("Hello world", 42)); @@ -154,6 +208,26 @@ private static void ParentArgument2() RunMethod(() => w2g2.ReturnGenericMethod(42, 99)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsParentType.With2ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With2ArgumentsGenericStatic.VoidMethod("Hello World", 42)); + Console.WriteLine($"{typeof(ArgumentsParentType.With2ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With2ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42)); + Console.WriteLine($"{typeof(ArgumentsParentType.With2ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With2ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42)); + Console.WriteLine($"{typeof(ArgumentsParentType.With2ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With2ArgumentsGenericStatic.ReturnGenericMethod("Hello World", 42)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsParentType.With2ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With2ArgumentsGenericStatic.VoidMethod("Hello world", 42)); + Console.WriteLine($"{typeof(ArgumentsParentType.With2ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With2ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42)); + Console.WriteLine($"{typeof(ArgumentsParentType.With2ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With2ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42)); + Console.WriteLine($"{typeof(ArgumentsParentType.With2ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With2ArgumentsGenericStatic.ReturnGenericMethod(42, 99)); + Console.WriteLine(); + // var w2in = new ArgumentsParentType.With2ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsParentType.With2ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w2in.VoidMethod("Hello World", 42)); @@ -203,6 +277,41 @@ private static void ParentArgument2() RunMethod(() => ArgumentsParentType.With2ArgumentsStatic.ReturnGenericMethod("Hello World", 42)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsParentType.With2ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With2ArgumentsStaticStruct.VoidMethod("Hello World", 42)); + Console.WriteLine($"{typeof(ArgumentsParentType.With2ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With2ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42)); + Console.WriteLine($"{typeof(ArgumentsParentType.With2ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With2ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42)); + Console.WriteLine($"{typeof(ArgumentsParentType.With2ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With2ArgumentsStaticStruct.ReturnGenericMethod(42, 99)); + Console.WriteLine($"{typeof(ArgumentsParentType.With2ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With2ArgumentsStaticStruct.ReturnGenericMethod("Hello World", 42)); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsParentType.With2ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With2ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With2ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With2ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With2ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With2ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With2ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With2ArgumentsGenericStaticStruct.ReturnGenericMethod("Hello World", 42), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsParentType.With2ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With2ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With2ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With2ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With2ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With2ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With2ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With2ArgumentsGenericStaticStruct.ReturnGenericMethod(42, 99), checkInstrumented: false); + Console.WriteLine(); + // + // var w2TBegin = new ArgumentsParentType.With2ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsParentType.With2ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w2TBegin.VoidMethod("Hello world", 42)); @@ -267,6 +376,26 @@ private static void StructParentArgument2() RunMethod(() => w2g2.ReturnGenericMethod(42, 99)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With2ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With2ArgumentsGenericStatic.VoidMethod("Hello World", 42)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With2ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With2ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With2ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With2ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With2ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With2ArgumentsGenericStatic.ReturnGenericMethod("Hello World", 42)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With2ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With2ArgumentsGenericStatic.VoidMethod("Hello world", 42)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With2ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With2ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With2ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With2ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With2ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With2ArgumentsGenericStatic.ReturnGenericMethod(42, 99)); + Console.WriteLine(); + // var w2in = new ArgumentsStructParentType.With2ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsStructParentType.With2ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w2in.VoidMethod("Hello World", 42)); @@ -316,6 +445,41 @@ private static void StructParentArgument2() RunMethod(() => ArgumentsStructParentType.With2ArgumentsStatic.ReturnGenericMethod("Hello World", 42)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With2ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With2ArgumentsStaticStruct.VoidMethod("Hello World", 42)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With2ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With2ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With2ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With2ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With2ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With2ArgumentsStaticStruct.ReturnGenericMethod(42, 99)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With2ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With2ArgumentsStaticStruct.ReturnGenericMethod("Hello World", 42)); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsStructParentType.With2ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With2ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With2ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With2ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With2ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With2ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With2ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With2ArgumentsGenericStaticStruct.ReturnGenericMethod("Hello World", 42), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsStructParentType.With2ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With2ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With2ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With2ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With2ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With2ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With2ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With2ArgumentsGenericStaticStruct.ReturnGenericMethod(42, 99), checkInstrumented: false); + Console.WriteLine(); + // + // var w2TBegin = new ArgumentsStructParentType.With2ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsStructParentType.With2ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w2TBegin.VoidMethod("Hello world", 42)); @@ -380,6 +544,26 @@ private static void GenericParentArgument2() RunMethod(() => w2g2.ReturnGenericMethod(42, 99)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With2ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With2ArgumentsGenericStatic.VoidMethod("Hello World", 42)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With2ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With2ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With2ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With2ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With2ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With2ArgumentsGenericStatic.ReturnGenericMethod("Hello World", 42)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With2ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With2ArgumentsGenericStatic.VoidMethod("Hello world", 42)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With2ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With2ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With2ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With2ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With2ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With2ArgumentsGenericStatic.ReturnGenericMethod(42, 99)); + Console.WriteLine(); + // var w2in = new ArgumentsGenericParentType.With2ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsGenericParentType.With2ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w2in.VoidMethod("Hello World", 42)); @@ -429,6 +613,38 @@ private static void GenericParentArgument2() RunMethod(() => ArgumentsGenericParentType.With2ArgumentsStatic.ReturnGenericMethod("Hello World", 42)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With2ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With2ArgumentsStaticStruct.VoidMethod("Hello World", 42)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With2ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With2ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With2ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With2ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With2ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With2ArgumentsStaticStruct.ReturnGenericMethod(42, 99)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With2ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With2ArgumentsStaticStruct.ReturnGenericMethod("Hello World", 42)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With2ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With2ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With2ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With2ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With2ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With2ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With2ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With2ArgumentsGenericStaticStruct.ReturnGenericMethod("Hello World", 42)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With2ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With2ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With2ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With2ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With2ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With2ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With2ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With2ArgumentsGenericStaticStruct.ReturnGenericMethod(42, 99)); + Console.WriteLine(); + // var w2TBegin = new ArgumentsGenericParentType.With2ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsGenericParentType.With2ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w2TBegin.VoidMethod("Hello world", 42)); @@ -471,6 +687,13 @@ public void VoidMethod(string arg1, int arg2) { } public string ReturnReferenceMethod(string arg1, int arg2) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2) => default; } +static class With2ArgumentsGenericStatic +{ + public static void VoidMethod(string arg1, int arg2) { } + public static int ReturnValueMethod(string arg1, int arg2) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2) => default; +} class With2ArgumentsInherits : With2Arguments { } class With2ArgumentsInheritsGeneric : With2ArgumentsGeneric { } struct With2ArgumentsStruct @@ -487,6 +710,20 @@ public static void VoidMethod(string arg1, int arg2) { } public static string ReturnReferenceMethod(string arg1, int arg2) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2) => default; } +struct With2ArgumentsStaticStruct +{ + public static void VoidMethod(string arg1, int arg2) { } + public static int ReturnValueMethod(string arg1, int arg2) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2) => default; +} +struct With2ArgumentsGenericStaticStruct +{ + public static void VoidMethod(string arg1, int arg2) { } + public static int ReturnValueMethod(string arg1, int arg2) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2) => default; +} class With2ArgumentsThrowOnBegin : With2Arguments { } class With2ArgumentsThrowOnEnd : With2Arguments { } @@ -506,6 +743,13 @@ public void VoidMethod(string arg1, int arg2) { } public string ReturnReferenceMethod(string arg1, int arg2) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2) => default; } + public static class With2ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2) { } + public static int ReturnValueMethod(string arg1, int arg2) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2) => default; + } public class With2ArgumentsInherits : With2Arguments { } public class With2ArgumentsInheritsGeneric : With2ArgumentsGeneric { } public struct With2ArgumentsStruct @@ -522,6 +766,20 @@ public static void VoidMethod(string arg1, int arg2) { } public static string ReturnReferenceMethod(string arg1, int arg2) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2) => default; } + public struct With2ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2) { } + public static int ReturnValueMethod(string arg1, int arg2) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2) => default; + } + public struct With2ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2) { } + public static int ReturnValueMethod(string arg1, int arg2) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2) => default; + } public class With2ArgumentsThrowOnBegin : With2Arguments { } public class With2ArgumentsThrowOnEnd : With2Arguments { } } @@ -542,6 +800,13 @@ public void VoidMethod(string arg1, int arg2) { } public string ReturnReferenceMethod(string arg1, int arg2) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2) => default; } + public static class With2ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2) { } + public static int ReturnValueMethod(string arg1, int arg2) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2) => default; + } public class With2ArgumentsInherits : With2Arguments { } public class With2ArgumentsInheritsGeneric : With2ArgumentsGeneric { } public struct With2ArgumentsStruct @@ -558,6 +823,20 @@ public static void VoidMethod(string arg1, int arg2) { } public static string ReturnReferenceMethod(string arg1, int arg2) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2) => default; } + public struct With2ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2) { } + public static int ReturnValueMethod(string arg1, int arg2) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2) => default; + } + public struct With2ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2) { } + public static int ReturnValueMethod(string arg1, int arg2) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2) => default; + } public class With2ArgumentsThrowOnBegin : With2Arguments { } public class With2ArgumentsThrowOnEnd : With2Arguments { } } @@ -578,6 +857,13 @@ public void VoidMethod(string arg1, int arg2) { } public string ReturnReferenceMethod(string arg1, int arg2) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2) => default; } + public static class With2ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2) { } + public static int ReturnValueMethod(string arg1, int arg2) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2) => default; + } public class With2ArgumentsInherits : With2Arguments { } public class With2ArgumentsInheritsGeneric : With2ArgumentsGeneric { } public struct With2ArgumentsStruct @@ -594,6 +880,20 @@ public static void VoidMethod(string arg1, int arg2) { } public static string ReturnReferenceMethod(string arg1, int arg2) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2) => default; } + public struct With2ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2) { } + public static int ReturnValueMethod(string arg1, int arg2) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2) => default; + } + public struct With2ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2) { } + public static int ReturnValueMethod(string arg1, int arg2) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2) => default; + } public class With2ArgumentsThrowOnBegin : With2Arguments { } public class With2ArgumentsThrowOnEnd : With2Arguments { } } diff --git a/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With3Arguments.cs b/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With3Arguments.cs index 5e40ebd68261..0bd5b052f6b2 100644 --- a/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With3Arguments.cs +++ b/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With3Arguments.cs @@ -41,6 +41,26 @@ private static void Argument3() RunMethod(() => w3g2.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2))); Console.WriteLine(); // + Console.WriteLine($"{typeof(With3ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => With3ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(With3ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => With3ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(With3ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => With3ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(With3ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => With3ArgumentsGenericStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(With3ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => With3ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(With3ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => With3ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(With3ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => With3ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(With3ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => With3ArgumentsGenericStatic.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2))); + Console.WriteLine(); + // var w3in = new With3ArgumentsInherits(); Console.WriteLine($"{typeof(With3ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w3in.VoidMethod("Hello World", 42, Tuple.Create(1, 2))); @@ -90,6 +110,40 @@ private static void Argument3() RunMethod(() => With3ArgumentsStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2))); Console.WriteLine(); // + Console.WriteLine($"{typeof(With3ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With3ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(With3ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With3ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(With3ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With3ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(With3ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With3ArgumentsStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(With3ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With3ArgumentsStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(With3ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With3ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine($"{typeof(With3ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With3ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine($"{typeof(With3ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With3ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine($"{typeof(With3ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With3ArgumentsGenericStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(With3ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With3ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine($"{typeof(With3ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With3ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine($"{typeof(With3ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With3ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine($"{typeof(With3ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With3ArgumentsGenericStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine(); + // var w3TBegin = new With3ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(With3ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w3TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2))); @@ -154,6 +208,26 @@ private static void ParentArgument3() RunMethod(() => w3g2.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2))); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsParentType.With3ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With3ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsParentType.With3ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With3ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsParentType.With3ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With3ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsParentType.With3ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With3ArgumentsGenericStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsParentType.With3ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With3ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsParentType.With3ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With3ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsParentType.With3ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With3ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsParentType.With3ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With3ArgumentsGenericStatic.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2))); + Console.WriteLine(); + // var w3in = new ArgumentsParentType.With3ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsParentType.With3ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w3in.VoidMethod("Hello World", 42, Tuple.Create(1, 2))); @@ -203,6 +277,41 @@ private static void ParentArgument3() RunMethod(() => ArgumentsParentType.With3ArgumentsStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2))); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsParentType.With3ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With3ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsParentType.With3ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With3ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsParentType.With3ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With3ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsParentType.With3ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With3ArgumentsStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsParentType.With3ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With3ArgumentsStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsParentType.With3ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With3ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With3ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With3ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With3ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With3ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With3ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With3ArgumentsGenericStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsParentType.With3ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With3ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With3ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With3ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With3ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With3ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With3ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With3ArgumentsGenericStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine(); + // + // var w3TBegin = new ArgumentsParentType.With3ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsParentType.With3ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w3TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2))); @@ -267,6 +376,26 @@ private static void StructParentArgument3() RunMethod(() => w3g2.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2))); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With3ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With3ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With3ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With3ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With3ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With3ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With3ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With3ArgumentsGenericStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With3ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With3ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With3ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With3ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With3ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With3ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With3ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With3ArgumentsGenericStatic.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2))); + Console.WriteLine(); + // var w3in = new ArgumentsStructParentType.With3ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsStructParentType.With3ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w3in.VoidMethod("Hello World", 42, Tuple.Create(1, 2))); @@ -316,6 +445,41 @@ private static void StructParentArgument3() RunMethod(() => ArgumentsStructParentType.With3ArgumentsStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2))); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With3ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With3ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With3ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With3ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With3ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With3ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With3ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With3ArgumentsStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With3ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With3ArgumentsStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsStructParentType.With3ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With3ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With3ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With3ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With3ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With3ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With3ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With3ArgumentsGenericStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsStructParentType.With3ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With3ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With3ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With3ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With3ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With3ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With3ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With3ArgumentsGenericStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2)), checkInstrumented: false); + Console.WriteLine(); + // + // var w3TBegin = new ArgumentsStructParentType.With3ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsStructParentType.With3ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w3TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2))); @@ -380,6 +544,26 @@ private static void GenericParentArgument3() RunMethod(() => w3g2.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2))); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With3ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With3ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With3ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With3ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With3ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With3ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With3ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With3ArgumentsGenericStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With3ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With3ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With3ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With3ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With3ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With3ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With3ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With3ArgumentsGenericStatic.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2))); + Console.WriteLine(); + // var w3in = new ArgumentsGenericParentType.With3ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsGenericParentType.With3ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w3in.VoidMethod("Hello World", 42, Tuple.Create(1, 2))); @@ -429,6 +613,38 @@ private static void GenericParentArgument3() RunMethod(() => ArgumentsGenericParentType.With3ArgumentsStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2))); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With3ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With3ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With3ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With3ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With3ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With3ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With3ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With3ArgumentsStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With3ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With3ArgumentsStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With3ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With3ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With3ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With3ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With3ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With3ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With3ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With3ArgumentsGenericStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2))); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With3ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With3ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With3ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With3ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With3ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With3ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2))); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With3ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With3ArgumentsGenericStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2))); + Console.WriteLine(); + // var w3TBegin = new ArgumentsGenericParentType.With3ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsGenericParentType.With3ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w3TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2))); @@ -471,6 +687,13 @@ public void VoidMethod(string arg1, int arg2, object arg3) { } public string ReturnReferenceMethod(string arg1, int arg2, object arg3) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3) => default; } +static class With3ArgumentsGenericStatic +{ + public static void VoidMethod(string arg1, int arg2, object arg3) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3) => default; +} class With3ArgumentsInherits : With3Arguments { } class With3ArgumentsInheritsGeneric : With3ArgumentsGeneric { } struct With3ArgumentsStruct @@ -487,6 +710,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3) { } public static string ReturnReferenceMethod(string arg1, int arg2, object arg3) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3) => default; } +struct With3ArgumentsStaticStruct +{ + public static void VoidMethod(string arg1, int arg2, object arg3) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3) => default; +} +struct With3ArgumentsGenericStaticStruct +{ + public static void VoidMethod(string arg1, int arg2, object arg3) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3) => default; +} class With3ArgumentsThrowOnBegin : With3Arguments { } class With3ArgumentsThrowOnEnd : With3Arguments { } @@ -506,6 +743,13 @@ public void VoidMethod(string arg1, int arg2, object arg3) { } public string ReturnReferenceMethod(string arg1, int arg2, object arg3) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3) => default; } + public static class With3ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2, object arg3) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3) => default; + } public class With3ArgumentsInherits : With3Arguments { } public class With3ArgumentsInheritsGeneric : With3ArgumentsGeneric { } public struct With3ArgumentsStruct @@ -522,6 +766,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3) { } public static string ReturnReferenceMethod(string arg1, int arg2, object arg3) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3) => default; } + public struct With3ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3) => default; + } + public struct With3ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3) => default; + } public class With3ArgumentsThrowOnBegin : With3Arguments { } public class With3ArgumentsThrowOnEnd : With3Arguments { } } @@ -542,6 +800,13 @@ public void VoidMethod(string arg1, int arg2, object arg3) { } public string ReturnReferenceMethod(string arg1, int arg2, object arg3) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3) => default; } + public static class With3ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2, object arg3) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3) => default; + } public class With3ArgumentsInherits : With3Arguments { } public class With3ArgumentsInheritsGeneric : With3ArgumentsGeneric { } public struct With3ArgumentsStruct @@ -558,6 +823,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3) { } public static string ReturnReferenceMethod(string arg1, int arg2, object arg3) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3) => default; } + public struct With3ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3) => default; + } + public struct With3ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3) => default; + } public class With3ArgumentsThrowOnBegin : With3Arguments { } public class With3ArgumentsThrowOnEnd : With3Arguments { } } @@ -578,6 +857,13 @@ public void VoidMethod(string arg1, int arg2, object arg3) { } public string ReturnReferenceMethod(string arg1, int arg2, object arg3) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3) => default; } + public static class With3ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2, object arg3) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3) => default; + } public class With3ArgumentsInherits : With3Arguments { } public class With3ArgumentsInheritsGeneric : With3ArgumentsGeneric { } public struct With3ArgumentsStruct @@ -594,6 +880,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3) { } public static string ReturnReferenceMethod(string arg1, int arg2, object arg3) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3) => default; } + public struct With3ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3) => default; + } + public struct With3ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3) => default; + } public class With3ArgumentsThrowOnBegin : With3Arguments { } public class With3ArgumentsThrowOnEnd : With3Arguments { } } diff --git a/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With4Arguments.cs b/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With4Arguments.cs index c7442fc16cd5..44a917737ee4 100644 --- a/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With4Arguments.cs +++ b/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With4Arguments.cs @@ -42,6 +42,26 @@ private static void Argument4() RunMethod(() => w4g2.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask)); Console.WriteLine(); // + Console.WriteLine($"{typeof(With4ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => With4ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(With4ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => With4ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(With4ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => With4ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(With4ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => With4ArgumentsGenericStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(With4ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => With4ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(With4ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => With4ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(With4ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => With4ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(With4ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => With4ArgumentsGenericStatic.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine(); + // var w4in = new With4ArgumentsInherits(); Console.WriteLine($"{typeof(With4ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w4in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); @@ -91,6 +111,40 @@ private static void Argument4() RunMethod(() => With4ArgumentsStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); Console.WriteLine(); // + Console.WriteLine($"{typeof(With4ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With4ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(With4ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With4ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(With4ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With4ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(With4ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With4ArgumentsStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(With4ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With4ArgumentsStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(With4ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With4ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine($"{typeof(With4ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With4ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine($"{typeof(With4ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With4ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine($"{typeof(With4ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With4ArgumentsGenericStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(With4ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With4ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine($"{typeof(With4ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With4ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine($"{typeof(With4ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With4ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine($"{typeof(With4ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With4ArgumentsGenericStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine(); + // var w4TBegin = new With4ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(With4ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w4TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask)); @@ -155,6 +209,26 @@ private static void ParentArgument4() RunMethod(() => w4g2.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsParentType.With4ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With4ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsParentType.With4ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With4ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsParentType.With4ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With4ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsParentType.With4ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With4ArgumentsGenericStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsParentType.With4ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With4ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsParentType.With4ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With4ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsParentType.With4ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With4ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsParentType.With4ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With4ArgumentsGenericStatic.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine(); + // var w4in = new ArgumentsParentType.With4ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsParentType.With4ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w4in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); @@ -204,6 +278,41 @@ private static void ParentArgument4() RunMethod(() => ArgumentsParentType.With4ArgumentsStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsParentType.With4ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With4ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsParentType.With4ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With4ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsParentType.With4ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With4ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsParentType.With4ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With4ArgumentsStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsParentType.With4ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With4ArgumentsStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsParentType.With4ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With4ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With4ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With4ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With4ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With4ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With4ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With4ArgumentsGenericStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsParentType.With4ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With4ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With4ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With4ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With4ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With4ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With4ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With4ArgumentsGenericStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine(); + // + // var w4TBegin = new ArgumentsParentType.With4ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsParentType.With4ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w4TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask)); @@ -268,6 +377,26 @@ private static void StructParentArgument4() RunMethod(() => w4g2.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With4ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With4ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With4ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With4ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With4ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With4ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With4ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With4ArgumentsGenericStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With4ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With4ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With4ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With4ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With4ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With4ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With4ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With4ArgumentsGenericStatic.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine(); + // var w4in = new ArgumentsStructParentType.With4ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsStructParentType.With4ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w4in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); @@ -317,6 +446,40 @@ private static void StructParentArgument4() RunMethod(() => ArgumentsStructParentType.With4ArgumentsStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With4ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With4ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With4ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With4ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With4ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With4ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With4ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With4ArgumentsStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With4ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With4ArgumentsStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsStructParentType.With4ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With4ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With4ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With4ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With4ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With4ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With4ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With4ArgumentsGenericStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsStructParentType.With4ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With4ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With4ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With4ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With4ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With4ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With4ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With4ArgumentsGenericStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask), checkInstrumented: false); + Console.WriteLine(); + // var w4TBegin = new ArgumentsStructParentType.With4ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsStructParentType.With4ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w4TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask)); @@ -381,6 +544,26 @@ private static void GenericParentArgument4() RunMethod(() => w4g2.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With4ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With4ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With4ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With4ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With4ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With4ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With4ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With4ArgumentsGenericStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With4ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With4ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With4ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With4ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With4ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With4ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With4ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With4ArgumentsGenericStatic.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine(); + // var w4in = new ArgumentsGenericParentType.With4ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsGenericParentType.With4ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w4in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); @@ -430,6 +613,38 @@ private static void GenericParentArgument4() RunMethod(() => ArgumentsGenericParentType.With4ArgumentsStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With4ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With4ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With4ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With4ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With4ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With4ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With4ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With4ArgumentsStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With4ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With4ArgumentsStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With4ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With4ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With4ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With4ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With4ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With4ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With4ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With4ArgumentsGenericStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With4ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With4ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With4ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With4ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With4ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With4ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With4ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With4ArgumentsGenericStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask)); + Console.WriteLine(); + // var w4TBegin = new ArgumentsGenericParentType.With4ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsGenericParentType.With4ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w4TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask)); @@ -472,6 +687,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4) { } public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4) => default; } +static class With4ArgumentsGenericStatic +{ + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4) => default; +} class With4ArgumentsInherits : With4Arguments { } class With4ArgumentsInheritsGeneric : With4ArgumentsGeneric { } struct With4ArgumentsStruct @@ -488,6 +710,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4) { } public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4) => default; } +struct With4ArgumentsStaticStruct +{ + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4) => default; +} +struct With4ArgumentsGenericStaticStruct +{ + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4) => default; +} class With4ArgumentsThrowOnBegin : With4Arguments { } class With4ArgumentsThrowOnEnd : With4Arguments { } @@ -507,6 +743,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4) { } public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4) => default; } + public static class With4ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4) => default; + } public class With4ArgumentsInherits : With4Arguments { } public class With4ArgumentsInheritsGeneric : With4ArgumentsGeneric { } public struct With4ArgumentsStruct @@ -523,6 +766,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4) { } public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4) => default; } + public struct With4ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4) => default; + } + public struct With4ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4) => default; + } public class With4ArgumentsThrowOnBegin : With4Arguments { } public class With4ArgumentsThrowOnEnd : With4Arguments { } } @@ -543,6 +800,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4) { } public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4) => default; } + public static class With4ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4) => default; + } public class With4ArgumentsInherits : With4Arguments { } public class With4ArgumentsInheritsGeneric : With4ArgumentsGeneric { } public struct With4ArgumentsStruct @@ -559,6 +823,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4) { } public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4) => default; } + public struct With4ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4) => default; + } + public struct With4ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4) => default; + } public class With4ArgumentsThrowOnBegin : With4Arguments { } public class With4ArgumentsThrowOnEnd : With4Arguments { } } @@ -579,6 +857,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4) { } public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4) => default; } + public static class With4ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4) => default; + } public class With4ArgumentsInherits : With4Arguments { } public class With4ArgumentsInheritsGeneric : With4ArgumentsGeneric { } public struct With4ArgumentsStruct @@ -595,6 +880,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4) { } public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4) => default; } + public struct With4ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4) => default; + } + public struct With4ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4) => default; + } public class With4ArgumentsThrowOnBegin : With4Arguments { } public class With4ArgumentsThrowOnEnd : With4Arguments { } } diff --git a/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With5Arguments.cs b/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With5Arguments.cs index 528e030f319c..1fdb75641f1b 100644 --- a/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With5Arguments.cs +++ b/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With5Arguments.cs @@ -43,6 +43,26 @@ private static void Argument5() RunMethod(() => w5g2.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); Console.WriteLine(); // + Console.WriteLine($"{typeof(With5ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => With5ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(With5ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => With5ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(With5ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => With5ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(With5ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => With5ArgumentsGenericStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(With5ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => With5ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(With5ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => With5ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(With5ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => With5ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(With5ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => With5ArgumentsGenericStatic.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine(); + // var w5in = new With5ArgumentsInherits(); Console.WriteLine($"{typeof(With5ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w5in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); @@ -92,6 +112,40 @@ private static void Argument5() RunMethod(() => With5ArgumentsStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); Console.WriteLine(); // + Console.WriteLine($"{typeof(With5ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With5ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(With5ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With5ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(With5ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With5ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(With5ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With5ArgumentsStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(With5ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With5ArgumentsStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(With5ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With5ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None), checkInstrumented: false); + Console.WriteLine($"{typeof(With5ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With5ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None), checkInstrumented: false); + Console.WriteLine($"{typeof(With5ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With5ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None),checkInstrumented: false); + Console.WriteLine($"{typeof(With5ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With5ArgumentsGenericStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(With5ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With5ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None), checkInstrumented: false); + Console.WriteLine($"{typeof(With5ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With5ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None), checkInstrumented: false); + Console.WriteLine($"{typeof(With5ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With5ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None), checkInstrumented: false); + Console.WriteLine($"{typeof(With5ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With5ArgumentsGenericStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None), checkInstrumented: false); + Console.WriteLine(); + // var w5TBegin = new With5ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(With5ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w5TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); @@ -156,6 +210,26 @@ private static void ParentArgument5() RunMethod(() => w5g2.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsParentType.With5ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With5ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsParentType.With5ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With5ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsParentType.With5ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With5ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsParentType.With5ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With5ArgumentsGenericStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsParentType.With5ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With5ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsParentType.With5ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With5ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsParentType.With5ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With5ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsParentType.With5ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With5ArgumentsGenericStatic.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine(); + // var w5in = new ArgumentsParentType.With5ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsParentType.With5ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w5in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); @@ -205,6 +279,40 @@ private static void ParentArgument5() RunMethod(() => ArgumentsParentType.With5ArgumentsStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsParentType.With5ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With5ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsParentType.With5ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With5ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsParentType.With5ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With5ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsParentType.With5ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With5ArgumentsStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsParentType.With5ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With5ArgumentsStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsParentType.With5ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With5ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With5ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With5ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With5ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With5ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With5ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With5ArgumentsGenericStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsParentType.With5ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With5ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With5ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With5ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With5ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With5ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With5ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With5ArgumentsGenericStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None), checkInstrumented: false); + Console.WriteLine(); + // var w5TBegin = new ArgumentsParentType.With5ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsParentType.With5ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w5TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); @@ -269,6 +377,26 @@ private static void StructParentArgument5() RunMethod(() => w5g2.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With5ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With5ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With5ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With5ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With5ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With5ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With5ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With5ArgumentsGenericStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With5ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With5ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With5ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With5ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With5ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With5ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With5ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With5ArgumentsGenericStatic.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine(); + // var w5in = new ArgumentsStructParentType.With5ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsStructParentType.With5ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w5in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); @@ -318,6 +446,40 @@ private static void StructParentArgument5() RunMethod(() => ArgumentsStructParentType.With5ArgumentsStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With5ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With5ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With5ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With5ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With5ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With5ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With5ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With5ArgumentsStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With5ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With5ArgumentsStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsStructParentType.With5ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With5ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With5ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With5ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With5ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With5ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With5ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With5ArgumentsGenericStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsStructParentType.With5ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With5ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With5ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With5ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With5ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With5ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With5ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With5ArgumentsGenericStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None), checkInstrumented: false); + Console.WriteLine(); + // var w5TBegin = new ArgumentsStructParentType.With5ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsStructParentType.With5ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w5TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); @@ -382,6 +544,26 @@ private static void GenericParentArgument5() RunMethod(() => w5g2.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With5ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With5ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With5ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With5ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With5ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With5ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With5ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With5ArgumentsGenericStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With5ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With5ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With5ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With5ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With5ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With5ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With5ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With5ArgumentsGenericStatic.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine(); + // var w5in = new ArgumentsGenericParentType.With5ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsGenericParentType.With5ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w5in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); @@ -431,6 +613,38 @@ private static void GenericParentArgument5() RunMethod(() => ArgumentsGenericParentType.With5ArgumentsStatic.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With5ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With5ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With5ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With5ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With5ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With5ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With5ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With5ArgumentsStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With5ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With5ArgumentsStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With5ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With5ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With5ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With5ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With5ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With5ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With5ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With5ArgumentsGenericStaticStruct.ReturnGenericMethod>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With5ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With5ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With5ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With5ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With5ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With5ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With5ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With5ArgumentsGenericStaticStruct.ReturnGenericMethod>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); + Console.WriteLine(); + // var w5TBegin = new ArgumentsGenericParentType.With5ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsGenericParentType.With5ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w5TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None)); @@ -473,6 +687,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Cancellati public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5) => default; } +static class With5ArgumentsGenericStatic +{ + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5) => default; +} class With5ArgumentsInherits : With5Arguments { } class With5ArgumentsInheritsGeneric : With5ArgumentsGeneric { } struct With5ArgumentsStruct @@ -489,6 +710,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Can public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5) => default; } +struct With5ArgumentsStaticStruct +{ + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5) => default; +} +struct With5ArgumentsGenericStaticStruct +{ + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5) => default; +} class With5ArgumentsThrowOnBegin : With5Arguments { } class With5ArgumentsThrowOnEnd : With5Arguments { } @@ -508,6 +743,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Cancellati public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5) => default; } + public static class With5ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5) => default; + } public class With5ArgumentsInherits : With5Arguments { } public class With5ArgumentsInheritsGeneric : With5ArgumentsGeneric { } public struct With5ArgumentsStruct @@ -524,6 +766,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Can public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5) => default; } + public struct With5ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5) => default; + } + public struct With5ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5) => default; + } public class With5ArgumentsThrowOnBegin : With5Arguments { } public class With5ArgumentsThrowOnEnd : With5Arguments { } } @@ -544,6 +800,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Cancellati public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5) => default; } + public static class With5ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5) => default; + } public class With5ArgumentsInherits : With5Arguments { } public class With5ArgumentsInheritsGeneric : With5ArgumentsGeneric { } public struct With5ArgumentsStruct @@ -560,6 +823,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Can public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5) => default; } + public struct With5ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5) => default; + } + public struct With5ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5) => default; + } public class With5ArgumentsThrowOnBegin : With5Arguments { } public class With5ArgumentsThrowOnEnd : With5Arguments { } } @@ -580,6 +857,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Cancellati public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5) => default; } + public static class With5ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5) => default; + } public class With5ArgumentsInherits : With5Arguments { } public class With5ArgumentsInheritsGeneric : With5ArgumentsGeneric { } public struct With5ArgumentsStruct @@ -596,6 +880,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Can public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5) => default; } + public struct With5ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5) => default; + } + public struct With5ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5) => default; + } public class With5ArgumentsThrowOnBegin : With5Arguments { } public class With5ArgumentsThrowOnEnd : With5Arguments { } } diff --git a/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With6Arguments.cs b/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With6Arguments.cs index 219f68395fa1..0ce0a5a520c3 100644 --- a/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With6Arguments.cs +++ b/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With6Arguments.cs @@ -43,6 +43,26 @@ private static void Argument6() RunMethod(() => w6g2.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); Console.WriteLine(); // + Console.WriteLine($"{typeof(With6ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => With6ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(With6ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => With6ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(With6ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => With6ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(With6ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => With6ArgumentsGenericStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(With6ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => With6ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(With6ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => With6ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(With6ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => With6ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(With6ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => With6ArgumentsGenericStatic.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine(); + // var w6in = new With6ArgumentsInherits(); Console.WriteLine($"{typeof(With6ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w6in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); @@ -92,6 +112,40 @@ private static void Argument6() RunMethod(() => With6ArgumentsStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); Console.WriteLine(); // + Console.WriteLine($"{typeof(With6ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With6ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(With6ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With6ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(With6ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With6ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(With6ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With6ArgumentsStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(With6ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With6ArgumentsStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(With6ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With6ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine($"{typeof(With6ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With6ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine($"{typeof(With6ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With6ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine($"{typeof(With6ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With6ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(With6ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With6ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine($"{typeof(With6ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With6ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine($"{typeof(With6ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With6ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine($"{typeof(With6ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With6ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine(); + // var w6TBegin = new With6ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(With6ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w6TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); @@ -156,6 +210,26 @@ private static void ParentArgument6() RunMethod(() => w6g2.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsParentType.With6ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With6ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsParentType.With6ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With6ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsParentType.With6ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With6ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsParentType.With6ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With6ArgumentsGenericStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsParentType.With6ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With6ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsParentType.With6ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With6ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsParentType.With6ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With6ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsParentType.With6ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With6ArgumentsGenericStatic.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine(); + // var w6in = new ArgumentsParentType.With6ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsParentType.With6ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w6in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); @@ -205,6 +279,40 @@ private static void ParentArgument6() RunMethod(() => ArgumentsParentType.With6ArgumentsStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsParentType.With6ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With6ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsParentType.With6ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With6ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsParentType.With6ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With6ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsParentType.With6ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With6ArgumentsStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsParentType.With6ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With6ArgumentsStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsParentType.With6ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With6ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With6ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With6ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With6ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With6ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With6ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With6ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsParentType.With6ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With6ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With6ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With6ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With6ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With6ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With6ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With6ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine(); + // var w6TBegin = new ArgumentsParentType.With6ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsParentType.With6ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w6TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); @@ -269,6 +377,26 @@ private static void StructParentArgument6() RunMethod(() => w6g2.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With6ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With6ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With6ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With6ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With6ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With6ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With6ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With6ArgumentsGenericStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With6ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With6ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With6ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With6ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With6ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With6ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With6ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With6ArgumentsGenericStatic.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine(); + // var w6in = new ArgumentsStructParentType.With6ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsStructParentType.With6ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w6in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); @@ -318,6 +446,40 @@ private static void StructParentArgument6() RunMethod(() => ArgumentsStructParentType.With6ArgumentsStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With6ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With6ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With6ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With6ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With6ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With6ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With6ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With6ArgumentsStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With6ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With6ArgumentsStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsStructParentType.With6ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With6ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With6ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With6ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With6ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With6ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With6ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With6ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsStructParentType.With6ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With6ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With6ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With6ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With6ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With6ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With6ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With6ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987), checkInstrumented: false); + Console.WriteLine(); + // var w6TBegin = new ArgumentsStructParentType.With6ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsStructParentType.With6ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w6TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); @@ -382,6 +544,26 @@ private static void GenericParentArgument6() RunMethod(() => w6g2.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With6ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With6ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With6ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With6ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With6ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With6ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With6ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With6ArgumentsGenericStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With6ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With6ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With6ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With6ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With6ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With6ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With6ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With6ArgumentsGenericStatic.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine(); + // var w6in = new ArgumentsGenericParentType.With6ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsGenericParentType.With6ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w6in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); @@ -431,6 +613,38 @@ private static void GenericParentArgument6() RunMethod(() => ArgumentsGenericParentType.With6ArgumentsStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With6ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With6ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With6ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With6ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With6ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With6ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With6ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With6ArgumentsStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With6ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With6ArgumentsStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With6ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With6ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With6ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With6ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With6ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With6ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With6ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With6ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With6ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With6ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With6ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With6ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With6ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With6ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With6ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With6ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); + Console.WriteLine(); + // var w6TBegin = new ArgumentsGenericParentType.With6ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsGenericParentType.With6ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w6TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987)); @@ -473,6 +687,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Cancellati public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6) => default; } +static class With6ArgumentsGenericStatic +{ + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6) => default; +} class With6ArgumentsInherits : With6Arguments { } class With6ArgumentsInheritsGeneric : With6ArgumentsGeneric { } struct With6ArgumentsStruct @@ -489,6 +710,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Can public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6) => default; } +struct With6ArgumentsStaticStruct +{ + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6) => default; +} +struct With6ArgumentsGenericStaticStruct +{ + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6) => default; +} class With6ArgumentsThrowOnBegin : With6Arguments { } class With6ArgumentsThrowOnEnd : With6Arguments { } @@ -508,6 +743,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Cancellati public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6) => default; } + public static class With6ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6) => default; + } public class With6ArgumentsInherits : With6Arguments { } public class With6ArgumentsInheritsGeneric : With6ArgumentsGeneric { } public struct With6ArgumentsStruct @@ -524,6 +766,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Can public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6) => default; } + public struct With6ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6) => default; + } + public struct With6ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6) => default; + } public class With6ArgumentsThrowOnBegin : With6Arguments { } public class With6ArgumentsThrowOnEnd : With6Arguments { } } @@ -544,6 +800,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Cancellati public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6) => default; } + public static class With6ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6) => default; + } public class With6ArgumentsInherits : With6Arguments { } public class With6ArgumentsInheritsGeneric : With6ArgumentsGeneric { } public struct With6ArgumentsStruct @@ -560,6 +823,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Can public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6) => default; } + public struct With6ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6) => default; + } + public struct With6ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6) => default; + } public class With6ArgumentsThrowOnBegin : With6Arguments { } public class With6ArgumentsThrowOnEnd : With6Arguments { } } @@ -580,6 +857,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Cancellati public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6) => default; } + public static class With6ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6) => default; + } public class With6ArgumentsInherits : With6Arguments { } public class With6ArgumentsInheritsGeneric : With6ArgumentsGeneric { } public struct With6ArgumentsStruct @@ -596,6 +880,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Can public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6) => default; } + public struct With6ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6) => default; + } + public struct With6ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6) => default; + } public class With6ArgumentsThrowOnBegin : With6Arguments { } public class With6ArgumentsThrowOnEnd : With6Arguments { } } diff --git a/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With7Arguments.cs b/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With7Arguments.cs index 526d28a945b5..43dc8dbcd788 100644 --- a/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With7Arguments.cs +++ b/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With7Arguments.cs @@ -43,6 +43,26 @@ private static void Argument7() RunMethod(() => w7g2.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); Console.WriteLine(); // + Console.WriteLine($"{typeof(With7ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => With7ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(With7ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => With7ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(With7ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => With7ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(With7ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => With7ArgumentsGenericStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(With7ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => With7ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(With7ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => With7ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(With7ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => With7ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(With7ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => With7ArgumentsGenericStatic.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine(); + // var w7in = new With7ArgumentsInherits(); Console.WriteLine($"{typeof(With7ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w7in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); @@ -92,6 +112,40 @@ private static void Argument7() RunMethod(() => With7ArgumentsStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); Console.WriteLine(); // + Console.WriteLine($"{typeof(With7ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With7ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(With7ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With7ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(With7ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With7ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(With7ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With7ArgumentsStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(With7ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With7ArgumentsStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(With7ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With7ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine($"{typeof(With7ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With7ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine($"{typeof(With7ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With7ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine($"{typeof(With7ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With7ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(With7ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With7ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine($"{typeof(With7ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With7ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine($"{typeof(With7ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With7ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine($"{typeof(With7ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With7ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine(); + // var w7TBegin = new With7ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(With7ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w7TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); @@ -156,6 +210,26 @@ private static void ParentArgument7() RunMethod(() => w7g2.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsParentType.With7ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With7ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsParentType.With7ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With7ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsParentType.With7ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With7ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsParentType.With7ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With7ArgumentsGenericStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsParentType.With7ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With7ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsParentType.With7ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With7ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsParentType.With7ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With7ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsParentType.With7ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With7ArgumentsGenericStatic.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine(); + // var w7in = new ArgumentsParentType.With7ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsParentType.With7ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w7in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); @@ -205,6 +279,40 @@ private static void ParentArgument7() RunMethod(() => ArgumentsParentType.With7ArgumentsStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsParentType.With7ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With7ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsParentType.With7ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With7ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsParentType.With7ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With7ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsParentType.With7ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With7ArgumentsStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsParentType.With7ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With7ArgumentsStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsParentType.With7ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With7ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With7ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With7ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With7ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With7ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With7ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With7ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsParentType.With7ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With7ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With7ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With7ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With7ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With7ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With7ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With7ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine(); + // var w7TBegin = new ArgumentsParentType.With7ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsParentType.With7ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w7TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); @@ -269,6 +377,26 @@ private static void StructParentArgument7() RunMethod(() => w7g2.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With7ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With7ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With7ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With7ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With7ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With7ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With7ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With7ArgumentsGenericStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With7ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With7ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With7ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With7ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With7ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With7ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With7ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With7ArgumentsGenericStatic.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine(); + // var w7in = new ArgumentsStructParentType.With7ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsStructParentType.With7ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w7in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); @@ -318,6 +446,40 @@ private static void StructParentArgument7() RunMethod(() => ArgumentsStructParentType.With7ArgumentsStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With7ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With7ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With7ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With7ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With7ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With7ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With7ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With7ArgumentsStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With7ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With7ArgumentsStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsStructParentType.With7ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With7ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With7ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With7ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With7ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With7ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With7ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With7ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsStructParentType.With7ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With7ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With7ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With7ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With7ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With7ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With7ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With7ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value"), checkInstrumented: false); + Console.WriteLine(); + // var w7TBegin = new ArgumentsStructParentType.With7ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsStructParentType.With7ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w7TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); @@ -382,6 +544,26 @@ private static void GenericParentArgument7() RunMethod(() => w7g2.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With7ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With7ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With7ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With7ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With7ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With7ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With7ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With7ArgumentsGenericStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With7ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With7ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With7ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With7ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With7ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With7ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With7ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With7ArgumentsGenericStatic.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine(); + // var w7in = new ArgumentsGenericParentType.With7ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsGenericParentType.With7ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w7in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); @@ -431,6 +613,38 @@ private static void GenericParentArgument7() RunMethod(() => ArgumentsGenericParentType.With7ArgumentsStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With7ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With7ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With7ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With7ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With7ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With7ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With7ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With7ArgumentsStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With7ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With7ArgumentsStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With7ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With7ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With7ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With7ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With7ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With7ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With7ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With7ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With7ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With7ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With7ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With7ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With7ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With7ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With7ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With7ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); + Console.WriteLine(); + // var w7TBegin = new ArgumentsGenericParentType.With7ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsGenericParentType.With7ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w7TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value")); @@ -473,6 +687,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Cancellati public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7) => default; } +static class With7ArgumentsGenericStatic +{ + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7) => default; +} class With7ArgumentsInherits : With7Arguments { } class With7ArgumentsInheritsGeneric : With7ArgumentsGeneric { } struct With7ArgumentsStruct @@ -489,6 +710,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Can public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7) => default; } +struct With7ArgumentsStaticStruct +{ + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7) => default; +} +struct With7ArgumentsGenericStaticStruct +{ + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7) => default; +} class With7ArgumentsThrowOnBegin : With7Arguments { } class With7ArgumentsThrowOnEnd : With7Arguments { } @@ -508,6 +743,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Cancellati public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7) => default; } + public static class With7ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7) => default; + } public class With7ArgumentsInherits : With7Arguments { } public class With7ArgumentsInheritsGeneric : With7ArgumentsGeneric { } public struct With7ArgumentsStruct @@ -524,6 +766,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Can public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7) => default; } + public struct With7ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7) => default; + } + public struct With7ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7) => default; + } public class With7ArgumentsThrowOnBegin : With7Arguments { } public class With7ArgumentsThrowOnEnd : With7Arguments { } } @@ -544,6 +800,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Cancellati public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7) => default; } + public static class With7ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7) => default; + } public class With7ArgumentsInherits : With7Arguments { } public class With7ArgumentsInheritsGeneric : With7ArgumentsGeneric { } public struct With7ArgumentsStruct @@ -560,6 +823,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Can public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7) => default; } + public struct With7ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7) => default; + } + public struct With7ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7) => default; + } public class With7ArgumentsThrowOnBegin : With7Arguments { } public class With7ArgumentsThrowOnEnd : With7Arguments { } } @@ -580,6 +857,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Cancellati public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7) => default; } + public static class With7ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7) => default; + } public class With7ArgumentsInherits : With7Arguments { } public class With7ArgumentsInheritsGeneric : With7ArgumentsGeneric { } public struct With7ArgumentsStruct @@ -596,6 +880,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Can public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7) => default; } + public struct With7ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7) => default; + } + public struct With7ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7) => default; + } public class With7ArgumentsThrowOnBegin : With7Arguments { } public class With7ArgumentsThrowOnEnd : With7Arguments { } } diff --git a/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With8Arguments.cs b/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With8Arguments.cs index 28eef2f056ba..c0bde1c03126 100644 --- a/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With8Arguments.cs +++ b/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With8Arguments.cs @@ -44,6 +44,26 @@ private static void Argument8() RunMethod(() => w8g2.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); Console.WriteLine(); // + Console.WriteLine($"{typeof(With8ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => With8ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(With8ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => With8ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(With8ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => With8ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(With8ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => With8ArgumentsGenericStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(With8ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => With8ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(With8ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => With8ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(With8ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => With8ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(With8ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => With8ArgumentsGenericStatic.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine(); + // var w8in = new With8ArgumentsInherits(); Console.WriteLine($"{typeof(With8ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w8in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); @@ -93,6 +113,40 @@ private static void Argument8() RunMethod(() => With8ArgumentsStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); Console.WriteLine(); // + Console.WriteLine($"{typeof(With8ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With8ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(With8ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With8ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(With8ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With8ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(With8ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With8ArgumentsStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(With8ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With8ArgumentsStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(With8ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With8ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine($"{typeof(With8ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With8ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine($"{typeof(With8ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With8ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine($"{typeof(With8ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With8ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(With8ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With8ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine($"{typeof(With8ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With8ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine($"{typeof(With8ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With8ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine($"{typeof(With8ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With8ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine(); + // var w8TBegin = new With8ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(With8ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w8TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); @@ -157,6 +211,26 @@ private static void ParentArgument8() RunMethod(() => w8g2.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsParentType.With8ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With8ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsParentType.With8ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With8ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsParentType.With8ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With8ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsParentType.With8ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With8ArgumentsGenericStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsParentType.With8ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With8ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsParentType.With8ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With8ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsParentType.With8ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With8ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsParentType.With8ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With8ArgumentsGenericStatic.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine(); + // var w8in = new ArgumentsParentType.With8ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsParentType.With8ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w8in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); @@ -206,6 +280,40 @@ private static void ParentArgument8() RunMethod(() => ArgumentsParentType.With8ArgumentsStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsParentType.With8ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With8ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsParentType.With8ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With8ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsParentType.With8ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With8ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsParentType.With8ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With8ArgumentsStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsParentType.With8ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With8ArgumentsStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsParentType.With8ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With8ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With8ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With8ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With8ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With8ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With8ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With8ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsParentType.With8ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With8ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With8ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With8ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With8ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With8ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With8ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With8ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine(); + // var w8TBegin = new ArgumentsParentType.With8ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsParentType.With8ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w8TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); @@ -270,6 +378,26 @@ private static void StructParentArgument8() RunMethod(() => w8g2.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With8ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With8ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With8ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With8ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With8ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With8ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With8ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With8ArgumentsGenericStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With8ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With8ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With8ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With8ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With8ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With8ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With8ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With8ArgumentsGenericStatic.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine(); + // var w8in = new ArgumentsStructParentType.With8ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsStructParentType.With8ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w8in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); @@ -319,6 +447,40 @@ private static void StructParentArgument8() RunMethod(() => ArgumentsStructParentType.With8ArgumentsStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With8ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With8ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With8ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With8ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With8ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With8ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With8ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With8ArgumentsStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With8ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With8ArgumentsStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsStructParentType.With8ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With8ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With8ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With8ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With8ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With8ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With8ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With8ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsStructParentType.With8ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With8ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With8ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With8ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With8ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With8ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With8ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With8ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly()), checkInstrumented: false); + Console.WriteLine(); + // var w8TBegin = new ArgumentsStructParentType.With8ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsStructParentType.With8ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w8TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); @@ -383,6 +545,26 @@ private static void GenericParentArgument8() RunMethod(() => w8g2.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With8ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With8ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With8ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With8ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With8ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With8ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With8ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With8ArgumentsGenericStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With8ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With8ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With8ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With8ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With8ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With8ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With8ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With8ArgumentsGenericStatic.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine(); + // var w8in = new ArgumentsGenericParentType.With8ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsGenericParentType.With8ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w8in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); @@ -432,6 +614,38 @@ private static void GenericParentArgument8() RunMethod(() => ArgumentsGenericParentType.With8ArgumentsStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With8ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With8ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With8ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With8ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With8ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With8ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With8ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With8ArgumentsStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With8ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With8ArgumentsStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With8ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With8ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With8ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With8ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With8ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With8ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With8ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With8ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With8ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With8ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With8ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With8ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With8ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With8ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With8ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With8ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); + Console.WriteLine(); + // var w8TBegin = new ArgumentsGenericParentType.With8ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsGenericParentType.With8ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w8TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly())); @@ -474,6 +688,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Cancellati public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8) => default; } +static class With8ArgumentsGenericStatic +{ + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8) => default; +} class With8ArgumentsInherits : With8Arguments { } class With8ArgumentsInheritsGeneric : With8ArgumentsGeneric { } struct With8ArgumentsStruct @@ -490,6 +711,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Can public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8) => default; } +struct With8ArgumentsStaticStruct +{ + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8) => default; +} +struct With8ArgumentsGenericStaticStruct +{ + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8) => default; +} class With8ArgumentsThrowOnBegin : With8Arguments { } class With8ArgumentsThrowOnEnd : With8Arguments { } @@ -509,6 +744,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Cancellati public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8) => default; } + public static class With8ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8) => default; + } public class With8ArgumentsInherits : With8Arguments { } public class With8ArgumentsInheritsGeneric : With8ArgumentsGeneric { } public struct With8ArgumentsStruct @@ -525,6 +767,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Can public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8) => default; } + public struct With8ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8) => default; + } + public struct With8ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8) => default; + } public class With8ArgumentsThrowOnBegin : With8Arguments { } public class With8ArgumentsThrowOnEnd : With8Arguments { } } @@ -545,6 +801,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Cancellati public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8) => default; } + public static class With8ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8) => default; + } public class With8ArgumentsInherits : With8Arguments { } public class With8ArgumentsInheritsGeneric : With8ArgumentsGeneric { } public struct With8ArgumentsStruct @@ -561,6 +824,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Can public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8) => default; } + public struct With8ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8) => default; + } + public struct With8ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8) => default; + } public class With8ArgumentsThrowOnBegin : With8Arguments { } public class With8ArgumentsThrowOnEnd : With8Arguments { } } @@ -581,6 +858,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Cancellati public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8) => default; } + public static class With8ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8) => default; + } public class With8ArgumentsInherits : With8Arguments { } public class With8ArgumentsInheritsGeneric : With8ArgumentsGeneric { } public struct With8ArgumentsStruct @@ -597,6 +881,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Can public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8) => default; } + public struct With8ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8) => default; + } + public struct With8ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8) => default; + } public class With8ArgumentsThrowOnBegin : With8Arguments { } public class With8ArgumentsThrowOnEnd : With8Arguments { } } diff --git a/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With9Arguments.cs b/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With9Arguments.cs index a9590b7d8287..a4813412afa2 100644 --- a/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With9Arguments.cs +++ b/tracer/test/test-applications/instrumentation/CallTargetNativeTest/With9Arguments.cs @@ -44,6 +44,26 @@ private static void Argument9() RunMethod(() => w9g2.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); Console.WriteLine(); // + Console.WriteLine($"{typeof(With9ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => With9ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(With9ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => With9ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(With9ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => With9ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(With9ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => With9ArgumentsGenericStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(With9ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => With9ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(With9ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => With9ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(With9ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => With9ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(With9ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => With9ArgumentsGenericStatic.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine(); + // var w9in = new With9ArgumentsInherits(); Console.WriteLine($"{typeof(With9ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w9in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); @@ -93,6 +113,40 @@ private static void Argument9() RunMethod(() => With9ArgumentsStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); Console.WriteLine(); // + Console.WriteLine($"{typeof(With9ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With9ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(With9ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With9ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(With9ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With9ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(With9ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With9ArgumentsStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(With9ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With9ArgumentsStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(With9ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With9ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine($"{typeof(With9ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With9ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine($"{typeof(With9ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With9ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine($"{typeof(With9ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With9ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(With9ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => With9ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine($"{typeof(With9ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => With9ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine($"{typeof(With9ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => With9ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine($"{typeof(With9ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => With9ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine(); + // var w9TBegin = new With9ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(With9ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w9TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); @@ -157,6 +211,26 @@ private static void ParentArgument9() RunMethod(() => w9g2.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsParentType.With9ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With9ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsParentType.With9ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With9ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsParentType.With9ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With9ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsParentType.With9ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With9ArgumentsGenericStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsParentType.With9ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With9ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsParentType.With9ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With9ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsParentType.With9ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With9ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsParentType.With9ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With9ArgumentsGenericStatic.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine(); + // var w9in = new ArgumentsParentType.With9ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsParentType.With9ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w9in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); @@ -206,6 +280,40 @@ private static void ParentArgument9() RunMethod(() => ArgumentsParentType.With9ArgumentsStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsParentType.With9ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With9ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsParentType.With9ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With9ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsParentType.With9ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With9ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsParentType.With9ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With9ArgumentsStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsParentType.With9ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With9ArgumentsStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsParentType.With9ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With9ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With9ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With9ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With9ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With9ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With9ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With9ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsParentType.With9ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsParentType.With9ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With9ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsParentType.With9ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With9ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsParentType.With9ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsParentType.With9ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsParentType.With9ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine(); + // var w9TBegin = new ArgumentsParentType.With9ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsParentType.With9ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w9TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); @@ -270,6 +378,26 @@ private static void StructParentArgument9() RunMethod(() => w9g2.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With9ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With9ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With9ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With9ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With9ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With9ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With9ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With9ArgumentsGenericStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With9ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With9ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With9ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With9ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With9ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With9ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With9ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With9ArgumentsGenericStatic.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine(); + // var w9in = new ArgumentsStructParentType.With9ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsStructParentType.With9ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w9in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); @@ -319,6 +447,40 @@ private static void StructParentArgument9() RunMethod(() => ArgumentsStructParentType.With9ArgumentsStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsStructParentType.With9ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With9ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With9ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With9ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With9ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With9ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With9ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With9ArgumentsStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With9ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With9ArgumentsStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsStructParentType.With9ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With9ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With9ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With9ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With9ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With9ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With9ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With9ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine(); + // + // Note: We skip instrumentation today for generic value types. + Console.WriteLine($"{typeof(ArgumentsStructParentType.With9ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsStructParentType.With9ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With9ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsStructParentType.With9ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With9ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsStructParentType.With9ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine($"{typeof(ArgumentsStructParentType.With9ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsStructParentType.With9ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null), checkInstrumented: false); + Console.WriteLine(); + // var w9TBegin = new ArgumentsStructParentType.With9ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsStructParentType.With9ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w9TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); @@ -383,6 +545,26 @@ private static void GenericParentArgument9() RunMethod(() => w9g2.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With9ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With9ArgumentsGenericStatic.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With9ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With9ArgumentsGenericStatic.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With9ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With9ArgumentsGenericStatic.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With9ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With9ArgumentsGenericStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With9ArgumentsGenericStatic).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With9ArgumentsGenericStatic.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With9ArgumentsGenericStatic).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With9ArgumentsGenericStatic.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With9ArgumentsGenericStatic).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With9ArgumentsGenericStatic.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With9ArgumentsGenericStatic).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With9ArgumentsGenericStatic.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine(); + // var w9in = new ArgumentsGenericParentType.With9ArgumentsInherits(); Console.WriteLine($"{typeof(ArgumentsGenericParentType.With9ArgumentsInherits).FullName}.VoidMethod"); RunMethod(() => w9in.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); @@ -432,6 +614,38 @@ private static void GenericParentArgument9() RunMethod(() => ArgumentsGenericParentType.With9ArgumentsStatic.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); Console.WriteLine(); // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With9ArgumentsStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With9ArgumentsStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With9ArgumentsStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With9ArgumentsStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With9ArgumentsStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With9ArgumentsStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With9ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With9ArgumentsStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With9ArgumentsStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With9ArgumentsStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With9ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With9ArgumentsGenericStaticStruct.VoidMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With9ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With9ArgumentsGenericStaticStruct.ReturnValueMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With9ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With9ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With9ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With9ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>("Hello World", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine(); + // + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With9ArgumentsGenericStaticStruct).FullName}.VoidMethod"); + RunMethod(() => ArgumentsGenericParentType.With9ArgumentsGenericStaticStruct.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With9ArgumentsGenericStaticStruct).FullName}.ReturnValueMethod"); + RunMethod(() => ArgumentsGenericParentType.With9ArgumentsGenericStaticStruct.ReturnValueMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With9ArgumentsGenericStaticStruct).FullName}.ReturnReferenceMethod"); + RunMethod(() => ArgumentsGenericParentType.With9ArgumentsGenericStaticStruct.ReturnReferenceMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine($"{typeof(ArgumentsGenericParentType.With9ArgumentsGenericStaticStruct).FullName}.ReturnGenericMethod"); + RunMethod(() => ArgumentsGenericParentType.With9ArgumentsGenericStaticStruct.ReturnGenericMethod, ulong>(42, 99, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); + Console.WriteLine(); + // var w9TBegin = new ArgumentsGenericParentType.With9ArgumentsThrowOnBegin(); Console.WriteLine($"{typeof(ArgumentsGenericParentType.With9ArgumentsThrowOnBegin).FullName}.VoidMethod"); RunMethod(() => w9TBegin.VoidMethod("Hello world", 42, Tuple.Create(1, 2), Task.CompletedTask, CancellationToken.None, 987, "Arg7-Value", Assembly.GetExecutingAssembly(), null)); @@ -474,6 +688,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Cancellati public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8, int? arg9) => default; } +static class With9ArgumentsGenericStatic +{ + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8, int? arg9) => default; +} class With9ArgumentsInherits : With9Arguments { } class With9ArgumentsInheritsGeneric : With9ArgumentsGeneric { } struct With9ArgumentsStruct @@ -490,6 +711,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Can public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8, int? arg9) => default; } +struct With9ArgumentsStaticStruct +{ + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8, int? arg9) => default; +} +struct With9ArgumentsGenericStaticStruct +{ + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8, int? arg9) => default; +} class With9ArgumentsThrowOnBegin : With9Arguments { } class With9ArgumentsThrowOnEnd : With9Arguments { } @@ -509,6 +744,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Cancellati public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8, int? arg9) => default; } + public static class With9ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8, int? arg9) => default; + } public class With9ArgumentsInherits : With9Arguments { } public class With9ArgumentsInheritsGeneric : With9ArgumentsGeneric { } public struct With9ArgumentsStruct @@ -525,6 +767,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Can public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8, int? arg9) => default; } + public struct With9ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8, int? arg9) => default; + } + public struct With9ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8, int? arg9) => default; + } public class With9ArgumentsThrowOnBegin : With9Arguments { } public class With9ArgumentsThrowOnEnd : With9Arguments { } } @@ -545,6 +801,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Cancellati public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8, int? arg9) => default; } + public static class With9ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8, int? arg9) => default; + } public class With9ArgumentsInherits : With9Arguments { } public class With9ArgumentsInheritsGeneric : With9ArgumentsGeneric { } public struct With9ArgumentsStruct @@ -561,6 +824,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Can public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8, int? arg9) => default; } + public struct With9ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8, int? arg9) => default; + } + public struct With9ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8, int? arg9) => default; + } public class With9ArgumentsThrowOnBegin : With9Arguments { } public class With9ArgumentsThrowOnEnd : With9Arguments { } } @@ -581,6 +858,13 @@ public void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Cancellati public string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => "Hello World"; public T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8, int? arg9) => default; } + public static class With9ArgumentsGenericStatic + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8, int? arg9) => default; + } public class With9ArgumentsInherits : With9Arguments { } public class With9ArgumentsInheritsGeneric : With9ArgumentsGeneric { } public struct With9ArgumentsStruct @@ -597,6 +881,20 @@ public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, Can public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => "Hello World"; public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8, int? arg9) => default; } + public struct With9ArgumentsStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8, int? arg9) => default; + } + public struct With9ArgumentsGenericStaticStruct + { + public static void VoidMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) { } + public static int ReturnValueMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => 42; + public static string ReturnReferenceMethod(string arg1, int arg2, object arg3, Task arg4, CancellationToken arg5, ulong arg6, string arg7, Assembly arg8, int? arg9) => "Hello World"; + public static T ReturnGenericMethod(TArg1 arg1, int arg2, TArg3 arg3, Task arg4, CancellationToken arg5, TArg6 arg6, string arg7, Assembly arg8, int? arg9) => default; + } public class With9ArgumentsThrowOnBegin : With9Arguments { } public class With9ArgumentsThrowOnEnd : With9Arguments { } }