Skip to content

UNT0008 fixes do not function in VS 2026 (at least since 18.4.x) #468

Closed

Description

@DorCoMaNdO

Bug description

UNT0008 appears when null coalescing is used on Unity objects, this functions the same on VS 2022 and VS 2026, however on VS 2026, when attempting to use the lightbulb fix, no preview is presented, nor do any of the confirmation options (single instance fix, as well as "Fix all occurrences in") do anything.

  • Version of analyzers assembly: Whichever was/is distributed with VS 2026 since at least 18.4.x up to 18.6.1 (current latest stable release)
  • Analyzer rule: UNT0008
  • Error (exception message, type, and callstack where applicable): N/A

To Reproduce

Steps or code to reproduce the behavior:

  1. Have the analyzer present a warning for UNT0008
  2. Perform null coalescing on a Unity object
  3. Attempt to fix via the lightbulb solution (without AI)

Expected behavior

The fix option should present a preview for the single instance fix and for "Fix all occurrences in", as well as actually perform the fix.

Screenshots

Image

Additional context

Other issues such as UNT0026 (also set to present a warning) do have functional fixes, however I'm not sure if that's true for all of them.
I'm not also sure if this needs to be reported here or as a VS feedback (or if it should be mirrored), if it's the latter then let me know.

Activity

  1. added
    bug
    on Jun 2, 2026
  2. sailro commented on Jun 2, 2026

    @sailro
    Member

    Hello Dor (@DorCoMaNdO) and sorry for the delay, I missed this one.

    I reproduce the issue with:

    • VS2022 17.14.33
    • VS2026 Insiders
    • VS2026 18.6.2
    • VSCode 1.122.1

    So I guess we have a bug directly in the analyzer. Having a look right now.

  3. sailro commented on Jun 2, 2026

    @sailro
    Member

    OK I found and fixed the issue.

    It was properly working for simple members like transform?.transform but silently returning the unchanged document for everything else like invocations, chains, indexers, causing the VS lightbulb to be a no-op.

    We should now support all constructs.

    Thank you for this report.

    Regards

  4. added a commit that references this issue on Jun 3, 2026
    0dcfa90
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions