Skip to content

Problem: Existing interfaces with generic types may be only partially supportable with nullable types #275

Open
@natebosch

Description

@natebosch

Concrete example: List<int?>(1); is safe, but List<int>(1) will most likely need to throw at runtime because [null] is not a List<int> with NNBD. List<int>.filled(1, 0); would be safe.

Activity

leafpetersen

leafpetersen commented on Mar 18, 2019

@leafpetersen
Member

Yes. The length setter is another known case.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @natebosch@leafpetersen

        Issue actions

          Problem: Existing interfaces with generic types may be only partially supportable with nullable types · Issue #275 · dart-lang/language