Skip to content

Evaluation failing for non-null, nullable field #51690

Open
@kenzieschmoll

Description

@kenzieschmoll

a is a nullable list. At the point of evaluation, a has been checked non null.

Screenshot 2023-03-01 at 11 05 38 AM

Screenshot 2023-03-01 at 10 46 31 AM

We should either

  1. have evaluation respect the type promotion that occurs earlier in the method, or
  2. have evaluation insert a ! for nullable variable a when evaluating a.length. If a is null, I would expect a null assertion error. If a is non-null, a.length should evaluate as expected (which is the current result of a?.length)

@annagrin

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.front-end-serverIssues with the frontend serverlegacy-area-front-endLegacy: Use area-dart-model instead.web-dev-compilerweb-evalevaluation support on the web

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions