Skip to content

Commit

Permalink
Simplify, fix code typos in docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Washi1337 committed Mar 15, 2023
1 parent e839a83 commit c64a899
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docs/dotnet/type-signatures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -274,15 +274,15 @@ These rules are implemented in AsmResolver using the ``IsCompatibleWith`` and ``

.. code-block:: csharp
if (comparer.IsCompatibleWith(type1, type2))
if (type1.IsCompatibleWith(type2))
{
// type1 can be converted to type2.
}
.. code-block:: csharp
if (comparer.IsAssignableTo(type1, type2))
if (type1.IsAssignableTo(type2))
{
// Values of type1 can be assigned to variables of type2.
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ protected ArrayBaseTypeSignature(TypeSignature baseType)
{
}

/// <inheritdoc />
public override bool IsValueType => false;

/// <summary>
/// Gets the number of dimensions this array defines.
/// </summary>
Expand Down Expand Up @@ -56,8 +59,7 @@ protected override bool IsDirectlyCompatibleWith(TypeSignature other)
var v = BaseType.GetUnderlyingType();
var w = elementType.GetUnderlyingType();

return SignatureComparer.Default.Equals(v.GetReducedType(), w.GetReducedType())
|| v.IsCompatibleWith(w);
return v.IsCompatibleWith(w);
}
}
}
3 changes: 0 additions & 3 deletions src/AsmResolver.DotNet/Signatures/Types/ArrayTypeSignature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ public ArrayTypeSignature(TypeSignature baseType, params ArrayDimension[] dimens
/// <inheritdoc />
public override string Name => $"{BaseType.Name ?? NullTypeToString}{GetDimensionsString()}";

/// <inheritdoc />
public override bool IsValueType => false;

/// <summary>
/// Gets a collection of dimensions.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ public SzArrayTypeSignature(TypeSignature baseType)
/// <inheritdoc />
public override string Name => $"{BaseType.Name ?? NullTypeToString}[]";

/// <inheritdoc />
public override bool IsValueType => false;

/// <inheritdoc />
public override int Rank => 1;

Expand Down

0 comments on commit c64a899

Please sign in to comment.