x) Updated argument expressions and method overrides in multiple classes

In this commit, several changes were made across different files:

- In `FSM.cs` and `Imm.cs`, the `[CallerArgumentExpression]` attribute was updated to reflect the correct argument names.
- The `ProcessWork` method in `Imm.cs` was changed from virtual to override.
- In `Log.cs`, the `[CallerArgumentExpression]` attribute was updated for clarity.
- A new override for the `GetHashCode()` method was added in `AddressStack.cs`.
- The version of "Microsoft.CodeAnalysis.CSharp" package reference was updated from 4.2.0 to 4.3.1 in 'SharpLib.csproj'.

These changes improve code readability and ensure that methods are correctly overridden where necessary. Also, updating the package version ensures compatibility with newer features or bug fixes provided by Microsoft's C# compiler platform.
This commit is contained in:
Marc Hernandez 2024-07-26 20:53:36 -07:00
parent 23017e0852
commit b0b9496c4a
5 changed files with 8 additions and 6 deletions

View File

@ -22,7 +22,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.2.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.1" />
<PackageReference Include="Optional" Version="4.0.0" />
<PackageReference Include="Optional.Async" Version="1.3.0" />
<PackageReference Include="System.Collections.Immutable" Version="8.0.0" />

View File

@ -54,7 +54,7 @@ public record class FSM<TSUB, ST, CTX> : imm.Recorded<TSUB>, Imm
[CallerMemberName] string memberName = "",
[CallerFilePath] string filePath = "",
[CallerLineNumber] int lineNumber = 0,
[CallerArgumentExpression("fn")]
[CallerArgumentExpression("newState")]
string expression = default
)
{

View File

@ -340,7 +340,7 @@ public record class Timed<T> : Recorded<T>, imm.Imm
[CallerMemberName] string dbgName = "",
[CallerFilePath] string dbgPath = "",
[CallerLineNumber] int dbgLine = 0,
[CallerArgumentExpression("next")]
[CallerArgumentExpression("fn")]
string dbgExp = ""
)
where U : T
@ -358,7 +358,7 @@ public record class Timed<T> : Recorded<T>, imm.Imm
)
=> ProcessWork( fn, reason, dbgName, dbgPath, dbgLine, dbgExp );
virtual public T ProcessWork( Func<T, T> fn,
override public T ProcessWork( Func<T, T> fn,
string reason,
string dbgName,
string dbgPath,

View File

@ -45,7 +45,7 @@ public record struct Value<T>( T _val, string _exp = "" )
}
static public Value<U> Get<U>( U v,
[CallerArgumentExpression("fn")]
[CallerArgumentExpression("v")]
string dbgExp = ""
)
{

View File

@ -31,7 +31,9 @@ namespace Tracing
return true;
}
public IReadOnlyList<ulong> Stack => _stack;
public override int GetHashCode() => _stack.GetHashCode();
public IReadOnlyList<ulong> Stack => _stack;
public void AddFrame(ulong address)
{