Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

passing generic function literals #426

Closed
@Andersmholmgren

Description

@Andersmholmgren

I have the following

typedef BuiltListProperty<T> BuiltListPropertyFactory<T>(
    Stream<ListMutation<T>> mutations);

BuiltListProperty<Object /*=T*/ > _defaultBuiltListPropertyFactory /*<T>*/ (
        Stream<ListMutation /*<T>*/ > mutations) =>
    new BuiltListProperty<Object /*=T*/ >(mutations);

class BuiltListProperty<E> {
  BuiltListProperty /*<R>*/ map /*<R>*/ (/*=R*/ f(E element),
          [BuiltListPropertyFactory /*<R>*/ builtListFactory =
              _defaultBuiltListPropertyFactory /*<R>*/]) => ...
}

The analyzer complains with

ERROR: Type check failed: _defaultBuiltListPropertyFactory ((Stream<ListMutation>) → BuiltListProperty) is not of type (Stream<ListMutation>) → BuiltListProperty ([frentity] lib/src/list_property/built_list_property.dart:64)

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

    Issue actions