blob: 1fb936cab2f34815768e30c9a8d45de0f98ef7c4 [file] [log] [blame]
const num three = 3;
dynamic dynamicFunction(dynamic d) => d;
Object? objectFunction(Object? o) => o;
int intFunction(int i) => i;
T idFunction<T>(T t) => t;
const int Function(int) idAsIntFunction = idFunction;
class Class<T> {
final bool field;
const Class(dynamic value) : field = value is T;
}
class ClassWithBound<T extends num> {
final bool field;
const ClassWithBound() : field = three is T;
const ClassWithBound.withValue(dynamic value) : field = value is T;
}
class ClassWithList<T> {
final bool field;
const ClassWithList(dynamic value) : field = value is List<T>;
}
class ClassWithFunction<T> {
final bool field;
const ClassWithFunction(dynamic value) : field = value is T Function(T);
}
void main() {}