This repository has been archived by the owner on Feb 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
passing generic function literals #426
Comments
Nice example! A few things could be going on here:
The error I'm seeing makes a little more sense:
Basically it ends up with the uninstantiated generic function type. So the error message itself is correct, but, it's no good that you can't express what you're trying to express here. I'll see if I can find the bug about instantiated tear-offs & if not, open a new one. |
The other bug is dart-lang/sdk#25175. We thought perhaps we could wait to implement instantiated tear-offs, but this example is a good one for why that doesn't work. :) It's ugly, but a workaround in the short term might be: typedef BuiltListProperty<T> BuiltListPropertyFactory<T>(
Stream<ListMutation<T>> mutations);
class BuiltListProperty<E> {
BuiltListProperty /*<R>*/ map /*<R>*/ (/*=R*/ f(E element),
[BuiltListPropertyFactory /*<R>*/ builtListFactory]) {
if (builtListFactory == null) {
builtListFactory = (Stream<ListMutation /*<R>*/ > mutations) =>
new BuiltListProperty<Object /*=R*/ >(mutations);
}
}
} |
Closed
5 tasks
believe this should be fixed now. Strong mode will infer it. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have the following
The analyzer complains with
The text was updated successfully, but these errors were encountered: