sdk
sdk copied to clipboard
[analyzer] Imprecise error when implementing non-existing type
A class declaration trying to import a non-existing type results in the implements_non_class diagnostic rather than pointing out that the type doesn't exist.
class A implements B {
/// ^ [analyzer] Classes and mixins can only implement other classes and mixins.
/// ^ [cfe] Error: Type 'B' not found.
}
The CFE does a better job here, both calling out the type and indicating the type can't be found.
Assuming it's only valid to implement classes, I would recommend that we generate an (existing) undefined_class diagnostic instead.