Skip to content

Cannot inspect value of lists with null values in debugger #4790

Closed

Description

@ethanblake4

Describe the bug
When debugging, I get an error if I try to inspect the value of lists that contain a null value.

To Reproduce
Create main.dart with the following code:

void main() {
  final List<String?> myList = [null];
  print(myList.length);
}

Set a breakpoint at the print statement and debug the code.
Hover over myList either in the code pane or the debug sidebar.
VS Code displays an error: type 'Null' is not a subtype of type 'Response' in type cast

Expected behavior
You see the value of the list [null]

Screenshots
image

Please complete the following information:

Workspace Environment
Dart Code extension: 3.75.20231009
Flutter extension: 3.74.0 (not activated)

App: Visual Studio Code
App Host: desktop
Version: win 1.83.0

Workspace type: Unknown (Dart SDK) (LSP)

Dart (3.1.3): C:\tools\dart-sdk
Flutter (undefined): undefined (No device)

Output from 'dart info'

C:\tools\dart-sdk\bin\dart.exe info

If providing this information as part of reporting a bug, please review the information
below to ensure it only contains things you're comfortable posting publicly.

General info

  • Dart 3.1.3 (stable) (Tue Sep 26 14:25:13 2023 +0000) on "windows_x64"
  • on windows / "Windows 10 Home" 10.0 (Build 22621)
  • locale is en-US

Process info

Memory CPU Elapsed time Command line
361 MB -- dart.exe
103 MB -- dart.exe
386 MB -- dart.exe
47 MB -- dart.exe
293 MB -- dart.exe
378 MB -- dart.exe
148 MB -- dart.exe
85 MB -- dart.exe

Activity

  1. added this to the v3.76.0 milestone on Oct 12, 2023
  2. added
    in debuggingRelates to the debug adapter or process of running debug sessions
    relies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available
    on Oct 12, 2023
  3. DanTup commented on Oct 12, 2023

    @DanTup
    Member
  4. DanTup commented on Oct 12, 2023

    @DanTup
    Member

    Fixed by dart-lang/sdk@a949bbf. The fix is in the SDK debug adapter, so will show up in a future SDK release.

  5. akshg05 commented on Nov 23, 2023

    @akshg05

    Is the fix released and available? I still experience the same.

  6. DanTup commented on Nov 23, 2023

    @DanTup
    Member

    Unfortunately the fix was made after the branch for the last stable SDK releases. It will show up in the next stable SDK releases (it's probably already in the latest betas, but I'm not certain).

  7. akshg05 commented on Nov 23, 2023

    @akshg05

    Okay. Hope it comes in soon.
    Thanks

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

    in debuggingRelates to the debug adapter or process of running debug sessionsis bugrelies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions