Closed
Description
Function type error messages from strong-mode can be hard to understand. It took me a while to decipher this:
Invalid override. The type of FunctionTypeImpl.substitute2 ((List<DartType>, List<DartType>, [List<FunctionTypeAliasElement>]) → DartType) is not a subtype of FunctionType.substitute2 ((List<DartType>, List<DartType>) → FunctionType).lib/src/generated/element.dart, line 5713
I think the issue is the horizontal scrolling ... the thing that's wrong is pushed way off the right side, in both Atom and IntelliJ it's very hard to see the return type is different.
@vsmenon had an idea: we can instead say something about the return type:
Return type DartType is not a subtype of FunctionType, in the override FunctionTypeImpl.substitute2 (overridden from FunctionType.substitute2).
I'd be good to check other tools (for Dart but also other languages) to get some ideas on what works best here.
Of course, they won't always be that easy, but a few special cases can probably handle a lot of the common errors.