Skip to content

No way to verify that a list argument's entries are valid in a const assert #29276

@Hixie

Description

@Hixie
abstract class MultiChildRenderObjectWidget extends RenderObjectWidget {
  const MultiChildRenderObjectWidget({ Key key, this.children: const <Widget>[] })
    : assert(children != null),
      assert(!children.any((Widget child) => child == null)), // <-- this line won't compile
      super(key: key);
  // ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).customer-fluttertype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions