Skip to content

Fix compiler warnings across the project#44

Merged
jonathanvdc merged 3 commits intomasterfrom
copilot/fix-compiler-warnings
Mar 28, 2026
Merged

Fix compiler warnings across the project#44
jonathanvdc merged 3 commits intomasterfrom
copilot/fix-compiler-warnings

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 28, 2026

Several compiler warnings were present across the codebase, spanning obsolete API usage, incorrect value-type identity comparisons, stale XML doc comments, and an unassigned variable capture.

Changes

  • SYSLIB0051 (ContractHelpers.cs): Remove obsolete [Serializable] + SerializationInfo/StreamingContext constructor from private AssertionException; unused in .NET 10.

  • CA2013 (SwitchFlow.cs, ReturnFlow.cs): Replace object.ReferenceEquals with .Equals for Instruction (a value type) — boxing makes ReferenceEquals always return false.

    // Before
    if (object.ReferenceEquals(newSwitchValue, SwitchValue))
    // After
    if (newSwitchValue.Equals(SwitchValue))
  • CS0618 — Loyc API renames (EncoderState.cs, TypeCodec.cs, InstructionCodecElements.cs, DecoderState.cs):

    • EmptySourceFile.DefaultEmptySourceFile.Synthetic
    • CodeSymbols.PtrArrowCodeSymbols.RightArrow
    • CodeSymbols.SwitchCodeSymbols.SwitchStmt (encoder + decoder)
    • LNodeFactory.List(...)LNodeFactory.AltList(...)
  • CS0618 — CustomLiteral (ConstantCodec.cs): Encode integer literals using the new Factory.Literal(value, symbol) overload with TypeMarker. Decoder updated to read node.TypeMarker directly, with a pragma-suppressed fallback for old CustomLiteral-encoded nodes.

  • CS1572/CS1573 (ClrMethodBodyAnalyzer.cs): Fix <param> doc tags referencing non-existent landingPadTag — update to match the actual parameter analyzedHandler.

  • CS8887 (DeferredInitializerTests.cs): Initialize init to default before it is captured in a recursive lambda.


⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

Agent-Logs-Url: https://github.com/jonathanvdc/Flame/sessions/f6e123c5-be46-4cf7-95ad-9e1ddb9246c2

Co-authored-by: jonathanvdc <9839946+jonathanvdc@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix compiler warnings during project build Fix compiler warnings across the project Mar 28, 2026
Copilot AI requested a review from jonathanvdc March 28, 2026 17:55
Copy link
Copy Markdown
Owner

@jonathanvdc jonathanvdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work but this fails on the portable test suite. e.g., try the OptimizeRecursiveMethod test

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 28, 2026

Good work but this fails on the portable test suite. e.g., try the OptimizeRecursiveMethod test

Fixed in 760f0ca. The issue was in TryDecomposeCustomLiteral — LES-parsed plain integers like 0 and 1 have a TypeMarker of '_' (not null, but the default "no type marker" symbol), so they incorrectly entered the custom literal branch. Added a guard && node.TypeMarker.Name != "_" to skip nodes with the default type marker.

Copy link
Copy Markdown
Owner

@jonathanvdc jonathanvdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@jonathanvdc jonathanvdc marked this pull request as ready for review March 28, 2026 18:31
@jonathanvdc jonathanvdc merged commit 9542cc5 into master Mar 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants