dartanalyzer --version: dartanalyzer version 1.25.0-dev.2.0
If the new function type syntax is used inside an optional argument then dartanalyzer will crash. To repro create a file with:
String doStuff([String Function() argument]) => argument();
Then run the dartanalyzer on this file - see a stack trace:
Unhandled exception:
NoSuchMethodError: The getter 'element' was called on null.
Receiver: null
Tried calling: element
#0 Object._noSuchMethod (dart:core-patch/object_patch.dart:43)
#1 Object.noSuchMethod (dart:core-patch/object_patch.dart:47)
#2 TypeResolverVisitor.visitGenericFunctionType (package:analyzer/src/generated/resolver.dart:9942)
...
However analyzing this file works:
String doStuff(String Function() argument) => argument();
Either optional positional or optional named arguments cause a crash.