13 overrides of ReturnType
System.Private.CoreLib (6)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\DynamicMethod.cs (1)
375public override Type ReturnType => _returnType;
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodBuilderInstantiation.cs (1)
99public override Type ReturnType => _method.ReturnType;
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodOnTypeBuilderInstantiation.cs (1)
120public override Type ReturnType => _method.ReturnType;
src\System\Reflection\Emit\RuntimeMethodBuilder.cs (1)
455public override Type ReturnType => m_returnType;
src\System\Reflection\Emit\SymbolMethod.cs (1)
101public override Type ReturnType => m_returnType;
src\System\Reflection\RuntimeMethodInfo.CoreCLR.cs (1)
316public override Type ReturnType => Signature.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\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)
98public sealed override Type ReturnType => ReturnParameter.ParameterType;
System.Xaml.Tests (1)
Common\CustomMethodInfo.cs (1)
50public override Type ReturnType => ReturnTypeResult.Or(DelegatingMethod.ReturnType)!;
474 references to 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)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.5.25257.101\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
116&& typeof(TReturn).IsAssignableFrom(factory.ReturnType)
Commands\GetDocumentCommandWorker.cs (5)
231if (!_generateMethodReturnType.IsAssignableFrom(generateWithVersionMethod.ReturnType)) 234Resources.FormatMethodReturnTypeUnsupported(GenerateMethodName, serviceType, generateWithVersionMethod.ReturnType, _generateMethodReturnType)); 444if (!returnType.IsAssignableFrom(method.ReturnType)) 447Resources.FormatMethodReturnTypeUnsupported(methodName, type, method.ReturnType, returnType)); 461Resources.FormatMethodReturnedNull(method.Name, method.DeclaringType, method.ReturnType));
Infrastructure.Common (1)
xunit\ConditionAttribute.cs (1)
113if (mi != null && mi.IsStatic && mi.GetParameters().Length == 0 && mi.ReturnType == typeof(bool))
Metrics (2)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (2)
172if (!typeof(TValue).GetTypeInfo().IsAssignableFrom(method.ReturnType.GetTypeInfo())) 255VerifyResultTypeCompatibility<TReturn>(methodInfo.ReturnType);
Metrics.Legacy (2)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (2)
172if (!typeof(TValue).GetTypeInfo().IsAssignableFrom(method.ReturnType.GetTypeInfo())) 255VerifyResultTypeCompatibility<TReturn>(methodInfo.ReturnType);
Microsoft.AspNetCore.Components.Endpoints (2)
src\Shared\PropertyHelper\PropertyHelper.cs (2)
249var typeOutput = propertyGetMethod.ReturnType; 280Debug.Assert(setMethod.ReturnType == typeof(void));
Microsoft.AspNetCore.Components.WebAssembly (1)
HotReload\MetadataUpdateHandlerInvoker.cs (1)
172updateMethod.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\Shared\PropertyHelper\PropertyHelper.cs (2)
249var typeOutput = propertyGetMethod.ReturnType; 280Debug.Assert(setMethod.ReturnType == typeof(void));
Microsoft.AspNetCore.Http.Extensions (15)
RequestDelegateFactory.cs (3)
347var returnType = methodInfo.ReturnType; 404PopulateBuiltInResponseTypeMetadata(methodInfo.ReturnType, factoryContext.EndpointBuilder); 465methodInfo.ReturnType);
src\Shared\EndpointMetadataPopulator.cs (1)
49var returnType = methodInfo.ReturnType;
src\Shared\ObjectMethodExecutor\AwaitableInfo.cs (2)
62var awaiterType = getAwaiterMethod.ReturnType; 107getResultMethod.ReturnType,
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\Shared\ParameterBindingMethodCache.cs (4)
207return methodInfo.ReturnType.Equals(typeof(bool)); 240var valueTaskResultType = methodInfo.ReturnType.GetGenericArguments()[0]; 308return methodInfo.ReturnType.IsGenericType && 309methodInfo.ReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>);
Microsoft.AspNetCore.Http.Extensions.Tests (1)
ValidationsGenerator\ValidationsGeneratorTestBase.cs (1)
299&& typeof(TReturn).IsAssignableFrom(factory.ReturnType)
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (1)
src\Identity\test\Shared\ApiConsistencyTestBase.cs (1)
42where typeof(Task).IsAssignableFrom(method.ReturnType)
Microsoft.AspNetCore.Identity.InMemory.Test (1)
src\Identity\test\Shared\ApiConsistencyTestBase.cs (1)
42where typeof(Task).IsAssignableFrom(method.ReturnType)
Microsoft.AspNetCore.Identity.Test (1)
src\Identity\test\Shared\ApiConsistencyTestBase.cs (1)
42where typeof(Task).IsAssignableFrom(method.ReturnType)
Microsoft.AspNetCore.Mvc.Abstractions (4)
src\Shared\ParameterBindingMethodCache.cs (4)
207return methodInfo.ReturnType.Equals(typeof(bool)); 240var valueTaskResultType = methodInfo.ReturnType.GetGenericArguments()[0]; 308return methodInfo.ReturnType.IsGenericType && 309methodInfo.ReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>);
Microsoft.AspNetCore.Mvc.ApiExplorer (2)
ApiResponseTypeProvider.cs (1)
349var declaredReturnType = action.MethodInfo.ReturnType;
EndpointMetadataApiDescriptionProvider.cs (1)
165AddSupportedResponseTypes(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\Shared\EndpointMetadataPopulator.cs (1)
49var returnType = methodInfo.ReturnType;
src\Shared\ObjectMethodExecutor\AwaitableInfo.cs (2)
62var awaiterType = getAwaiterMethod.ReturnType; 107getResultMethod.ReturnType,
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\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.RazorPages.Test (1)
Infrastructure\ExecutorFactoryTest.cs (1)
179Assert.Equal($"Unsupported handler method return type '{methodInfo.ReturnType}'.", ex.Message);
Microsoft.AspNetCore.Mvc.Testing (1)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.5.25257.101\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
116&& 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 (12)
Services\OpenApiGenerator.cs (1)
103var responseType = method.ReturnType;
src\Shared\ObjectMethodExecutor\AwaitableInfo.cs (2)
62var awaiterType = getAwaiterMethod.ReturnType; 107getResultMethod.ReturnType,
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\Shared\ParameterBindingMethodCache.cs (4)
207return methodInfo.ReturnType.Equals(typeof(bool)); 240var valueTaskResultType = methodInfo.ReturnType.GetGenericArguments()[0]; 308return methodInfo.ReturnType.IsGenericType && 309methodInfo.ReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>);
Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests (1)
SnapshotTestHelper.cs (1)
307&& typeof(TReturn).IsAssignableFrom(factory.ReturnType)
Microsoft.AspNetCore.Routing (2)
src\Shared\PropertyHelper\PropertyHelper.cs (2)
249var typeOutput = propertyGetMethod.ReturnType; 280Debug.Assert(setMethod.ReturnType == typeof(void));
Microsoft.AspNetCore.Routing.Abstractions (2)
src\Shared\PropertyHelper\PropertyHelper.cs (2)
249var typeOutput = propertyGetMethod.ReturnType; 280Debug.Assert(setMethod.ReturnType == typeof(void));
Microsoft.AspNetCore.Shared.Tests (9)
src\Shared\ObjectMethodExecutor\AwaitableInfo.cs (2)
62var awaiterType = getAwaiterMethod.ReturnType; 107getResultMethod.ReturnType,
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\Shared\PropertyHelper\PropertyHelper.cs (2)
249var typeOutput = propertyGetMethod.ReturnType; 280Debug.Assert(setMethod.ReturnType == typeof(void));
Microsoft.AspNetCore.SignalR.Client.Core (1)
HubConnection.cs (1)
2105public 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\Shared\ObjectMethodExecutor\AwaitableInfo.cs (2)
62var awaiterType = getAwaiterMethod.ReturnType; 107getResultMethod.ReturnType,
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)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.5.25257.101\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
116&& typeof(TReturn).IsAssignableFrom(factory.ReturnType)
Microsoft.CodeAnalysis (3)
InternalUtilities\UICultureUtilities.cs (3)
33if ((object?)currentUICultureSetter == null || !currentUICultureSetter.IsStatic || currentUICultureSetter.ContainsGenericParameters || currentUICultureSetter.ReturnType != typeof(void)) 72if ((object?)currentThreadGetter == null || !currentThreadGetter.IsStatic || currentThreadGetter.ContainsGenericParameters || currentThreadGetter.ReturnType != type || currentThreadGetter.GetParameters().Length != 0) 79if ((object?)currentUICultureSetter == null || currentUICultureSetter.IsStatic || currentUICultureSetter.ContainsGenericParameters || currentUICultureSetter.ReturnType != typeof(void))
Microsoft.CodeAnalysis.Analyzers (2)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (2)
172if (!typeof(TValue).GetTypeInfo().IsAssignableFrom(method.ReturnType.GetTypeInfo())) 255VerifyResultTypeCompatibility<TReturn>(methodInfo.ReturnType);
Microsoft.CodeAnalysis.AnalyzerUtilities (2)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (2)
172if (!typeof(TValue).GetTypeInfo().IsAssignableFrom(method.ReturnType.GetTypeInfo())) 255VerifyResultTypeCompatibility<TReturn>(methodInfo.ReturnType);
Microsoft.CodeAnalysis.BannedApiAnalyzers (2)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (2)
172if (!typeof(TValue).GetTypeInfo().IsAssignableFrom(method.ReturnType.GetTypeInfo())) 255VerifyResultTypeCompatibility<TReturn>(methodInfo.ReturnType);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (10)
CodeGen\CodeGenFunctionPointersTests.cs (10)
99var funcPtr = m.ReturnType; 121var funcPtr = m.ReturnType; 194var returnType = m.ReturnType; 645var returnType = m.ReturnType; 868var returnTypeWithAnnotations = ((FunctionPointerTypeSymbol)m.ReturnType).Signature.ReturnTypeWithAnnotations; 2550var returnType = (FunctionPointerTypeSymbol)m.ReturnType; 6308Assert.True(baseM2.ReturnType.Equals(derivedM2.ReturnType, TypeCompareKind.ConsiderEverything)); 6310Assert.True(baseM4.ReturnType.Equals(derivedM4.ReturnType, TypeCompareKind.ConsiderEverything));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Attributes\AttributeTests.cs (1)
2884Assert.Equal(typeParameters[0], invokeMethod.ReturnType);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Syntax\SyntaxTests.cs (2)
288if (method.ReturnType == typeof(IEnumerable<SyntaxKind>) && method.GetParameters() is []) 308Assert.Equal(typeof(IEnumerable<SyntaxKind>), method.ReturnType);
Microsoft.CodeAnalysis.EditorFeatures (8)
Lightup\LightupHelpers.cs (8)
133if (method.ReturnType != typeof(void)) 135throw new InvalidOperationException($"Method '{method}' produces an unexpected value of type '{method.ReturnType}'"); 200if (method.ReturnType != typeof(void)) 202throw new InvalidOperationException($"Method '{method}' produces an unexpected value of type '{method.ReturnType}'"); 263if (!typeof(TResult).GetTypeInfo().IsAssignableFrom(method.ReturnType.GetTypeInfo())) 265throw new InvalidOperationException($"Method '{method}' produces a value of type '{method.ReturnType}', which is not assignable to type '{typeof(TResult)}'"); 317if (!typeof(TResult).GetTypeInfo().IsAssignableFrom(method.ReturnType.GetTypeInfo())) 319throw new InvalidOperationException($"Method '{method}' produces a value of type '{method.ReturnType}', which is not assignable to type '{typeof(TResult)}'");
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (1)
Debugger\Engine\DkmClrValue.cs (1)
346DkmClrType.Create(appDomain, (TypeImpl)((methodValue == null) ? method.ReturnType : methodValue.GetType())),
Microsoft.CodeAnalysis.Features (3)
SemanticSearch\AbstractSemanticSearchService.cs (3)
322if (method.ReturnType != typeof(IEnumerable<ISymbol>) && 323method.ReturnType != typeof(IAsyncEnumerable<ISymbol>)) 327method.ReturnType,
Microsoft.CodeAnalysis.PublicApiAnalyzers (2)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (2)
172if (!typeof(TValue).GetTypeInfo().IsAssignableFrom(method.ReturnType.GetTypeInfo())) 255VerifyResultTypeCompatibility<TReturn>(methodInfo.ReturnType);
Microsoft.CodeAnalysis.ResxSourceGenerator (2)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (2)
172if (!typeof(TValue).GetTypeInfo().IsAssignableFrom(method.ReturnType.GetTypeInfo())) 255VerifyResultTypeCompatibility<TReturn>(methodInfo.ReturnType);
Microsoft.CodeAnalysis.Scripting (1)
Hosting\ObjectFormatter\ObjectFormatterHelpers.cs (1)
255return (method.ReturnType == typeof(void))
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (1)
Syntax\SyntaxFactsTest.vb (1)
1269If method.ReturnType = GetType(IEnumerable(Of SyntaxKind)) AndAlso method.GetParameters().Length = 0 Then
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (4)
Rpc\RpcServer.cs (1)
148if (method.ReturnType.IsConstructedGenericType)
src\Compilers\Core\Portable\InternalUtilities\UICultureUtilities.cs (3)
33if ((object?)currentUICultureSetter == null || !currentUICultureSetter.IsStatic || currentUICultureSetter.ContainsGenericParameters || currentUICultureSetter.ReturnType != typeof(void)) 72if ((object?)currentThreadGetter == null || !currentThreadGetter.IsStatic || currentThreadGetter.ContainsGenericParameters || currentThreadGetter.ReturnType != type || currentThreadGetter.GetParameters().Length != 0) 79if ((object?)currentUICultureSetter == null || currentUICultureSetter.IsStatic || currentUICultureSetter.ContainsGenericParameters || currentUICultureSetter.ReturnType != typeof(void))
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
src\Workspaces\MSBuild\BuildHost\Rpc\RpcServer.cs (1)
148if (method.ReturnType.IsConstructedGenericType)
Microsoft.CodeAnalysis.Workspaces.UnitTests (4)
Remote\ServiceDescriptorTests.cs (4)
118if (method.ReturnType.IsGenericType && method.ReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>)) 120AddTypeRecursive(method.ReturnType.GetGenericArguments().Single(), method); 125Assert.Equal(typeof(ValueTask), method.ReturnType);
Microsoft.CSharp (4)
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.RemoteExecutor (5)
RemoteExecutor.cs (5)
420if (method.ReturnType != typeof(void) 421&& method.ReturnType != typeof(int) 422&& method.ReturnType != typeof(Task) 423&& method.ReturnType != typeof(Task<int>)) 425throw new ArgumentException($"Invalid return type: {method.ReturnType}. Expected void, int, or Task", nameof(method));
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (3)
HelperFactory.cs (3)
152if (method.ReturnType == typeof(void)) 158var writerOutput = ConvertResultExpression(method.ReturnType, invokeExpression); 194var writerOutput = ConvertResultExpression(method.ReturnType, invokeExpression);
Microsoft.DotNet.XUnitExtensions (1)
src\Microsoft.DotNet.XUnitExtensions.Shared\Discoverers\ConditionalTestDiscoverer.cs (1)
156if (mi != null && mi.IsStatic && mi.GetParameters().Length == 0 && mi.ReturnType == typeof(bool))
Microsoft.DotNet.XUnitV3Extensions (1)
src\Microsoft.DotNet.XUnitExtensions.Shared\Discoverers\ConditionalTestDiscoverer.cs (1)
156if (mi != null && mi.IsStatic && mi.GetParameters().Length == 0 && mi.ReturnType == typeof(bool))
Microsoft.Extensions.AI (7)
Functions\AIFunctionFactory.cs (7)
840Type t = method.ReturnType; 1018Type returnType = key.Method.ReturnType; 1083return await marshalResult(result, taskResultGetter.ReturnType, cancellationToken); 1087returnTypeInfo = serializerOptions.GetTypeInfo(taskResultGetter.ReturnType); 1100MethodInfo asTaskResultGetter = GetMethodFromGenericMethodDefinition(valueTaskAsTask.ReturnType, _taskGetResult); 1109return await marshalResult(result, asTaskResultGetter.ReturnType, cancellationToken); 1113returnTypeInfo = serializerOptions.GetTypeInfo(asTaskResultGetter.ReturnType);
Microsoft.Extensions.AI.Abstractions (1)
src\Shared\JsonSchemaExporter\NullabilityInfoContext\NullabilityInfoContext.cs (1)
442return method.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 (13)
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);
Expression\Node.cs (1)
1058Contracts.Assert(meth.ReturnType != typeof(void));
Microsoft.VisualBasic.Core (8)
Microsoft\VisualBasic\CompilerServices\ConversionResolution.vb (2)
650Dim resultType As System.Type = DirectCast(current, MethodInfo).ReturnType 789Dim resultType As System.Type = DirectCast(current, MethodInfo).ReturnType
Microsoft\VisualBasic\CompilerServices\ObjectFlowControl.vb (1)
122operatorInfo.ReturnType IsNot forLoopArgumentType Then
Microsoft\VisualBasic\CompilerServices\Symbols.vb (1)
880returnType = currentMethod.ReturnType
Microsoft\VisualBasic\CompilerServices\Utils.LateBinder.vb (2)
547If method.MemberType = MemberTypes.Method Then returnType = DirectCast(method, MethodInfo).ReturnType 650propertyType = accessor.ReturnType
Microsoft\VisualBasic\CompilerServices\Utils.vb (2)
183method1.ReturnType.IsGenericallyEquivalentTo(method2.ReturnType, method1, method2) Then
PresentationBuildTasks (1)
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;
Roslyn.Diagnostics.Analyzers (2)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (2)
172if (!typeof(TValue).GetTypeInfo().IsAssignableFrom(method.ReturnType.GetTypeInfo())) 255VerifyResultTypeCompatibility<TReturn>(methodInfo.ReturnType);
Shared (1)
JsonSchemaExporter\NullabilityInfoContext\NullabilityInfoContext.cs (1)
442return method.ReturnType;
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)
88WriteTypeWithNamespace(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)
1285MethodInfo? setMethod = providerType.GetMethod("Set" + provideAttr.PropertyName, new Type[] { receiverType, getMethod.ReturnType }); 1292extendedList.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)
207Type 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)
190if (target.ReturnType == typeof(void) || index > pi.Length) 197return target.ReturnType; 218if (info.ReturnType != typeof(void)) 220types.Add(info.ReturnType); 294public override int ProducedStack => _target.ReturnType == typeof(void) ? 0 : 1; 340if (_target.ReturnType != typeof(void)) 387public override int ProducedStack => _target.ReturnType == typeof(void) ? 0 : 1; 437if (_target.ReturnType != typeof(void))
System\Linq\Expressions\Interpreter\CallInstruction.Generated.cs (3)
81if (target.ReturnType == typeof(void)) 125if (target.ReturnType == typeof(void)) 167if (info.ReturnType == typeof(void))
System\Linq\Expressions\Interpreter\LightCompiler.cs (2)
2676compMethod.ReturnType.GetInvokeMethod(), 2708if (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 (13)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (1)
3259if (method.ReturnType != typeof(void))
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodBuilderInstantiation.cs (1)
99public override Type ReturnType => _method.ReturnType;
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodOnTypeBuilderInstantiation.cs (1)
120public override Type ReturnType => _method.ReturnType;
src\libraries\System.Private.CoreLib\src\System\Reflection\NullabilityInfoContext.cs (1)
444return method.ReturnType;
src\libraries\System.Private.CoreLib\src\System\StartupHookProvider.cs (2)
199if (initializeMethod == null || initializeMethod.ReturnType != typeof(void)) 208initializeMethod.ReturnType == typeof(void) &&
src\System\Reflection\Emit\DynamicILGenerator.cs (2)
89&& meth.ReturnType != typeof(void)) 269if (methodInfo.ReturnType != typeof(void))
src\System\Reflection\Emit\RuntimeILGenerator.cs (1)
619if (methodInfo.ReturnType != typeof(void))
src\System\Reflection\Emit\RuntimeMethodBuilder.cs (1)
246return mi.ReturnType;
src\System\Reflection\Emit\RuntimeModuleBuilder.cs (3)
1008return GetArrayMethodToken(declaringType, method.Name, method.CallingConvention, method.ReturnType, tt); 1039this, method.CallingConvention, method.ReturnType, 1046sigHelp = SignatureHelper.GetMethodSigHelper(this, method.ReturnType, parameterTypes);
System.Private.DataContractSerialization (36)
System\Runtime\Serialization\ClassDataContract.cs (2)
1109if (method.ReturnType != Globals.TypeOfVoid) 1132if (method.ReturnType != Globals.TypeOfVoid)
System\Runtime\Serialization\CodeGenerator.cs (2)
128BeginMethod(signature.ReturnType, methodName, paramTypes, allowPrivateMemberAccess); 596memberType = method.ReturnType;
System\Runtime\Serialization\CollectionDataContract.cs (3)
858enumeratorType = GetEnumeratorMethod.ReturnType; 890Type elementType = getCurrentMethod.ReturnType; 1350if (getEnumeratorMethod == null || !Globals.TypeOfIEnumerator.IsAssignableFrom(getEnumeratorMethod.ReturnType))
System\Runtime\Serialization\DataContract.cs (2)
1052if (method != null && method.ReturnType == UnderlyingType) 1988if (!Globals.TypeOfTypeEnumerable.IsAssignableFrom(method.ReturnType))
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (8)
109_ilg.ConvertValue(Globals.TypeOfDateTimeOffset, _ilg.CurrentMethod.ReturnType); 115_ilg.ConvertValue(Globals.TypeOfMemoryStream, _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); 274_ilg.ConvertValue(Globals.TypeOfObject, _ilg.CurrentMethod.ReturnType); 1013if (collectionContract.AddMethod.ReturnType != Globals.TypeOfVoid) 1023if (collectionContract.AddMethod.ReturnType != Globals.TypeOfVoid)
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (5)
121DynamicMethod dynamicMethod = new DynamicMethod(methodName, signature.ReturnType, paramTypes, typeof(JsonFormatWriterGenerator).Module, allowPrivateMemberAccess); 379enumeratorType = collectionContract.GetEnumeratorMethod.ReturnType; 413Type elementType = getCurrentMethod.ReturnType; 421_ilg.ConvertValue(collectionContract.GetEnumeratorMethod.ReturnType, Globals.TypeOfIDictionaryEnumerator); 429_ilg.ConvertValue(collectionContract.GetEnumeratorMethod.ReturnType, ctorParam);
System\Runtime\Serialization\SchemaExporter.cs (3)
636if (!(Globals.TypeOfXmlQualifiedName.IsAssignableFrom(getMethod.ReturnType)) && !(Globals.TypeOfXmlSchemaType.IsAssignableFrom(getMethod.ReturnType))) 637throw new InvalidDataContractException(SR.Format(SR.InvalidReturnTypeOnGetSchemaMethod, DataContract.GetClrTypeFullName(clrType), methodName, DataContract.GetClrTypeFullName(getMethod.ReturnType), DataContract.GetClrTypeFullName(Globals.TypeOfXmlQualifiedName), typeof(XmlSchemaType)));
System\Runtime\Serialization\XmlFormatReaderGenerator.cs (7)
146_ilg.ConvertValue(Globals.TypeOfDateTimeOffset, _ilg.CurrentMethod.ReturnType); 152_ilg.ConvertValue(Globals.TypeOfMemoryStream, _ilg.CurrentMethod.ReturnType); 156_ilg.ConvertValue(_objectLocal.LocalType, _ilg.CurrentMethod.ReturnType); 183_ilg.ConvertValue(_objectLocal.LocalType, _ilg.CurrentMethod.ReturnType); 340_ilg.ConvertValue(Globals.TypeOfObject, _ilg.CurrentMethod.ReturnType); 936if (collectionContract.AddMethod.ReturnType != Globals.TypeOfVoid) 942if (collectionContract.AddMethod.ReturnType != Globals.TypeOfVoid)
System\Runtime\Serialization\XmlFormatWriterGenerator.cs (4)
458enumeratorType = collectionContract.GetEnumeratorMethod.ReturnType; 492Type elementType = getCurrentMethod.ReturnType; 499_ilg.ConvertValue(collectionContract.GetEnumeratorMethod.ReturnType, Globals.TypeOfIDictionaryEnumerator); 506_ilg.ConvertValue(collectionContract.GetEnumeratorMethod.ReturnType, ctorParam);
System.Private.Xml (29)
System\Xml\Serialization\Mappings.cs (4)
1121if (_needSchema && typeof(XmlSchemaType).IsAssignableFrom(_getSchemaMethod.ReturnType)) 1213if (typeof(XmlSchemaType).IsAssignableFrom(_getSchemaMethod.ReturnType)) 1308if (typeof(XmlSchemaType).IsAssignableFrom(_getSchemaMethod.ReturnType)) 1314else 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)
1276if (enumerator == null || !typeof(IEnumerator).IsAssignableFrom(enumerator.ReturnType)) 1283if (enumerator != null && typeof(IEnumerator).IsAssignableFrom(enumerator.ReturnType)) 1301if (enumerator == null || !typeof(IEnumerator).IsAssignableFrom(enumerator.ReturnType)) 1308PropertyInfo? 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)
1978ilg.ConvertValue(XmlDocument_ReadNode.ReturnType, localAttr.LocalType); 2647ilg.ConvertValue(XmlSerializationReader_ShrinkArray.ReturnType, typeDesc.Type!); 2662ilg.ConvertValue(XmlSerializationReader_ShrinkArray.ReturnType, member.Mapping.ChoiceIdentifier.Mapping.TypeDesc.Type!.MakeArrayType()); 2829if (Add.ReturnType != typeof(void))
System\Xml\Serialization\XmlSerializationWriterILGen.cs (5)
168returnType = XmlConvert_ToString.ReturnType; 186returnType = FromXXX.ReturnType; 1273if (method.ReturnType != typeof(void)) 1514ilg.ConvertValue(getEnumeratorMethod.ReturnType, typeof(IEnumerator)); 2483ilg.ConvertValue(Activator_CreateInstance.ReturnType, cast);
System\Xml\Xsl\IlGen\GenerateHelper.cs (1)
829retType = meth.ReturnType.Name;
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)
138sb.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)
428mi.ReturnType, null, null, 507LocalBuilder? resultLocal = mi.ReturnType != typeof(void) ? 539Convert(il, typeof(object), mi.ReturnType, false);
System.Reflection.Emit (3)
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 != voidType)
System\Reflection\Emit\ModuleBuilderImpl.cs (1)
794MetadataSignatureHelper.GetMethodSignature(this, ParameterTypes(method.GetParameters()), method.ReturnType,
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.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;
System.Xaml.Tests (1)
Common\CustomMethodInfo.cs (1)
50public override Type ReturnType => ReturnTypeResult.Or(DelegatingMethod.ReturnType)!;
Test.Utilities (2)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (2)
172if (!typeof(TValue).GetTypeInfo().IsAssignableFrom(method.ReturnType.GetTypeInfo())) 255VerifyResultTypeCompatibility<TReturn>(methodInfo.ReturnType);
Text.Analyzers (2)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (2)
172if (!typeof(TValue).GetTypeInfo().IsAssignableFrom(method.ReturnType.GetTypeInfo())) 255VerifyResultTypeCompatibility<TReturn>(methodInfo.ReturnType);