Improve diagnostic situation for constructor tearoffs from deferred library #54611
Labels
area-front-end
Use area-front-end for front end / CFE / kernel format related issues.
cfe-messages
Poor/undesirable messaging in errors/warnings emitted by the CFE.
Consider:
other.dart:
main.dart:
This provides no analyzer diagnostics (which is a known issue that applies to more situations), but the front end does error:
Most deferred errors will happen at runtime if you haven't imported the library with an explanation as to why, but this is happening at compile time, I'm assuming because the tear off is constant?
It's nice for it to happen at compile time, but the error isn't helpful for developers trying to resolve it since
.new
is a constructor reference.Side note: I discovered this issue since
unnecessary_lambdas
made this change automatically (fix here).The text was updated successfully, but these errors were encountered: