Closed
Description
Implicit instantiation of generic functions, e.g:
void main() {
void localFn<T>(T x) {
print(T);
}
void Function(int) k0 = localFn;
}
are restricted to cases where the thing being partially instantiated is an identifier which names a function or method declaration. It may not be an arbitrary expression (e.g. a local variable).
Question 1: For the explicit variant, do we intend to relax this (for implicit also?)?
Question 2: If so, we we allow explicit instantiation of this
(for implicit and/or explicit)?
extension on void Function<T>(T x) {
void foo() {
void Function(int) f = this<int>; // Ok?
void Function(int) g = this; // Ok?
}
}
cc @lrhn @eernstg @munificent @natebosch @jakemac53 @stereotype441