Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/DotNet/ICodedToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,11 @@ public static AssemblyRef ToAssemblyRef(this IAssembly asm) {
/// Converts <paramref name="type"/> to a <see cref="TypeSig"/>
/// </summary>
/// <param name="type">The type</param>
/// <param name="checkValueType"><c>true</c> if we should try to figure out whether
/// <param name="resolveToCheckValueType"><c>true</c> if we should try to resolve in order to figure out whether
/// <paramref name="type"/> is a <see cref="ValueType"/></param>
/// <returns>A <see cref="TypeSig"/> instance or <c>null</c> if <paramref name="type"/>
/// is invalid</returns>
public static TypeSig ToTypeSig(this ITypeDefOrRef type, bool checkValueType = true) {
public static TypeSig ToTypeSig(this ITypeDefOrRef type, bool resolveToCheckValueType = true) {
if (type is null)
return null;

Expand All @@ -214,10 +214,10 @@ public static TypeSig ToTypeSig(this ITypeDefOrRef type, bool checkValueType = t

var td = type as TypeDef;
if (td is not null)
return CreateClassOrValueType(type, checkValueType ? td.IsValueType : false);
return CreateClassOrValueType(type, td.IsValueType);

if (type is TypeRef tr) {
if (checkValueType)
if (resolveToCheckValueType)
td = tr.Resolve();
return CreateClassOrValueType(type, td is null ? false : td.IsValueType);
}
Expand Down