Closed
Description
Consider the following:
extension type E(C c) implements C {}
class C {
void c() {}
}
Can you spot the problem?
The issue becomes apparent when you try and invoke c()
:
void main() {
E e = E(C());
e.c();
}
and you see an invocation_of_non_function_expression
diagnostic.
Potentially I see two possible improvements:
- a warning on
E
, nudging you to renamec
to not collide withvoid c()
, and - an improved message on the invocation of
.c()
(For 2, I'm thinking something more like how we report field and method conflicts CONFLICTING_FIELD_AND_METHOD
.)
/cc @bwilkerson @scheglov @srawlins @dart-lang/language-team