10 overrides of ReturnType
System.Private.CoreLib (4)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodBuilderInstantiation.cs (1)
99public override Type ReturnType => _method.ReturnType;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodOnTypeBuilderInstantiation.cs (1)
120public override Type ReturnType => _method.ReturnType;
System\Reflection\Emit\DynamicMethod.cs (1)
126public override Type ReturnType
System\Reflection\RuntimeMethodInfo.cs (1)
250public sealed override Type ReturnType
System.Reflection.Context (3)
System\Reflection\Context\Delegation\DelegatingMethodInfo.cs (1)
101public override Type ReturnType
System\Reflection\Context\Virtual\VirtualPropertyBase.PropertyGetterBase.cs (1)
20public sealed override Type ReturnType
System\Reflection\Context\Virtual\VirtualPropertyBase.PropertySetterBase.cs (1)
22public sealed override Type ReturnType
System.Reflection.Emit (2)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodBuilderInstantiation.cs (1)
99public override Type ReturnType => _method.ReturnType;
System\Reflection\Emit\ArrayMethod.cs (1)
72public override Type ReturnType => _returnType;
System.Reflection.MetadataLoadContext (1)
System\Reflection\TypeLoading\Methods\RoMethod.cs (1)
96public sealed override Type ReturnType => ReturnParameter.ParameterType;
451 references to ReturnType
Aspire.Hosting.Azure.Tests (3)
PublicApiTests\FunctionsPublicApiTests.cs (3)
25method.ReturnType == typeof(IResourceBuilder<AzureFunctionsAppResource>)), 28method.ReturnType == typeof(IResourceBuilder<AzureFunctionsAppResource>)) 46.Where(method => method.ReturnType == typeof(IResourceBuilder<AzureFunctionsProjectResource>));
Aspire.Hosting.CodeGeneration.TypeScript.Tests (1)
TypeScriptLanguageSupportTests.cs (1)
303Assert.Equal(typeof(JsonElement), hook.ReturnType);
Aspire.Hosting.Native.CodeGeneration (19)
NativeProviderProjection.cs (6)
95var awaitPrefix = typeof(Task).IsAssignableFrom(method.ReturnType) ? "await " : ""; 217private static Type ReturnType(MethodInfo method) => method.ReturnType == typeof(Task) ? typeof(void) : 218method.ReturnType.IsGenericType && method.ReturnType.GetGenericTypeDefinition() == typeof(Task<>) 219? method.ReturnType.GetGenericArguments()[0] : method.ReturnType;
Program.cs (7)
83var asynchronous = method.ReturnType == typeof(Task) || 84method.ReturnType.IsGenericType && method.ReturnType.GetGenericTypeDefinition() == typeof(Task<>); 85var returnType = method.ReturnType == typeof(Task) ? typeof(void) : 86asynchronous ? method.ReturnType.GetGenericArguments()[0] : method.ReturnType; 152throw new NotSupportedException($"Unsupported native return type: {method.ReturnType}.");
src\Aspire.Hosting.RemoteHost\AtsCapabilityScanner.cs (6)
2163var returnTypeId = MapToAtsTypeId(method.ReturnType, assemblyExportedTypeCache); 2166var returnsBuilder = returnTypeId != null && IsResourceBuilderType(method.ReturnType); 2296var returnType = invokeMethod.ReturnType; 2688var typeRef = CreateTypeRef(method.ReturnType, enumCollector: null, assemblyExportedTypeCache); 3196CollectResourceTypeFromType(method.ReturnType, discoveredTypes); 3299CollectResourceTypeFromType(invokeMethod.ReturnType, discoveredTypes);
Aspire.Hosting.Native.Core.Tests (6)
NativeCSharpClientTests.cs (6)
34var sourceReturn = source.ReturnType == typeof(Task) ? typeof(void) : 35source.ReturnType.IsGenericType && source.ReturnType.GetGenericTypeDefinition() == typeof(Task<>) 36? source.ReturnType.GetGenericArguments()[0] : source.ReturnType; 38projectedMethod.ReturnType);
Aspire.Hosting.RemoteHost (10)
Ats\AtsCallbackProxyFactory.cs (1)
78var returnType = invokeMethod.ReturnType;
Ats\CapabilityDispatcher.cs (2)
397result = await UnwrapAsyncResultAsync(result, methodToInvoke.ReturnType).ConfigureAwait(false); 484result = await UnwrapAsyncResultAsync(result, methodToInvoke.ReturnType).ConfigureAwait(false);
AtsCapabilityScanner.cs (6)
2163var returnTypeId = MapToAtsTypeId(method.ReturnType, assemblyExportedTypeCache); 2166var returnsBuilder = returnTypeId != null && IsResourceBuilderType(method.ReturnType); 2296var returnType = invokeMethod.ReturnType; 2688var typeRef = CreateTypeRef(method.ReturnType, enumCollector: null, assemblyExportedTypeCache); 3196CollectResourceTypeFromType(method.ReturnType, discoveredTypes); 3299CollectResourceTypeFromType(invokeMethod.ReturnType, discoveredTypes);
Language\LanguageService.cs (1)
177if (method.ReturnType != typeof(JsonElement))
Aspire.Hosting.RemoteHost.Tests (1)
AtsCapabilityScannerTests.cs (1)
703Assert.Equal(typeof(IResourceBuilder<global::Aspire.Hosting.Yarp.YarpResource>), withConfigurationMethod.ReturnType);
Aspire.Hosting.Tests (1)
ProjectResourceTests.cs (1)
1073Assert.Equal(typeof(IResourceBuilder<ProjectResource>), method.ReturnType);
dotnet-svcutil-lib (54)
FrameworkFork\Microsoft.Xml\Xml\Serialization\Mappings.cs (4)
1165if (_needSchema && typeof(XmlSchemaType).IsAssignableFrom(_getSchemaMethod.ReturnType)) 1256if (typeof(XmlSchemaType).IsAssignableFrom(_getSchemaMethod.ReturnType)) 1352if (typeof(XmlSchemaType).IsAssignableFrom(_getSchemaMethod.ReturnType)) 1358else if (typeof(XmlQualifiedName).IsAssignableFrom(_getSchemaMethod.ReturnType))
FrameworkFork\Microsoft.Xml\Xml\Serialization\SourceInfo.cs (2)
117Type eType = get_Item.ReturnType; 231ILG.ConvertValue(Nullable_get_Value.ReturnType, targetType);
FrameworkFork\Microsoft.Xml\Xml\Serialization\TypeExtensions.cs (2)
43method.ReturnType != null && 44targetType.IsAssignableFrom(method.ReturnType))
FrameworkFork\Microsoft.Xml\Xml\Serialization\Types.cs (4)
1283if (enumerator == null || !typeof(IEnumerator).IsAssignableFrom(enumerator.ReturnType)) 1290if (enumerator != null && typeof(IEnumerator).IsAssignableFrom(enumerator.ReturnType)) 1308if (enumerator == null || !typeof(IEnumerator).IsAssignableFrom(enumerator.ReturnType)) 1318PropertyInfo p = enumerator.ReturnType.GetProperty("Current");
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlReflectionImporter.cs (2)
495if (!(typeof(XmlQualifiedName).IsAssignableFrom(getMethod.ReturnType)) && !(typeof(XmlSchemaType).IsAssignableFrom(getMethod.ReturnType)))
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriterILGen.cs (6)
169returnType = XmlConvert_ToString.ReturnType; 189returnType = FromXXX.ReturnType; 1346if (method.ReturnType != typeof(void)) 1575if (getEnumeratorMethod != null && typeof(IEnumerator).IsAssignableFrom(getEnumeratorMethod.ReturnType)) 1595ilg.ConvertValue(getEnumeratorMethod.ReturnType, typeof(IEnumerator)); 2583ilg.ConvertValue(Activator_CreateInstance.ReturnType, cast);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ClassDataContract.cs (1)
1237if (method.ReturnType != Globals.TypeOfVoid)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeGenerator.cs (2)
197BeginMethod(signature.ReturnType, methodName, paramTypes, allowPrivateMemberAccess); 721memberType = method.ReturnType;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CollectionDataContract.cs (1)
1266if (getEnumeratorMethod == null || !Globals.TypeOfIEnumerator.IsAssignableFrom(getEnumeratorMethod.ReturnType))
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (2)
1240if (method != null && method.ReturnType == UnderlyingType) 2114if (!Globals.TypeOfTypeEnumerable.IsAssignableFrom(method.ReturnType))
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\SchemaExporter.cs (2)
62if (!(Globals.TypeOfXmlQualifiedName.IsAssignableFrom(getMethod.ReturnType))) 63throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.InvalidReturnTypeOnGetSchemaMethod, DataContract.GetClrTypeFullName(clrType), methodName, DataContract.GetClrTypeFullName(getMethod.ReturnType), DataContract.GetClrTypeFullName(Globals.TypeOfXmlQualifiedName))));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatReaderGenerator.cs (6)
129_ilg.ConvertValue(Globals.TypeOfDateTimeOffset, _ilg.CurrentMethod.ReturnType); 135_ilg.ConvertValue(Globals.TypeOfKeyValuePair.MakeGenericType(classContract.KeyValuePairGenericArguments), _ilg.CurrentMethod.ReturnType); 139_ilg.ConvertValue(_objectLocal.LocalType, _ilg.CurrentMethod.ReturnType); 150_ilg.ConvertValue(_objectLocal.LocalType, _ilg.CurrentMethod.ReturnType); 788if (collectionContract.AddMethod.ReturnType != Globals.TypeOfVoid) 794if (collectionContract.AddMethod.ReturnType != Globals.TypeOfVoid)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatWriterGenerator.cs (4)
376enumeratorType = collectionContract.GetEnumeratorMethod.ReturnType; 413Type elementType = getCurrentMethod.ReturnType; 420_ilg.ConvertValue(collectionContract.GetEnumeratorMethod.ReturnType, Globals.TypeOfIDictionaryEnumerator); 427_ilg.ConvertValue(collectionContract.GetEnumeratorMethod.ReturnType, ctorParam);
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ServiceReflector.cs (5)
828method.ReturnType != s_asyncResultType) 851if (method.ReturnType == taskType) 855if (method.ReturnType.IsGenericType() && method.ReturnType.GetGenericTypeDefinition() == taskTResultType) 865Type methodReturnType = method.ReturnType;
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\TypeLoader.cs (9)
374if (!typeof(IEnumerable<Type>).IsAssignableFrom(method.ReturnType)) 527if (method1.ReturnType != method2.ReturnType || 1054if ((!isTask && outputMethod.ReturnType != ServiceReflector.VoidType) || (isTask && taskTResult != ServiceReflector.VoidType) || 1157Type responseType = isTask ? taskTResult : methodInfo.ReturnType; 1639if (_syncOperation.SyncMethod.ReturnType != _syncOperation.EndMethod.ReturnType) 1761if (_syncOperation.SyncMethod.ReturnType != _syncOperation.TaskTResult) 1880if (_taskOperation.TaskTResult != _asyncOperation.EndMethod.ReturnType)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\InvokerUtil.cs (1)
33bool returnsValue = method.ReturnType != typeof(void);
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\TaskMethodInvoker.cs (1)
36_taskTResultGetMethod = ((PropertyInfo)taskMethod.ReturnType.GetMember(ResultMethodName)[0]).GetGetMethod();
GetDocument.Insider (6)
Commands\GetDocumentCommandWorker.cs (5)
245if (!_generateMethodReturnType.IsAssignableFrom(generateWithVersionMethod.ReturnType)) 248Resources.FormatMethodReturnTypeUnsupported(GenerateMethodName, serviceType, generateWithVersionMethod.ReturnType, _generateMethodReturnType)); 458if (!returnType.IsAssignableFrom(method.ReturnType)) 461Resources.FormatMethodReturnTypeUnsupported(methodName, type, method.ReturnType, returnType)); 475Resources.FormatMethodReturnedNull(method.Name, method.DeclaringType, method.ReturnType));
src\d85239adf2da4ad4\HostFactoryResolver.cs (1)
117&& typeof(TReturn).IsAssignableFrom(factory.ReturnType)
Infrastructure.Common (1)
xunit\ConditionAttribute.cs (1)
113if (mi != null && mi.IsStatic && mi.GetParameters().Length == 0 && mi.ReturnType == typeof(bool))
Microsoft.AspNetCore.Components.Endpoints (2)
src\aspnetcore\src\Shared\PropertyHelper\PropertyHelper.cs (2)
249var typeOutput = propertyGetMethod.ReturnType; 280Debug.Assert(setMethod.ReturnType == typeof(void));
Microsoft.AspNetCore.Hosting (1)
Internal\StartupLoader.cs (1)
352if (returnType != null && methodInfo.ReturnType != returnType)
Microsoft.AspNetCore.Http.Abstractions (3)
Extensions\UseMiddlewareExtensions.cs (1)
87if (!typeof(Task).IsAssignableFrom(invokeMethod.ReturnType))
src\aspnetcore\src\Shared\PropertyHelper\PropertyHelper.cs (2)
249var typeOutput = propertyGetMethod.ReturnType; 280Debug.Assert(setMethod.ReturnType == typeof(void));
Microsoft.AspNetCore.Http.Extensions (15)
RequestDelegateFactory.cs (3)
348var returnType = methodInfo.ReturnType; 412PopulateBuiltInResponseTypeMetadata(methodInfo.ReturnType, factoryContext); 473methodInfo.ReturnType);
src\aspnetcore\src\Shared\EndpointMetadataPopulator.cs (1)
49var returnType = methodInfo.ReturnType;
src\aspnetcore\src\Shared\ObjectMethodExecutor\AwaitableInfo.cs (2)
62var awaiterType = getAwaiterMethod.ReturnType; 107getResultMethod.ReturnType,
src\aspnetcore\src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (5)
37MethodReturnType = methodInfo.ReturnType; 281var postCoercionMethodReturnType = coercedAwaitableInfo.CoercerResultType ?? methodInfo.ReturnType; 424var taskAwaiterGetResultMethodInfo = (MethodInfo)taskGetAwaiterMethodInfo.ReturnType.GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo); 426resultType = taskAwaiterGetResultMethodInfo.ReturnType; 439var methodReturnType = methodInfo.ReturnType;
src\aspnetcore\src\Shared\ParameterBindingMethodCache.cs (4)
196return methodInfo.ReturnType.Equals(typeof(bool)); 229var valueTaskResultType = methodInfo.ReturnType.GetGenericArguments()[0]; 297return methodInfo.ReturnType.IsGenericType && 298methodInfo.ReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>);
Microsoft.AspNetCore.Mvc.Abstractions (4)
src\aspnetcore\src\Shared\ParameterBindingMethodCache.cs (4)
196return methodInfo.ReturnType.Equals(typeof(bool)); 229var valueTaskResultType = methodInfo.ReturnType.GetGenericArguments()[0]; 297return methodInfo.ReturnType.IsGenericType && 298methodInfo.ReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>);
Microsoft.AspNetCore.Mvc.ApiExplorer (2)
ApiResponseTypeProvider.cs (1)
443var declaredReturnType = action.MethodInfo.ReturnType;
EndpointMetadataApiDescriptionProvider.cs (1)
166AddSupportedResponseTypes(apiDescription.SupportedResponseTypes, methodInfo.ReturnType, routeEndpoint.Metadata);
Microsoft.AspNetCore.Mvc.Core (14)
ApplicationModels\DefaultApplicationModelProvider.cs (1)
361var returnType = methodInfo.ReturnType;
Filters\MiddlewareFilterConfigurationProvider.cs (1)
60if (methodInfo.ReturnType != returnType)
ModelBinding\Metadata\DefaultBindingMetadataProvider.cs (2)
144return cloneMethod != null && (cloneMethod.ReturnType == type || cloneMethod.ReturnType == type.BaseType);
src\aspnetcore\src\Shared\EndpointMetadataPopulator.cs (1)
49var returnType = methodInfo.ReturnType;
src\aspnetcore\src\Shared\ObjectMethodExecutor\AwaitableInfo.cs (2)
62var awaiterType = getAwaiterMethod.ReturnType; 107getResultMethod.ReturnType,
src\aspnetcore\src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (5)
37MethodReturnType = methodInfo.ReturnType; 281var postCoercionMethodReturnType = coercedAwaitableInfo.CoercerResultType ?? methodInfo.ReturnType; 424var taskAwaiterGetResultMethodInfo = (MethodInfo)taskGetAwaiterMethodInfo.ReturnType.GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo); 426resultType = taskAwaiterGetResultMethodInfo.ReturnType; 439var methodReturnType = methodInfo.ReturnType;
src\aspnetcore\src\Shared\PropertyHelper\PropertyHelper.cs (2)
249var typeOutput = propertyGetMethod.ReturnType; 280Debug.Assert(setMethod.ReturnType == typeof(void));
Microsoft.AspNetCore.Mvc.RazorPages (2)
Infrastructure\ExecutorFactory.cs (2)
27var returnType = method.ReturnType; 119ConvertMethod.MakeGenericMethod(method.ReturnType.GenericTypeArguments),
Microsoft.AspNetCore.Mvc.Testing (1)
src\d85239adf2da4ad4\HostFactoryResolver.cs (1)
117&& typeof(TReturn).IsAssignableFrom(factory.ReturnType)
Microsoft.AspNetCore.Mvc.ViewFeatures (4)
ViewComponents\DefaultViewComponentDescriptorProvider.cs (4)
86if (!selectedMethod.ReturnType.IsGenericType || 87selectedMethod.ReturnType.GetGenericTypeDefinition() != typeof(Task<>)) 98if (selectedMethod.ReturnType == typeof(void)) 104else if (typeof(Task).IsAssignableFrom(selectedMethod.ReturnType))
Microsoft.AspNetCore.OpenApi (13)
Extensions\TypeExtensions.cs (1)
60var returnType = methodInfo.ReturnType;
Services\OpenApiGenerator.cs (1)
102var responseType = method.ReturnType;
src\aspnetcore\src\Shared\ObjectMethodExecutor\AwaitableInfo.cs (2)
62var awaiterType = getAwaiterMethod.ReturnType; 107getResultMethod.ReturnType,
src\aspnetcore\src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (5)
37MethodReturnType = methodInfo.ReturnType; 281var postCoercionMethodReturnType = coercedAwaitableInfo.CoercerResultType ?? methodInfo.ReturnType; 424var taskAwaiterGetResultMethodInfo = (MethodInfo)taskGetAwaiterMethodInfo.ReturnType.GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo); 426resultType = taskAwaiterGetResultMethodInfo.ReturnType; 439var methodReturnType = methodInfo.ReturnType;
src\aspnetcore\src\Shared\ParameterBindingMethodCache.cs (4)
196return methodInfo.ReturnType.Equals(typeof(bool)); 229var valueTaskResultType = methodInfo.ReturnType.GetGenericArguments()[0]; 297return methodInfo.ReturnType.IsGenericType && 298methodInfo.ReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>);
Microsoft.AspNetCore.Routing (2)
src\aspnetcore\src\Shared\PropertyHelper\PropertyHelper.cs (2)
249var typeOutput = propertyGetMethod.ReturnType; 280Debug.Assert(setMethod.ReturnType == typeof(void));
Microsoft.AspNetCore.Routing.Abstractions (2)
src\aspnetcore\src\Shared\PropertyHelper\PropertyHelper.cs (2)
249var typeOutput = propertyGetMethod.ReturnType; 280Debug.Assert(setMethod.ReturnType == typeof(void));
Microsoft.AspNetCore.SignalR.Client.Core (1)
HubConnection.cs (1)
2403public bool HasResult => _callback.Method.ReturnType == typeof(Task<object>);
Microsoft.AspNetCore.SignalR.Core (10)
Internal\TypedClientBuilder.cs (3)
124var returnType = interfaceMethodInfo.ReturnType; 144methodBuilder.SetReturnType(interfaceMethodInfo.ReturnType); 285if (!typeof(Task).IsAssignableFrom(interfaceMethod.ReturnType))
src\aspnetcore\src\Shared\ObjectMethodExecutor\AwaitableInfo.cs (2)
62var awaiterType = getAwaiterMethod.ReturnType; 107getResultMethod.ReturnType,
src\aspnetcore\src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (5)
37MethodReturnType = methodInfo.ReturnType; 281var postCoercionMethodReturnType = coercedAwaitableInfo.CoercerResultType ?? methodInfo.ReturnType; 424var taskAwaiterGetResultMethodInfo = (MethodInfo)taskGetAwaiterMethodInfo.ReturnType.GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo); 426resultType = taskAwaiterGetResultMethodInfo.ReturnType; 439var methodReturnType = methodInfo.ReturnType;
Microsoft.AspNetCore.TestHost (1)
src\d85239adf2da4ad4\HostFactoryResolver.cs (1)
117&& typeof(TReturn).IsAssignableFrom(factory.ReturnType)
Microsoft.CodeAnalysis.NetAnalyzers (2)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Lightup\LightupHelpers.cs (2)
137if (!typeof(TValue).GetTypeInfo().IsAssignableFrom(method.ReturnType.GetTypeInfo())) 220VerifyResultTypeCompatibility<TReturn>(methodInfo.ReturnType);
Microsoft.CodeAnalysis.Scripting (1)
Hosting\ObjectFormatter\ObjectFormatterHelpers.cs (1)
254return (method.ReturnType == typeof(void))
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
Rpc\RpcMethodInvoker.cs (1)
53if (calledMethod.ReturnType.IsConstructedGenericType)
Microsoft.CSharp (5)
Microsoft\CSharp\RuntimeBinder\ComInterop\TypeUtils.cs (1)
125if (mi.ReturnType != typeTo)
Microsoft\CSharp\RuntimeBinder\RuntimeBinderExtensions.cs (2)
57&& method1.ReturnType.IsGenericallyEquivalentTo(method2.ReturnType, method1, method2)
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\MethodInfo.cs (1)
59TypesAreEqual(m.ReturnType, genericReturn.AssociatedSystemType));
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (1)
1438methodSymbol.RetType = GetCTypeFromType(method.ReturnType);
Microsoft.DotNet.HotReload.WebAssembly.Browser (2)
src\sdk\src\Dotnet.Watch\HotReloadAgent\MetadataUpdateHandlerInvoker.cs (2)
260updateMethod.ReturnType == typeof(void)) 272updateMethod.ReturnType == typeof(void))
Microsoft.Extensions.AI.Abstractions (7)
Functions\AIFunctionFactory.cs (7)
885Type t = method.ReturnType; 1032returnType = key.Method.ReturnType; 1094returnType = taskResultGetter.ReturnType; 1103return await marshalResult(result, taskResultGetter.ReturnType, cancellationToken).ConfigureAwait(true); 1132MethodInfo asTaskResultGetter = GetMethodFromGenericMethodDefinition(valueTaskAsTask.ReturnType, _taskGetResult); 1133returnType = asTaskResultGetter.ReturnType; 1143return await marshalResult(result, asTaskResultGetter.ReturnType, cancellationToken).ConfigureAwait(true);
Microsoft.Extensions.DocumentExtraction.Abstractions.Tests (4)
DocumentExtractionDocumentBuilderTests.cs (4)
49Assert.Equal(typeof(Task<ExtractionDocument>), extract.ReturnType); 65Assert.Equal(typeof(object), getService.ReturnType); 76Assert.Equal(typeof(void), dispose.ReturnType); 82Assert.Equal(typeof(void), hook.ReturnType);
Microsoft.Extensions.DotNetDeltaApplier (2)
src\sdk\src\Dotnet.Watch\HotReloadAgent\MetadataUpdateHandlerInvoker.cs (2)
260updateMethod.ReturnType == typeof(void)) 272updateMethod.ReturnType == typeof(void))
Microsoft.JSInterop (1)
Infrastructure\DotNetDispatcher.cs (1)
197returnType = methodInfo.ReturnType;
Microsoft.Maui (2)
Handlers\HybridWebView\HybridWebViewHandler.cs (2)
278 if (dotnetMethod.ReturnType.IsGenericType) 280 var resultProperty = dotnetMethod.ReturnType.GetProperty(nameof(Task<object>.Result));
Microsoft.Maui.Controls (4)
BindingExpression.cs (3)
278 if (pi.CanWrite && pi.SetMethod.ReturnType == typeof(int)) 291 if (pi.CanWrite && pi.SetMethod.ReturnType == typeof(string)) 302 if (pi.CanWrite && pi.SetMethod.ReturnType == typeof(object))
TypeConversionHelper.cs (1)
154 => toType.IsAssignableFrom(method.ReturnType);
Microsoft.ML.Core (11)
CommandLine\CmdParser.cs (2)
1367if (meth != null && meth.IsStatic && !meth.IsPrivate && meth.ReturnType == type) 1376if (meth != null && !meth.IsPrivate && meth.ReturnType == typeof(bool))
ComponentModel\ComponentCatalog.cs (3)
361var outputType = method.ReturnType; 653if (meth.ReturnType != instType) 667if (meth.ReturnType != instType)
ComponentModel\LoadableClassAttribute.cs (2)
181Contracts.CheckParam(meth.ReturnType == typeof(void), nameof(sigTypes), "LoadableClass signature type must be a delegate type with void return"); 213Contracts.CheckParam(meth.ReturnType == typeof(void), nameof(sigTypes), "LoadableClass signature type must be a delegate type with void return");
Utilities\FuncMethodInfo`1.cs (1)
20Contracts.CheckParam(typeof(TResult).IsAssignableFrom(GenericMethodDefinition.ReturnType), nameof(methodInfo), "Cannot be generic on return type");
Utilities\FuncMethodInfo`2.cs (1)
21Contracts.CheckParam(typeof(TResult).IsAssignableFrom(GenericMethodDefinition.ReturnType), nameof(methodInfo), "Cannot be generic on return type");
Utilities\FuncMethodInfo`3.cs (1)
21Contracts.CheckParam(typeof(TResult).IsAssignableFrom(GenericMethodDefinition.ReturnType), nameof(methodInfo), "Cannot be generic on return type");
Utilities\Utils.cs (1)
964if (meth.ReturnType != typeof(TRet))
Microsoft.ML.Data (1)
DataView\InternalSchemaDefinition.cs (1)
119Contracts.Assert(Generator.GetMethodInfo().ReturnType == typeof(void));
Microsoft.ML.DataView (1)
Utils.cs (1)
34Debug.Assert(meth.ReturnType == typeof(TRet));
Microsoft.ML.Transforms (12)
Expression\BuiltinFunctions.cs (3)
381Type type = fn.ReturnType; 392Type type = fn.ReturnType; 417return FunctionProviderUtils.GetNA(fn.ReturnType);
Expression\CodeGen.cs (2)
1254Contracts.Assert(node.Method.ReturnType != typeof(void)); 1288if (node.Method.ReturnType != typeof(void))
Expression\LambdaBinder.cs (7)
1150get { return Method.ReturnType == typeof(void); } 1161bool isIdent = ps.Length == 1 && meth.ReturnType == typeof(void); 1204var extRet = ExprNode.ToExprTypeKind(meth.ReturnType); 1210node.Head.Value, provider.NameSpace, meth.ReturnType)); 1429if (res != null && res.GetType() != best.Method.ReturnType) 1433node.Head.Value, best.Provider.NameSpace, res.GetType(), best.Method.ReturnType)); 1456_host.Assert(res.GetType() == best.Method.ReturnType);
Mono.Cecil (1)
Mono.Cecil\Import.cs (1)
413 ? ImportType (method_info.ReturnType, context, method_info.ReturnParameter.GetRequiredCustomModifiers (), method_info.ReturnParameter.GetOptionalCustomModifiers ())
PresentationBuildTasks (1)
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (1)
2058propertyType = parameters.Length == 1 ? methodInfo.ReturnType : parameters[1].ParameterType;
PresentationFramework (8)
MS\Internal\Data\IndexedEnumerable.cs (1)
479if ((mi != null) && (mi.ReturnType == typeof(int)))
MS\Internal\WindowsRuntime\Generated\WinRT\Marshalers.cs (1)
873var objReferenceConstructor = HelperType.GetConstructor(BindingFlags.NonPublic | BindingFlags.CreateInstance | BindingFlags.Instance, null, new[] { fromAbiMethod.ReturnType }, null);
MS\Internal\WindowsRuntime\Generated\WinRT\TypeExtensions.cs (2)
60return type.GetHelperType().GetMethod("GetAbi", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static).ReturnType; 65return type.GetHelperType().GetMethod("CreateMarshaler", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static).ReturnType;
System\Windows\Markup\BamlRecordReader.cs (1)
5819return this.AttachedPropertyGetter.ReturnType;
System\Windows\Markup\Primitives\ElementMarkupObject.cs (2)
226if (shouldSerializeMethod != null && shouldSerializeMethod.ReturnType != typeof(bool)) 249if (shouldSerializeMethod != null && shouldSerializeMethod.ReturnType != typeof(bool))
System\Windows\Markup\XamlTypeMapper.cs (1)
2058propertyType = parameters.Length == 1 ? methodInfo.ReturnType : parameters[1].ParameterType;
System.ComponentModel.Annotations (1)
System\ComponentModel\DataAnnotations\CustomValidationAttribute.cs (1)
252if (!typeof(ValidationResult).IsAssignableFrom(methodInfo.ReturnType))
System.ComponentModel.Composition (4)
System\ComponentModel\Composition\ContractNameServices.cs (1)
80WriteTypeWithNamespace(methodNameStringBuilder, method.ReturnType, formatGenericName);
System\ComponentModel\Composition\Primitives\ExportedDelegate.cs (1)
51parameterTypes[parameters.Length] = _method.ReturnType;
System\ComponentModel\Composition\ReflectionModel\ReflectionMethod.cs (1)
42get { return UnderlyingMethod.ReturnType; }
System\ComponentModel\Composition\ReflectionModel\ReflectionProperty.cs (1)
98return UnderlyingGetMethod.ReturnType;
System.ComponentModel.TypeConverter (3)
System\ComponentModel\MemberDescriptor.cs (1)
414if (result != null && !result.ReturnType.IsEquivalentTo(returnType))
System\ComponentModel\ReflectTypeDescriptionProvider.cs (2)
1281MethodInfo? setMethod = providerType.GetMethod("Set" + provideAttr.PropertyName, new Type[] { receiverType, getMethod.ReturnType }); 1288extendedList.Add(new ReflectPropertyDescriptor(providerType, provideAttr.PropertyName, getMethod.ReturnType, receiverType, getMethod, setMethod, null));
System.Composition.TypedParts (1)
System\Composition\TypedParts\ActivationFeatures\OnImportsSatisfiedFeature.cs (1)
43if (!(m.IsPublic || m.IsAssembly) || m.IsStatic || m.ReturnType != typeof(void) ||
System.Linq.Expressions (81)
System\Dynamic\Utils\DelegateHelpers.cs (1)
182Type returnType = delegateInvokeMethod.ReturnType;
System\Dynamic\Utils\TypeExtensions.cs (1)
65public static Type GetReturnType(this MethodBase mi) => mi.IsConstructor ? mi.DeclaringType! : ((MethodInfo)mi).ReturnType;
System\Dynamic\Utils\TypeUtils.cs (1)
725if ((mi.Name == "op_Implicit" || mi.Name == "op_Explicit") && AreEquivalent(mi.ReturnType, typeTo))
System\Linq\Expressions\BinaryExpression.cs (27)
346TypeUtils.AreEquivalent(method.ReturnType, left.GetNonNullableType()); 608return new MethodBinaryExpression(binaryType, left, right, method.ReturnType, method); 616if (method != null && method.ReturnType.IsValueType && !method.ReturnType.IsNullableType()) 618if (method.ReturnType != typeof(bool) || liftToNull) 620return new MethodBinaryExpression(binaryType, left, right, method.ReturnType.LiftPrimitiveOrThrow(), method); 642return new MethodBinaryExpression(binaryType, left, right, method.ReturnType, method); 648method.ReturnType.IsValueType && !method.ReturnType.IsNullableType()) 650if (method.ReturnType != typeof(bool) || liftToNull) 652return new MethodBinaryExpression(binaryType, left, right, method.ReturnType.LiftPrimitiveOrThrow(), method); 767if (method.ReturnType == typeof(void)) 819if (method.ReturnType != pms[0].ParameterType) 834if (opTrue == null || opTrue.ReturnType != typeof(bool) || 835opFalse == null || opFalse.ReturnType != typeof(bool)) 1288returnType = (left.Type.IsNullableType() && TypeUtils.AreEquivalent(method.ReturnType, left.Type.GetNonNullableType())) ? left.Type : method.ReturnType; 1294returnType = (left.Type.IsNullableType() && TypeUtils.AreEquivalent(method.ReturnType, left.Type.GetNonNullableType())) ? left.Type : method.ReturnType; 1341returnType = (left.Type.IsNullableType() && method.ReturnType == left.Type.GetNonNullableType()) ? left.Type : method.ReturnType; 1347returnType = (left.Type.IsNullableType() && method.ReturnType == left.Type.GetNonNullableType()) ? left.Type : method.ReturnType; 1395if (method.ReturnType == typeof(void)) 1409if (!TypeUtils.AreEquivalent(method.ReturnType, right.Type)) 1557if (!TypeUtils.AreEquivalent(mi.ReturnType, left.Type)) 1563if (!TypeUtils.AreEquivalent(pms[0].ParameterType, method.ReturnType))
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (1)
1094if (initializers[i].AddMethod.ReturnType != typeof(void))
System\Linq\Expressions\IndexExpression.cs (2)
395if (getter.ReturnType != indexer.PropertyType) 419if (setter.ReturnType != typeof(void))
System\Linq\Expressions\Interpreter\CallInstruction.cs (8)
195if (target.ReturnType == typeof(void) || index > pi.Length) 202return target.ReturnType; 222if (info.ReturnType != typeof(void)) 224types.Add(info.ReturnType); 298public override int ProducedStack => _target.ReturnType == typeof(void) ? 0 : 1; 344if (_target.ReturnType != typeof(void)) 391public override int ProducedStack => _target.ReturnType == typeof(void) ? 0 : 1; 441if (_target.ReturnType != typeof(void))
System\Linq\Expressions\Interpreter\CallInstruction.Generated.cs (3)
80if (target.ReturnType == typeof(void)) 124if (target.ReturnType == typeof(void)) 165if (info.ReturnType == typeof(void))
System\Linq\Expressions\Interpreter\LightCompiler.cs (2)
2695compMethod.ReturnType.GetInvokeMethod(), 2727if (add.ReturnType != typeof(void))
System\Linq\Expressions\Interpreter\LightLambda.cs (1)
359if (method.ReturnType == typeof(void))
System\Linq\Expressions\Interpreter\TypeOperations.cs (3)
153Debug.Assert(mi.ReturnType.IsValueType, "Nullable is only allowed on value types."); 154Debug.Assert(!mi.ReturnType.IsNullableType()); 156_defaultValueType = mi.ReturnType;
System\Linq\Expressions\InvocationExpression.cs (7)
430return new InvocationExpression0(expression, method.ReturnType); 468return new InvocationExpression1(expression, method.ReturnType, arg0); 509return new InvocationExpression2(expression, method.ReturnType, arg0, arg1); 555return new InvocationExpression3(expression, method.ReturnType, arg0, arg1, arg2); 605return new InvocationExpression4(expression, method.ReturnType, arg0, arg1, arg2, arg3); 659return new InvocationExpression5(expression, method.ReturnType, arg0, arg1, arg2, arg3, arg4); 736return new InvocationExpressionN(expression, args, mi.ReturnType);
System\Linq\Expressions\LambdaExpression.cs (5)
76public Type ReturnType => Type.GetInvokeMethod().ReturnType; 974if (mi.ReturnType != typeof(void) && !TypeUtils.AreReferenceAssignable(mi.ReturnType, body.Type)) 976if (!TryQuote(mi.ReturnType, ref body)) 978throw Error.ExpressionTypeDoesNotMatchReturn(body.Type, mi.ReturnType);
System\Linq\Expressions\MethodCallExpression.cs (1)
36public sealed override Type Type => Method.ReturnType;
System\Linq\Expressions\SwitchExpression.cs (1)
244if (comparison.ReturnType != typeof(bool))
System\Linq\Expressions\UnaryExpression.cs (13)
67(resultIsNullable && !TypeUtils.AreEquivalent(Method.ReturnType, this.Type)); 365return new UnaryExpression(unaryType, operand, method.ReturnType, method); 372if (method != null && method.ReturnType.IsValueType && !method.ReturnType.IsNullableType()) 374return new UnaryExpression(unaryType, operand, method.ReturnType.LiftPrimitiveOrThrow(), method); 390return new UnaryExpression(unaryType, operand, method.ReturnType, method); 395method.ReturnType.IsValueType && !method.ReturnType.IsNullableType()) 397return new UnaryExpression(unaryType, operand, method.ReturnType.LiftPrimitiveOrThrow(), method); 435if (ParameterIsAssignable(pms[0], operand.Type) && TypeUtils.AreEquivalent(method.ReturnType, convertToType)) 437return new UnaryExpression(unaryType, operand, method.ReturnType, method); 442(TypeUtils.AreEquivalent(method.ReturnType, convertToType.GetNonNullableType()) || 443TypeUtils.AreEquivalent(method.ReturnType, convertToType)))
System\Runtime\CompilerServices\CallSite.cs (4)
307if (invoke.ReturnType == typeof(void)) 339Type[] args = new Type[invoke.ReturnType != typeof(void) ? pis.Length : pis.Length - 1]; 351if (invoke.ReturnType != typeof(void)) 353args[args.Length - 1] = invoke.ReturnType;
System.Private.CoreLib (8)
Internal\Reflection\Augments\ReflectionAugments.cs (1)
361if (methodInfo != null && methodInfo.ReturnType.Equals(invokeMethod.ReturnType))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (1)
3165if (method.ReturnType != typeof(void))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodBuilderInstantiation.cs (1)
99public override Type ReturnType => _method.ReturnType;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodOnTypeBuilderInstantiation.cs (1)
120public override Type ReturnType => _method.ReturnType;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\NullabilityInfoContext.cs (1)
444return method.ReturnType;
src\runtime\src\libraries\System.Private.CoreLib\src\System\StartupHookProvider.cs (2)
215if (initializeMethod == null || initializeMethod.ReturnType != typeof(void)) 224initializeMethod.ReturnType == typeof(void) &&
System\Reflection\DynamicInvokeInfo.cs (1)
122Type returnType = methodInfo.ReturnType;
System.Private.DataContractSerialization (36)
System\Runtime\Serialization\ClassDataContract.cs (2)
1112if (method.ReturnType != typeof(void)) 1135if (method.ReturnType != typeof(void))
System\Runtime\Serialization\CodeGenerator.cs (2)
127BeginMethod(signature.ReturnType, methodName, paramTypes, allowPrivateMemberAccess); 595memberType = method.ReturnType;
System\Runtime\Serialization\CollectionDataContract.cs (3)
859enumeratorType = GetEnumeratorMethod.ReturnType; 888Type elementType = getCurrentMethod.ReturnType; 1348if (getEnumeratorMethod == null || !typeof(IEnumerator).IsAssignableFrom(getEnumeratorMethod.ReturnType))
System\Runtime\Serialization\DataContract.cs (2)
1078if (method != null && method.ReturnType == UnderlyingType) 2014if (!typeof(IEnumerable<Type>).IsAssignableFrom(method.ReturnType))
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (8)
109_ilg.ConvertValue(typeof(DateTimeOffset), _ilg.CurrentMethod.ReturnType); 115_ilg.ConvertValue(typeof(System.IO.MemoryStream), _ilg.CurrentMethod.ReturnType); 119_ilg.ConvertValue(_objectLocal.LocalType, _ilg.CurrentMethod.ReturnType); 132_ilg.ConvertValue(_objectLocal.LocalType, _ilg.CurrentMethod.ReturnType); 186DynamicMethod dynamicMethod = new DynamicMethod(methodName, signature.ReturnType, paramTypes, typeof(JsonFormatReaderGenerator).Module, allowPrivateMemberAccess); 278_ilg.ConvertValue(typeof(object), _ilg.CurrentMethod.ReturnType); 1017if (collectionContract.AddMethod.ReturnType != typeof(void)) 1027if (collectionContract.AddMethod.ReturnType != typeof(void))
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (5)
121DynamicMethod dynamicMethod = new DynamicMethod(methodName, signature.ReturnType, paramTypes, typeof(JsonFormatWriterGenerator).Module, allowPrivateMemberAccess); 379enumeratorType = collectionContract.GetEnumeratorMethod.ReturnType; 410Type elementType = getCurrentMethod.ReturnType; 418_ilg.ConvertValue(collectionContract.GetEnumeratorMethod.ReturnType, typeof(IDictionaryEnumerator)); 426_ilg.ConvertValue(collectionContract.GetEnumeratorMethod.ReturnType, ctorParam);
System\Runtime\Serialization\SchemaExporter.cs (3)
633if (!(typeof(XmlQualifiedName).IsAssignableFrom(getMethod.ReturnType)) && !(typeof(XmlSchemaType).IsAssignableFrom(getMethod.ReturnType))) 634throw new InvalidDataContractException(SR.Format(SR.InvalidReturnTypeOnGetSchemaMethod, DataContract.GetClrTypeFullName(clrType), methodName, DataContract.GetClrTypeFullName(getMethod.ReturnType), DataContract.GetClrTypeFullName(typeof(XmlQualifiedName)), typeof(XmlSchemaType)));
System\Runtime\Serialization\XmlFormatReaderGenerator.cs (7)
146_ilg.ConvertValue(typeof(DateTimeOffset), _ilg.CurrentMethod.ReturnType); 152_ilg.ConvertValue(typeof(System.IO.MemoryStream), _ilg.CurrentMethod.ReturnType); 156_ilg.ConvertValue(_objectLocal.LocalType, _ilg.CurrentMethod.ReturnType); 183_ilg.ConvertValue(_objectLocal.LocalType, _ilg.CurrentMethod.ReturnType); 344_ilg.ConvertValue(typeof(object), _ilg.CurrentMethod.ReturnType); 940if (collectionContract.AddMethod.ReturnType != typeof(void)) 946if (collectionContract.AddMethod.ReturnType != typeof(void))
System\Runtime\Serialization\XmlFormatWriterGenerator.cs (4)
458enumeratorType = collectionContract.GetEnumeratorMethod.ReturnType; 489Type elementType = getCurrentMethod.ReturnType; 496_ilg.ConvertValue(collectionContract.GetEnumeratorMethod.ReturnType, typeof(IDictionaryEnumerator)); 503_ilg.ConvertValue(collectionContract.GetEnumeratorMethod.ReturnType, ctorParam);
System.Private.Xml (28)
System\Xml\Serialization\Mappings.cs (4)
1135if (_needSchema && typeof(XmlSchemaType).IsAssignableFrom(_getSchemaMethod.ReturnType)) 1227if (typeof(XmlSchemaType).IsAssignableFrom(_getSchemaMethod.ReturnType)) 1322if (typeof(XmlSchemaType).IsAssignableFrom(_getSchemaMethod.ReturnType)) 1328else if (typeof(XmlQualifiedName).IsAssignableFrom(_getSchemaMethod.ReturnType))
System\Xml\Serialization\SourceInfo.cs (2)
119Type eType = get_Item.ReturnType; 233ILG.ConvertValue(Nullable_get_Value.ReturnType, targetType);
System\Xml\Serialization\TypeExtensions.cs (2)
42method.ReturnType != null && 43targetType.IsAssignableFrom(method.ReturnType))
System\Xml\Serialization\Types.cs (4)
1339if (enumerator == null || !typeof(IEnumerator).IsAssignableFrom(enumerator.ReturnType)) 1346if (enumerator != null && typeof(IEnumerator).IsAssignableFrom(enumerator.ReturnType)) 1364if (enumerator == null || !typeof(IEnumerator).IsAssignableFrom(enumerator.ReturnType)) 1371PropertyInfo? p = enumerator.ReturnType.GetProperty("Current");
System\Xml\Serialization\XmlReflectionImporter.cs (2)
502if (!(typeof(XmlQualifiedName).IsAssignableFrom(getMethod.ReturnType)) && !(typeof(XmlSchemaType).IsAssignableFrom(getMethod.ReturnType)))
System\Xml\Serialization\XmlSerializationReaderILGen.cs (4)
2054ilg.ConvertValue(XmlDocument_ReadNode.ReturnType, localAttr.LocalType); 2763ilg.ConvertValue(XmlSerializationReader_ShrinkArray.ReturnType, typeDesc.Type!); 2778ilg.ConvertValue(XmlSerializationReader_ShrinkArray.ReturnType, member.Mapping.ChoiceIdentifier.Mapping.TypeDesc.Type!.MakeArrayType()); 2945if (Add.ReturnType != typeof(void))
System\Xml\Serialization\XmlSerializationWriterILGen.cs (5)
168returnType = XmlConvert_ToString.ReturnType; 186returnType = FromXXX.ReturnType; 1273if (method.ReturnType != typeof(void)) 1518ilg.ConvertValue(getEnumeratorMethod.ReturnType, typeof(IEnumerator)); 2526ilg.ConvertValue(Activator_CreateInstance.ReturnType, cast);
System\Xml\Xsl\IlGen\IteratorDescriptor.cs (3)
117Debug.Assert(currentMethod.ReturnType == itemStorageType, 133Debug.Assert(methGlobal.ReturnType == itemStorageType || 134typeof(IList<>).MakeGenericType(itemStorageType).IsAssignableFrom(methGlobal.ReturnType),
System\Xml\Xsl\Runtime\XmlExtensionFunction.cs (1)
243_retClrType = GetClrType(_meth.ReturnType);
System\Xml\Xsl\XsltOld\XsltCompileContext.cs (1)
966XPathResultType returnType = GetXPathType(method.ReturnType);
System.Reflection.Context (3)
System\Reflection\Context\Delegation\DelegatingMethodInfo.cs (1)
103get { return UnderlyingMethod.ReturnType; }
System\Reflection\Context\Virtual\VirtualMethodBase.cs (1)
150sb.Append(ReturnType.ToString());
System\Reflection\Context\Virtual\VirtualReturnParameter.cs (1)
10: base(method, method.ReturnType, name: null, position: -1)
System.Reflection.DispatchProxy (3)
System\Reflection\DispatchProxyGenerator.cs (3)
469mi.ReturnType, returnParameter.GetRequiredCustomModifiers(), returnParameter.GetOptionalCustomModifiers(), 548LocalBuilder? resultLocal = mi.ReturnType != typeof(void) ? 580Convert(_assembly, il, typeof(object), mi.ReturnType, false);
System.Reflection.Emit (2)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodBuilderInstantiation.cs (1)
99public override Type ReturnType => _method.ReturnType;
System\Reflection\Emit\ILGeneratorImpl.cs (1)
648if (methodInfo.ReturnType.UnderlyingSystemType != voidType)
System.Runtime.InteropServices (1)
System\Runtime\InteropServices\Marshalling\ComImportInteropInterfaceDetailsStrategy.cs (1)
98MethodBuilder builder = implementation.DefineMethod(method.Name, MethodAttributes.Private | MethodAttributes.Final | MethodAttributes.HideBySig | MethodAttributes.Virtual, CallingConventions.HasThis, method.ReturnType, returnTypeRequiredModifiers, returnTypeOptionalModifiers, parameterTypes, parameterRequiredModifiers, parameterOptionalModifiers);
System.Runtime.InteropServices.JavaScript (5)
System\Runtime\InteropServices\JavaScript\JSHostImplementation.cs (5)
227if (method.ReturnType == typeof(void)) 234else if (method.ReturnType == typeof(int)) 239else if (method.ReturnType == typeof(Task)) 256else if (method.ReturnType == typeof(Task<int>)) 262throw new InvalidOperationException(SR.Format(SR.ReturnTypeNotSupportedForMain, method.ReturnType.FullName));
System.ServiceModel.Primitives (18)
System\ServiceModel\Description\ServiceReflector.cs (5)
865method.ReturnType != s_asyncResultType) 888if (method.ReturnType == taskType) 892if (method.ReturnType.IsGenericType() && method.ReturnType.GetGenericTypeDefinition() == taskTResultType) 902Type methodReturnType = method.ReturnType;
System\ServiceModel\Description\TypeLoader.cs (9)
382if (!typeof(IEnumerable<Type>).IsAssignableFrom(method.ReturnType)) 540if (method1.ReturnType != method2.ReturnType || 1071if ((!isTask && outputMethod.ReturnType != ServiceReflector.VoidType) || (isTask && taskTResult != ServiceReflector.VoidType) || 1184Type responseType = isTask ? taskTResult : methodInfo.ReturnType; 1696if (_syncOperation.SyncMethod.ReturnType != _syncOperation.EndMethod.ReturnType) 1818if (_syncOperation.SyncMethod.ReturnType != _syncOperation.TaskTResult) 1937if (_taskOperation.TaskTResult != _asyncOperation.EndMethod.ReturnType)
System\ServiceModel\Dispatcher\InvokerUtil.cs (3)
51bool returnsValue = method.ReturnType != typeof(void); 111bool returnsValue = method.ReturnType != typeof(void); 112bool returnsValueType = method.ReturnType.IsValueType;
System\ServiceModel\Dispatcher\TaskMethodInvoker.cs (1)
31_taskTResultGetMethod = ((PropertyInfo)taskMethod.ReturnType.GetMember(ResultMethodName)[0]).GetGetMethod();
System.Text.Json (1)
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Union.cs (1)
297if (method.ReturnType != typeof(bool) || method.IsGenericMethodDefinition)
System.Windows.Forms.Design (2)
System\ComponentModel\Design\Serialization\CodeDomSerializerBase.cs (1)
2006expressionType = methodInfo.ReturnType;
System\Windows\Forms\Design\DocumentDesigner.DocumentInheritanceService.cs (1)
46memberType = method.ReturnType;
System.Xaml (9)
System\Xaml\Runtime\DynamicMethodRuntime.cs (2)
349Emit_BoxIfValueType(ilGenerator, factory.ReturnType); 432Emit_BoxIfValueType(ilGenerator, getter.ReturnType);
System\Xaml\Schema\CollectionReflector.cs (1)
270if ((result is not null) && !typeof(IEnumerator).IsAssignableFrom(result.ReturnType))
System\Xaml\Schema\TypeReflector.cs (2)
656curGetter.ReturnType == setterParams[1].ParameterType) 930return (pmi.Length == 1) && (mi.ReturnType != typeof(void));
System\Xaml\XamlMember.cs (4)
847if ((method.GetParameters().Length != 1) || (method.ReturnType == typeof(void))) 1020if (mi.ReturnType is not null && mi.ReturnType != typeof(void)) 1022return mi.ReturnType;