}
}
- private static string? GetBaseDirectoryCore()
+ private static string GetBaseDirectoryCore()
{
// Fallback path for hosts that do not set APP_CONTEXT_BASE_DIRECTORY explicitly
string? directory = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location);
if (directory != null && !Path.EndsInDirectorySeparator(directory))
directory += Path.DirectorySeparatorChar;
- return directory;
+ return directory ?? string.Empty;
}
}
}
public override Type ReturnType { get { return m_dynMethod.ReturnType; } }
- public override ParameterInfo? ReturnParameter { get { return m_dynMethod.ReturnParameter; } }
+ public override ParameterInfo ReturnParameter { get { return m_dynMethod.ReturnParameter; } }
public override ICustomAttributeProvider ReturnTypeCustomAttributes { get { return m_dynMethod.ReturnTypeCustomAttributes; } }
}
}
- public override ParameterInfo? ReturnParameter
+ public override ParameterInfo ReturnParameter
{
- get { return null; }
+ get { return new RuntimeParameterInfo(this, null, m_owner.m_returnType, -1); }
}
public override ICustomAttributeProvider ReturnTypeCustomAttributes
return rmi.GetParameters();
}
- public override ParameterInfo? ReturnParameter
+ public override ParameterInfo ReturnParameter
{
get
{
}
}
- public override ParameterInfo? ReturnParameter { get { throw new NotSupportedException(); } }
+ public override ParameterInfo ReturnParameter { get { throw new NotSupportedException(); } }
public override ICustomAttributeProvider ReturnTypeCustomAttributes { get { throw new NotSupportedException(); } }
public override MethodInfo GetBaseDefinition() { throw new NotSupportedException(); }
#endregion
{
sigHelp = SignatureHelper.GetMethodSigHelper(
this, method.CallingConvention, method.ReturnType,
- method.ReturnParameter!.GetRequiredCustomModifiers(), method.ReturnParameter.GetOptionalCustomModifiers(),
+ method.ReturnParameter.GetRequiredCustomModifiers(), method.ReturnParameter.GetOptionalCustomModifiers(),
parameterTypes, requiredCustomModifiers, optionalCustomModifiers);
}
catch (NotImplementedException)
#region Public Abstract\Virtual Members
public override Type ReturnType { get { return m_method.ReturnType; } }
- public override ParameterInfo? ReturnParameter { get { throw new NotSupportedException(); } }
+ public override ParameterInfo ReturnParameter { get { throw new NotSupportedException(); } }
public override ICustomAttributeProvider ReturnTypeCustomAttributes { get { throw new NotSupportedException(); } }
public override MethodInfo GetBaseDefinition() { throw new NotSupportedException(); }
#endregion
null); // strong name key pair
Module manifestModule = ManifestModule;
- if (manifestModule != null)
+ if (manifestModule.MDStreamVersion > 0x10000)
{
- if (manifestModule.MDStreamVersion > 0x10000)
- {
- manifestModule.GetPEKind(out PortableExecutableKinds pek, out ImageFileMachine ifm);
- an.SetProcArchIndex(pek, ifm);
- }
+ manifestModule.GetPEKind(out PortableExecutableKinds pek, out ImageFileMachine ifm);
+ an.SetProcArchIndex(pek, ifm);
}
return an;
}
get { return ReturnParameter; }
}
-#pragma warning disable CS6809 // TODO-NULLABLE: Covariant return types (https://github.com/dotnet/roslyn/issues/23268)
public override ParameterInfo ReturnParameter => FetchReturnParameter();
-#pragma warning restore CS6809
public override bool IsCollectible => (RuntimeMethodHandle.GetIsCollectible(new RuntimeMethodHandleInternal(m_handle)) != Interop.BOOL.FALSE);
DomainAssembly *pAssembly = refAssembly->GetDomainAssembly();
Assembly* currentAssembly = pAssembly->GetCurrentAssembly();
- if (currentAssembly == NULL)
- return NULL;
-
Module *pModule = currentAssembly->GetManifestModule();
DomainFile * pDomainFile = pModule->GetDomainFile();
// The value of APP_CONTEXT_BASE_DIRECTORY key has to be a string and it is not allowed to be any other type.
// Otherwise the caller will get invalid cast exception
return (string?)GetData("APP_CONTEXT_BASE_DIRECTORY") ??
- (s_defaultBaseDirectory ?? (s_defaultBaseDirectory = GetBaseDirectoryCore())) ?? string.Empty;
+ s_defaultBaseDirectory ?? (s_defaultBaseDirectory = GetBaseDirectoryCore());
}
}
public override MemberTypes MemberType => MemberTypes.Method;
- public virtual ParameterInfo? ReturnParameter { get { throw NotImplemented.ByDesign; } }
+ public virtual ParameterInfo ReturnParameter { get { throw NotImplemented.ByDesign; } }
public virtual Type ReturnType { get { throw NotImplemented.ByDesign; } }
public override Type[] GetGenericArguments() { throw new NotSupportedException(SR.NotSupported_SubclassOverride); }
if (PositionImpl == -1)
{
if (MemberImpl.MemberType == MemberTypes.Method)
- return ((MethodInfo)MemberImpl).ReturnParameter!;
+ return ((MethodInfo)MemberImpl).ReturnParameter;
else
throw new SerializationException(SR.Serialization_BadParameterInfo);
}
}
// Creates a copy of this string in lower case. The culture is set by culture.
- public string ToLower()
- {
- return CultureInfo.CurrentCulture.TextInfo.ToLower(this);
- }
+ public string ToLower() => ToLower(null);
// Creates a copy of this string in lower case. The culture is set by culture.
public string ToLower(CultureInfo? culture)
return CultureInfo.InvariantCulture.TextInfo.ToLower(this);
}
- public string ToUpper()
- {
- return CultureInfo.CurrentCulture.TextInfo.ToUpper(this);
- }
+ public string ToUpper() => ToUpper(null);
// Creates a copy of this string in upper case. The culture is set by culture.
public string ToUpper(CultureInfo? culture)